SSCHAcode / python-sscha

The python implementation of the Stochastic Self-Consistent Harmonic Approximation (SSCHA).
GNU General Public License v3.0
55 stars 21 forks source link

How to install and use MPI-parallel version of SSCHA? #100

Closed Bingtan-Li closed 2 years ago

Bingtan-Li commented 2 years ago

Is there any special parameter settings needed in setup.py or input.py?

diegomartinez2 commented 2 years ago

On linux the command line for installing from source is, if you have an administrator (root) account:

sudo python3 setup.py install

or if you want it only for your user:

python3 setup.py install --user

Note that there is also a requirements.txt file. Use this command for install the required libraries:

pip install -r requirements.txt

In order to use the MPI implementation you need also to install MPI on python with pip:

python -m pip install mpi4py

If you want to use remote computers or sending work to a cluster:

sudo apt-get install openssh-client openssh-server

I hope this helps.

Bingtan-Li commented 2 years ago

Dear Diego,

Many thanks for your replying.

It is clear for me now.

Besides, there is a few more qusetions about MPI.

  1. Compared to the version without MPI, how much more efficiently will MPI improve computing efficiency? Does it increase linearly with the number of kernels?

  2. Is it true that all functions can use MPI to improve computing efficiency?

Best regards, Bingtan Li

diegomartinez2 commented 2 years ago
  1. In computing, parallelization efficiency is not linear, see Amdahl's law. The best parallelization gives 1/N with N the number of cores, after that there is the data transmission bottleneck that reduces the efficiency.
  2. Parallelization are best done in batches of independent calculations. There are functions that are intrinsically not parallelizables, like operations that require the knowledge of a previous step.
Bingtan-Li commented 2 years ago

I see. Thank you again.