forked from lijiext/lammps
port dump_modify maxfiles option to COMPRESS and MPIIO package
This commit is contained in:
parent
7780d92823
commit
075598b405
|
@ -71,6 +71,19 @@ void DumpAtomGZ::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// each proc with filewriter = 1 opens a file
|
||||
|
|
|
@ -75,6 +75,19 @@ void DumpCFGGZ::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// each proc with filewriter = 1 opens a file
|
||||
|
|
|
@ -73,6 +73,19 @@ void DumpCustomGZ::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// each proc with filewriter = 1 opens a file
|
||||
|
|
|
@ -73,6 +73,19 @@ void DumpXYZGZ::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// each proc with filewriter = 1 opens a file
|
||||
|
|
|
@ -77,6 +77,19 @@ void DumpAtomMPIIO::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (append_flag) { // append open
|
||||
|
|
|
@ -96,6 +96,19 @@ void DumpCFGMPIIO::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (append_flag) { // append open
|
||||
|
|
|
@ -98,6 +98,19 @@ void DumpCustomMPIIO::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (append_flag) { // append open
|
||||
|
|
|
@ -98,6 +98,19 @@ void DumpXYZMPIIO::openfile()
|
|||
sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1);
|
||||
}
|
||||
*ptr = '*';
|
||||
if (maxfiles > 0) {
|
||||
if (numfiles < maxfiles) {
|
||||
nameslist[numfiles] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[numfiles],filecurrent);
|
||||
++numfiles;
|
||||
} else {
|
||||
remove(nameslist[fileidx]);
|
||||
delete[] nameslist[fileidx];
|
||||
nameslist[fileidx] = new char[strlen(filecurrent)+1];
|
||||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (append_flag) { // append open
|
||||
|
|
|
@ -573,7 +573,7 @@ void Dump::openfile()
|
|||
strcpy(nameslist[fileidx],filecurrent);
|
||||
fileidx = (fileidx + 1) % maxfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// each proc with filewriter = 1 opens a file
|
||||
|
|
|
@ -60,7 +60,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :
|
|||
earg(NULL), vtype(NULL), vformat(NULL), columns(NULL), choose(NULL),
|
||||
dchoose(NULL), clist(NULL), field2index(NULL), argindex(NULL), id_compute(NULL),
|
||||
compute(NULL), id_fix(NULL), fix(NULL), id_variable(NULL), variable(NULL),
|
||||
vbuf(NULL), id_custom(NULL), flag_custom(NULL), typenames(NULL),
|
||||
vbuf(NULL), id_custom(NULL), flag_custom(NULL), typenames(NULL),
|
||||
pack_choice(NULL)
|
||||
{
|
||||
if (narg == 5) error->all(FLERR,"No dump custom arguments specified");
|
||||
|
@ -1676,7 +1676,7 @@ int DumpCustom::modify_param(int narg, char **arg)
|
|||
|
||||
if (strcmp(arg[0],"refresh") == 0) {
|
||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
||||
if (strncmp(arg[1],"c_",2) != 0)
|
||||
if (strncmp(arg[1],"c_",2) != 0)
|
||||
error->all(FLERR,"Illegal dump_modify command");
|
||||
if (refreshflag) error->all(FLERR,"Dump modify can only have one refresh");
|
||||
|
||||
|
|
Loading…
Reference in New Issue