Skip to content

Commit

Permalink
When specifying optional arguments, all previous optional arguments m…
Browse files Browse the repository at this point in the history
…ust be specified. This did not error with MPICH since "verbosity" and the communicator were both type int. However it produced an error with OpenMPI. (#7)
  • Loading branch information
tskisner authored and keskitalo committed Nov 13, 2019
1 parent f0a7782 commit 70933bc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/test_libconviqt_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main( int argc, char **argv ) {
int flag;
MPI_Initialized( &flag );
if ( flag ) throw std::runtime_error( "ERROR: MPI was already initialized" );

std::cout << "Initializing MPI" << std::endl;

if ( MPI_Init( &argc, &argv ) ) throw std::runtime_error( "ERROR: Failed to initialize MPI" );
Expand Down Expand Up @@ -102,15 +102,17 @@ int main( int argc, char **argv ) {
pnt_world[row*5+3] = 0; // TOD
pnt_world[row*5+4] = row+first_sample; // time
}


int verbosity=1;

std::cout << rank << " : Convolving self" << std::endl;
convolver cnv_self( &s, &b, &d, pol, lmax, beammmax, order, comm_self );
convolver cnv_self( &s, &b, &d, pol, lmax, beammmax, order, verbosity, comm_self );
if (rank == 0) cnv_self.convolve( pnt_self );

MPI_Barrier( comm_world );

std::cout << rank << " : Convolving world" << std::endl;
convolver cnv_world( &s, &b, &d, pol, lmax, beammmax, order, comm_world );
convolver cnv_world( &s, &b, &d, pol, lmax, beammmax, order, verbosity, comm_world );
cnv_world.convolve( pnt_world );

std::vector<int> counts(ntasks);
Expand Down Expand Up @@ -146,9 +148,8 @@ int main( int argc, char **argv ) {
}

}

if ( MPI_Finalize() ) throw std::runtime_error( "ERROR: Failed to finalize MPI" );

return 0;
}

0 comments on commit 70933bc

Please sign in to comment.