starpu_mpi.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * StarPU
  3. * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
  4. *
  5. * This program 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. * This program 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_H__
  17. #define __STARPU_MPI_H__
  18. #include <starpu.h>
  19. #include <mpi.h>
  20. #include <common/list.h>
  21. #include <pthread.h>
  22. LIST_TYPE(starpu_mpi_req,
  23. void *ptr;
  24. starpu_data_handle data_handle;
  25. starpu_access_mode mode;
  26. MPI_Datatype datatype;
  27. MPI_Request request;
  28. void (*handle_new)(struct starpu_mpi_req_s *);
  29. void (*handle_pending)(struct starpu_mpi_req_s *);
  30. unsigned submitted;
  31. int dst;
  32. int src;
  33. int mpi_tag;
  34. MPI_Comm comm;
  35. pthread_mutex_t req_mutex;
  36. pthread_cond_t req_cond;
  37. );
  38. int starpu_mpi_isend(starpu_data_handle data_handle, struct starpu_mpi_req_s *req,
  39. int dest, int mpi_tag, MPI_Comm comm,
  40. void (*callback)(void *));
  41. int starpu_mpi_irecv(starpu_data_handle data_handle, struct starpu_mpi_req_s *req,
  42. int source, int mpi_tag, MPI_Comm comm,
  43. void (*callback)(void *));
  44. int starpu_mpi_send(starpu_data_handle data_handle,
  45. int dest, int mpi_tag, MPI_Comm comm);
  46. int starpu_mpi_recv(starpu_data_handle data_handle,
  47. int source, int mpi_tag, MPI_Comm comm, MPI_Status *status);
  48. int starpu_mpi_wait(struct starpu_mpi_req_s *req, MPI_Status *status);
  49. int starpu_mpi_test(struct starpu_mpi_req_s *req, int *flag, MPI_Status *status);
  50. int starpu_mpi_initialize(void);
  51. int starpu_mpi_shutdown(void);
  52. #endif // __STARPU_MPI_H__