X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/237fd22b56db7d1c67360c37559ce3aab16a002d..dc122c0fb3802061bc2fdb4abd50bf02a224cfdc:/include/smpi/smpi.h diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 6d5245ee8f..0322577b82 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -17,6 +17,7 @@ #include #ifdef __cplusplus +#include #include #endif @@ -1048,8 +1049,9 @@ MPI_CALL(XBT_PUBLIC int, MPI_Dist_graph_create, (MPI_Comm comm_old, int n, const const int* weights, MPI_Info info, int reorder, MPI_Comm* comm_dist_graph)); MPI_CALL(XBT_PUBLIC int, MPI_Dist_graph_create_adjacent, (MPI_Comm comm_old, int indegree, const int* sources, const int* sourceweights, int outdegree, const int* destinations, const int* destweights, MPI_Info info, int reorder, MPI_Comm* comm_dist_graph)); -MPI_CALL(XBT_PUBLIC int, MPI_Dist_graph_neighbors, (MPI_Comm comm, int maxindegree, int* sources, int* sourceweights, - int maxoutdegree, int* destinations, int* destweights)); +MPI_CALL(XBT_PUBLIC int, MPI_Dist_graph_neighbors, + (MPI_Comm comm, int maxindegree, int* sources, int* sourceweights, int maxoutdegree, int* destinations, + int* destweights)); MPI_CALL(XBT_PUBLIC int, MPI_Dist_graph_neighbors_count, (MPI_Comm comm, int *indegree, int *outdegree, int *weighted)); MPI_CALL(XBT_PUBLIC int, MPI_Win_test, (MPI_Win win, int* flag)); @@ -1148,6 +1150,9 @@ XBT_PUBLIC void smpi_execute_flops_benched(double flops); XBT_PUBLIC void smpi_execute(double duration); XBT_PUBLIC void smpi_execute_benched(double duration); +XBT_PUBLIC void smpi_bench_begin(); +XBT_PUBLIC void smpi_bench_end(); + XBT_PUBLIC unsigned long long smpi_rastro_resolution(); XBT_PUBLIC unsigned long long smpi_rastro_timestamp(); XBT_PUBLIC void smpi_sample_1(int global, const char* file, const char* tag, int iters, double threshold); @@ -1237,7 +1242,7 @@ XBT_PUBLIC void SMPI_thread_create(); SG_END_DECL -/* C++ declarations for shared_malloc */ +/* C++ declarations for shared_malloc and default copy buffer callback */ #ifdef __cplusplus XBT_PUBLIC int smpi_is_shared(const void* ptr, std::vector>& private_blocks, size_t* offset); @@ -1245,6 +1250,31 @@ std::vector> shift_and_frame_private_blocks(const std: size_t offset, size_t buff_size); std::vector> merge_private_blocks(const std::vector>& src, const std::vector>& dst); + +/* May be used by S4U simulations to manually initialize SMPI */ +XBT_PUBLIC void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, + size_t buff_size); + +/** + * @brief Callback to set cost for SMPI operations (send, recv, isend) + * + * This callback replaces the configuration parameters smpi/or, smpi/os, smpi/ois. + * It offers more flexibility for cost functions. + * + * @param size Size of message being received/sent + * @param source Source host + * @param dst Destination host + */ +using SmpiOpCostCb = std::function; +/** @brief SMPI functions that accept cost functions */ +enum class SmpiOperation { RECV = 2, SEND = 1, ISEND = 0 }; +/** + * @brief Register a cost callback for some SMPI function (MPI_Send, MPI_ISend or MPI_Recv) + * + * @param op SMPI function + * @param cb User's callback + */ +XBT_PUBLIC void smpi_register_op_cost_callback(SmpiOperation op, const SmpiOpCostCb& cb); #endif -#endif +#endif