c_mapping.qbk 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. [section:c_mapping Mapping from C MPI to Boost.MPI]
  2. This section provides tables that map from the functions and constants
  3. of the standard C MPI to their Boost.MPI equivalents. It will be most
  4. useful for users that are already familiar with the C or Fortran
  5. interfaces to MPI, or for porting existing parallel programs to Boost.MPI.
  6. Note that this is not a perfect one to one mapping, the Boost.MPI will sometime
  7. use function from the C API in a way that is transparent for the end user.
  8. For example, [@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node50.html#Node50
  9. `MPI_Probe and friends`] can be used to implement asynchronous send/recv.
  10. [table Point-to-point communication
  11. [[C Function/Constant] [Boost.MPI Equivalent]]
  12. [[`MPI_ANY_SOURCE`] [`any_source`]]
  13. [[`MPI_ANY_TAG`] [`any_tag`]]
  14. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node40.html#Node40
  15. `MPI_Bsend`]] [unsupported]]
  16. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node51.html#Node51
  17. `MPI_Bsend_init`]] [unsupported]]
  18. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node42.html#Node42
  19. `MPI_Buffer_attach`]] [unsupported]]
  20. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node42.html#Node42
  21. `MPI_Buffer_detach`]] [unsupported]]
  22. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node50.html#Node50
  23. `MPI_Cancel`]]
  24. [[memberref boost::mpi::request::cancel
  25. `request::cancel`]]]
  26. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node35.html#Node35
  27. `MPI_Get_count`]]
  28. [[memberref boost::mpi::status::count `status::count`]]]
  29. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node46.html#Node46
  30. `MPI_Ibsend`]] [unsupported]]
  31. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node50.html#Node50
  32. `MPI_Iprobe`]]
  33. [[memberref boost::mpi::communicator::iprobe `communicator::iprobe`]]]
  34. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node46.html#Node46
  35. `MPI_Irsend`]] [unsupported]]
  36. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node46.html#Node46
  37. `MPI_Isend`]]
  38. [[memberref boost::mpi::communicator::isend
  39. `communicator::isend`]]]
  40. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node46.html#Node46
  41. `MPI_Issend`]] [unsupported]]
  42. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node46.html#Node46
  43. `MPI_Irecv`]]
  44. [[memberref boost::mpi::communicator::isend
  45. `communicator::irecv`]]]
  46. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node50.html#Node50
  47. `MPI_Probe`]]
  48. [[memberref boost::mpi::communicator::probe `communicator::probe`]]]
  49. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node53.html#Node53
  50. `MPI_PROC_NULL`]] [unsupported]]
  51. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node34.html#Node34 `MPI_Recv`]]
  52. [[memberref boost::mpi::communicator::recv
  53. `communicator::recv`]]]
  54. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node51.html#Node51
  55. `MPI_Recv_init`]] [unsupported]]
  56. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  57. `MPI_Request_free`]] [unsupported]]
  58. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node40.html#Node40
  59. `MPI_Rsend`]] [unsupported]]
  60. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node51.html#Node51
  61. `MPI_Rsend_init`]] [unsupported]]
  62. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node31.html#Node31
  63. `MPI_Send`]]
  64. [[memberref boost::mpi::communicator::send
  65. `communicator::send`]]]
  66. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node52.html#Node52
  67. `MPI_Sendrecv`]] [[memberref boost::mpi::communicator::sendrecv
  68. `communicator::sendrecv`]]]
  69. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node52.html#Node52
  70. `MPI_Sendrecv_replace`]] [unsupported]]
  71. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node51.html#Node51
  72. `MPI_Send_init`]] [unsupported]]
  73. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node40.html#Node40
  74. `MPI_Ssend`]] [unsupported]]
  75. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node51.html#Node51
  76. `MPI_Ssend_init`]] [unsupported]]
  77. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node51.html#Node51
  78. `MPI_Start`]] [unsupported]]
  79. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node51.html#Node51
  80. `MPI_Startall`]] [unsupported]]
  81. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  82. `MPI_Test`]] [[memberref boost::mpi::request::wait `request::test`]]]
  83. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  84. `MPI_Testall`]] [[funcref boost::mpi::test_all `test_all`]]]
  85. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  86. `MPI_Testany`]] [[funcref boost::mpi::test_any `test_any`]]]
  87. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  88. `MPI_Testsome`]] [[funcref boost::mpi::test_some `test_some`]]]
  89. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node50.html#Node50
  90. `MPI_Test_cancelled`]]
  91. [[memberref boost::mpi::status::cancelled
  92. `status::cancelled`]]]
  93. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  94. `MPI_Wait`]] [[memberref boost::mpi::request::wait
  95. `request::wait`]]]
  96. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  97. `MPI_Waitall`]] [[funcref boost::mpi::wait_all `wait_all`]]]
  98. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  99. `MPI_Waitany`]] [[funcref boost::mpi::wait_any `wait_any`]]]
  100. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node47.html#Node47
  101. `MPI_Waitsome`]] [[funcref boost::mpi::wait_some `wait_some`]]]
  102. ]
  103. Boost.MPI automatically maps C and C++ data types to their MPI
  104. equivalents. The following table illustrates the mappings between C++
  105. types and MPI datatype constants.
  106. [table Datatypes
  107. [[C Constant] [Boost.MPI Equivalent]]
  108. [[`MPI_CHAR`] [`signed char`]]
  109. [[`MPI_SHORT`] [`signed short int`]]
  110. [[`MPI_INT`] [`signed int`]]
  111. [[`MPI_LONG`] [`signed long int`]]
  112. [[`MPI_UNSIGNED_CHAR`] [`unsigned char`]]
  113. [[`MPI_UNSIGNED_SHORT`] [`unsigned short int`]]
  114. [[`MPI_UNSIGNED_INT`] [`unsigned int`]]
  115. [[`MPI_UNSIGNED_LONG`] [`unsigned long int`]]
  116. [[`MPI_FLOAT`] [`float`]]
  117. [[`MPI_DOUBLE`] [`double`]]
  118. [[`MPI_LONG_DOUBLE`] [`long double`]]
  119. [[`MPI_BYTE`] [unused]]
  120. [[`MPI_PACKED`] [used internally for [link
  121. mpi.tutorial.user_data_types serialized data types]]]
  122. [[`MPI_LONG_LONG_INT`] [`long long int`, if supported by compiler]]
  123. [[`MPI_UNSIGNED_LONG_LONG_INT`] [`unsigned long long int`, if
  124. supported by compiler]]
  125. [[`MPI_FLOAT_INT`] [`std::pair<float, int>`]]
  126. [[`MPI_DOUBLE_INT`] [`std::pair<double, int>`]]
  127. [[`MPI_LONG_INT`] [`std::pair<long, int>`]]
  128. [[`MPI_2INT`] [`std::pair<int, int>`]]
  129. [[`MPI_SHORT_INT`] [`std::pair<short, int>`]]
  130. [[`MPI_LONG_DOUBLE_INT`] [`std::pair<long double, int>`]]
  131. ]
  132. Boost.MPI does not provide direct wrappers to the MPI derived
  133. datatypes functionality. Instead, Boost.MPI relies on the
  134. _Serialization_ library to construct MPI datatypes for user-defined
  135. classes. The section on [link mpi.tutorial.user_data_types user-defined
  136. data types] describes this mechanism, which is used for types that
  137. marked as "MPI datatypes" using [classref
  138. boost::mpi::is_mpi_datatype `is_mpi_datatype`].
  139. The derived datatypes table that follows describes which C++ types
  140. correspond to the functionality of the C MPI's datatype
  141. constructor. Boost.MPI may not actually use the C MPI function listed
  142. when building datatypes of a certain form. Since the actual datatypes
  143. built by Boost.MPI are typically hidden from the user, many of these
  144. operations are called internally by Boost.MPI.
  145. [table Derived datatypes
  146. [[C Function/Constant] [Boost.MPI Equivalent]]
  147. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node56.html#Node56
  148. `MPI_Address`]] [used automatically in Boost.MPI for MPI version 1.x]]
  149. [[[@http://www.mpi-forum.org/docs/mpi-20-html/node76.htm#Node76
  150. `MPI_Get_address`]] [used automatically in Boost.MPI for MPI version 2.0 and higher]]
  151. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node58.html#Node58
  152. `MPI_Type_commit`]] [used automatically in Boost.MPI]]
  153. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node55.html#Node55
  154. `MPI_Type_contiguous`]] [arrays]]
  155. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node56.html#Node56
  156. `MPI_Type_extent`]] [used automatically in Boost.MPI]]
  157. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node58.html#Node58
  158. `MPI_Type_free`]] [used automatically in Boost.MPI]]
  159. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node55.html#Node55
  160. `MPI_Type_hindexed`]] [any type used as a subobject]]
  161. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node55.html#Node55
  162. `MPI_Type_hvector`]] [unused]]
  163. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node55.html#Node55
  164. `MPI_Type_indexed`]] [any type used as a subobject]]
  165. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node57.html#Node57
  166. `MPI_Type_lb`]] [unsupported]]
  167. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node56.html#Node56
  168. `MPI_Type_size`]] [used automatically in Boost.MPI]]
  169. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node55.html#Node55
  170. `MPI_Type_struct`]] [user-defined classes and structs with MPI 1.x]]
  171. [[[@http://www.mpi-forum.org/docs/mpi-20-html/node76.htm#Node76
  172. `MPI_Type_create_struct`]] [user-defined classes and structs with MPI 2.0 and higher]]
  173. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node57.html#Node57
  174. `MPI_Type_ub`]] [unsupported]]
  175. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node55.html#Node55
  176. `MPI_Type_vector`]] [used automatically in Boost.MPI]]
  177. ]
  178. MPI's packing facilities store values into a contiguous buffer, which
  179. can later be transmitted via MPI and unpacked into separate values via
  180. MPI's unpacking facilities. As with datatypes, Boost.MPI provides an
  181. abstract interface to MPI's packing and unpacking facilities. In
  182. particular, the two archive classes [classref
  183. boost::mpi::packed_oarchive `packed_oarchive`] and [classref
  184. boost::mpi::packed_iarchive `packed_iarchive`] can be used
  185. to pack or unpack a contiguous buffer using MPI's facilities.
  186. [table Packing and unpacking
  187. [[C Function] [Boost.MPI Equivalent]]
  188. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node62.html#Node62
  189. `MPI_Pack`]] [[classref
  190. boost::mpi::packed_oarchive `packed_oarchive`]]]
  191. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node62.html#Node62
  192. `MPI_Pack_size`]] [used internally by Boost.MPI]]
  193. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node62.html#Node62
  194. `MPI_Unpack`]] [[classref
  195. boost::mpi::packed_iarchive `packed_iarchive`]]]
  196. ]
  197. Boost.MPI supports a one-to-one mapping for most of the MPI
  198. collectives. For each collective provided by Boost.MPI, the underlying
  199. C MPI collective will be invoked when it is possible (and efficient)
  200. to do so.
  201. [table Collectives
  202. [[C Function] [Boost.MPI Equivalent]]
  203. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node73.html#Node73
  204. `MPI_Allgather`]] [[funcref boost::mpi::all_gather `all_gather`]]]
  205. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node73.html#Node73
  206. `MPI_Allgatherv`]] [most uses supported by [funcref boost::mpi::all_gather `all_gather`]]]
  207. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node82.html#Node82
  208. `MPI_Allreduce`]] [[funcref boost::mpi::all_reduce `all_reduce`]]]
  209. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node75.html#Node75
  210. `MPI_Alltoall`]] [[funcref boost::mpi::all_to_all `all_to_all`]]]
  211. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node75.html#Node75
  212. `MPI_Alltoallv`]] [most uses supported by [funcref boost::mpi::all_to_all `all_to_all`]]]
  213. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node66.html#Node66
  214. `MPI_Barrier`]] [[memberref
  215. boost::mpi::communicator::barrier `communicator::barrier`]]]
  216. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node67.html#Node67
  217. `MPI_Bcast`]] [[funcref boost::mpi::broadcast `broadcast`]]]
  218. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node69.html#Node69
  219. `MPI_Gather`]] [[funcref boost::mpi::gather `gather`]]]
  220. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node69.html#Node69
  221. `MPI_Gatherv`]] [most uses supported by [funcref boost::mpi::gather `gather`],
  222. other usages supported by [funcref boost::mpi::gatherv `gatherv`]]]
  223. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node77.html#Node77
  224. `MPI_Reduce`]] [[funcref boost::mpi::reduce `reduce`]]]
  225. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node83.html#Node83
  226. `MPI_Reduce_scatter`]] [unsupported]]
  227. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node84.html#Node84
  228. `MPI_Scan`]] [[funcref boost::mpi::scan `scan`]]]
  229. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node71.html#Node71
  230. `MPI_Scatter`]] [[funcref boost::mpi::scatter `scatter`]]]
  231. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node71.html#Node71
  232. `MPI_Scatterv`]] [most uses supported by [funcref boost::mpi::scatter `scatter`],
  233. other uses supported by [funcref boost::mpi::scatterv `scatterv`]]]
  234. [[[@http://www.mpi-forum.org/docs/mpi-20-html/node145.htm#Node145
  235. `MPI_IN_PLACE`]] [supported implicitly by [funcref boost::mpi::all_reduce
  236. `all_reduce` by omitting the output value]]]
  237. ]
  238. Boost.MPI uses function objects to specify how reductions should occur
  239. in its equivalents to `MPI_Allreduce`, `MPI_Reduce`, and
  240. `MPI_Scan`. The following table illustrates how
  241. [@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node78.html#Node78
  242. predefined] and
  243. [@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node80.html#Node80
  244. user-defined] reduction operations can be mapped between the C MPI and
  245. Boost.MPI.
  246. [table Reduction operations
  247. [[C Constant] [Boost.MPI Equivalent]]
  248. [[`MPI_BAND`] [[classref boost::mpi::bitwise_and `bitwise_and`]]]
  249. [[`MPI_BOR`] [[classref boost::mpi::bitwise_or `bitwise_or`]]]
  250. [[`MPI_BXOR`] [[classref boost::mpi::bitwise_xor `bitwise_xor`]]]
  251. [[`MPI_LAND`] [`std::logical_and`]]
  252. [[`MPI_LOR`] [`std::logical_or`]]
  253. [[`MPI_LXOR`] [[classref boost::mpi::logical_xor `logical_xor`]]]
  254. [[`MPI_MAX`] [[classref boost::mpi::maximum `maximum`]]]
  255. [[`MPI_MAXLOC`] [unsupported]]
  256. [[`MPI_MIN`] [[classref boost::mpi::minimum `minimum`]]]
  257. [[`MPI_MINLOC`] [unsupported]]
  258. [[`MPI_Op_create`] [used internally by Boost.MPI]]
  259. [[`MPI_Op_free`] [used internally by Boost.MPI]]
  260. [[`MPI_PROD`] [`std::multiplies`]]
  261. [[`MPI_SUM`] [`std::plus`]]
  262. ]
  263. MPI defines several special communicators, including `MPI_COMM_WORLD`
  264. (including all processes that the local process can communicate with),
  265. `MPI_COMM_SELF` (including only the local process), and
  266. `MPI_COMM_EMPTY` (including no processes). These special communicators
  267. are all instances of the [classref boost::mpi::communicator
  268. `communicator`] class in Boost.MPI.
  269. [table Predefined communicators
  270. [[C Constant] [Boost.MPI Equivalent]]
  271. [[`MPI_COMM_WORLD`] [a default-constructed [classref boost::mpi::communicator `communicator`]]]
  272. [[`MPI_COMM_SELF`] [a [classref boost::mpi::communicator `communicator`] that contains only the current process]]
  273. [[`MPI_COMM_EMPTY`] [a [classref boost::mpi::communicator `communicator`] that evaluates false]]
  274. ]
  275. Boost.MPI supports groups of processes through its [classref
  276. boost::mpi::group `group`] class.
  277. [table Group operations and constants
  278. [[C Function/Constant] [Boost.MPI Equivalent]]
  279. [[`MPI_GROUP_EMPTY`] [a default-constructed [classref
  280. boost::mpi::group `group`]]]
  281. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node97.html#Node97
  282. `MPI_Group_size`]] [[memberref boost::mpi::group::size `group::size`]]]
  283. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node97.html#Node97
  284. `MPI_Group_rank`]] [memberref boost::mpi::group::rank `group::rank`]]
  285. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node97.html#Node97
  286. `MPI_Group_translate_ranks`]] [memberref boost::mpi::group::translate_ranks `group::translate_ranks`]]
  287. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node97.html#Node97
  288. `MPI_Group_compare`]] [operators `==` and `!=`]]
  289. [[`MPI_IDENT`] [operators `==` and `!=`]]
  290. [[`MPI_SIMILAR`] [operators `==` and `!=`]]
  291. [[`MPI_UNEQUAL`] [operators `==` and `!=`]]
  292. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  293. `MPI_Comm_group`]] [[memberref
  294. boost::mpi::communicator::group `communicator::group`]]]
  295. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  296. `MPI_Group_union`]] [operator `|` for groups]]
  297. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  298. `MPI_Group_intersection`]] [operator `&` for groups]]
  299. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  300. `MPI_Group_difference`]] [operator `-` for groups]]
  301. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  302. `MPI_Group_incl`]] [[memberref boost::mpi::group::include `group::include`]]]
  303. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  304. `MPI_Group_excl`]] [[memberref boost::mpi::group::include `group::exclude`]]]
  305. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  306. `MPI_Group_range_incl`]] [unsupported]]
  307. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node98.html#Node98
  308. `MPI_Group_range_excl`]] [unsupported]]
  309. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node99.html#Node99
  310. `MPI_Group_free`]] [used automatically in Boost.MPI]]
  311. ]
  312. Boost.MPI provides manipulation of communicators through the [classref
  313. boost::mpi::communicator `communicator`] class.
  314. [table Communicator operations
  315. [[C Function] [Boost.MPI Equivalent]]
  316. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node101.html#Node101
  317. `MPI_Comm_size`]] [[memberref boost::mpi::communicator::size `communicator::size`]]]
  318. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node101.html#Node101
  319. `MPI_Comm_rank`]] [[memberref boost::mpi::communicator::rank
  320. `communicator::rank`]]]
  321. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node101.html#Node101
  322. `MPI_Comm_compare`]] [operators `==` and `!=`]]
  323. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node102.html#Node102
  324. `MPI_Comm_dup`]] [[classref boost::mpi::communicator `communicator`]
  325. class constructor using `comm_duplicate`]]
  326. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node102.html#Node102
  327. `MPI_Comm_create`]] [[classref boost::mpi::communicator
  328. `communicator`] constructor]]
  329. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node102.html#Node102
  330. `MPI_Comm_split`]] [[memberref boost::mpi::communicator::split
  331. `communicator::split`]]]
  332. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node103.html#Node103
  333. `MPI_Comm_free`]] [used automatically in Boost.MPI]]
  334. ]
  335. Boost.MPI currently provides support for inter-communicators via the
  336. [classref boost::mpi::intercommunicator `intercommunicator`] class.
  337. [table Inter-communicator operations
  338. [[C Function] [Boost.MPI Equivalent]]
  339. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node112.html#Node112
  340. `MPI_Comm_test_inter`]] [use [memberref boost::mpi::communicator::as_intercommunicator `communicator::as_intercommunicator`]]]
  341. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node112.html#Node112
  342. `MPI_Comm_remote_size`]] [[memberref boost::mpi::intercommunicator::remote_size] `intercommunicator::remote_size`]]
  343. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node112.html#Node112
  344. `MPI_Comm_remote_group`]] [[memberref boost::mpi::intercommunicator::remote_group `intercommunicator::remote_group`]]]
  345. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node113.html#Node113
  346. `MPI_Intercomm_create`]] [[classref boost::mpi::intercommunicator `intercommunicator`] constructor]]
  347. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node113.html#Node113
  348. `MPI_Intercomm_merge`]] [[memberref boost::mpi::intercommunicator::merge `intercommunicator::merge`]]]
  349. ]
  350. Boost.MPI currently provides no support for attribute caching.
  351. [table Attributes and caching
  352. [[C Function/Constant] [Boost.MPI Equivalent]]
  353. [[`MPI_NULL_COPY_FN`] [unsupported]]
  354. [[`MPI_NULL_DELETE_FN`] [unsupported]]
  355. [[`MPI_KEYVAL_INVALID`] [unsupported]]
  356. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node119.html#Node119
  357. `MPI_Keyval_create`]] [unsupported]]
  358. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node119.html#Node119
  359. `MPI_Copy_function`]] [unsupported]]
  360. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node119.html#Node119
  361. `MPI_Delete_function`]] [unsupported]]
  362. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node119.html#Node119
  363. `MPI_Keyval_free`]] [unsupported]]
  364. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node119.html#Node119
  365. `MPI_Attr_put`]] [unsupported]]
  366. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node119.html#Node119
  367. `MPI_Attr_get`]] [unsupported]]
  368. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node119.html#Node119
  369. `MPI_Attr_delete`]] [unsupported]]
  370. ]
  371. Boost.MPI will provide complete support for creating communicators
  372. with different topologies and later querying those topologies. Support
  373. for graph topologies is provided via an interface to the
  374. [@http://www.boost.org/libs/graph/doc/index.html Boost Graph Library
  375. (BGL)], where a communicator can be created which matches the
  376. structure of any BGL graph, and the graph topology of a communicator
  377. can be viewed as a BGL graph for use in existing, generic graph
  378. algorithms.
  379. [table Process topologies
  380. [[C Function/Constant] [Boost.MPI Equivalent]]
  381. [[`MPI_GRAPH`] [unnecessary; use [memberref boost::mpi::communicator::as_graph_communicator `communicator::as_graph_communicator`]]]
  382. [[`MPI_CART`] [unnecessary; use [memberref boost::mpi::communicator::has_cartesian_topology `communicator::has_cartesian_topology`]]]
  383. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node133.html#Node133
  384. `MPI_Cart_create`]] [[classref boost::mpi::cartesian_communicator `cartesian_communicator`]
  385. constructor]]
  386. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node134.html#Node134
  387. `MPI_Dims_create`]] [[funcref boost::mpi::cartesian_dimensions `cartesian_dimensions`]]]
  388. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node135.html#Node135
  389. `MPI_Graph_create`]] [[classref
  390. boost::mpi::graph_communicator
  391. `graph_communicator ctors`]]]
  392. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  393. `MPI_Topo_test`]] [[memberref
  394. boost::mpi::communicator::as_graph_communicator
  395. `communicator::as_graph_communicator`], [memberref
  396. boost::mpi::communicator::has_cartesian_topology
  397. `communicator::has_cartesian_topology`]]]
  398. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  399. `MPI_Graphdims_get`]] [[funcref boost::mpi::num_vertices
  400. `num_vertices`], [funcref boost::mpi::num_edges `num_edges`]]]
  401. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  402. `MPI_Graph_get`]] [[funcref boost::mpi::vertices
  403. `vertices`], [funcref boost::mpi::edges `edges`]]]
  404. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  405. `MPI_Cartdim_get`]] [[memberref boost::mpi::cartesian_communicator::ndims `cartesian_communicator::ndims` ]]]
  406. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  407. `MPI_Cart_get`]] [[memberref boost::mpi::cartesian_communicator::topology `cartesian_communicator::topology` ]]]
  408. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  409. `MPI_Cart_rank`]] [[memberref boost::mpi::cartesian_communicator::rank `cartesian_communicator::rank` ]]]
  410. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  411. `MPI_Cart_coords`]] [[memberref boost::mpi::cartesian_communicator::coordinates `cartesian_communicator::coordinates` ]]]
  412. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  413. `MPI_Graph_neighbors_count`]] [[funcref boost::mpi::out_degree
  414. `out_degree`]]]
  415. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node136.html#Node136
  416. `MPI_Graph_neighbors`]] [[funcref boost::mpi::out_edges
  417. `out_edges`], [funcref boost::mpi::adjacent_vertices `adjacent_vertices`]]]
  418. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node137.html#Node137
  419. `MPI_Cart_shift`]] [[memberref boost::mpi::cartesian_communicator::shifted_ranks `cartesian_communicator::shifted_ranks` ]]]
  420. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node138.html#Node138
  421. `MPI_Cart_sub`]] [[classref boost::mpi::cartesian_communicator `cartesian_communicator`]
  422. constructor]]
  423. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node139.html#Node139
  424. `MPI_Cart_map`]] [unsupported]]
  425. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node139.html#Node139
  426. `MPI_Graph_map`]] [unsupported]]
  427. ]
  428. Boost.MPI supports environmental inquires through the [classref
  429. boost::mpi::environment `environment`] class.
  430. [table Environmental inquiries
  431. [[C Function/Constant] [Boost.MPI Equivalent]]
  432. [[`MPI_TAG_UB`] [unnecessary; use [memberref
  433. boost::mpi::environment::max_tag `environment::max_tag`]]]
  434. [[`MPI_HOST`] [unnecessary; use [memberref
  435. boost::mpi::environment::host_rank `environment::host_rank`]]]
  436. [[`MPI_IO`] [unnecessary; use [memberref
  437. boost::mpi::environment::io_rank `environment::io_rank`]]]
  438. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node143.html#Node147
  439. `MPI_Get_processor_name`]]
  440. [[memberref boost::mpi::environment::processor_name
  441. `environment::processor_name`]]]
  442. ]
  443. Boost.MPI translates MPI errors into exceptions, reported via the
  444. [classref boost::mpi::exception `exception`] class.
  445. [table Error handling
  446. [[C Function/Constant] [Boost.MPI Equivalent]]
  447. [[`MPI_ERRORS_ARE_FATAL`] [unused; errors are translated into
  448. Boost.MPI exceptions]]
  449. [[`MPI_ERRORS_RETURN`] [unused; errors are translated into
  450. Boost.MPI exceptions]]
  451. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node148.html#Node148
  452. `MPI_errhandler_create`]] [unused; errors are translated into
  453. Boost.MPI exceptions]]
  454. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node148.html#Node148
  455. `MPI_errhandler_set`]] [unused; errors are translated into
  456. Boost.MPI exceptions]]
  457. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node148.html#Node148
  458. `MPI_errhandler_get`]] [unused; errors are translated into
  459. Boost.MPI exceptions]]
  460. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node148.html#Node148
  461. `MPI_errhandler_free`]] [unused; errors are translated into
  462. Boost.MPI exceptions]]
  463. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node148.html#Node148
  464. `MPI_Error_string`]] [used internally by Boost.MPI]]
  465. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node149.html#Node149
  466. `MPI_Error_class`]] [[memberref boost::mpi::exception::error_class `exception::error_class`]]]
  467. ]
  468. The MPI timing facilities are exposed via the Boost.MPI [classref
  469. boost::mpi::timer `timer`] class, which provides an interface
  470. compatible with the [@http://www.boost.org/libs/timer/index.html Boost
  471. Timer library].
  472. [table Timing facilities
  473. [[C Function/Constant] [Boost.MPI Equivalent]]
  474. [[`MPI_WTIME_IS_GLOBAL`] [unnecessary; use [memberref
  475. boost::mpi::timer::time_is_global `timer::time_is_global`]]]
  476. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node150.html#Node150
  477. `MPI_Wtime`]] [use [memberref boost::mpi::timer::elapsed
  478. `timer::elapsed`] to determine the time elapsed from some specific
  479. starting point]]
  480. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node150.html#Node150
  481. `MPI_Wtick`]] [[memberref boost::mpi::timer::elapsed_min `timer::elapsed_min`]]]
  482. ]
  483. MPI startup and shutdown are managed by the construction and
  484. destruction of the Boost.MPI [classref boost::mpi::environment
  485. `environment`] class.
  486. [table Startup/shutdown facilities
  487. [[C Function] [Boost.MPI Equivalent]]
  488. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node151.html#Node151
  489. `MPI_Init`]] [[classref boost::mpi::environment `environment`]
  490. constructor]]
  491. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node151.html#Node151
  492. `MPI_Finalize`]] [[classref boost::mpi::environment `environment`]
  493. destructor]]
  494. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node151.html#Node151
  495. `MPI_Initialized`]] [[memberref boost::mpi::environment::initialized
  496. `environment::initialized`]]]
  497. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node151.html#Node151
  498. `MPI_Abort`]] [[memberref boost::mpi::environment::abort
  499. `environment::abort`]]]
  500. ]
  501. Boost.MPI does not provide any support for the profiling facilities in
  502. MPI 1.1.
  503. [table Profiling interface
  504. [[C Function] [Boost.MPI Equivalent]]
  505. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node153.html#Node153
  506. `PMPI_*` routines]] [unsupported]]
  507. [[[@http://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node156.html#Node156
  508. `MPI_Pcontrol`]] [unsupported]]
  509. ]
  510. [endsect:c_mapping]