print to hi-level logfile

Dear all,

I did not find in the documentation how to print to the hi-level logfile in multi-partition mode.

I have this issue because I am runing several neb relaxations in one lammps script and I would like to print to the hi-level logfile what each neb calculation corresponds to.

Thanks to let me know if this is doable.

Emile

Dear all,

I did not find in the documentation how to print to the hi-level logfile
in multi-partition mode.

I have this issue because I am runing several neb relaxations in one
lammps script and I would like to print to the hi-level logfile what each
neb calculation corresponds to.

Thanks to let me know if this is doable.

i don't think that can be done without source code modification. but that
change should be small and straightforward. let me have a quick look and
i'll report back here.

axel.

emile,

this change should do the trick. just do:

print “some text” screen no universe yes

and “some text” should be printed to the global screen.
please try it out and let me know. i’ll add it to my pull request for the next LAMMPS patch.

axel.

diff --git a/src/input.cpp b/src/input.cpp
index 3d28777…6505326 100644
— a/src/input.cpp
+++ b/src/input.cpp
@@ -1175,6 +1175,7 @@ void Input::print()

FILE *fp = NULL;
int screenflag = 1;

  • int universeflag = 0;

int iarg = 1;
while (iarg < narg) {
@@ -1197,6 +1198,12 @@ void Input::print()
else if (strcmp(arg[iarg+1],“no”) == 0) screenflag = 0;
else error->all(FLERR,“Illegal print command”);
iarg += 2;

  • } else if (strcmp(arg[iarg],“universe”) == 0) {
  • if (iarg+2 > narg) error->all(FLERR,“Illegal print command”);
  • if (strcmp(arg[iarg+1],“yes”) == 0) universeflag = 1;
  • else if (strcmp(arg[iarg+1],“no”) == 0) universeflag = 0;
  • else error->all(FLERR,“Illegal print command”);
  • iarg += 2;
    } else error->all(FLERR,“Illegal print command”);
    }

@@ -1208,6 +1215,8 @@ void Input::print()
fclose(fp);
}
}

  • if (universeflag && (universe->me == 0) && (universe->uscreen))
  • fprintf(universe->uscreen,"%s\n",line);
    }

/* ---------------------------------------------------------------------- */
[akohlmey@…3785… src]$

It does not print in the log.lammps file but it is printed to the screen so I can get what I want by outputing the screen
mpirun -np 8 ~/bin/lammps/src/lmp_mpi -partition 8x1 -in in.launch > lmp.out

That’s fine for me.
Thank you

It does not print in the log.lammps file but it is printed to the screen
so I can get what I want by outputing the screen

​that was just first test version. the patch i'm submitting for the next
LAMMPS release will also print to the logfile and thus be 100% symmetric
with the "screen" option:


https://github.com/lammps/lammps/pull/716/commits/2e40c00995a1591d7d57567aaa3112cecb43dd32

​axel.​