Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] run_style verlet/split fails for certain types of examples #4149

Open
bcdandurand opened this issue Apr 26, 2024 · 0 comments
Open

[BUG] run_style verlet/split fails for certain types of examples #4149

bcdandurand opened this issue Apr 26, 2024 · 0 comments
Labels

Comments

@bcdandurand
Copy link

Summary

I am working on experimental modifications of the VerletSplit class. So far, I tested the use of run_style verlet/split on a number of example applications, and for one in particular, I run into an issue that appears to be fixed with a slight change of code. I would like to request that the development team for VerletSplit.cpp make changes for future releases as exemplified below to address the issue raised below.

LAMMPS Version and Platform

LAMMPS (7 Feb 2024). I'm currently working on a local git branch that is not modified from this version.

Steps to Reproduce

I modified my local copy of lammps/examples/SPIN/dipole_spin/in.spin.iron_dipole_pppm in the following manner:

  1. In order to be able to run the example on more than 8 processors with MPI, I changed
    region box block 0.0 12.0 0.0 12.0 0.0 12.0
    to
    region box block 0.0 24.0 0.0 24.0 0.0 24.0

  2. I added the line run_style verlet/split before the run statement

I built lammps with the additional packages needed to run this application. My build.sh script (run from my lammps/build directory) appears as follows:

#!/bin/bash

cmake -D PKG_SPIN=yes -D PKG_DIPOLE=yes -D PKG_MANYBODY=yes -D PKG_MOLECULE=yes -D PKG_KSPACE=yes -D PKG_RIGID=yes -D PKG_EXTRA-PAIR=yes -D PKG_EXTRA-MOLECULE=yes -D PKG_OPENMP=no -D PKG_MDI=yes -D PKG_DIELECTRIC=yes -D PKG_REPLICA=yes -D PKG_MISC=yes -D CMAKE_BUILD_TYPE=Release ../cmake
make

(I'm sure not all of these packages are needed for the SPIN application mentioned.) When I run,

$ mpirun -n 10 ~/lammps/build/lmp -partition 8 2 -in in.spin.iron_dipole_pppm

I got memory violation errors which I traced to VerletSplit::rk_setup. After I replaced the line
MPI_Gatherv(atom->q,n,MPI_DOUBLE,atom->q,qsize,qdisp,MPI_DOUBLE,0,block);
with
if(atom->q_flag) MPI_Gatherv(atom->q,n,MPI_DOUBLE,atom->q,qsize,qdisp,MPI_DOUBLE,0,block);
(i.e., adding the if statement) and re-building, the simulation appears to run as expected. The rationale for the change is that when the atom->q_flag is false, the buffers are not allocated/initialised even on the sending side.

Further Information, Files, and Links

While the fix provided above appears to work for the above example, this ticket is to request that the development team responsible for maintaining the VerletSplit class address for future releases the apparent issue that certain types of MPI communications are not always applicable for certain applications in this and perhaps other forms that may be anticipated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant