Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Move definition of macro TOPAGE to private.hpp
[simgrid.git] / src / smpi / private.hpp
1 /* Copyright (c) 2016. The SimGrid Team. All rights reserved.               */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SMPI_PRIVATE_HPP
7 #define SMPI_PRIVATE_HPP
8
9 #include <unordered_map>
10 #include "src/instr/instr_smpi.h"
11
12 /**
13  * Get the address of the beginning of the memory page where addr is located.
14  * Note that we use an integer division here, so (a/b)*b is not a, unless a%b == 0
15  *
16  * This is used when privatizing.
17  */
18 #define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
19
20 #ifdef HAVE_PAPI
21 typedef 
22     std::vector<std::pair</* counter name */std::string, /* counter value */long long>> papi_counter_t;
23 XBT_PRIVATE papi_counter_t& smpi_process_counter_data(void);
24 XBT_PRIVATE int smpi_process_event_set(void);
25 #endif
26
27 extern std::unordered_map<std::string, double> location2speedup;
28
29 /** @brief Returns the last call location (filename, linenumber). Process-specific. */
30 extern "C" {
31 XBT_PUBLIC(smpi_trace_call_location_t*) smpi_process_get_call_location(void);
32 XBT_PUBLIC(smpi_trace_call_location_t*) smpi_trace_get_call_location();
33 }
34 #endif
35