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

This commit is contained in:
sjplimp 2013-04-02 15:21:31 +00:00
parent d930685e68
commit f62f514868
2 changed files with 10 additions and 9 deletions

View File

@ -104,7 +104,7 @@ Dump::Dump(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
nclusterprocs = 1;
filewriter = 1;
fileproc = me;
MPI_Comm_split(world,me,0,&dumpcomm);
MPI_Comm_split(world,me,0,&clustercomm);
multiname = new char[strlen(filename) + 16];
*ptr = '\0';
sprintf(multiname,"%s%d%s",filename,me,ptr+1);
@ -140,7 +140,7 @@ Dump::~Dump()
memory->destroy(proclist);
delete irregular;
if (multiproc) MPI_Comm_free(&dumpcomm);
if (multiproc) MPI_Comm_free(&clustercomm);
// XTC style sets fp to NULL since it closes file in its destructor
@ -290,11 +290,12 @@ void Dump::write()
else nmax = nme;
// write timestep header
// for multiproc, nheader = # of lines in this file via Allreduce on dumpcomm
// for multiproc,
// nheader = # of lines in this file via Allreduce on clustercomm
bigint nheader = ntotal;
if (multiproc)
MPI_Allreduce(&bnme,&nheader,1,MPI_LMP_BIGINT,MPI_SUM,dumpcomm);
MPI_Allreduce(&bnme,&nheader,1,MPI_LMP_BIGINT,MPI_SUM,clustercomm);
if (filewriter) write_header(nheader);
@ -694,8 +695,8 @@ void Dump::modify_params(int narg, char **arg)
else filewriter = 0;
int icluster = fileproc/nper;
MPI_Comm_free(&dumpcomm);
MPI_Comm_split(world,icluster,0,&dumpcomm);
MPI_Comm_free(&clustercomm);
MPI_Comm_split(world,icluster,0,&clustercomm);
delete [] multiname;
multiname = new char[strlen(filename) + 16];
@ -745,8 +746,8 @@ void Dump::modify_params(int narg, char **arg)
if (me == fileproc) filewriter = 1;
else filewriter = 0;
MPI_Comm_free(&dumpcomm);
MPI_Comm_split(world,icluster,0,&dumpcomm);
MPI_Comm_free(&clustercomm);
MPI_Comm_split(world,icluster,0,&clustercomm);
delete [] multiname;
multiname = new char[strlen(filename) + 16];

View File

@ -63,7 +63,7 @@ class Dump : protected Pointers {
int filewriter; // 1 if this proc writes a file, else 0
int fileproc; // ID of proc in my cluster who writes to file
char *multiname; // dump filename with % converted to cluster ID
MPI_Comm dumpcomm;
MPI_Comm clustercomm; // MPI communicator within my cluster of procs
int header_flag; // 0 = item, 2 = xyz
int flush_flag; // 0 if no flush, 1 if flush every dump