git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11323 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -38,9 +38,7 @@ using namespace LAMMPS_NS;
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DumpAtomMPIIO::DumpAtomMPIIO(LAMMPS *lmp, int narg, char **arg) :
|
||||
DumpAtom(lmp, narg, arg)
|
||||
{
|
||||
}
|
||||
DumpAtom(lmp, narg, arg) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -11,13 +11,9 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Paul Coffman (IBM)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(atom_mpiio,DumpAtomMPIIO)
|
||||
DumpStyle(atom/mpiio,DumpAtomMPIIO)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@ -59,22 +59,19 @@ enum{INT,DOUBLE,STRING}; // same as in DumpCFG
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DumpCustomMPIIO::DumpCustomMPIIO(LAMMPS *lmp, int narg, char **arg) :
|
||||
DumpCustom(lmp, narg, arg)
|
||||
{
|
||||
}
|
||||
DumpCustom(lmp, narg, arg) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DumpCustomMPIIO::~DumpCustomMPIIO()
|
||||
{
|
||||
if (multifile == 0) MPI_File_close(&mpifh);
|
||||
if (multifile == 0) MPI_File_close(&mpifh);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void DumpCustomMPIIO::openfile()
|
||||
{
|
||||
|
||||
if (singlefile_opened) { // single file already opened, so just return after resetting filesize
|
||||
mpifo = currentFileSize;
|
||||
MPI_File_set_size(mpifh,mpifo+headerSize+sumFileSize);
|
||||
@ -140,7 +137,6 @@ void DumpCustomMPIIO::openfile()
|
||||
|
||||
void DumpCustomMPIIO::write()
|
||||
{
|
||||
|
||||
if (domain->triclinic == 0) {
|
||||
boxxlo = domain->boxlo[0];
|
||||
boxxhi = domain->boxhi[0];
|
||||
@ -504,7 +500,6 @@ void DumpCustomMPIIO::header_item_triclinic(bigint ndump)
|
||||
|
||||
void DumpCustomMPIIO::write_data(int n, double *mybuf)
|
||||
{
|
||||
|
||||
(this->*write_choice)(n,mybuf);
|
||||
}
|
||||
|
||||
@ -512,7 +507,6 @@ void DumpCustomMPIIO::write_data(int n, double *mybuf)
|
||||
|
||||
void DumpCustomMPIIO::write_binary(int n, double *mybuf)
|
||||
{
|
||||
|
||||
MPI_Status mpiStatus;
|
||||
n *= size_one;
|
||||
|
||||
|
||||
@ -11,13 +11,9 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Paul Coffman (IBM)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(custom_mpiio,DumpCustomMPIIO)
|
||||
DumpStyle(custom/mpiio,DumpCustomMPIIO)
|
||||
|
||||
#else
|
||||
|
||||
@ -42,6 +38,7 @@ class DumpCustomMPIIO : public DumpCustom {
|
||||
MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize;
|
||||
int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data
|
||||
char *filecurrent; // name of file for this round (with % and * replaced)
|
||||
|
||||
#if defined(_OPENMP)
|
||||
int convert_string_omp(int, double *); // multithreaded version of convert_string
|
||||
#endif
|
||||
@ -63,8 +60,6 @@ class DumpCustomMPIIO : public DumpCustom {
|
||||
FnPtrData write_choice; // ptr to write data functions
|
||||
void write_binary(int, double *);
|
||||
void write_string(int, double *);
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -59,15 +59,13 @@ enum{INT,DOUBLE,STRING}; // same as in DumpCFG
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DumpXYZMPIIO::DumpXYZMPIIO(LAMMPS *lmp, int narg, char **arg) :
|
||||
DumpXYZ(lmp, narg, arg)
|
||||
{
|
||||
}
|
||||
DumpXYZ(lmp, narg, arg) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DumpXYZMPIIO::~DumpXYZMPIIO()
|
||||
{
|
||||
if (multifile == 0) MPI_File_close(&mpifh);
|
||||
if (multifile == 0) MPI_File_close(&mpifh);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -251,7 +249,6 @@ void DumpXYZMPIIO::init_style()
|
||||
|
||||
void DumpXYZMPIIO::write_header(bigint n)
|
||||
{
|
||||
|
||||
MPI_Status mpiStatus;
|
||||
|
||||
if (performEstimate) {
|
||||
@ -275,7 +272,6 @@ void DumpXYZMPIIO::write_header(bigint n)
|
||||
|
||||
void DumpXYZMPIIO::write_data(int n, double *mybuf)
|
||||
{
|
||||
|
||||
(this->*write_choice)(n,mybuf);
|
||||
}
|
||||
|
||||
@ -287,7 +283,6 @@ void DumpXYZMPIIO::write_string(int n, double *mybuf)
|
||||
|
||||
if (performEstimate) {
|
||||
|
||||
|
||||
#if defined(_OPENMP)
|
||||
int nthreads = omp_get_max_threads();
|
||||
if (nthreads > 1)
|
||||
|
||||
@ -11,13 +11,9 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Paul Coffman (IBM)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(xyz_mpiio,DumpXYZMPIIO)
|
||||
DumpStyle(xyz/mpiio,DumpXYZMPIIO)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@ -82,12 +82,12 @@ void RestartMPIIO::openForWrite(char *filename)
|
||||
void RestartMPIIO::write(MPI_Offset headerOffset, int send_size, double *buf)
|
||||
{
|
||||
MPI_Status mpiStatus;
|
||||
long incPrefix = 0;
|
||||
long longSendSize = (long) send_size;
|
||||
MPI_Scan(&longSendSize,&incPrefix,1,MPI_LONG,MPI_SUM,world);
|
||||
bigint incPrefix = 0;
|
||||
bigint bigintSendSize = (bigint) send_size;
|
||||
MPI_Scan(&bigintSendSize,&incPrefix,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
|
||||
long largestIncPrefix = incPrefix;
|
||||
MPI_Bcast(&largestIncPrefix, 1, MPI_LONG, (nprocs-1), world);
|
||||
bigint largestIncPrefix = incPrefix;
|
||||
MPI_Bcast(&largestIncPrefix, 1, MPI_LMP_BIGINT, (nprocs-1), world);
|
||||
|
||||
int err = MPI_File_set_size(mpifh,
|
||||
(headerOffset+(largestIncPrefix*sizeof(double))));
|
||||
@ -102,7 +102,7 @@ void RestartMPIIO::write(MPI_Offset headerOffset, int send_size, double *buf)
|
||||
}
|
||||
|
||||
err = MPI_File_write_at_all(mpifh,headerOffset +
|
||||
((incPrefix-longSendSize)*sizeof(double)),
|
||||
((incPrefix-bigintSendSize)*sizeof(double)),
|
||||
buf,send_size,MPI_DOUBLE,&mpiStatus);
|
||||
if (err != MPI_SUCCESS) {
|
||||
char str[MPI_MAX_ERROR_STRING+128];
|
||||
@ -124,12 +124,12 @@ void RestartMPIIO::write(MPI_Offset headerOffset, int send_size, double *buf)
|
||||
follow the collective IO call with rank independant IO to read remaining data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void RestartMPIIO::read(MPI_Offset chunkOffset, long chunkSize, double *buf)
|
||||
void RestartMPIIO::read(MPI_Offset chunkOffset, bigint chunkSize, double *buf)
|
||||
{
|
||||
MPI_Status mpiStatus;
|
||||
|
||||
int intChunkSize;
|
||||
long remainingSize = 0;
|
||||
bigint remainingSize = 0;
|
||||
if (chunkSize > INT_MAX) {
|
||||
intChunkSize = INT_MAX;
|
||||
remainingSize = chunkSize - INT_MAX;
|
||||
|
||||
@ -31,7 +31,7 @@ class RestartMPIIO : protected Pointers {
|
||||
void openForRead(char *);
|
||||
void openForWrite(char *);
|
||||
void write(MPI_Offset, int, double *);
|
||||
void read(MPI_Offset, long, double *);
|
||||
void read(MPI_Offset, bigint, double *);
|
||||
void close();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user