Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/c++/error_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* -----------------------------------------------------------------------------
*/

#include <cstdlib>
#include <iostream>
#include <string>

Expand All @@ -21,6 +22,13 @@
meto::error_handler::error_handler(const std::string &customError,
int errorCode) {
MPI_Comm comm = MPI_COMM_WORLD;
int flag = 0;

std::cerr << customError << "\n";
MPI_Abort(comm, errorCode);

if (MPI_Initialized(&flag)) {
MPI_Abort(comm, errorCode);
} else {
std::exit(errorCode);
}
}
2 changes: 1 addition & 1 deletion src/c++/mpi_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int meto::MPIContext::get_size() { return comm_size_; }
* @returns The MPI communicator handle.
*/

int meto::MPIContext::get_handle() { return comm_handle_; }
MPI_Comm meto::MPIContext::get_handle() { return comm_handle_; }

/**
* @brief Gets the identifying tag.
Expand Down
2 changes: 1 addition & 1 deletion src/c++/mpi_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MPIContext {
// Getters
int get_size();
int get_rank();
int get_handle();
MPI_Comm get_handle();

std::string get_tag() const;
};
Expand Down