Navigation Menu

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 fix for tiled communication at cutoffs near box size #1388

Merged
merged 2 commits into from Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/balance.cpp
Expand Up @@ -1255,14 +1255,14 @@ void Balance::dumpout(bigint tstep)
int m = 0;
for (int i = 0; i < nprocs; i++) {
domain->lamda_box_corners(&boxall[i][0],&boxall[i][3]);
fprintf(fp,"%d %d %g %g %g\n",m+1,1,bc[0][0],bc[0][1],bc[0][1]);
fprintf(fp,"%d %d %g %g %g\n",m+2,1,bc[1][0],bc[1][1],bc[1][1]);
fprintf(fp,"%d %d %g %g %g\n",m+3,1,bc[2][0],bc[2][1],bc[2][1]);
fprintf(fp,"%d %d %g %g %g\n",m+4,1,bc[3][0],bc[3][1],bc[3][1]);
fprintf(fp,"%d %d %g %g %g\n",m+5,1,bc[4][0],bc[4][1],bc[4][1]);
fprintf(fp,"%d %d %g %g %g\n",m+6,1,bc[5][0],bc[5][1],bc[5][1]);
fprintf(fp,"%d %d %g %g %g\n",m+7,1,bc[6][0],bc[6][1],bc[6][1]);
fprintf(fp,"%d %d %g %g %g\n",m+8,1,bc[7][0],bc[7][1],bc[7][1]);
fprintf(fp,"%d %d %g %g %g\n",m+1,1,bc[0][0],bc[0][1],bc[0][2]);
fprintf(fp,"%d %d %g %g %g\n",m+2,1,bc[1][0],bc[1][1],bc[1][2]);
fprintf(fp,"%d %d %g %g %g\n",m+3,1,bc[2][0],bc[2][1],bc[2][2]);
fprintf(fp,"%d %d %g %g %g\n",m+4,1,bc[3][0],bc[3][1],bc[3][2]);
fprintf(fp,"%d %d %g %g %g\n",m+5,1,bc[4][0],bc[4][1],bc[4][2]);
fprintf(fp,"%d %d %g %g %g\n",m+6,1,bc[5][0],bc[5][1],bc[5][2]);
fprintf(fp,"%d %d %g %g %g\n",m+7,1,bc[6][0],bc[6][1],bc[6][2]);
fprintf(fp,"%d %d %g %g %g\n",m+8,1,bc[7][0],bc[7][1],bc[7][2]);
m += 8;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/comm_tiled.cpp
Expand Up @@ -512,7 +512,7 @@ void CommTiled::forward_comm(int /*dummy*/)
MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]);
}
if (sendother[iswap]) {
for (i = 0; i < nsendproc[iswap]; i++) {
for (i = 0; i < nsend; i++) {
n = avec->pack_comm(sendnum[iswap][i],sendlist[iswap][i],
buf_send,pbc_flag[iswap][i],pbc[iswap][i]);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap][i],0,world);
Expand Down
12 changes: 6 additions & 6 deletions src/fix_ave_histo.cpp
Expand Up @@ -46,9 +46,9 @@ enum{IGNORE,END,EXTRA};

FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg),
nvalues(0), which(NULL), argindex(NULL), value2index(NULL),
nvalues(0), which(NULL), argindex(NULL), value2index(NULL),
ids(NULL), fp(NULL), stats_list(NULL),
bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL),
bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL),
coord(NULL), vector(NULL)
{
if (narg < 10) error->all(FLERR,"Illegal fix ave/histo command");
Expand Down Expand Up @@ -232,7 +232,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :

} else if (which[i] == VARIABLE) {
int ivariable = input->variable->find(ids[i]);
if (ivariable < 0)
if (ivariable < 0)
error->all(FLERR,"Fix ave/histo input is invalid variable");
// variables only produce one kind of output
if (input->variable->equalstyle(ivariable)) kindglobal = 1;
Expand All @@ -247,13 +247,13 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
if (kindperatom) kind = PERATOM;
if (kindlocal) kind = LOCAL;
} else if (kind == GLOBAL) {
if (!kindglobal)
if (!kindglobal)
error->all(FLERR,"Fix ave/histo input kind is invalid");
} else if (kind == PERATOM) {
if (!kindperatom)
if (!kindperatom)
error->all(FLERR,"Fix ave/histo input kind is invalid");
} else if (kind == LOCAL) {
if (!kindlocal)
if (!kindlocal)
error->all(FLERR,"Fix ave/histo input kind is invalid");
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/fix_balance.cpp
Expand Up @@ -274,10 +274,6 @@ void FixBalance::rebalance()
comm->layout = Comm::LAYOUT_TILED;
}

// output of new decomposition

if (balance->outflag) balance->dumpout(update->ntimestep);

// reset proc sub-domains
// check and warn if any proc's subbox is smaller than neigh skin
// since may lead to lost atoms in comm->exchange()
Expand All @@ -286,12 +282,17 @@ void FixBalance::rebalance()
domain->set_local_box();
domain->subbox_too_small_check(neighbor->skin);

// output of new decomposition

if (balance->outflag) balance->dumpout(update->ntimestep);

// move atoms to new processors via irregular()
// for non-RCB only needed if migrate_check() says an atom moves too far
// else allow caller's comm->exchange() to do it
// set disable = 0, so weights migrate with atoms
// important to delay disable = 1 until after pre_neighbor imbfinal calc
// b/c atoms may migrate again in comm->exchange()
// NOTE: for reproducible debug runs, set 1st arg of migrate_atoms() to 1

if (domain->triclinic) domain->x2lamda(atom->nlocal);
if (wtflag) balance->fixstore->disable = 0;
Expand Down