git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9728 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
17
src/dump.cpp
17
src/dump.cpp
@ -104,7 +104,7 @@ Dump::Dump(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||||||
nclusterprocs = 1;
|
nclusterprocs = 1;
|
||||||
filewriter = 1;
|
filewriter = 1;
|
||||||
fileproc = me;
|
fileproc = me;
|
||||||
MPI_Comm_split(world,me,0,&dumpcomm);
|
MPI_Comm_split(world,me,0,&clustercomm);
|
||||||
multiname = new char[strlen(filename) + 16];
|
multiname = new char[strlen(filename) + 16];
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
sprintf(multiname,"%s%d%s",filename,me,ptr+1);
|
sprintf(multiname,"%s%d%s",filename,me,ptr+1);
|
||||||
@ -140,7 +140,7 @@ Dump::~Dump()
|
|||||||
memory->destroy(proclist);
|
memory->destroy(proclist);
|
||||||
delete irregular;
|
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
|
// XTC style sets fp to NULL since it closes file in its destructor
|
||||||
|
|
||||||
@ -290,11 +290,12 @@ void Dump::write()
|
|||||||
else nmax = nme;
|
else nmax = nme;
|
||||||
|
|
||||||
// write timestep header
|
// 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;
|
bigint nheader = ntotal;
|
||||||
if (multiproc)
|
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);
|
if (filewriter) write_header(nheader);
|
||||||
|
|
||||||
@ -694,8 +695,8 @@ void Dump::modify_params(int narg, char **arg)
|
|||||||
else filewriter = 0;
|
else filewriter = 0;
|
||||||
int icluster = fileproc/nper;
|
int icluster = fileproc/nper;
|
||||||
|
|
||||||
MPI_Comm_free(&dumpcomm);
|
MPI_Comm_free(&clustercomm);
|
||||||
MPI_Comm_split(world,icluster,0,&dumpcomm);
|
MPI_Comm_split(world,icluster,0,&clustercomm);
|
||||||
|
|
||||||
delete [] multiname;
|
delete [] multiname;
|
||||||
multiname = new char[strlen(filename) + 16];
|
multiname = new char[strlen(filename) + 16];
|
||||||
@ -745,8 +746,8 @@ void Dump::modify_params(int narg, char **arg)
|
|||||||
if (me == fileproc) filewriter = 1;
|
if (me == fileproc) filewriter = 1;
|
||||||
else filewriter = 0;
|
else filewriter = 0;
|
||||||
|
|
||||||
MPI_Comm_free(&dumpcomm);
|
MPI_Comm_free(&clustercomm);
|
||||||
MPI_Comm_split(world,icluster,0,&dumpcomm);
|
MPI_Comm_split(world,icluster,0,&clustercomm);
|
||||||
|
|
||||||
delete [] multiname;
|
delete [] multiname;
|
||||||
multiname = new char[strlen(filename) + 16];
|
multiname = new char[strlen(filename) + 16];
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class Dump : protected Pointers {
|
|||||||
int filewriter; // 1 if this proc writes a file, else 0
|
int filewriter; // 1 if this proc writes a file, else 0
|
||||||
int fileproc; // ID of proc in my cluster who writes to file
|
int fileproc; // ID of proc in my cluster who writes to file
|
||||||
char *multiname; // dump filename with % converted to cluster ID
|
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 header_flag; // 0 = item, 2 = xyz
|
||||||
int flush_flag; // 0 if no flush, 1 if flush every dump
|
int flush_flag; // 0 if no flush, 1 if flush every dump
|
||||||
|
|||||||
Reference in New Issue
Block a user