starpu_mpi_private.c 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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 Centre National de la Recherche Scientifique
  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. void _starpu_mpi_set_debug_level_min(int level)
  23. {
  24. _starpu_debug_level_min = level;
  25. }
  26. void _starpu_mpi_set_debug_level_max(int level)
  27. {
  28. _starpu_debug_level_max = level;
  29. }
  30. int starpu_mpi_get_communication_tag(void)
  31. {
  32. return _starpu_mpi_tag;
  33. }
  34. void starpu_mpi_set_communication_tag(int tag)
  35. {
  36. _starpu_mpi_tag = tag;
  37. }
  38. char *_starpu_mpi_get_mpi_code(int code)
  39. {
  40. switch (code)
  41. {
  42. case MPI_SUCCESS: return "MPI_SUCCESS";
  43. #ifdef MPI_ERR_BUFFER
  44. case MPI_ERR_BUFFER: return "MPI_ERR_BUFFER";
  45. #endif
  46. #ifdef MPI_ERR_COUNT
  47. case MPI_ERR_COUNT: return "MPI_ERR_COUNT";
  48. #endif
  49. #ifdef MPI_ERR_TYPE
  50. case MPI_ERR_TYPE: return "MPI_ERR_TYPE";
  51. #endif
  52. #ifdef MPI_ERR_TAG
  53. case MPI_ERR_TAG: return "MPI_ERR_TAG";
  54. #endif
  55. #ifdef MPI_ERR_COMM
  56. case MPI_ERR_COMM: return "MPI_ERR_COMM";
  57. #endif
  58. #ifdef MPI_ERR_RANK
  59. case MPI_ERR_RANK: return "MPI_ERR_RANK";
  60. #endif
  61. #ifdef MPI_ERR_REQUEST
  62. case MPI_ERR_REQUEST: return "MPI_ERR_REQUEST";
  63. #endif
  64. #ifdef MPI_ERR_ROOT
  65. case MPI_ERR_ROOT: return "MPI_ERR_ROOT";
  66. #endif
  67. #ifdef MPI_ERR_GROUP
  68. case MPI_ERR_GROUP: return "MPI_ERR_GROUP";
  69. #endif
  70. #ifdef MPI_ERR_OP
  71. case MPI_ERR_OP: return "MPI_ERR_OP";
  72. #endif
  73. #ifdef MPI_ERR_TOPOLOGY
  74. case MPI_ERR_TOPOLOGY: return "MPI_ERR_TOPOLOGY";
  75. #endif
  76. #ifdef MPI_ERR_DIMS
  77. case MPI_ERR_DIMS: return "MPI_ERR_DIMS";
  78. #endif
  79. #ifdef MPI_ERR_ARG
  80. case MPI_ERR_ARG: return "MPI_ERR_ARG";
  81. #endif
  82. #ifdef MPI_ERR_UNKNOWN
  83. case MPI_ERR_UNKNOWN: return "MPI_ERR_UNKNOWN";
  84. #endif
  85. #ifdef MPI_ERR_TRUNCATE
  86. case MPI_ERR_TRUNCATE: return "MPI_ERR_TRUNCATE";
  87. #endif
  88. #ifdef MPI_ERR_OTHER
  89. case MPI_ERR_OTHER: return "MPI_ERR_OTHER";
  90. #endif
  91. #ifdef MPI_ERR_INTERN
  92. case MPI_ERR_INTERN: return "MPI_ERR_INTERN";
  93. #endif
  94. #ifdef MPI_ERR_IN_STATUS
  95. case MPI_ERR_IN_STATUS: return "MPI_ERR_IN_STATUS";
  96. #endif
  97. #ifdef MPI_ERR_PENDING
  98. case MPI_ERR_PENDING: return "MPI_ERR_PENDING";
  99. #endif
  100. #ifdef MPI_ERR_ACCESS
  101. case MPI_ERR_ACCESS: return "MPI_ERR_ACCESS";
  102. #endif
  103. #ifdef MPI_ERR_AMODE
  104. case MPI_ERR_AMODE: return "MPI_ERR_AMODE";
  105. #endif
  106. #ifdef MPI_ERR_ASSERT
  107. case MPI_ERR_ASSERT: return "MPI_ERR_ASSERT";
  108. #endif
  109. #ifdef MPI_ERR_BAD_FILE
  110. case MPI_ERR_BAD_FILE: return "MPI_ERR_BAD_FILE";
  111. #endif
  112. #ifdef MPI_ERR_BASE
  113. case MPI_ERR_BASE: return "MPI_ERR_BASE";
  114. #endif
  115. #ifdef MPI_ERR_CONVERSION
  116. case MPI_ERR_CONVERSION: return "MPI_ERR_CONVERSION";
  117. #endif
  118. #ifdef MPI_ERR_DISP
  119. case MPI_ERR_DISP: return "MPI_ERR_DISP";
  120. #endif
  121. #ifdef MPI_ERR_DUP_DATAREP
  122. case MPI_ERR_DUP_DATAREP: return "MPI_ERR_DUP_DATAREP";
  123. #endif
  124. #ifdef MPI_ERR_FILE_EXISTS
  125. case MPI_ERR_FILE_EXISTS: return "MPI_ERR_FILE_EXISTS";
  126. #endif
  127. #ifdef MPI_ERR_FILE_IN_USE
  128. case MPI_ERR_FILE_IN_USE: return "MPI_ERR_FILE_IN_USE";
  129. #endif
  130. #ifdef MPI_ERR_FILE
  131. case MPI_ERR_FILE: return "MPI_ERR_FILE";
  132. #endif
  133. #ifdef MPI_ERR_INFO_KEY
  134. case MPI_ERR_INFO_KEY: return "MPI_ERR_INFO_KEY";
  135. #endif
  136. #ifdef MPI_ERR_INFO_NOKEY
  137. case MPI_ERR_INFO_NOKEY: return "MPI_ERR_INFO_NOKEY";
  138. #endif
  139. #ifdef MPI_ERR_INFO_VALUE
  140. case MPI_ERR_INFO_VALUE: return "MPI_ERR_INFO_VALUE";
  141. #endif
  142. #ifdef MPI_ERR_INFO
  143. case MPI_ERR_INFO: return "MPI_ERR_INFO";
  144. #endif
  145. #ifdef MPI_ERR_IO
  146. case MPI_ERR_IO: return "MPI_ERR_IO";
  147. #endif
  148. #ifdef MPI_ERR_KEYVAL
  149. case MPI_ERR_KEYVAL: return "MPI_ERR_KEYVAL";
  150. #endif
  151. #ifdef MPI_ERR_LOCKTYPE
  152. case MPI_ERR_LOCKTYPE: return "MPI_ERR_LOCKTYPE";
  153. #endif
  154. #ifdef MPI_ERR_NAME
  155. case MPI_ERR_NAME: return "MPI_ERR_NAME";
  156. #endif
  157. #ifdef MPI_ERR_NO_MEM
  158. case MPI_ERR_NO_MEM: return "MPI_ERR_NO_MEM";
  159. #endif
  160. #ifdef MPI_ERR_NOT_SAME
  161. case MPI_ERR_NOT_SAME: return "MPI_ERR_NOT_SAME";
  162. #endif
  163. #ifdef MPI_ERR_NO_SPACE
  164. case MPI_ERR_NO_SPACE: return "MPI_ERR_NO_SPACE";
  165. #endif
  166. #ifdef MPI_ERR_NO_SUCH_FILE
  167. case MPI_ERR_NO_SUCH_FILE: return "MPI_ERR_NO_SUCH_FILE";
  168. #endif
  169. #ifdef MPI_ERR_PORT
  170. case MPI_ERR_PORT: return "MPI_ERR_PORT";
  171. #endif
  172. #ifdef MPI_ERR_QUOTA
  173. case MPI_ERR_QUOTA: return "MPI_ERR_QUOTA";
  174. #endif
  175. #ifdef MPI_ERR_READ_ONLY
  176. case MPI_ERR_READ_ONLY: return "MPI_ERR_READ_ONLY";
  177. #endif
  178. #ifdef MPI_ERR_RMA_CONFLICT
  179. case MPI_ERR_RMA_CONFLICT: return "MPI_ERR_RMA_CONFLICT";
  180. #endif
  181. #ifdef MPI_ERR_RMA_SYNC
  182. case MPI_ERR_RMA_SYNC: return "MPI_ERR_RMA_SYNC";
  183. #endif
  184. #ifdef MPI_ERR_SERVICE
  185. case MPI_ERR_SERVICE: return "MPI_ERR_SERVICE";
  186. #endif
  187. #ifdef MPI_ERR_SIZE
  188. case MPI_ERR_SIZE: return "MPI_ERR_SIZE";
  189. #endif
  190. #ifdef MPI_ERR_SPAWN
  191. case MPI_ERR_SPAWN: return "MPI_ERR_SPAWN";
  192. #endif
  193. #ifdef MPI_ERR_UNSUPPORTED_DATAREP
  194. case MPI_ERR_UNSUPPORTED_DATAREP: return "MPI_ERR_UNSUPPORTED_DATAREP";
  195. #endif
  196. #ifdef MPI_ERR_UNSUPPORTED_OPERATION
  197. case MPI_ERR_UNSUPPORTED_OPERATION: return "MPI_ERR_UNSUPPORTED_OPERATION";
  198. #endif
  199. #ifdef MPI_ERR_WIN
  200. case MPI_ERR_WIN: return "MPI_ERR_WIN";
  201. #endif
  202. #if defined(MPI_ERR_LASTCODE) && MPI_ERR_LASTCODE != MPI_SUCCESS
  203. case MPI_ERR_LASTCODE: return "MPI_ERR_LASTCODE";
  204. #endif
  205. default: return "UNKNOWN_MPI_CODE";
  206. }
  207. }