Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid copying data if it comes from/to a shared buffer, even internally.
[simgrid.git] / include / smpi / smpi.h
index cae3e1f..bc9dcb7 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <simgrid/forward.h>
 #include <smpi/forward.hpp>
+#include <smpi/smpi_helpers_internal.h>
 #include <xbt/function_types.h>
 
 #include <stddef.h>
@@ -1025,14 +1026,13 @@ XBT_PUBLIC void smpi_trace_set_call_location__(const char* file, int* line);
   SMPI_SAMPLE_LOOP(loop_init, (loop_end), (loop_iter), 1, (iters), (thres))
 #define SMPI_SAMPLE_DELAY(duration) for(smpi_execute(duration); 0; )
 #define SMPI_SAMPLE_FLOPS(flops) for(smpi_execute_flops(flops); 0; )
-
 XBT_PUBLIC void* smpi_shared_malloc(size_t size, const char* file, int line);
 #define SMPI_SHARED_MALLOC(size) smpi_shared_malloc((size), __FILE__, __LINE__)
 XBT_PUBLIC void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int nb_shared_blocks);
 #define SMPI_PARTIAL_SHARED_MALLOC(size, shared_block_offsets, nb_shared_blocks)                                       \
   smpi_shared_malloc_partial((size), (shared_block_offsets), (nb_shared_blocks))
 
-XBT_PUBLIC void smpi_shared_free(void* data);
+
 #define SMPI_SHARED_FREE(data) smpi_shared_free(data)
 
 XBT_PUBLIC int smpi_shared_known_call(const char* func, const char* input);
@@ -1061,7 +1061,7 @@ SG_END_DECL
 
 /* C++ declarations for shared_malloc */
 #ifdef __cplusplus
-XBT_PUBLIC int smpi_is_shared(void* ptr, std::vector<std::pair<size_t, size_t>>& private_blocks, size_t* offset);
+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,
                                                                       size_t offset, size_t buff_size);