starpu_mpi_private.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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_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. LIST_TYPE(starpu_mpi_req,
  28. /* description of the data at StarPU level */
  29. starpu_data_handle data_handle;
  30. /* description of the data to be sent/received */
  31. void *ptr;
  32. MPI_Datatype datatype;
  33. /* who are we talking to ? */
  34. int srcdst;
  35. int mpi_tag;
  36. MPI_Comm comm;
  37. void (*func)(struct starpu_mpi_req_s *);
  38. MPI_Status *status;
  39. MPI_Request request;
  40. int *flag;
  41. int ret;
  42. pthread_mutex_t req_mutex;
  43. pthread_cond_t req_cond;
  44. unsigned request_type; /* 0 send, 1 recv */
  45. unsigned submitted;
  46. unsigned completed;
  47. /* In the case of a Wait/Test request, we are going to post a request
  48. * to test the completion of another request */
  49. struct starpu_mpi_req_s *other_request;
  50. /* in the case of detached requests */
  51. unsigned detached;
  52. void *callback_arg;
  53. void (*callback)(void *);
  54. );
  55. #endif // __STARPU_MPI_PRIVATE_H__