git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11946 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2014-05-08 14:51:32 +00:00
parent cf0cd2e912
commit de0c8d1f14
8 changed files with 13 additions and 14 deletions

View File

@ -300,7 +300,7 @@ void Balance::command(int narg, char **arg)
if (domain->triclinic) domain->x2lamda(atom->nlocal);
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms();
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);

View File

@ -362,7 +362,7 @@ void ChangeBox::command(int narg, char **arg)
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms();
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);

View File

@ -400,7 +400,7 @@ void CreateAtoms::command(int narg, char **arg)
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms();
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
}

View File

@ -270,7 +270,7 @@ void DisplaceAtoms::command(int narg, char **arg)
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms();
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);

View File

@ -78,7 +78,7 @@ Irregular::~Irregular()
for triclinic: atoms must be in lamda coords (0-1) before this is called
------------------------------------------------------------------------- */
void Irregular::migrate_atoms()
void Irregular::migrate_atoms(int sortflag)
{
// clear global->local map since atoms move to new procs
// clear old ghosts so map_set() at end will operate only on local atoms
@ -145,10 +145,8 @@ void Irregular::migrate_atoms()
// create irregular communication plan, perform comm, destroy plan
// returned nrecv = size of buffer needed for incoming atoms
// debug: turn on sorting for repoducible irregular() via extra final arg
//int nrecv = create_atom(nsendatom,sizes,proclist,1);
int nrecv = create_atom(nsendatom,sizes,proclist);
int nrecv = create_atom(nsendatom,sizes,proclist,sortflag);
if (nrecv > maxrecv) grow_recv(nrecv);
exchange_atom(buf_send,sizes,buf_recv);
destroy_atom();
@ -255,7 +253,7 @@ int Irregular::migrate_check()
return total # of doubles I will recv (not including self)
------------------------------------------------------------------------- */
int Irregular::create_atom(int n, int *sizes, int *proclist, int sort)
int Irregular::create_atom(int n, int *sizes, int *proclist, int sortflag)
{
int i;
@ -370,7 +368,7 @@ int Irregular::create_atom(int n, int *sizes, int *proclist, int sort)
// useful for debugging to insure reproducible ordering of received atoms
// invoke by adding final arg = 1 to create_atom() call in migrate_atoms()
if (sort) {
if (sortflag) {
int *order = new int[nrecv];
int *proc_recv_ordered = new int[nrecv];
int *length_recv_ordered = new int[nrecv];

View File

@ -27,7 +27,7 @@ class Irregular : protected Pointers {
Irregular(class LAMMPS *);
~Irregular();
void migrate_atoms();
void migrate_atoms(int sortflag = 0);
int migrate_check();
int create_data(int, int *);
void exchange_data(char *, int, char *);
@ -87,7 +87,7 @@ class Irregular : protected Pointers {
PlanAtom *aplan;
PlanData *dplan;
int create_atom(int, int *, int *, int sort = 0);
int create_atom(int, int *, int *, int);
void exchange_atom(double *, int *, double *);
void destroy_atom();
int coord2proc(double *, int &, int &, int &);

View File

@ -547,7 +547,7 @@ void ReadDump::atoms()
if (triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms();
irregular->migrate_atoms(1);
delete irregular;
if (triclinic) domain->lamda2x(atom->nlocal);

View File

@ -429,13 +429,14 @@ void ReadRestart::command(int narg, char **arg)
}
// move atoms to new processors via irregular()
// turn sorting on in migrate_atoms() to avoid non-reproducible restarts
// in case read by different proc than wrote restart file
// first do map_init() since irregular->migrate_atoms() will do map_clear()
if (atom->map_style) atom->map_init();
if (domain->triclinic) domain->x2lamda(atom->nlocal);
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms();
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);