starpu_mpi_cache.h 2.1 KB

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