starpu_clusters.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2015,2017,2019 CNRS
  4. * Copyright (C) 2015,2018 Université de Bordeaux
  5. * Copyright (C) 2015,2017 Inria
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #ifndef __STARPU_CLUSTERS_UTIL_H__
  19. #define __STARPU_CLUSTERS_UTIL_H__
  20. #include <starpu_config.h>
  21. #ifdef STARPU_CLUSTER
  22. #ifdef STARPU_HAVE_HWLOC
  23. #include <hwloc.h>
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. /**
  29. @defgroup API_Clustering_Machine Clustering Machine
  30. @{
  31. */
  32. #define STARPU_CLUSTER_MIN_NB (1<<STARPU_MODE_SHIFT)
  33. #define STARPU_CLUSTER_MAX_NB (2<<STARPU_MODE_SHIFT)
  34. #define STARPU_CLUSTER_NB (3<<STARPU_MODE_SHIFT)
  35. #define STARPU_CLUSTER_PREFERE_MIN (4<<STARPU_MODE_SHIFT)
  36. #define STARPU_CLUSTER_KEEP_HOMOGENEOUS (5<<STARPU_MODE_SHIFT)
  37. #define STARPU_CLUSTER_POLICY_NAME (6<<STARPU_MODE_SHIFT)
  38. #define STARPU_CLUSTER_POLICY_STRUCT (7<<STARPU_MODE_SHIFT)
  39. #define STARPU_CLUSTER_CREATE_FUNC (8<<STARPU_MODE_SHIFT)
  40. #define STARPU_CLUSTER_CREATE_FUNC_ARG (9<<STARPU_MODE_SHIFT)
  41. #define STARPU_CLUSTER_TYPE (10<<STARPU_MODE_SHIFT)
  42. #define STARPU_CLUSTER_AWAKE_WORKERS (11<<STARPU_MODE_SHIFT)
  43. #define STARPU_CLUSTER_PARTITION_ONE (12<<STARPU_MODE_SHIFT)
  44. #define STARPU_CLUSTER_NEW (13<<STARPU_MODE_SHIFT)
  45. #define STARPU_CLUSTER_NCORES (14<<STARPU_MODE_SHIFT)
  46. /**
  47. These represent the default available functions to enforce cluster
  48. use by the sub-runtime
  49. */
  50. enum starpu_cluster_types
  51. {
  52. STARPU_CLUSTER_OPENMP, /**< todo */
  53. STARPU_CLUSTER_INTEL_OPENMP_MKL, /**< todo */
  54. #ifdef STARPU_MKL
  55. STARPU_CLUSTER_GNU_OPENMP_MKL, /**< todo */
  56. #endif
  57. };
  58. struct starpu_cluster_machine;
  59. struct starpu_cluster_machine* starpu_cluster_machine(hwloc_obj_type_t cluster_level, ...);
  60. int starpu_uncluster_machine(struct starpu_cluster_machine* clusters);
  61. int starpu_cluster_print(struct starpu_cluster_machine* clusters);
  62. /* Prologue functions */
  63. void starpu_openmp_prologue(void*);
  64. #define starpu_intel_openmp_mkl_prologue starpu_openmp_prologue
  65. #ifdef STARPU_MKL
  66. void starpu_gnu_openmp_mkl_prologue(void*);
  67. #endif /* STARPU_MKL */
  68. /** @} */
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif
  73. #endif
  74. #endif /* __STARPU_CLUSTERS_UTIL_H__ */