Does MPI standard provide a preprocessor macro, so my C/C++ code could branch if it is compiled by MPI-enabled compiler? Something like _OPENMP
macro for OpenMP.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
According to the MPI standard (page 335), you can check for the MPI_VERSION
macro:
In order to cope with changes to the MPI Standard, there are both compile-time and runtime ways to determine which version of the standard is in use in the environment one is using.
The "version" will be represented by two separate integers, for the version and subversion:
In C,
#define MPI_VERSION 3 #define MPI_SUBVERSION 0