starpu_mpi_cache.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011-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. #ifndef __STARPU_MPI_CACHE_H__
  17. #define __STARPU_MPI_CACHE_H__
  18. #include <starpu.h>
  19. #include <stdlib.h>
  20. #include <mpi.h>
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. extern int _starpu_cache_enabled;
  26. void _starpu_mpi_cache_init(MPI_Comm comm);
  27. void _starpu_mpi_cache_shutdown();
  28. void _starpu_mpi_cache_data_init(starpu_data_handle_t data_handle);
  29. void _starpu_mpi_cache_data_clear(starpu_data_handle_t data_handle);
  30. /*
  31. * If the data is already available in the cache, return a pointer to the data
  32. * If the data is NOT available in the cache, add it to the cache and return NULL
  33. */
  34. int _starpu_mpi_cache_received_data_set(starpu_data_handle_t data);
  35. int _starpu_mpi_cache_received_data_get(starpu_data_handle_t data);
  36. void _starpu_mpi_cache_received_data_clear(starpu_data_handle_t data);
  37. /*
  38. * If the data is already available in the cache, return a pointer to the data
  39. * If the data is NOT available in the cache, add it to the cache and return NULL
  40. */
  41. int _starpu_mpi_cache_sent_data_set(starpu_data_handle_t data, int dest);
  42. int _starpu_mpi_cache_sent_data_get(starpu_data_handle_t data, int dest);
  43. void _starpu_mpi_cache_sent_data_clear(starpu_data_handle_t data);
  44. void _starpu_mpi_cache_flush(starpu_data_handle_t data_handle);
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif // __STARPU_MPI_CACHE_H__