Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
implement mpi_isendrecv and mpi_isendrecv_replace
[simgrid.git] / include / smpi / smpi.h
index cf14a3f..0812035 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 #include <vector>
 #endif
 
-#ifdef _WIN32
-#define MPI_CALL(type, name, args)                                                                                     \
-  type name args;                                                                                                      \
-  type _XBT_CONCAT(P, name) args
-#else
 #define MPI_CALL(type, name, args)                                                                                     \
   type name args __attribute__((weak));                                                                                \
-  type _XBT_CONCAT(P, name) args
-#endif
+  type _XBT_CONCAT(P, name)                                                                                            \
+  args
 
 SG_BEGIN_DECL
 #define MPI_THREAD_SINGLE     0
@@ -239,15 +234,11 @@ typedef SMPI_Info* MPI_Info;
 #define MPI_STATUSES_IGNORE ((MPI_Status*)NULL)
 #define MPI_STATUS_SIZE 5
 
-#if !defined(DLL_EXPORT)
 #if defined(c_plusplus) || defined(__cplusplus)
 #define SMPI_PREDEFINED_POINTER(type, internal) (static_cast<type> (static_cast<void*> (&(internal))))
 #else
 #define SMPI_PREDEFINED_POINTER(type, internal) ((type) ((void *) &(internal)))
 #endif
-#else
-#define SMPI_PREDEFINED_POINTER(type, internal) ((type) &(internal))
-#endif
 
 extern SMPI_Datatype smpi_MPI_DATATYPE_NULL;
 extern SMPI_Datatype smpi_MPI_CHAR;
@@ -714,8 +705,13 @@ MPI_CALL(XBT_PUBLIC int, MPI_Irsend,
 MPI_CALL(XBT_PUBLIC int, MPI_Sendrecv,
          (const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void* recvbuf, int recvcount,
           MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_Isendrecv,
+         (const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void* recvbuf, int recvcount,
+          MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Request* req));
 MPI_CALL(XBT_PUBLIC int, MPI_Sendrecv_replace, (void* buf, int count, MPI_Datatype datatype, int dst, int sendtag,
                                                 int src, int recvtag, MPI_Comm comm, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_Isendrecv_replace, (void* buf, int count, MPI_Datatype datatype, int dst, int sendtag,
+                                                int src, int recvtag, MPI_Comm comm, MPI_Request* req));
 
 MPI_CALL(XBT_PUBLIC int, MPI_Test, (MPI_Request * request, int* flag, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC int, MPI_Testany, (int count, MPI_Request requests[], int* index, int* flag, MPI_Status* status));
@@ -1132,7 +1128,16 @@ MPI_CALL(XBT_PUBLIC int, MPI_Ineighbor_alltoallw,
           const MPI_Aint* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Status_f2c, (MPI_Fint *f_status, MPI_Status *c_status));
 MPI_CALL(XBT_PUBLIC int, MPI_Status_c2f, (MPI_Status *c_status, MPI_Fint *f_status));
-
+MPI_CALL(XBT_PUBLIC int, MPI_Parrived, (MPI_Request request, int partition, int *flag));
+MPI_CALL(XBT_PUBLIC int, MPI_Pready, (int partitions, MPI_Request request));
+MPI_CALL(XBT_PUBLIC int, MPI_Pready_range, (int partition_low, int partition_high, MPI_Request request));
+MPI_CALL(XBT_PUBLIC int, MPI_Pready_list, (int length, int partition_list[], MPI_Request request));
+MPI_CALL(XBT_PUBLIC int, MPI_Precv_init, (void* buf, int partitions, MPI_Count count,
+                                  MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
+                                  MPI_Info info, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Psend_init, (const void* buf, int partitions, MPI_Count count,
+                                  MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
+                                  MPI_Info info, MPI_Request *request));
 
 
 //FIXME: End of all the not yet implemented stuff
@@ -1169,11 +1174,11 @@ XBT_PUBLIC void smpi_comm_set_copy_data_callback(void (*callback)(smx_activity_t
  * called from the user's application! (With the __FILE__ and __LINE__ values
  * passed as parameters.)
  */
-XBT_PUBLIC void smpi_trace_set_call_location(const char* file, int line);
+XBT_PUBLIC void smpi_trace_set_call_location(const char* file, int line, const char* call_name);
 /** Fortran binding **/
-XBT_PUBLIC void smpi_trace_set_call_location_(const char* file, const int* line);
+XBT_PUBLIC void smpi_trace_set_call_location_(const char* file, const int* line, const char* call_name);
 /** Fortran binding + -fsecond-underscore **/
-XBT_PUBLIC void smpi_trace_set_call_location__(const char* file, const int* line);
+XBT_PUBLIC void smpi_trace_set_call_location__(const char* file, const int* line, const char* call_name);
 
 #define SMPI_ITER_NAME1(line) _XBT_CONCAT(iter_count, line)
 #define SMPI_ITER_NAME(line) SMPI_ITER_NAME1(line)
@@ -1241,8 +1246,15 @@ XBT_PUBLIC void SMPI_thread_create();
 
 SG_END_DECL
 
-/* C++ declarations for shared_malloc and default copy buffer callback */
 #ifdef __cplusplus
+XBT_PUBLIC void SMPI_app_instance_start(const char* name, std::function<void()> const& code,
+                                        std::vector<simgrid::s4u::Host*> const& hosts);
+XBT_PUBLIC void SMPI_app_instance_join(const std::string& instance_id);
+
+/* This version without parameter is nice to use with SMPI_app_instance_start() */
+XBT_PUBLIC void MPI_Init();
+
+/* C++ declarations for shared_malloc and default copy buffer callback */
 XBT_PUBLIC int smpi_is_shared(const void* ptr, std::vector<std::pair<size_t, size_t>>& private_blocks, size_t* offset);
 
 std::vector<std::pair<size_t, size_t>> shift_and_frame_private_blocks(const std::vector<std::pair<size_t, size_t>>& vec,