starpu_mpi_private.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * StarPU
  3. * Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (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_PRIVATE_H__
  17. #define __STARPU_MPI_PRIVATE_H__
  18. #include <starpu.h>
  19. #include <common/config.h>
  20. #include "starpu_mpi.h"
  21. #include "starpu_mpi_fxt.h"
  22. #include <common/list.h>
  23. #include <common/utils.h>
  24. #include <pthread.h>
  25. #define SEND_REQ 0
  26. #define RECV_REQ 1
  27. #define WAIT_REQ 2
  28. #define TEST_REQ 3
  29. #define BARRIER_REQ 4
  30. LIST_TYPE(starpu_mpi_req,
  31. /* description of the data at StarPU level */
  32. starpu_data_handle data_handle;
  33. /* description of the data to be sent/received */
  34. void *ptr;
  35. MPI_Datatype datatype;
  36. /* who are we talking to ? */
  37. int srcdst;
  38. int mpi_tag;
  39. MPI_Comm comm;
  40. void (*func)(struct starpu_mpi_req_s *);
  41. MPI_Status *status;
  42. MPI_Request request;
  43. int *flag;
  44. int ret;
  45. pthread_mutex_t req_mutex;
  46. pthread_cond_t req_cond;
  47. unsigned request_type; /* 0 send, 1 recv */
  48. unsigned submitted;
  49. unsigned completed;
  50. /* In the case of a Wait/Test request, we are going to post a request
  51. * to test the completion of another request */
  52. struct starpu_mpi_req_s *other_request;
  53. /* in the case of detached requests */
  54. unsigned detached;
  55. void *callback_arg;
  56. void (*callback)(void *);
  57. );
  58. #endif // __STARPU_MPI_PRIVATE_H__