Problem with efficiency

Asked by Anastasia Sarmakeeva on 2015-12-16

Hi everyone,

I'm trying to simulate clump interactions using version 1.20 of YADE and this process goes much more slower than in versions 1.12 and earlier. Do you know why?

my test:https://www.dropbox.com/s/zbr4adcb0ox2ir4/test3.py?dl=0

Welcome to Yade 2015-03-17.git-16ecad0
TCP python prompt on localhost:9000, auth cookie `asuyke'
XMLRPC info provider on http://localhost:21000
Running script test3.py
mass clump1= 496.138472945
WARN /usr/local/src/git/yade.git/pkg/common/InsertionSortCollider.cpp:80 insertionSortParallel: Parallel insertion: only 11 thread(s) used. The number of bodies is probably too small for allowing more threads, or the geometry is flat. The contact detection should succeed but not all available threads are used.
Name Count Time Rel. time
-------------------------------------------------------------------------------------------------------
ForceResetter 1000 2228466us 15.54%
InsertionSortCollider 4 132829us 0.93%
InteractionLoop 1000 2073839us 14.46%
PyRunner 0 0us 0.00%
NewtonIntegrator 1000 9906800us 69.08%
TOTAL 14341937us 100.00%

Welcome to Yade 2015-12-16.git-dfb3daf
TCP python prompt on localhost:9000, auth cookie `decuay'
XMLRPC info provider on http://localhost:21000
Running script test3.py
mass clump1= 496.138472945
Name Count Time Rel. time
-------------------------------------------------------------------------------------------------------
ForceResetter 1000 67124us 0.01%
InsertionSortCollider 4 1666146us 0.24%
InteractionLoop 1000 697955915us 99.50%
PyRunner 0 0us 0.00%
NewtonIntegrator 1000 1795053us 0.26%
TOTAL 701484240us 100.00%

Thanks a lot, Nastya

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2015-12-18
Last reply:
2016-01-04
Anton Gladky (gladky-anton) said : #1

Hi,

please provide also text-files, mentioned in your script.

sorry, you can use also https://www.dropbox.com/sh/wr6k1jmiaqtc74y/AADB0V6ApCFjkrXp08dGQUaha?dl=0
there is clumps have less spheres.

Christian Jakob (jakob-ifgt) said : #4

Hi,

Does the generation of clumps takes longer in the 1.20 version, or does the calculation takes longer?
Can you please check and report?

Thank in advance,

Christian

Hi, Cristian!

The generation of clumps is faster. However the calculations takes much more time. Thus the whole process of simulation requires much more time.

Thanks a lot, Nastya.

Anton Gladky (gladky-anton) said : #6

Hi Nastya,

I am not able to reproduce the problem. There is a comparison in 1-Thread
mode:

a) Small case:
================
TCP python prompt on localhost:9000, auth cookie `sycsed'
Welcome to Yade 1.12.0
XMLRPC info provider on http://localhost:21000
Running script test3.py
mass clump1= 444.798422395
Name
Count Time Rel. time
-------------------------------------------------------------------------------------------------------
ForceResetter 1000
10191us 2.00%
InsertionSortCollider 4
24270us 4.76%
InteractionLoop 1000
295811us 58.02%
PyRunner 0
0us 0.00%
NewtonIntegrator 1000
179569us 35.22%
TOTAL
509842us 100.00%

real 1m32.913s
user 1m32.856s
sys 0m0.128s
================
================
TCP python prompt on localhost:9000, auth cookie `scsuka'
Welcome to Yade 2015-12-16.git-8d837d1
XMLRPC info provider on http://localhost:21000
Running script test3.py
mass clump1= 444.798422302
Name
Count Time Rel. time
-------------------------------------------------------------------------------------------------------
ForceResetter 1000
9492us 1.87%
InsertionSortCollider 4
17902us 3.53%
InteractionLoop 1000
301487us 59.45%
PyRunner 0
0us 0.00%
NewtonIntegrator 1000
178256us 35.15%
TOTAL
507140us 100.00%

real 1m30.711s
user 1m30.704s
sys 0m0.096s
================

b) Large case:
================
TCP python prompt on localhost:9000, auth cookie `kcsade'
Welcome to Yade 1.12.0
XMLRPC info provider on http://localhost:21000
Running script test3.py
mass clump1= 496.138472947
Name
Count Time Rel. time
-------------------------------------------------------------------------------------------------------
ForceResetter 1000
76792us 1.21%
InsertionSortCollider 4
317825us 5.02%
InteractionLoop 1000
4268519us 67.38%
PyRunner 0
0us 0.00%
NewtonIntegrator 1000
1672283us 26.40%
TOTAL
6335421us 100.00%

real 3m23.575s
user 3m23.544s
sys 0m0.216s
================
TCP python prompt on localhost:9000, auth cookie `yeksud'
Welcome to Yade 2015-12-16.git-8d837d1
XMLRPC info provider on http://localhost:21000
Running script test3.py
mass clump1= 496.138472945
Name
Count Time Rel. time
-------------------------------------------------------------------------------------------------------
ForceResetter 1000
79881us 1.23%
InsertionSortCollider 4
314319us 4.84%
InteractionLoop 1000
4373225us 67.34%
PyRunner 0
0us 0.00%
NewtonIntegrator 1000
1726648us 26.59%
TOTAL
6494074us 100.00%

real 3m32.254s
user 3m32.236s
sys 0m0.224s
================

================================================================

Tests were done without qt and export to VTK. Please check,
whether you compiled 1.20 in release, not in debug mode.

Best regards

Anton

Hi, Anton,

I do it not in debug mode.
Maybe you have another suggestions?

Thanks a lot for your answer, Nastya.

Jan Stránský (honzik) said : #8

Hi Nastya,
do you run your examples using one core (as Anton did)? If not, could you
please try and check the results?
cheers
Jan

2015-12-18 13:27 GMT+01:00 Anastasia Sarmakeeva <
<email address hidden>>:

> Question #279270 on Yade changed:
> https://answers.launchpad.net/yade/+question/279270
>
> Status: Answered => Open
>
> Anastasia Sarmakeeva is still having a problem:
> Hi, Anton,
>
> I do it not in debug mode.
> Maybe you have another suggestions?
>
> Thanks a lot for your answer, Nastya.
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Anton Gladky (gladky-anton) said : #9

I did it with 3 threads also. No much difference.

Also I would recommend you to switch off GUI to be sure, that it does not slow down the simulation.

Henry (wenjiexu) said : #10

I have meet the same problem.
The new version of Yade (After Jun, 2015) is slower than the old version (Before March 2015).

Henry (wenjiexu) said : #11

Furthermore, I have switch off GUI during the simualtion. And the efficiency of the new version is about 1/4 that of the old one?
I run it with 4 threads.

Thanks a lot!

Anton Gladky (gladky-anton) said : #12

It looks like the problem is in SPH, which was enabled on some platforms for yadedaily. I will disable it for a while..

The remarkable result in the OP is:
InteractionLoop 1000 697955915us 99.50%

99.5% of the time in interactions is very surprising. The only real changes in clump logic were related to inertia, independently of interactions.
Can SPH have side effects on interactions? It would be a surprise.

Please don't report results with more than one thread unless the topic of the question is parallelization (here it is not).

Bruno

Anton Gladky (gladky-anton) said : #14

2016-01-04 15:02 GMT+01:00 Bruno Chareyre
<email address hidden>:
> 99.5% of the time in interactions is very surprising. The only real changes in clump logic were related to inertia, independently of interactions.
> Can SPH have side effects on interactions? It would be a surprise.

It looks like we can blame SPH. I will have a look, how it can influence.

Regards

Anton

Anton Gladky (gladky-anton) said : #15

Update. It looks, that the code is working more-less
correctly [1] and SPH is causing efficiency drop because
one need to calculate the density. But there is definitely
a way to optimize an algorithm.

[1] https://github.com/yade/trunk/blob/master/pkg/common/Collider.cpp#L20

Regards

Anton

2016-01-04 15:02 GMT+01:00 Bruno Chareyre
<email address hidden>:
> 99.5% of the time in interactions is very surprising. The only real changes in clump logic were related to inertia, independently of interactions.
> Can SPH have side effects on interactions? It would be a surprise.

Can you help with this problem?

Provide an answer of your own, or ask Anastasia Sarmakeeva for more information if necessary.

To post a message you must log in.