#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include "mpi.h"
◆ main()
Minimal mpi self test for varying number of processors.
43 MPI_Init(&argc,&argv);
44 MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
45 MPI_Comm_rank(MPI_COMM_WORLD,&myid);
47 std::stringstream filename_stringstream;
49 <<
"mpi_seltest_np" <<numprocs <<
"rank" << myid;
52 myfile.open(filename_stringstream.str().c_str());
54 myfile <<
"This worked" << std::endl;