Dear lammps users,
Lammps crashes when trying to do MPI_Allreduce in compute_scalar method in fix_langevin.cpp. This occurs only when the energy is to be computed at the zeroth step of simulation. Starting from a restart file is free of this problem. The temporary workaround is to disable MPI_Allreduce at step 0. That is, putting ‘if’ conditional at the end of compute_scalar method, like this:
if(update->ntimestep>0)
{
double energy_all;
MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
return -energy_all;
}
else return 0.;
solves the problem. Not sure whether this solution is optimal but works.
Another reservation concerning thermostating rotational degrees of freedom. I saw the discussion concerning the 10/3 factor which was found necessary to put in omega_thermostat method in the variable gamma1. This factor comes from some difference between friction forces acting on translation 6 Pi eta r and rotation 8 Pi eta r^3. So, upon incorporation of the factor 10/3 everything is OK in omega_thermostat method including the rotational diffusion. However, the same factor has been incorporated to angmom_thermostat. This is definitely incorrect. In case of nonspherical particles the friction forces are not isotropic and not of the form 8 Pi eta r^3. I think that it would be better to get rid of this factor in angmon_thermostat and mention in the manual that fix_langevin does not properly handle the rotational diffusion in the case of nonspherical particles. Of course, thermostating will work well with or without this factor.
Regards
Tomasz