-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement Teuchos MPI operations #10
Comments
Very good starting point. I have a comment concerning the API. Here we have 3 "blocking" send(snd_buf, comm); // Alias for send<Default>(snd_buff, comm);
send<Ready>(snd_buf, comm);
send<Synchronous>(snd_buf, comm);
send<Buffered>(snd_buf, comm); This way we can also implement the |
That's definitely an option, but since the enum class Mode {
Blocking,
Buffered,
Immediate,
Ready,
Synchronous
};
// most modes just return an error code
template <Mode mode>
struct SendReturn {
using type = int;
}
// Immediate return value includes an MPI_Request
struct IsendResult {
int err;
MPI_Request req;
};
template<> struct SendReturn<Mode::Immediate> {
using type = IsendResult;
}
template <Mode mode>
typename SendReturn<mode>::type send(...);
template<> typename SendReturn<Blocking>::type send<Blocking>(...) {...}
... I think (though I might be missing something), this basically just replaces symbol lookup with template resolution in the compiler, and I'm not sure it really buys us anything |
I see that I misunderstood a bit - you were just suggesting doing this for the synchronous versions. I think my point still stands (though we can avoid the funky return type template). |
I think The idea of the template parameter with a default value is to be able to change this value for ease of checking communication pattern correctness, like force synchronous send instead of send to prevent deadlocks that can be hidden by a high eager limit on the test platform. So basically, in pseudo-code enum class Mode {
Bare,
Blocking,
Ready,
Synchronous
};
#ifdef DEBUG_COMM
template<Mode mode=Synchronous>
#else
template<Mode mode=Bare>
#endif
int send(View, Comm);
#ifdef DEBUG_COMM
template<Mode mode=Synchronous>
#else
template<Mode mode=Bare>
#endif
Req isend(View, Comm); Or we can go crazier and have a |
Maybe the thing to do right now while we consider this is put some relatively lean wrappers around MPI functions in the |
The motivation here is to prove we have a reasonable implementation by being able to run Trilinos on top of KokkosComm
The text was updated successfully, but these errors were encountered: