quit (conditional exit) in partition mode

Dear Lammps community,

I want my simulation to stop running if/when a given criteria is satisfied. In this case when the CM of a molecule cross a region along the Z-axis. The below lines work fine when running a single job (non-partition mode).

variable zcm equal xcm(molecule,z)
run 5000000 every 10000 “if '${zcm} < 100 ’ then quit”

Now I run the same simulation in partition mode with different random seeds for statistical purpose. In this case when the above criteria is satisfied for one of the jobs, then all the other jobs are also stop running.

Is there a way to stop only the simulation for which the above criteria is satisfied without effecting the other jobs, which all these jobs in the partition mode.

Thank you.

In multi-partition mode, all the procs are in the “universe” MPI comm.
Each job in the partition has a subset of procs which are
all in the local “world” MPI comm. When one of the partition jobs

does a “quit”, each proc in the world calls error->done, which
does simply this:


if (output) delete output;
if (screen && screen != stdout) fclose(screen);
if (logfile) fclose(logfile);


So I don’t see why that would kill other partitions.
Unless Finaize() propagates info to procs in other


Finalize() and exit() will terminate the processes in the
one partition, so they will not be available to continue

in multi-partition mode (i.e. be assigned another script to run).

Maybe there could be an argument to the quit command

1 = kill everything in all partitions

2 = kill one partition

3 = simply terminate one partition and allow it to be

assigned another job (same as if it came to the

end of the script