1
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ This should be possible in principle. Do you have a deeper question? $\endgroup$
    – Bill Barth
    Jun 9 '15 at 20:55
  • $\begingroup$ @BillBarth Yeah it should be possible but it is not working. My code looks like this: Main(){ .....MPI_BARRIER If(id of processor = 0 ) then do system (mpirun -np 16 -f {Nodelist} ./lammps)}}. This is happenning in main and I am submitting my job as mpirun -np 16 ./a.out, where a.out is exe $\endgroup$ Jun 10 '15 at 19:28
  • $\begingroup$ You can't run mpirun from a job that is already running in parallel. If you run mpirun -np 16 ./a.out, then you already have 16 instances of main() running, so all you need to do is calling the LAMMPS executable directly from each of these instances of main(). $\endgroup$ Jun 11 '15 at 11:44
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.