gpt4 book ai didi

c++ - MPI 是否提供预处理器宏?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:34:20 25 4
gpt4 key购买 nike

MPI 标准是否提供预处理器宏,因此如果我的 C/C++ 代码是由支持 MPI 的编译器编译的,它可以分支?类似于 OpenMP 的 _OPENMP 宏。

最佳答案

根据MPI standard (第 335 页),您可以检查 MPI_VERSION 宏:

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

关于c++ - MPI 是否提供预处理器宏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28353969/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com