#include <unistd.h>
#include <xbt/misc.h>
+#ifdef __cplusplus
+#include <vector>
+#endif
+
#ifdef _WIN32
-#define MPI_CALL(type,name,args) \
- type name args; \
- type P##name args
+#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 P##name args
+#define MPI_CALL(type, name, args) \
+ type name args __attribute__((weak)); \
+ type _XBT_CONCAT(P, name) args
#endif
SG_BEGIN_DECL()
ERROR(MPI_T_ERR_PVAR_NO_ATOMIC)
#define GENERATE_ENUM(ENUM) ENUM,
-#define GENERATE_STRING(STRING) #STRING,
+#define GENERATE_STRING(STRING) _XBT_STRINGIFY(STRING),
enum ERROR_ENUM {
FOREACH_ERROR(GENERATE_ENUM)
#define MPI_STATUS_IGNORE ((MPI_Status*)NULL)
#define MPI_STATUSES_IGNORE ((MPI_Status*)NULL)
+#define MPI_STATUS_SIZE 5
XBT_PUBLIC_DATA const MPI_Datatype MPI_DATATYPE_NULL;
XBT_PUBLIC_DATA const MPI_Datatype MPI_CHAR;
MPI_CALL(XBT_PUBLIC int, MPI_Type_ub, (MPI_Datatype datatype, MPI_Aint* disp));
MPI_CALL(XBT_PUBLIC int, MPI_Type_commit, (MPI_Datatype * datatype));
MPI_CALL(XBT_PUBLIC int, MPI_Type_hindexed,
- (int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
+ (int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
MPI_CALL(XBT_PUBLIC int, MPI_Type_create_hindexed,
(int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
MPI_CALL(XBT_PUBLIC int, MPI_Type_create_hindexed_block,
MPI_CALL(XBT_PUBLIC int, MPI_Type_create_indexed_block,
(int count, int blocklength, const int* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
MPI_CALL(XBT_PUBLIC int, MPI_Type_struct,
- (int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype));
+ (int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types, MPI_Datatype* newtype));
MPI_CALL(XBT_PUBLIC int, MPI_Type_create_struct,
(int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types, MPI_Datatype* newtype));
MPI_CALL(XBT_PUBLIC int, MPI_Type_vector,
XBT_PUBLIC void smpi_execute(double duration);
XBT_PUBLIC void smpi_execute_benched(double duration);
-// PLEASE NOTE: If you remove these functions, the entire smpi_dvfs.cpp file can be removed as well!!
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_pstate_speed(sg_host_self(), pstate_index) instead") XBT_PUBLIC double smpi_get_host_power_peak_at(int pstate_index);
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_speed(sg_host_self()) instead") XBT_PUBLIC double smpi_get_host_current_power_peak();
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_nb_pstates(sg_host_self()) instead") XBT_PUBLIC int smpi_get_host_nb_pstates();
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_set_pstate(sg_host_self(), pstate_index) instead") XBT_PUBLIC void smpi_set_host_pstate(int pstate_index);
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_pstate(sg_host_self()) instead") XBT_PUBLIC int smpi_get_host_pstate();
-
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_consumed_energy(sg_host_self()) instead") XBT_PUBLIC double smpi_get_host_consumed_energy();
-
-
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, int line, int iters, double threshold);
/** Fortran binding + -fsecond-underscore **/
XBT_PUBLIC void smpi_trace_set_call_location__(const char* file, int* line);
-#define SMPI_ITER_NAME1(line) iter_count##line
+#define SMPI_ITER_NAME1(line) _XBT_CONCAT(iter_count, line)
#define SMPI_ITER_NAME(line) SMPI_ITER_NAME1(line)
#define SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, global, iters, thres)\
int SMPI_ITER_NAME(__LINE__)=0;\
XBT_PUBLIC int smpi_shared_known_call(const char* func, const char* input);
XBT_PUBLIC void* smpi_shared_get_call(const char* func, const char* input);
XBT_PUBLIC void* smpi_shared_set_call(const char* func, const char* input, void* data);
-#define SMPI_SHARED_CALL(func, input, ...) \
- (smpi_shared_known_call(#func, input) ? smpi_shared_get_call(#func, input) \
- : smpi_shared_set_call(#func, input, (func(__VA_ARGS__))))
+#define SMPI_SHARED_CALL(func, input, ...) \
+ (smpi_shared_known_call(_XBT_STRINGIFY(func), input) \
+ ? smpi_shared_get_call(_XBT_STRINGIFY(func), input) \
+ : smpi_shared_set_call(_XBT_STRINGIFY(func), input, (func(__VA_ARGS__))))
/* Fortran specific stuff */
XBT_PUBLIC int smpi_main(const char* program, int argc, char* argv[]);
-XBT_PUBLIC void smpi_process_init(int* argc, char*** argv);
/* Trace replay specific stuff */
XBT_PUBLIC void smpi_replay_init(const char* instance_id, int rank, double start_delay_flops); // Only initialization
/* C++ declarations for shared_malloc */
#ifdef __cplusplus
-#include <vector>
-
XBT_PUBLIC int smpi_is_shared(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);
std::vector<std::pair<size_t, size_t>> merge_private_blocks(const std::vector<std::pair<size_t, size_t>>& src,
const std::vector<std::pair<size_t, size_t>>& dst);
-
#endif
#endif