starpu_mpi_private.h 1.8 KB

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