perfmodel.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2013 Université de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2011 Télécom-SudParis
  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 __PERFMODEL_H__
  19. #define __PERFMODEL_H__
  20. #include <common/config.h>
  21. #include <starpu.h>
  22. #include <core/task_bundle.h>
  23. #include <stdio.h>
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. /**
  29. * Performance models files are stored in a directory whose name
  30. * include the version of the performance model format. The version
  31. * number is also written in the file itself.
  32. * When updating the format, the variable _STARPU_PERFMODEL_VERSION
  33. * should be updated. It is then possible to switch easily between
  34. * differents versions of StarPU having different performance model
  35. * formats.
  36. */
  37. #define _STARPU_PERFMODEL_VERSION 42
  38. struct _starpu_perfmodel_list
  39. {
  40. struct _starpu_perfmodel_list *next;
  41. struct starpu_perfmodel *model;
  42. };
  43. struct starpu_data_descr;
  44. struct _starpu_job;
  45. struct starpu_perfmodel_arch;
  46. void _starpu_get_perf_model_dir(char *path, size_t maxlen);
  47. void _starpu_get_perf_model_dir_codelets(char *path, size_t maxlen);
  48. void _starpu_get_perf_model_dir_bus(char *path, size_t maxlen);
  49. void _starpu_get_perf_model_dir_debug(char *path, size_t maxlen);
  50. double _starpu_history_based_job_expected_perf(struct starpu_perfmodel *model, struct starpu_perfmodel_arch* arch, struct _starpu_job *j, unsigned nimpl);
  51. int _starpu_register_model(struct starpu_perfmodel *model);
  52. void _starpu_load_per_arch_based_model(struct starpu_perfmodel *model);
  53. void _starpu_load_common_based_model(struct starpu_perfmodel *model);
  54. void _starpu_load_history_based_model(struct starpu_perfmodel *model, unsigned scan_history);
  55. void _starpu_load_perfmodel(struct starpu_perfmodel *model);
  56. void _starpu_initialize_registered_performance_models(void);
  57. void _starpu_deinitialize_registered_performance_models(void);
  58. double _starpu_regression_based_job_expected_perf(struct starpu_perfmodel *model,
  59. struct starpu_perfmodel_arch* arch, struct _starpu_job *j, unsigned nimpl);
  60. double _starpu_non_linear_regression_based_job_expected_perf(struct starpu_perfmodel *model,
  61. struct starpu_perfmodel_arch* arch, struct _starpu_job *j, unsigned nimpl);
  62. void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfmodel *model, struct starpu_perfmodel_arch * arch,
  63. unsigned cpuid, double measured, unsigned nimpl);
  64. void _starpu_create_sampling_directory_if_needed(void);
  65. void _starpu_load_bus_performance_files(void);
  66. void _starpu_set_calibrate_flag(unsigned val);
  67. unsigned _starpu_get_calibrate_flag(void);
  68. #if defined(STARPU_USE_CUDA)
  69. int *_starpu_get_cuda_affinity_vector(unsigned gpuid);
  70. #endif
  71. #if defined(STARPU_USE_OPENCL)
  72. int *_starpu_get_opencl_affinity_vector(unsigned gpuid);
  73. #endif
  74. void _starpu_save_bandwidth_and_latency_disk(double bandwidth_write, double bandwidth_read,
  75. double latency_write, double latency_read, unsigned node);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif // __PERFMODEL_H__