Can I start parallel run of LAMMPS from inside a C++ code. Is it possible to compile my code and then do mpirun with my compiled code. I also have one system command inside the code, which starts parallel instances of LAMMPS with mpirun.
1 Answer
$\begingroup$
$\endgroup$
Look at https://github.com/jeffhammond/HPCInfo/blob/master/docs/LAMMPS.mediawiki and https://github.com/awlange/lammps_ensembles. We did exactly this for the purpose of umbrella sampling etc.
Interface to PLUMED worked, among other things.
mpirun
from a job that is already running in parallel. If you runmpirun -np 16 ./a.out
, then you already have 16 instances ofmain()
running, so all you need to do is calling the LAMMPS executable directly from each of these instances ofmain()
. $\endgroup$