starpu_mpi_private.h 1.7 KB

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