Adding MPI wrapper class
This commit is contained in:
@@ -26,11 +26,10 @@ std::shared_ptr<Database> loadInputs( int nprocs )
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// Initialize MPI
|
||||
int rank, nprocs;
|
||||
MPI_Init(&argc,&argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
MPI_Comm_rank(comm,&rank);
|
||||
MPI_Comm_size(comm,&nprocs);
|
||||
Utilities::MPI comm( MPI_COMM_WORLD );
|
||||
int rank = comm.getRank();
|
||||
int nprocs = comm.getSize();
|
||||
{ // Limit scope so variables that contain communicators will free before MPI_Finialize
|
||||
|
||||
if ( rank==0 ) {
|
||||
@@ -165,7 +164,7 @@ int main(int argc, char **argv)
|
||||
// Averages->Reduce();
|
||||
|
||||
} // Limit scope so variables that contain communicators will free before MPI_Finialize
|
||||
MPI_Barrier(comm);
|
||||
comm.barrier();
|
||||
MPI_Finalize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user