To enable MPI parallelization in potfit you have to add the
–enable-mpi switch to the
./waf configure command:
./waf configure -i pair -m apot --enable-mpi
How to run a parallel version of potfit is described here
How does the parallel code work?
The parallelization of potfit is a rather simple one. The configurations are distributed evenly among all available processes. This means, that if you have N configurations in your configuration file, it does not make sense to use more than N processes (also potfit will issue a warning if this is the case).
All the work of the optimization algorithms is done by the first process, all other processes will only be doing force calculations. After the initialization is complete and the configurations have been distributed to all available processes, the main process will determine new parameters, based on the optimization method, and broadcast them to all other processes. Every process will then calculate the potential from these parameters and the forces, energies, stresses, …. for its configurations. After this is finished, the results will be sent to the main process, who determines how to continue the optimization. The other processes wait for the next set of parameters to be transmitted by the main process.
Even though this is a very basic parallelization, it is rather efficient for potfit. Profiling runs have shown that potfit spends more than 95% of the computational time in the force routine, calculating forces, energies and stresses.