starpu_mpi_private.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2013,2015-2017 CNRS
  4. * Copyright (C) 2010,2012,2014-2016,2018 Université de Bordeaux
  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_debug;
  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. void _starpu_mpi_set_debug_level_min(int level)
  29. {
  30. _starpu_debug_level_min = level;
  31. }
  32. void _starpu_mpi_set_debug_level_max(int level)
  33. {
  34. _starpu_debug_level_max = level;
  35. }
  36. int starpu_mpi_get_communication_tag(void)
  37. {
  38. return _starpu_mpi_tag;
  39. }
  40. void starpu_mpi_set_communication_tag(int tag)
  41. {
  42. _starpu_mpi_tag = tag;
  43. }
  44. char *_starpu_mpi_get_mpi_error_code(int code)
  45. {
  46. static char str[MPI_MAX_OBJECT_NAME];
  47. int len;
  48. MPI_Error_string(code, str, &len);
  49. return str;
  50. }
  51. void _starpu_mpi_env_init(void)
  52. {
  53. _starpu_mpi_comm_debug = starpu_getenv("STARPU_MPI_COMM") != NULL;
  54. _starpu_mpi_fake_world_size = starpu_get_env_number("STARPU_MPI_FAKE_SIZE");
  55. _starpu_mpi_fake_world_rank = starpu_get_env_number("STARPU_MPI_FAKE_RANK");
  56. _starpu_mpi_thread_cpuid = starpu_get_env_number_default("STARPU_MPI_THREAD_CPUID", -1);
  57. _starpu_mpi_use_prio = starpu_get_env_number_default("STARPU_MPI_PRIORITIES", 1);
  58. _starpu_mpi_use_coop_sends = starpu_get_env_number_default("STARPU_MPI_COOP_SENDS", 1);
  59. }