#include "mpi.h"
// We place stdio.h *after* mpi.h to avoid conflicts with SEEK_SET et al
// (the name is #defined in stdio.h and used as an MPI constant
// MPI::SEEK_SET in the C++ binding for MPI)
#include
#include "mpitestconf.h"
#ifdef HAVE_IOSTREAM
// Not all C++ compilers have iostream instead of iostream.h
#include
#ifdef HAVE_NAMESPACE_STD
// Those that do need the std namespace; otherwise, a bare "cout"
// is likely to fail to compile
using namespace std;
#endif
#else
#include
#endif
#include
#include "mpitestcxx.h"
#define MAX_FPARM 5
#define MAX_BUFFER 65536
#define MAX_FTYPE 3
// We print no more than 10 errors. To ensure a clean exit,
// we normally continue until the end of the job (so that
// we can write out the standard No Errors or Found %d Errors message)
#define MAX_ERRORS 10
// This structure is used to determine how data is placed across the file
typedef struct { int n, b; } fileparm;
int main( int argc, char *argv[] )
{
int errs = 0;
MPI::Intracomm comm;
MPI::File fh;
int ftype;
int itmp, fparm, n, b, i, k, r, s;
int wrank, wsize;
fileparm fparms[MAX_FPARM] = {
1,4000, 4000,8, 4096,8, 64000,8, 65536,8 };
char filename[1024];
MTest_Init();
wrank = MPI::COMM_WORLD.Get_rank();
wsize = MPI::COMM_WORLD.Get_size();
for (ftype=0; ftype
// Now, open the same file for reading
}
if (comm != MPI::COMM_WORLD) {
comm.Free();
}
}
MTest_Finalize( errs );
return 0;
}