starpu_mpi.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. #include <starpu_mpi.h>
  17. #include <starpu_mpi_datatype.h>
  18. pthread_cond_t cond;
  19. pthread_mutex_t mutex;
  20. pthread_t progress_thread;
  21. int starpu_mpi_isend(starpu_data_handle data_handle, starpu_mpi_req_t *req,
  22. int dest, int mpi_tag, MPI_Comm comm,
  23. void (*callback)(void *))
  24. {
  25. return 0;
  26. }
  27. int starpu_mpi_irecv(starpu_data_handle data_handle, starpu_mpi_req_t *req,
  28. int source, int mpi_tag, MPI_Comm comm,
  29. void (*callback)(void *))
  30. {
  31. return 0;
  32. }
  33. int starpu_mpi_recv(starpu_data_handle data_handle,
  34. int source, int mpi_tag, MPI_Comm comm, MPI_Status *status)
  35. {
  36. /* test if we are blocking in a callback .. */
  37. int ret = starpu_sync_data_with_mem(data_handle, STARPU_W);
  38. if (ret)
  39. return ret;
  40. void *ptr = starpu_mpi_handle_to_ptr(data_handle);
  41. MPI_Datatype datatype;
  42. starpu_mpi_handle_to_datatype(data_handle, &datatype);
  43. MPI_Recv(ptr, 1, datatype, source, mpi_tag, comm, status);
  44. starpu_release_data_from_mem(data_handle);
  45. return 0;
  46. }
  47. int starpu_mpi_send(starpu_data_handle data_handle,
  48. int dest, int mpi_tag, MPI_Comm comm)
  49. {
  50. /* test if we are blocking in a callback .. */
  51. int ret = starpu_sync_data_with_mem(data_handle, STARPU_R);
  52. if (ret)
  53. return ret;
  54. void *ptr = starpu_mpi_handle_to_ptr(data_handle);
  55. MPI_Status status;
  56. MPI_Datatype datatype;
  57. starpu_mpi_handle_to_datatype(data_handle, &datatype);
  58. MPI_Send(ptr, 1, datatype, dest, mpi_tag, comm);
  59. starpu_release_data_from_mem(data_handle);
  60. return 0;
  61. }
  62. int starpu_mpi_wait(starpu_mpi_req_t *req)
  63. {
  64. return 0;
  65. }
  66. int starpu_mpi_test(starpu_mpi_req_t *req, int *flag)
  67. {
  68. return 0;
  69. }
  70. int starpu_mpi_initialize(void)
  71. {
  72. return 0;
  73. }
  74. int starpu_mpi_shutdown(void)
  75. {
  76. return 0;
  77. }