This was used in 2 files and should hence just go there.
#include <unordered_map>
#include "src/instr/instr_smpi.h"
+/**
+ * Get the address of the beginning of the memory page where addr is located.
+ * Note that we use an integer division here, so (a/b)*b is not a, unless a%b == 0
+ *
+ * This is used when privatizing.
+ */
+#define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
+
#ifdef HAVE_PAPI
typedef
std::vector<std::pair</* counter name */std::string, /* counter value */long long>> papi_counter_t;
XBT_PUBLIC(smpi_trace_call_location_t*) smpi_trace_get_call_location();
}
#endif
+
return data;
}
-#define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
/** Map a given SMPI privatization segment (make a SMPI process active) */
void smpi_switch_data_segment(int dest){
#include "../xbt/memory_map.hpp"
#include "private.h"
+#include "private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_memory, smpi, "Memory layout support for SMPI");
-#define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
-
#define PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC)
#define PROT_RW (PROT_READ | PROT_WRITE )
#define PROT_RX (PROT_READ | PROT_EXEC )