Fix bug introduced by uninitialized moloffset
This commit is contained in:
@ -446,7 +446,7 @@ void CreateAtoms::command(int narg, char **arg)
|
||||
|
||||
// molcreate = # of molecules I created
|
||||
|
||||
int molcreate = (atom->nlocal - nlocal_previous) / onemol->natoms;
|
||||
tagint molcreate = (atom->nlocal - nlocal_previous) / onemol->natoms;
|
||||
|
||||
// increment total bonds,angles,etc
|
||||
|
||||
@ -463,13 +463,13 @@ void CreateAtoms::command(int narg, char **arg)
|
||||
// moloffset = max molecule ID for all molecules owned by previous procs
|
||||
// including molecules existing before this creation
|
||||
|
||||
tagint moloffset;
|
||||
tagint moloffset = 0;
|
||||
if (molecule_flag) {
|
||||
tagint max = 0;
|
||||
for (int i = 0; i < nlocal_previous; i++) max = MAX(max,molecule[i]);
|
||||
tagint maxmol;
|
||||
MPI_Allreduce(&max,&maxmol,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||
MPI_Scan(&molcreate,&moloffset,1,MPI_INT,MPI_SUM,world);
|
||||
MPI_Scan(&molcreate,&moloffset,1,MPI_LMP_TAGINT,MPI_SUM,world);
|
||||
moloffset = moloffset - molcreate + maxmol;
|
||||
}
|
||||
|
||||
|
||||
@ -760,7 +760,7 @@ void Molecule::molecules(char *line)
|
||||
int iatom = values.next_int() - 1;
|
||||
if (iatom < 0 || iatom >= natoms) error->one(FLERR,"Invalid Molecules section in molecule file");
|
||||
count[iatom]++;
|
||||
molecule[iatom] = values.next_int();
|
||||
molecule[iatom] = values.next_tagint();
|
||||
// molecule[iatom] += moffset; // placeholder for possible molecule offset
|
||||
}
|
||||
} catch (TokenizerException &e) {
|
||||
|
||||
Reference in New Issue
Block a user