PHASTA/phastaChef

create hello world test driver to check if posix and syncio both work from phIO

Closed this issue · 3 comments

pseudo code for header processing

int numberOfNodes[2];
const char* iotype = "binary"
int nfiles[2] = {1,N}; //1: posix mode, >1: syncio mode 
int file = 0;
for(int i=0; i<2; i++) {
  phio_openfile_read("geombc", nfiles, &file);
  phio_readheader(&file, "number of nodes", &(numberOfNodes[i]), 1, "integer", iotype);
  phio_closefile_read(&file);
}
assert( numberOfNodes[0] == numberOfNodes[1] );

Commenting about the comment on "nfiles=1: posix mode”.
SyncIO also allows to have one single file that includes the data for all parts.
Would this case still be acceptable with the new interface?

Thanks for pointing that out. Using the nfiles arg is not correct. In solver the plan is to count the number of geombc-dat or restart-dat files and use that to determine if we will run in posix or syncio mode. With the mode known the appropriate phIO initialization/registration function will be called to enable it. I am working on that mechanism now.

the tests are up cwsmith/phasta@ec2df29