[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 30 Dec 2021 13:11:19 +0100
Your espresso script will run in parallel if you call it with `mpiexec
-n 4 ./pypresso script.py`. No other action is required. You can find
the number of processors on your workstation with the command `nproc`.
On clusters you will probably need to load mpiexec with `module load
openmpi` or similar.
The ESPResSo results are automatically collected on MPI rank 0 for you,
so matplotlib and other data processing tools will work as usual. The
box will be divided automatically. If you have good reasons to override
the default box partition, you can add `system.cell_system.node_grid =
[i,j,k]` right after the line `system = System(box_l=...)`.
I wouldn't recommend running a Jupyter notebook in parallel if you have
no prior experience with MPI parallelization. It's quite difficult to do
and there isn't much information available online to help with that
setup. You will find it much easier to export your notebook as a Python
script and run it directly with mpiexec or mpirun. Just make sure to
write the results of the calculation to a file, so that you can read
them later and plot them in a Python script or Jupyter notebook.
I'll look into writing something in the user guide about MPI
parallelization in the next few weeks. Most of the information is
already in my previous mail. ESPResSo was designed to work with
mpiexec/mpirun in a completely transparent manner.
On 2021-12-30 09:06, Ahmad Reza Motezakker wrote:
Dear Rudolf/Dear Jean-Noel,
Thank you very much for your help. I just need parallelization to run
I really appreciate if you provide a general document on
parallelization (also in Jupyter) with details. For example, how to
divide the box, collecting results and etc.
Thank you for your efforts,
From: Rudolf Weeber <email@example.com>
Sent: Wednesday, December 29, 2021 7:23:20 PM
To: Ahmad Reza Motezakker
Subject: Re: Parallelization
On Wed, Dec 29, 2021 at 05:08:18PM +0000, Ahmad Reza Motezakker wrote:
Is there any tutorial or any document on EspressoMD parallelization?
I really appreciate your help. Any suggestion or experience will be
really helpful for me.
Do you just want to run a simulation in parallel, or do you want to
extend Espresso andneed to write parallel code for that.
If it is about running, you use
mpirun -np <n> ./pypresso <script.py> <arguments>
where <n> is the number of processor cores you want to run on.
More is not necessarily better, as parallelizaiton requires
communicaiton, whicht akes time of its own.
For pure Lennard-Jones-systems parallelizaiton tends not to be worth
it belwo 10k particles. If you use electrostatics or other
computaiton-intensive algorithms, the number is lower.
In practice, just time some 100 integration steps using the Python
`time` or `timeit`modules and pick the number of cpu cores which
serves you best.
Hope that helps!