Using C MPI Syntax in a C ++ Application

I am developing a C ++ application for MPI. I have some existing code that is a C MPI application that partially does what I want, so I should be able to copy part of the code (or rewrite it in pure C ++) into my new program. Since the C ++ interface for MPI is outdated (and finding documentation is much more difficult), I seriously consider using the C interface for MPI in my C ++ application. Is the idea of ​​the gods mixing a C MPI interface with a C ++ MPI application, or do I really need to learn how to use Boost?

+3
source share
1 answer

There is no harm in using the C API from a C ++ application. Many popular APIs are written in C (as an example, use the Windows API, or POSIX, or SQLite, zlib, Python, or dozens of others).

So, if this seems like the most convenient solution, keep using the C API. It should be pretty easy to write some subtle rappers in C ++ "if that's a little for you."

But beyond that, a C ++ developer should always learn and use Boost. Since Boost has an MPI library, it might at least be worth checking out.

And, in the end, go with what seems most simple to you in your situation.

+5
source

All Articles