starpu_clusters.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. /** @defgroup API_Clustering_Machine Clustering Machine
  21. @{
  22. */
  23. #ifdef STARPU_HAVE_HWLOC
  24. #include <hwloc.h>
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29. #define STARPU_CLUSTER_MIN_NB (1<<STARPU_MODE_SHIFT)
  30. #define STARPU_CLUSTER_MAX_NB (2<<STARPU_MODE_SHIFT)
  31. #define STARPU_CLUSTER_NB (3<<STARPU_MODE_SHIFT)
  32. #define STARPU_CLUSTER_POLICY_NAME (4<<STARPU_MODE_SHIFT)
  33. #define STARPU_CLUSTER_POLICY_STRUCT (5<<STARPU_MODE_SHIFT)
  34. #define STARPU_CLUSTER_KEEP_HOMOGENEOUS (6<<STARPU_MODE_SHIFT)
  35. #define STARPU_CLUSTER_PREFERE_MIN (7<<STARPU_MODE_SHIFT)
  36. #define STARPU_CLUSTER_CREATE_FUNC (8<<STARPU_MODE_SHIFT)
  37. #define STARPU_CLUSTER_CREATE_FUNC_ARG (9<<STARPU_MODE_SHIFT)
  38. #define STARPU_CLUSTER_TYPE (10<<STARPU_MODE_SHIFT)
  39. #define STARPU_CLUSTER_AWAKE_WORKERS (11<<STARPU_MODE_SHIFT)
  40. #define STARPU_CLUSTER_PARTITION_ONE (12<<STARPU_MODE_SHIFT)
  41. #define STARPU_CLUSTER_NEW (13<<STARPU_MODE_SHIFT)
  42. #define STARPU_CLUSTER_NCORES (14<<STARPU_MODE_SHIFT)
  43. /**
  44. These represent the default available functions to enforce cluster
  45. use by the sub-runtime
  46. */
  47. enum starpu_cluster_types
  48. {
  49. STARPU_CLUSTER_OPENMP, /**< todo */
  50. STARPU_CLUSTER_INTEL_OPENMP_MKL, /**< todo */
  51. #ifdef STARPU_MKL
  52. STARPU_CLUSTER_GNU_OPENMP_MKL, /**< todo */
  53. #endif
  54. };
  55. struct starpu_cluster_machine;
  56. struct starpu_cluster_machine* starpu_cluster_machine(hwloc_obj_type_t cluster_level, ...);
  57. int starpu_uncluster_machine(struct starpu_cluster_machine* clusters);
  58. int starpu_cluster_print(struct starpu_cluster_machine* clusters);
  59. /* Prologue functions */
  60. void starpu_openmp_prologue(void*);
  61. #define starpu_intel_openmp_mkl_prologue starpu_openmp_prologue
  62. #ifdef STARPU_MKL
  63. void starpu_gnu_openmp_mkl_prologue(void*);
  64. #endif /* STARPU_MKL */
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif
  69. /** @} */
  70. #endif /* __STARPU_CLUSTERS_UTIL_H__ */