starpu_mpi_private.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #include <starpu_mpi_private.h>
  17. int _starpu_debug_rank=-1;
  18. int _starpu_debug_level_min=0;
  19. int _starpu_debug_level_max=0;
  20. int _starpu_mpi_tag = 42;
  21. int _starpu_mpi_comm_debug;
  22. int _starpu_mpi_nobind = -1;
  23. int _starpu_mpi_thread_cpuid = -1;
  24. int _starpu_mpi_use_prio = 1;
  25. int _starpu_mpi_fake_world_size = -1;
  26. int _starpu_mpi_fake_world_rank = -1;
  27. int _starpu_mpi_use_coop_sends = 1;
  28. int _starpu_mpi_mem_throttle = 0;
  29. void _starpu_mpi_set_debug_level_min(int level)
  30. {
  31. _starpu_debug_level_min = level;
  32. }
  33. void _starpu_mpi_set_debug_level_max(int level)
  34. {
  35. _starpu_debug_level_max = level;
  36. }
  37. int starpu_mpi_get_communication_tag(void)
  38. {
  39. return _starpu_mpi_tag;
  40. }
  41. void starpu_mpi_set_communication_tag(int tag)
  42. {
  43. _starpu_mpi_tag = tag;
  44. }
  45. char *_starpu_mpi_get_mpi_error_code(int code)
  46. {
  47. static char str[MPI_MAX_OBJECT_NAME];
  48. int len;
  49. MPI_Error_string(code, str, &len);
  50. return str;
  51. }
  52. void _starpu_mpi_env_init(void)
  53. {
  54. _starpu_mpi_comm_debug = starpu_getenv("STARPU_MPI_COMM") != NULL;
  55. _starpu_mpi_fake_world_size = starpu_get_env_number("STARPU_MPI_FAKE_SIZE");
  56. _starpu_mpi_fake_world_rank = starpu_get_env_number("STARPU_MPI_FAKE_RANK");
  57. _starpu_mpi_nobind = starpu_get_env_number_default("STARPU_MPI_NOBIND", 0);
  58. _starpu_mpi_thread_cpuid = starpu_get_env_number_default("STARPU_MPI_THREAD_CPUID", -1);
  59. _starpu_mpi_use_prio = starpu_get_env_number_default("STARPU_MPI_PRIORITIES", 1);
  60. _starpu_mpi_use_coop_sends = starpu_get_env_number_default("STARPU_MPI_COOP_SENDS", 1);
  61. _starpu_mpi_mem_throttle = starpu_get_env_number_default("STARPU_MPI_MEM_THROTTLE", 0);
  62. _starpu_debug_level_min = starpu_get_env_number_default("STARPU_MPI_DEBUG_LEVEL_MIN", 0);
  63. _starpu_debug_level_max = starpu_get_env_number_default("STARPU_MPI_DEBUG_LEVEL_MAX", 0);
  64. }