X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1f7474b9bb0f7838d0fc775e65608933f82724ca..ab1a94e98438ed2d29533aca9e613d667237c3d0:/src/smpi/private.hpp diff --git a/src/smpi/private.hpp b/src/smpi/private.hpp index a384ac7468..b05de0c4a0 100644 --- a/src/smpi/private.hpp +++ b/src/smpi/private.hpp @@ -9,6 +9,14 @@ #include #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> papi_counter_t; @@ -24,3 +32,4 @@ XBT_PUBLIC(smpi_trace_call_location_t*) smpi_process_get_call_location(void); XBT_PUBLIC(smpi_trace_call_location_t*) smpi_trace_get_call_location(); } #endif +