starpu_mpi_private.c 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010, 2012, 2014-2015 Université de Bordeaux
  4. * Copyright (C) 2010, 2011, 2012, 2013, 2015 CNRS
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #include <starpu_mpi_private.h>
  18. int _starpu_debug_rank=-1;
  19. int _starpu_debug_level_min=0;
  20. int _starpu_debug_level_max=0;
  21. int _starpu_mpi_tag = 42;
  22. int _starpu_mpi_comm;
  23. void _starpu_mpi_set_debug_level_min(int level)
  24. {
  25. _starpu_debug_level_min = level;
  26. }
  27. void _starpu_mpi_set_debug_level_max(int level)
  28. {
  29. _starpu_debug_level_max = level;
  30. }
  31. int starpu_mpi_get_communication_tag(void)
  32. {
  33. return _starpu_mpi_tag;
  34. }
  35. void starpu_mpi_set_communication_tag(int tag)
  36. {
  37. _starpu_mpi_tag = tag;
  38. }
  39. char *_starpu_mpi_get_mpi_code(int code)
  40. {
  41. switch (code)
  42. {
  43. case MPI_SUCCESS: return "MPI_SUCCESS";
  44. #ifdef MPI_ERR_BUFFER
  45. case MPI_ERR_BUFFER: return "MPI_ERR_BUFFER";
  46. #endif
  47. #ifdef MPI_ERR_COUNT
  48. case MPI_ERR_COUNT: return "MPI_ERR_COUNT";
  49. #endif
  50. #ifdef MPI_ERR_TYPE
  51. case MPI_ERR_TYPE: return "MPI_ERR_TYPE";
  52. #endif
  53. #ifdef MPI_ERR_TAG
  54. case MPI_ERR_TAG: return "MPI_ERR_TAG";
  55. #endif
  56. #ifdef MPI_ERR_COMM
  57. case MPI_ERR_COMM: return "MPI_ERR_COMM";
  58. #endif
  59. #ifdef MPI_ERR_RANK
  60. case MPI_ERR_RANK: return "MPI_ERR_RANK";
  61. #endif
  62. #ifdef MPI_ERR_REQUEST
  63. case MPI_ERR_REQUEST: return "MPI_ERR_REQUEST";
  64. #endif
  65. #ifdef MPI_ERR_ROOT
  66. case MPI_ERR_ROOT: return "MPI_ERR_ROOT";
  67. #endif
  68. #ifdef MPI_ERR_GROUP
  69. case MPI_ERR_GROUP: return "MPI_ERR_GROUP";
  70. #endif
  71. #ifdef MPI_ERR_OP
  72. case MPI_ERR_OP: return "MPI_ERR_OP";
  73. #endif
  74. #ifdef MPI_ERR_TOPOLOGY
  75. case MPI_ERR_TOPOLOGY: return "MPI_ERR_TOPOLOGY";
  76. #endif
  77. #ifdef MPI_ERR_DIMS
  78. case MPI_ERR_DIMS: return "MPI_ERR_DIMS";
  79. #endif
  80. #ifdef MPI_ERR_ARG
  81. case MPI_ERR_ARG: return "MPI_ERR_ARG";
  82. #endif
  83. #ifdef MPI_ERR_UNKNOWN
  84. case MPI_ERR_UNKNOWN: return "MPI_ERR_UNKNOWN";
  85. #endif
  86. #ifdef MPI_ERR_TRUNCATE
  87. case MPI_ERR_TRUNCATE: return "MPI_ERR_TRUNCATE";
  88. #endif
  89. #ifdef MPI_ERR_OTHER
  90. case MPI_ERR_OTHER: return "MPI_ERR_OTHER";
  91. #endif
  92. #ifdef MPI_ERR_INTERN
  93. case MPI_ERR_INTERN: return "MPI_ERR_INTERN";
  94. #endif
  95. #ifdef MPI_ERR_IN_STATUS
  96. case MPI_ERR_IN_STATUS: return "MPI_ERR_IN_STATUS";
  97. #endif
  98. #ifdef MPI_ERR_PENDING
  99. case MPI_ERR_PENDING: return "MPI_ERR_PENDING";
  100. #endif
  101. #ifdef MPI_ERR_ACCESS
  102. case MPI_ERR_ACCESS: return "MPI_ERR_ACCESS";
  103. #endif
  104. #ifdef MPI_ERR_AMODE
  105. case MPI_ERR_AMODE: return "MPI_ERR_AMODE";
  106. #endif
  107. #ifdef MPI_ERR_ASSERT
  108. case MPI_ERR_ASSERT: return "MPI_ERR_ASSERT";
  109. #endif
  110. #ifdef MPI_ERR_BAD_FILE
  111. case MPI_ERR_BAD_FILE: return "MPI_ERR_BAD_FILE";
  112. #endif
  113. #ifdef MPI_ERR_BASE
  114. case MPI_ERR_BASE: return "MPI_ERR_BASE";
  115. #endif
  116. #ifdef MPI_ERR_CONVERSION
  117. case MPI_ERR_CONVERSION: return "MPI_ERR_CONVERSION";
  118. #endif
  119. #ifdef MPI_ERR_DISP
  120. case MPI_ERR_DISP: return "MPI_ERR_DISP";
  121. #endif
  122. #ifdef MPI_ERR_DUP_DATAREP
  123. case MPI_ERR_DUP_DATAREP: return "MPI_ERR_DUP_DATAREP";
  124. #endif
  125. #ifdef MPI_ERR_FILE_EXISTS
  126. case MPI_ERR_FILE_EXISTS: return "MPI_ERR_FILE_EXISTS";
  127. #endif
  128. #ifdef MPI_ERR_FILE_IN_USE
  129. case MPI_ERR_FILE_IN_USE: return "MPI_ERR_FILE_IN_USE";
  130. #endif
  131. #ifdef MPI_ERR_FILE
  132. case MPI_ERR_FILE: return "MPI_ERR_FILE";
  133. #endif
  134. #ifdef MPI_ERR_INFO_KEY
  135. case MPI_ERR_INFO_KEY: return "MPI_ERR_INFO_KEY";
  136. #endif
  137. #ifdef MPI_ERR_INFO_NOKEY
  138. case MPI_ERR_INFO_NOKEY: return "MPI_ERR_INFO_NOKEY";
  139. #endif
  140. #ifdef MPI_ERR_INFO_VALUE
  141. case MPI_ERR_INFO_VALUE: return "MPI_ERR_INFO_VALUE";
  142. #endif
  143. #ifdef MPI_ERR_INFO
  144. case MPI_ERR_INFO: return "MPI_ERR_INFO";
  145. #endif
  146. #ifdef MPI_ERR_IO
  147. case MPI_ERR_IO: return "MPI_ERR_IO";
  148. #endif
  149. #ifdef MPI_ERR_KEYVAL
  150. case MPI_ERR_KEYVAL: return "MPI_ERR_KEYVAL";
  151. #endif
  152. #ifdef MPI_ERR_LOCKTYPE
  153. case MPI_ERR_LOCKTYPE: return "MPI_ERR_LOCKTYPE";
  154. #endif
  155. #ifdef MPI_ERR_NAME
  156. case MPI_ERR_NAME: return "MPI_ERR_NAME";
  157. #endif
  158. #ifdef MPI_ERR_NO_MEM
  159. case MPI_ERR_NO_MEM: return "MPI_ERR_NO_MEM";
  160. #endif
  161. #ifdef MPI_ERR_NOT_SAME
  162. case MPI_ERR_NOT_SAME: return "MPI_ERR_NOT_SAME";
  163. #endif
  164. #ifdef MPI_ERR_NO_SPACE
  165. case MPI_ERR_NO_SPACE: return "MPI_ERR_NO_SPACE";
  166. #endif
  167. #ifdef MPI_ERR_NO_SUCH_FILE
  168. case MPI_ERR_NO_SUCH_FILE: return "MPI_ERR_NO_SUCH_FILE";
  169. #endif
  170. #ifdef MPI_ERR_PORT
  171. case MPI_ERR_PORT: return "MPI_ERR_PORT";
  172. #endif
  173. #ifdef MPI_ERR_QUOTA
  174. case MPI_ERR_QUOTA: return "MPI_ERR_QUOTA";
  175. #endif
  176. #ifdef MPI_ERR_READ_ONLY
  177. case MPI_ERR_READ_ONLY: return "MPI_ERR_READ_ONLY";
  178. #endif
  179. #ifdef MPI_ERR_RMA_CONFLICT
  180. case MPI_ERR_RMA_CONFLICT: return "MPI_ERR_RMA_CONFLICT";
  181. #endif
  182. #ifdef MPI_ERR_RMA_SYNC
  183. case MPI_ERR_RMA_SYNC: return "MPI_ERR_RMA_SYNC";
  184. #endif
  185. #ifdef MPI_ERR_SERVICE
  186. case MPI_ERR_SERVICE: return "MPI_ERR_SERVICE";
  187. #endif
  188. #ifdef MPI_ERR_SIZE
  189. case MPI_ERR_SIZE: return "MPI_ERR_SIZE";
  190. #endif
  191. #ifdef MPI_ERR_SPAWN
  192. case MPI_ERR_SPAWN: return "MPI_ERR_SPAWN";
  193. #endif
  194. #ifdef MPI_ERR_UNSUPPORTED_DATAREP
  195. case MPI_ERR_UNSUPPORTED_DATAREP: return "MPI_ERR_UNSUPPORTED_DATAREP";
  196. #endif
  197. #ifdef MPI_ERR_UNSUPPORTED_OPERATION
  198. case MPI_ERR_UNSUPPORTED_OPERATION: return "MPI_ERR_UNSUPPORTED_OPERATION";
  199. #endif
  200. #ifdef MPI_ERR_WIN
  201. case MPI_ERR_WIN: return "MPI_ERR_WIN";
  202. #endif
  203. #if defined(MPI_ERR_LASTCODE) && MPI_ERR_LASTCODE != MPI_SUCCESS
  204. case MPI_ERR_LASTCODE: return "MPI_ERR_LASTCODE";
  205. #endif
  206. default: return "UNKNOWN_MPI_CODE";
  207. }
  208. }