-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impl. C++ template MPI Library #51
Labels
Comments
t-hishinuma
changed the title
impl. template MPI Library
impl. C++ template MPI Library
May 12, 2021
interface idea test_dot(...){
monolish::mpi::comm &comm = monolish::mpi::get_instance();
....
return comm.Allreduce<double>(ans);
}
int main(argc, argv){
monolish::mpi::comm comm; // singleton
//or comm(external_comm);
comm.Init(argc, argv);
....
ans = test_dot(x, y); //dont need comm
....
comm.Finalize();
} The comm class should be a singleton. |
class interface idea class monolish::mpi::comm{
private:
MPI_COMM COMM;
comm() = default;
~comm() {};
public:
comm(const comm &) = delete;
comm &operator=(const comm &) = delete;
comm(comm &&) = delete;
comm &operator=(comm &&) = delete;
static comm &get_instance() {
static comm instance;
return comm;
}
void Init(.....);
void Finalize();
double Allreduce(double val);
float Allreduce(float val);
.... |
MPI program need:
|
Remove "request" from "waitall" and wait for all communications at once. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in monolish::mpi
The text was updated successfully, but these errors were encountered: