remove MPIIO sources and references to them. update Purge.list and build systems
This commit is contained in:
@ -29,7 +29,6 @@
|
||||
#include "label_map.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "mpiio.h"
|
||||
#include "neighbor.h"
|
||||
#include "output.h"
|
||||
#include "pair.h"
|
||||
@ -74,16 +73,13 @@ void WriteRestart::command(int narg, char **arg)
|
||||
|
||||
if (strchr(arg[0],'%')) multiproc = nprocs;
|
||||
else multiproc = 0;
|
||||
if (utils::strmatch(arg[0],"\\.mpiio$")) mpiioflag = 1;
|
||||
else mpiioflag = 0;
|
||||
|
||||
if ((comm->me == 0) && mpiioflag)
|
||||
error->warning(FLERR,"MPI-IO output is unmaintained and unreliable. Use with caution.");
|
||||
if (utils::strmatch(arg[0],"\\.mpiio$"))
|
||||
error->all(FLERR,"MPI-IO files are no longer supported by LAMMPS");
|
||||
|
||||
// setup output style and process optional args
|
||||
// also called by Output class for periodic restart files
|
||||
|
||||
multiproc_options(multiproc,mpiioflag,narg-1,&arg[1]);
|
||||
multiproc_options(multiproc,narg-1,&arg[1]);
|
||||
|
||||
// init entire system since comm->exchange is done
|
||||
// comm::init needs neighbor::init needs pair::init needs kspace::init, etc
|
||||
@ -119,21 +115,9 @@ void WriteRestart::command(int narg, char **arg)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, int narg, char **arg)
|
||||
void WriteRestart::multiproc_options(int multiproc_caller, int narg, char **arg)
|
||||
{
|
||||
multiproc = multiproc_caller;
|
||||
mpiioflag = mpiioflag_caller;
|
||||
|
||||
// error checks
|
||||
|
||||
if (multiproc && mpiioflag)
|
||||
error->all(FLERR,"Restart file MPI-IO output not allowed with % in filename");
|
||||
|
||||
if (mpiioflag) {
|
||||
mpiio = new RestartMPIIO(lmp);
|
||||
if (!mpiio->mpiio_exists)
|
||||
error->all(FLERR,"Writing to MPI-IO filename when MPIIO package is not installed");
|
||||
}
|
||||
|
||||
// defaults for multiproc file writing
|
||||
|
||||
@ -354,49 +338,34 @@ void WriteRestart::write(const std::string &file)
|
||||
}
|
||||
}
|
||||
|
||||
// MPI-IO output to single file
|
||||
// output of one or more native files
|
||||
// filewriter = 1 = this proc writes to file
|
||||
// ping each proc in my cluster, receive its data, write data to file
|
||||
// else wait for ping from fileproc, send my data to fileproc
|
||||
|
||||
if (mpiioflag) {
|
||||
if (me == 0 && fp) {
|
||||
magic_string();
|
||||
if (ferror(fp)) io_error = 1;
|
||||
fclose(fp);
|
||||
fp = nullptr;
|
||||
int tmp,recv_size;
|
||||
|
||||
if (filewriter) {
|
||||
MPI_Status status;
|
||||
MPI_Request request;
|
||||
for (int iproc = 0; iproc < nclusterprocs; iproc++) {
|
||||
if (iproc) {
|
||||
MPI_Irecv(buf,max_size,MPI_DOUBLE,me+iproc,0,world,&request);
|
||||
MPI_Send(&tmp,0,MPI_INT,me+iproc,0,world);
|
||||
MPI_Wait(&request,&status);
|
||||
MPI_Get_count(&status,MPI_DOUBLE,&recv_size);
|
||||
} else recv_size = send_size;
|
||||
|
||||
write_double_vec(PERPROC,recv_size,buf);
|
||||
}
|
||||
mpiio->openForWrite(file.c_str());
|
||||
mpiio->write(headerOffset,send_size,buf);
|
||||
mpiio->close();
|
||||
magic_string();
|
||||
if (ferror(fp)) io_error = 1;
|
||||
fclose(fp);
|
||||
fp = nullptr;
|
||||
|
||||
} else {
|
||||
|
||||
// output of one or more native files
|
||||
// filewriter = 1 = this proc writes to file
|
||||
// ping each proc in my cluster, receive its data, write data to file
|
||||
// else wait for ping from fileproc, send my data to fileproc
|
||||
|
||||
int tmp,recv_size;
|
||||
|
||||
if (filewriter) {
|
||||
MPI_Status status;
|
||||
MPI_Request request;
|
||||
for (int iproc = 0; iproc < nclusterprocs; iproc++) {
|
||||
if (iproc) {
|
||||
MPI_Irecv(buf,max_size,MPI_DOUBLE,me+iproc,0,world,&request);
|
||||
MPI_Send(&tmp,0,MPI_INT,me+iproc,0,world);
|
||||
MPI_Wait(&request,&status);
|
||||
MPI_Get_count(&status,MPI_DOUBLE,&recv_size);
|
||||
} else recv_size = send_size;
|
||||
|
||||
write_double_vec(PERPROC,recv_size,buf);
|
||||
}
|
||||
magic_string();
|
||||
if (ferror(fp)) io_error = 1;
|
||||
fclose(fp);
|
||||
fp = nullptr;
|
||||
|
||||
} else {
|
||||
MPI_Recv(&tmp,0,MPI_INT,fileproc,0,world,MPI_STATUS_IGNORE);
|
||||
MPI_Rsend(buf,send_size,MPI_DOUBLE,fileproc,0,world);
|
||||
}
|
||||
MPI_Recv(&tmp,0,MPI_INT,fileproc,0,world,MPI_STATUS_IGNORE);
|
||||
MPI_Rsend(buf,send_size,MPI_DOUBLE,fileproc,0,world);
|
||||
}
|
||||
|
||||
// check for I/O error status
|
||||
@ -578,18 +547,7 @@ void WriteRestart::force_fields()
|
||||
|
||||
void WriteRestart::file_layout(int send_size)
|
||||
{
|
||||
if (me == 0) {
|
||||
write_int(MULTIPROC,multiproc);
|
||||
write_int(MPIIO,mpiioflag);
|
||||
}
|
||||
|
||||
if (mpiioflag) {
|
||||
int *all_send_sizes;
|
||||
memory->create(all_send_sizes,nprocs,"write_restart:all_send_sizes");
|
||||
MPI_Gather(&send_size, 1, MPI_INT, all_send_sizes, 1, MPI_INT, 0,world);
|
||||
if (me == 0) fwrite(all_send_sizes,sizeof(int),nprocs,fp);
|
||||
memory->destroy(all_send_sizes);
|
||||
}
|
||||
if (me == 0) write_int(MULTIPROC,multiproc);
|
||||
|
||||
// -1 flag signals end of file layout info
|
||||
|
||||
@ -597,14 +555,6 @@ void WriteRestart::file_layout(int send_size)
|
||||
int flag = -1;
|
||||
fwrite(&flag,sizeof(int),1,fp);
|
||||
}
|
||||
|
||||
// if MPI-IO file, broadcast the end of the header offste
|
||||
// this allows all ranks to compute offset to their data
|
||||
|
||||
if (mpiioflag) {
|
||||
if (me == 0) headerOffset = platform::ftell(fp);
|
||||
MPI_Bcast(&headerOffset,1,MPI_LMP_BIGINT,0,world);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user