Using PySPH with MPI

67 views
Skip to first unread message

Blair Geng

unread,
Jul 27, 2023, 3:38:08 AM7/27/23
to pysph-users
Hi,

I'm just wondering if we need to adjust our python file to use MPI for PySPH. I managed to build the Zoltan library and all the prerequisites mentioned in the installation document in a HPC cluster. I tried running PySPH with MPI using mpirun, but it was much slower than OpenMP(OpenMP used only 40 mins but MPI used 6 hours). So I'm wondering if I should have some lines at the top of script such as "import ... from mpi4py", etc. Thanks!

Best,
Blair

Prabhu Ramachandran

unread,
Jul 27, 2023, 1:49:46 PM7/27/23
to Blair Geng, pysph-users
You should not need to do anything special to enable MPI. The performance gains really depend on the problem. For small problems OpenMP performance is hard to beat. Where MPI is useful is when you have a huge problem with many millions of particles. You then distribute the particles and use a combination of MPI and OpenMP. For small problems, MPI will be slower.

Regards,
Prabhu
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/3eb11ae0-8663-428f-9c50-852c9af46377n%40googlegroups.com.

Message has been deleted

Blair Geng

unread,
Aug 7, 2023, 10:13:05 PM8/7/23
to pysph-users
Hi Prabhu,

Thank you! I have another question. When I'm using pysph with only OpenMP in a HPC cluster, there's no progress bar in the .output file. However, when I run the same script using mpirun, there will be progress bars for all the iterations like what is shown in the screenshot below. I'm wondering how I could make the progress bar show up for OpenMP. Thanks!

Screenshot 2023-08-07 at 6.59.11 PM.png

Best regards,
Blair

Blair Geng

unread,
Nov 28, 2023, 8:04:25 PM11/28/23
to pysph-users
Hi Prabhu,

Thanks for the clarification! You mentioned "distribute the particles". I'm wondering how it could be done when preparing the input files.

Also, I tried using OpenMP and MPI at the same time for one case of 1.5 million particles. But the runtime is about 4 times longer than the one using OpenMP only. I'm questioning myself if that's because I didn't distribute the particles before running the script.

Looking forward to your reply!

Best,
Blair

On Thursday, July 27, 2023 at 10:49:46 AM UTC-7 Prabhu Ramachandran wrote:
Reply all
Reply to author
Forward
0 new messages