starpu_mpi_cache.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 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. #endif
  26. extern int _starpu_cache_enabled;
  27. void _starpu_mpi_cache_init(MPI_Comm comm);
  28. void _starpu_mpi_cache_shutdown();
  29. void _starpu_mpi_cache_data_init(starpu_data_handle_t data_handle);
  30. void _starpu_mpi_cache_data_clear(starpu_data_handle_t data_handle);
  31. /*
  32. * If the data is already available in the cache, return a pointer to the data
  33. * If the data is NOT available in the cache, add it to the cache and return NULL
  34. */
  35. int _starpu_mpi_cache_received_data_set(starpu_data_handle_t data);
  36. int _starpu_mpi_cache_received_data_get(starpu_data_handle_t data);
  37. void _starpu_mpi_cache_received_data_clear(starpu_data_handle_t data);
  38. /*
  39. * If the data is already available in the cache, return a pointer to the data
  40. * If the data is NOT available in the cache, add it to the cache and return NULL
  41. */
  42. int _starpu_mpi_cache_sent_data_set(starpu_data_handle_t data, int dest);
  43. int _starpu_mpi_cache_sent_data_get(starpu_data_handle_t data, int dest);
  44. void _starpu_mpi_cache_sent_data_clear(starpu_data_handle_t data);
  45. void _starpu_mpi_cache_flush(starpu_data_handle_t data_handle);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif // __STARPU_MPI_CACHE_H__