-
Notifications
You must be signed in to change notification settings - Fork 52
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
Re-structure for use in multi-language scenarios #32
Comments
Yeah, when I started on rsmpi I structured it in a way that is more geared toward using it from a rust application and having rsmpi be the only interface through which MPI is used. I later realized that writing a rust library which can then be used from HPC applications written in the more traditional languages is also a likely scenario. However, there will have to be some restructuring to get rsmpi into shape for that use case. This issue touches on one aspect of it. The Types like Then of course objects like communicators that are passed in from another language could have different error handlers set. Right now, rsmpi assumes that communication operations crash on error, but that is not necessarily the case, so, in general, everything has to return Issue #12 is also somewhat related to this. If you don't mind, I will hijack this issue and make the title reflect the somewhat broader scope. It could then become a tracking issue for a few smaller issues that cover the different areas that need to be touched. |
is_initialized
Ah, I hadn't considered all of the potential issues here. If you do find a way to add Send + Sync traits to MPI objects statically depending on while MPI threading setting used, you may need an |
I'm also interested in this mode of use. I'll note that a best practice for MPI libraries is for object constructors to all take an It looks like rsmpi likes to use |
rsmpi does not currently support multi-language MPI programs very well. This issue is tracking the work needed to make it more embed-able.
Outstanding Issues:
mpi::is_initialized
UserCommunicator::from_raw
Original Comment
A scenario for rsmpi, which I imagine would be common, is to use it inside a static lib that is linked into a larger application. This larger application is likely written in another language like Fortran, C, or C++. The larger application is probably already initializing MPI with its preferred parameters. In this case, the Rust library could would not "own" the MPI initialization, and therefore would not call
mpi::initialize*
. However, it may still want to check if MPI has already been initialized, even if it is just to panic and tell the user that MPI needs to be initialized first.Of course,
ffi::MPI_Initialized
is available, but it seems like making the Rust-native version of it available is pretty low-cost.The text was updated successfully, but these errors were encountered: