[lammps-users] rerun issue

Hello lammps developers,

Just today i downloaded the last version of lammps via github with the command

git clone -b release https://github.com/lammps/lammps.git mylammps

When running lammps the version is LAMMPS (7 Jan 2022)

I am having a problem with the rerun command which i didn’ t have in previous versions. For example, what I am about to show runs with no problem in version 3Mar20.
What I want to do is dumping a trajectory after reruning and doing some analysis, but I get this error which does not appear in older versions

ERROR: Cannot reset timestep with active dump - must undump first (…/output.cpp:623)
Last command: rerun dump.lammpstrj dump x y z ix iy iz vx vy vz

I don’ t know if this new restriction is intended

I attached a simple data, dump and run files which can reproduce the error

Thanks for any comment

Matias

test.run (256 Bytes)

nvt_reserv.data (639 Bytes)

dump.lammpstrj (982 Bytes)

Matias,

this seems to be an unwanted side effect from the changes in this pull request: https://github.com/lammps/lammps/pull/3052

try applying the following change:

index a8fda4173d..b2b8011842 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -619,9 +619,8 @@ int Output::check_time_dumps(bigint ntimestep)
{
next_dump_any = MAXBIGINT;
for (int idump = 0; idump < ndump; idump++)
- if (last_dump[idump] >= 0)
- error->all(FLERR,
- "Cannot reset timestep with active dump - must undump first");
+ if ((last_dump[idump] >= 0) && !update->whichflag)
+ error->all(FLERR, "Cannot reset timestep with active dump - must undump first");

if (restart_flag_single) {
if (restart_every_single) {

Thank Axel, that solved the issue, nevertheless another appeared.

Now I wanted to get a new dump file for each frame in the original dump so in test.run
I changed this line

dump 1 all custom 1 dump_copy.lammpstrj id type xs ys zs vx vy vz

for

dump 1 all custom 1 dump_copy_*.lammpstrj id type xs ys zs vx vy vz

but lammps just write the dump for the first frame and then nothing.

Thanks again,

Matias

This can be worked around with the following change on top of the previous one.
This now doesn’t look like it is going to be a good permanent solution, though.
Will have to discuss with Steve about whether there is a better way to address this kind of issue.

diff --git a/src/dump.h b/src/dump.h
index 35da154d7c..482e87a207 100644
--- a/src/dump.h
+++ b/src/dump.h
@@ -19,6 +19,7 @@
namespace LAMMPS_NS {

class Dump : protected Pointers {
+ friend class Output;
public:
char *id; // user-defined name of Dump
char *style; // style of Dump
diff --git a/src/output.cpp b/src/output.cpp
index 449077d1fb..1376d365d8 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -632,7 +632,7 @@ int Output::check_time_dumps(bigint ntimestep)
{
next_dump_any = MAXBIGINT;
for (int idump = 0; idump < ndump; idump++)
- if ((last_dump[idump] >= 0) && !update->whichflag)
+ if ((last_dump[idump] >= 0) && !update->whichflag && !dump[idump]->multifile)
error->all(FLERR, "Cannot reset timestep with active dump - must undump first");

if (restart_flag_single) {