driver_mpi_source.h 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2016-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU 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. * StarPU 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 __DRIVER_MPI_SOURCE_H__
  17. #define __DRIVER_MPI_SOURCE_H__
  18. /** @file */
  19. #include <drivers/mp_common/mp_common.h>
  20. #include <starpu_mpi_ms.h>
  21. #include <datawizard/node_ops.h>
  22. #pragma GCC visibility push(hidden)
  23. void _starpu_mpi_ms_preinit(void);
  24. #ifdef STARPU_USE_MPI_MASTER_SLAVE
  25. extern struct _starpu_node_ops _starpu_driver_mpi_node_ops;
  26. /** Array of structures containing all the informations useful to send
  27. * and receive informations with devices */
  28. extern struct _starpu_mp_node *_starpu_mpi_ms_nodes[STARPU_MAXMPIDEVS];
  29. struct _starpu_mp_node *_starpu_mpi_src_get_mp_node_from_memory_node(int memory_node);
  30. struct _starpu_mp_node *_starpu_mpi_ms_src_get_actual_thread_mp_node();
  31. unsigned _starpu_mpi_src_get_device_count();
  32. void *_starpu_mpi_src_worker(void *arg);
  33. void _starpu_mpi_source_init(struct _starpu_mp_node *node);
  34. void _starpu_mpi_source_deinit(struct _starpu_mp_node *node);
  35. int _starpu_mpi_src_allocate_memory(void ** addr, size_t size, unsigned memory_node);
  36. void _starpu_mpi_source_free_memory(void *addr, unsigned memory_node);
  37. int _starpu_mpi_copy_mpi_to_ram_sync(void *src, unsigned src_node, void *dst, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, size_t size);
  38. int _starpu_mpi_copy_ram_to_mpi_sync(void *src, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst, unsigned dst_node, size_t size);
  39. int _starpu_mpi_copy_sink_to_sink_sync(void *src, unsigned src_node, void *dst, unsigned dst_node, size_t size);
  40. int _starpu_mpi_copy_mpi_to_ram_async(void *src, unsigned src_node, void *dst, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, size_t size, void * event);
  41. int _starpu_mpi_copy_ram_to_mpi_async(void *src, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst, unsigned dst_node, size_t size, void * event);
  42. int _starpu_mpi_copy_sink_to_sink_async(void *src, unsigned src_node, void *dst, unsigned dst_node, size_t size, void * event);
  43. int _starpu_mpi_copy_interface_from_mpi_to_cpu(starpu_data_handle_t handle, void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, struct _starpu_data_request *req);
  44. int _starpu_mpi_copy_interface_from_mpi_to_mpi(starpu_data_handle_t handle, void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, struct _starpu_data_request *req);
  45. int _starpu_mpi_copy_interface_from_cpu_to_mpi(starpu_data_handle_t handle, void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, struct _starpu_data_request *req);
  46. int _starpu_mpi_copy_data_from_mpi_to_cpu(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size, struct _starpu_async_channel *async_channel);
  47. int _starpu_mpi_copy_data_from_mpi_to_mpi(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size, struct _starpu_async_channel *async_channel);
  48. int _starpu_mpi_copy_data_from_cpu_to_mpi(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size, struct _starpu_async_channel *async_channel);
  49. int _starpu_mpi_is_direct_access_supported(unsigned node, unsigned handling_node);
  50. uintptr_t _starpu_mpi_malloc_on_node(unsigned dst_node, size_t size, int flags);
  51. void _starpu_mpi_free_on_node(unsigned dst_node, uintptr_t addr, size_t size, int flags);
  52. starpu_mpi_ms_kernel_t _starpu_mpi_ms_src_get_kernel_from_codelet(struct starpu_codelet *cl, unsigned nimpl);
  53. void(* _starpu_mpi_ms_src_get_kernel_from_job(const struct _starpu_mp_node *node STARPU_ATTRIBUTE_UNUSED, struct _starpu_job *j))(void);
  54. #endif /* STARPU_USE_MPI_MASTER_SLAVE */
  55. #pragma GCC visibility pop
  56. #endif /* __DRIVER_MPI_SOURCE_H__ */