starpu_mpi_cache.h 1.8 KB

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