wlav / cppyy

Other
387 stars 39 forks source link

Does cppyy support C++ libraries that use MPI? #185

Open NiKeYiGuN opened 11 months ago

wlav commented 11 months ago

Yes and no ... the biggest problem is that many parts of the MPI API are preprocessor defines, which are not reflected (there's some minor support for them using cppyy.macro() but it's a clutch and definitely not pleasant to use at the scale needed for MPI programs). Otherwise, it's just another C library and will simply work.

Also, mpi4py is pretty great.

As for the more specific question of "C++ libraries that use MPI", so not MPI itself directly: the only caveat that I've seen is if you run on heterogeneous hardware, or if you submit from different hardware, then you need to make sure to rebuild the PCH on each node. By default, the PCH will be build with -march=native, so may enable such things like AVX if the node on which it's build supports it. If the node where it's actually run does not, you'll end up with SIGILL. You can also set CLING_EXTRA_ARGS to something more innocuous such as -O2 to side-step this.

NiKeYiGuN commented 11 months ago

OK, thanks! I will try it.

NiKeYiGuN commented 11 months ago

What do you think about this issue #182 ? It's reporting the same error on windows 11 CLion with different toolchain (mingw64 and visual studio) about struct timeval .If you have time you can test it. I think it might be a bug. very thankful.