Welcome to ask.woodem.org. You may post when you login through your GitHub account.

How to speed up WOO's simulations?

0 votes
asked May 18 by ElaineMun (200 points)

Thanks again for all your help before. My new question will  be a little bit long, I will tried my best to describe my question clearly:

Recently, I tried to run a simulation with clumps in WOO. There were around 2000 clumps(100000 spheres) in the simulation. Then I found the simulation is very slow (spend 2 days run-time to finish 4 seconds simulation, and my case need to simulate 100 seconds, that means I need 50 days to finish one simulation).

(1)Firstly, I tried to find hotspots in my simulation using the timing function. I added "import woo.timing" and "woo.Scene.timingEnabled = True" into my python input file. and ran the simulation for a while, paused the simulation, then typed " woo.timing,stats()", I got this, it did not show me the time information I planed to get. did I have some mistakes during I used timing function? Thanks!

(2) Before this week, I ran all my simulations by typing "woo inputfile.py". Yesterday, I found I can define the number of CPU cores to use for simulation( https://woodem.org/user/running.html?highlight=run ). It is said "Woo is parallelized using OpenMP, and runs on 4 cores by default", is that ture?  So parallelized computaiton for WOO depends on the number of cores(not the number of threads)? Here are the system information of my computers, please have a look at it. Do you think they are good enough for speeding up my simulation? If I purchase a new processer, do you have any recommendations? should I spend money on the number of "cores", or should i spend money on the number of "threads"?

(3) I added "import wooMain" , "wooMain.options.ompThreads=4" and "wooMain.options.debug=True", and try to run the simulation by "woo [-j4] inputfile.py", but I got this. Is there any mistake for this result? How can I run simulation using OpenMP to improve the run time? Should I need to change the input file a lot? Thanks!

Sorry about so many questions. Thank you very much!

Best regards,



1 Answer

0 votes
answered 3 days ago by eudoxos (43,490 points)

Hi Lei,

(1) for timing, check out https://woodem.org/prog/performance.html . You assigned woo.Scene.timingEnabled (did that really do something?), it should be woo.master.timingEnabled. Than you will get something else than zeros in the output.

(2) woo uses by default all available cores (i.e. 6 threads on 6-core machine), the choice of 4 as default was arbitrary and changed later; I updated the documentation now so that it is not misleading. Check the number of threads through woo.master.numThreads. If you want to set before starting woo, use woo -j4 for 4 threads and so on (braces [...] indicate that the argument is optional and are not part of the command-line). So by default you are already running with OpenMP, but adjusting the number of cores might help. 17 cores for Xeon is for sure too much, and 8 cores for i7 might also be too much; try with -j6 or just run with different setting to get the difference.

You have some confusion about threads and cores; threads are what is running on cores, which are physically in the CPU; so you always pay for cores.

Check in your BIOS if your processor uses HyperThreading ("fake" 2 cores per 1 physical core, maybe they call it "threads"). Disable it; if enabled, OpenMP performance suffers.

(3) don't use wooMain.options to set parameters unless you know what you're doing; if you start woo using the woo main program, the options are already set and your changes will have no effect.

Maybe you can post separate questions, if they are not tightly related.

All the best!



commented 2 days ago by ElaineMun (200 points)

Hi Vaclav,

Thank you so much for your reply!

Best regards,