[lammps-users] Question about "how to multiple"

Dear colleagues,

I have questions about the LAMMPS -partition flag and “how to multiple”. I am using version 7Aug19.

Suppose I have 10 complete scripts (run1in.npt … run10in.npt) in a given directory.

I would like to run 2 simulations at a time in this universe of scripts, and after each one is finished, continue running the others.

To run 2 simulations at a time I use the “-partition 2xN” flag, where N is the number of processors in the partition.

My idea is to create an intermediate script (inputs.npt), with variables of type universe (as suggested in the manual (https://docs.lammps.org/Howto_multiple.html)

I’m making mistakes because I didn’t quite understand the concept of “how to multiple”.

When I run the intermediate script (inputs.npt) with the commands below:

variable i universe run1in.npt run2in.npt run3in.npt run4in.npt run5in.npt run6in.npt run7in.npt run8in.npt run9in.npt run10in.npt
jump $i

And the execution:

mpirun -np 2N ./lmp_mpi -partition 2xN -in inputs.npt

LAMMPS only runs normally the run1in.npt and run2in.npt files, not going on to the others (run3in.npt run4in.npt… run10in.npt).

Could someone help me to indicate what the probable mistake I made and a possible solution to run the 10 scripts in a sequence of 2 in 2 simulations?

Thanks in advance for your time.

Best Regards,

Emerson Parazzi Lyra

PhD candidate

School of Chemical Engineering

University of Campinas
500 Albert Einstein Ave, Campinas, SP, 13083-852, Brazil

Email: [email protected]

Orcid ID: https://orcid.org/0000-0002-7969-3764

what is the output? should be screen.? files, one for each partition.

Thanks for your reply, Dr. Axel Kohlmeyer.

Each of the 10 files (runXin.npt) are similar to the form below. Each file will generate a different output file LAMMPS.thermoValue, where “Value” is a temperature.

The 10 input files are in the same directory and the 10 output files should be created in the same folder as the input files.

The problem I’m having is that after starting with two partitions (-partition 2xN), LAMMPS stops and doesn’t run the third (run3in.npt), fourth (run3in.npt) and the next simulations of the “i” universe variable list.

I’m certainly calling the inputs loop wrong.

Thanks for your time in advance.

Emerson Parazzi Lyra

PhD candidate

School of Chemical Engineering

University of Campinas
500 Albert Einstein Ave, Campinas, SP, 13083-852, Brazil

Email: [email protected]

Orcid ID: https://orcid.org/0000-0002-7969-3764

I didn’t ask about the inputs but the generated output files.

Dr. Axel Kohlmeyer, I’m sorry, I don’t know if I understand your question, but I must generate an output file for each input file.

5 output files are being generated for the first two scripts (run1in.npt and run2in.npt).

The lammps output files (those without the thermo_style command results) are below:

“log.lammps” file:

image.png

“log.lammps.0” file:

and “log.lammps.1” file:

Thanks in advance for your time.

Emerson Parazzi Lyra

PhD candidate

School of Chemical Engineering

University of Campinas
500 Albert Einstein Ave, Campinas, SP, 13083-852, Brazil

Email: [email protected]

Orcid ID: https://orcid.org/0000-0002-7969-3764

I specifically asked for the screen.? files. They should contain the important information about why the jobs failed. The files you quote are useless because your inputs have a log command at the beginning.

image.png

Sorry, Dr. Axel Kohlmeyer.

Attached are all the files generated by Lammps when I ran the “set1.npt” script using the command below:

mpirun -np 12 ./lmp_mpi -partition 2x6 -in set1.npt

Thanks in advance for your time.

Emerson Parazzi Lyra

PhD candidate

School of Chemical Engineering

University of Campinas
500 Albert Einstein Ave, Campinas, SP, 13083-852, Brazil

Email: [email protected]

Orcid ID: https://orcid.org/0000-0002-7969-3764

image.png

log.lammps (58 Bytes)

log.lammps.0 (504 Bytes)

log.lammps.1 (504 Bytes)

screen.1 (7.97 KB)

screen.0 (7.97 KB)

set1.npt (174 Bytes)

LAMMPS.thermo200 (7.95 KB)

LAMMPS.thermo225 (7.95 KB)

ok. thanks that helps.

here is the problem: you are not doing a loop.
the “jump” command will tell LAMMPS to open and read the specified file from the beginning, but then there is no return to the original file and thus LAMMPS will end the run when the file is done.

since you have a ‘master’ file in “set1.npt”, that is where you need to do the loop and then you have to read the individual files with “include”.
also, since you have multiple independent simulations, you need to issue a clear command in between since you cannot recreate a box without deleting the old simulation system.

so your set1.npt file should look like this:

shell cd ch4teste7

shell cd 1000
variable f universe run1in.npt run2in.npt run3in.npt run4in.npt run5in.npt run6in.npt run7in.npt run8in.npt run9in.npt run10in.npt
label loop
clear
include $f
next f
jump set1.npt loop

instead of “set1.npt” in the “jump” command you could also use “SELF” (to avoid issues if you copy/rename the file for other uses).

axel.

image.png

I tested the commands you mentioned and everything worked perfectly. It was exactly what I needed.

Thank you very much for your time, Dr Axel Kohlmeyer.

Have a nice day!

Best Regards,

Emerson Parazzi Lyra

PhD candidate

School of Chemical Engineering

University of Campinas
500 Albert Einstein Ave, Campinas, SP, 13083-852, Brazil

Email: [email protected]

Orcid ID: https://orcid.org/0000-0002-7969-3764

image.png