"dump_modify every/time" command

Dear all,

No output and no error when ‘dump_modify every/time’ command is used ( 24 Mar 2022 version).

The following lines are part of my script:

variable t file tmp.times
variable s equal next(t)
dump 1 all custom 100 all-*.lammpstrj id type x y z
dump_modify 1 every/time v_s
run 20000
undump 1

Similar scripts work well when using the ‘dump_modify every’ command:

variable t file tmp.timesteps
variable s equal next(t)
dump 1 all custom 100 all-*.lammpstrj id type x y z
dump_modify 1 every v_s
run 20000
undump 1

Are there still some problems with the “dump_modify every/time” command ?
Looking forward to your reply.

Best regard.

-Leqing

Most likely you are not using it correctly. But it is impossible to make a proper assessment because crucial information is missing. I suggest you modify one of the example inputs of the LAMMPS distribution to reproduce the issue and provide the modified file and the corresponding tmp.timesteps file as well.

FeNiCr.eam.alloy (1.2 MB)
in.eam (1.4 KB)
tmp.times (78 Bytes)
tmp.timesteps (43 Bytes)
log-times.lammps (9.5 KB)
log-timesteps.lammps (36.9 KB)

Hello,

Here is my test file. Thank you for your kindly help!

-Leqing

It looks like you are subject to an uninitialized data bug that is fixed in the current development branch but not yet available in a released version.

There will be a new patch release of LAMMPS this week, probably tomorrow that will include this bugfix.

This new version will produce the expected output:

$ head -4 all-{???,????,?????}.lammpstrj
==> all-831.lammpstrj <==
ITEM: TIME
0.01001004133219757
ITEM: TIMESTEP
831

==> all-3344.lammpstrj <==
ITEM: TIME
0.1000540304000143
ITEM: TIMESTEP
3344

==> all-4726.lammpstrj <==
ITEM: TIME
0.4000098673391261
ITEM: TIMESTEP
4726

==> all-6082.lammpstrj <==
ITEM: TIME
1.000002447406801
ITEM: TIMESTEP
6082

==> all-8823.lammpstrj <==
ITEM: TIME
2.500186489365225
ITEM: TIMESTEP
8823

==> all-10855.lammpstrj <==
ITEM: TIME
4.000563271936227
ITEM: TIMESTEP
10855

It would be great to hear that. Can’t wait.
Thank you for your information.

Dear Axel,

Great thanks for the new patch release of LAMMPS.
However, the new version has the same problem mentioned above.

Please refer to the attached files.

-Leqing

log-times.lammps (9.5 KB)
log-timesteps.lammps (36.9 KB)

I found that delta can only be a constant, not a variable. Otherwise, there is no output files.
log-constant.lammps (36.9 KB)

That is not correct. If it would only accept a constant, you would already get an error when issuing the dump_modify command.

You will get output when you run with only 1 MPI rank.

The issue that is preventing the output (and stalling the parallel run) seems to be a different one than the bugfix.

Yes, I mean I get the output files if delta is a constant.
I’ll try the solution you recommended.

Thank you always!

Please try adding the one line as indicated below to src/output.cpp and recompile.
This is a different bug than the one I fixed before.

  diff --git a/src/output.cpp b/src/output.cpp
  index 26944d6e5b..f9e08dbefc 100644
  --- a/src/output.cpp
  +++ b/src/output.cpp   
  @@ -784,6 +781,7 @@ void Output::add_dump(int narg, char **arg)
     last_dump[ndump] = -1;
     var_dump[ndump] = nullptr;
     ivar_dump[ndump] = -1;
  +  next_dump[ndump] = 0;
   
     ndump++;
   }

And you need this one line change:

  diff --git a/src/dump.cpp b/src/dump.cpp
  index c9a98cb239..ac089de8c9 100644
  --- a/src/dump.cpp
  +++ b/src/dump.cpp
  @@ -1086,6 +1086,7 @@ void Dump::modify_params(int narg, char **arg)
         }
         output->mode_dump[idump] = 1;
         output->every_time_dump[idump] = delta;
  +      output->next_dump[idump] = update->ntimestep;
         iarg += 2;
   
       } else if (strcmp(arg[iarg],"fileper") == 0) {

Your solution perfectly solved the problem. It works! :smile: