amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
152 stars 98 forks source link

multithreading #1010

Closed cconroy20 closed 4 months ago

cconroy20 commented 8 months ago

Hi,

I'm trying to get a sense of how the run time should scale with the number of cores (CPUs, not GPUs). For the pure N body case, is there any benefit to running on multiple cores? How is the splitting of the computational cost done in this case? I understand the basics of how the splitting is done in tree(PM) and related codes, but I am not very familiar with direct N body codes.

thanks Charlie

cconroy20 commented 7 months ago

I'm finding odd behavior where running with N_CPU=6 is much slower than N_CPU=1, for 1000 particles. I understand that there will be communication overhead with multiple cores, but I would have thought that with 1000 particles there would be at least some gain. I'm working with a modified version of the evolution_cluster.py program (attached), where the only important change is: gravity = Petar(convert_nbody,number_of_workers=args.n_cpu)

any suggestions for what I might be doing wrong would be most appreciated!

evclust.py.txt

rieder commented 7 months ago

Hi,

With PeTar I definitely would expect a slowdown rather than a speedup with only 1000 particles. PeTar is written for orders of magnitude more particles. Its overhead will dominate.

cconroy20 commented 7 months ago

ah ok - very good to know! Can you recommend another solver that has better scaling with N_CPU for ~1e4 particles?

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.