XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
std::ofstream tracing_file;
-std::map<const simgrid::instr::Container*, std::ofstream*> tracing_files; // TI specific
+static std::map<const simgrid::instr::Container*, std::ofstream*> tracing_files; // TI specific
constexpr char OPT_TRACING_BASIC[] = "tracing/basic";
constexpr char OPT_TRACING_COMMENT_FILE[] = "tracing/comment-file";
namespace simgrid::instr {
static bool trace_active = false;
TraceFormat trace_format = TraceFormat::Paje;
-int trace_precision;
+static int trace_precision;
/*************
* Callbacks *
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_api, instr, "API");
-std::set<std::string, std::less<>> created_categories;
-std::set<std::string, std::less<>> declared_marks;
-std::set<std::string, std::less<>> user_host_variables;
-std::set<std::string, std::less<>> user_vm_variables;
-std::set<std::string, std::less<>> user_link_variables;
+static std::set<std::string, std::less<>> created_categories;
+static std::set<std::string, std::less<>> declared_marks;
+static std::set<std::string, std::less<>> user_host_variables;
+static std::set<std::string, std::less<>> user_vm_variables;
+static std::set<std::string, std::less<>> user_link_variables;
static void instr_user_variable(double time, const std::string& resource, const std::string& variable_name,
const std::string& parent_type, double value, InstrUserVariable what,
*/
enum class TraceFormat { Paje, /*TimeIndependent*/ Ti };
extern TraceFormat trace_format;
-extern int trace_precision;
extern double last_timestamp_to_dump;
void init();
XBT_PRIVATE std::string instr_pid(simgrid::s4u::Actor const& proc);
-extern XBT_PRIVATE std::set<std::string, std::less<>> created_categories;
-extern XBT_PRIVATE std::set<std::string, std::less<>> declared_marks;
-extern XBT_PRIVATE std::set<std::string, std::less<>> user_host_variables;
-extern XBT_PRIVATE std::set<std::string, std::less<>> user_vm_variables;
-extern XBT_PRIVATE std::set<std::string, std::less<>> user_link_variables;
-
/* from instr_config.c */
XBT_PRIVATE bool TRACE_needs_platform();
XBT_PRIVATE bool TRACE_is_enabled();
// utilities
XBT_PRIVATE void smpi_init_options_internal(bool called_by_smpi_main);
-extern XBT_PRIVATE char* smpi_data_exe_start; // start of the data+bss segment of the executable
-extern XBT_PRIVATE size_t smpi_data_exe_size; // size of the data+bss segment of the executable
-
XBT_PRIVATE bool smpi_switch_data_segment(simgrid::s4u::ActorPtr actor, const void* addr = nullptr);
XBT_PRIVATE void smpi_prepare_global_memory_segment();
std::unordered_map<std::string, double> location2speedup;
static int smpi_exit_status = 0;
-xbt_os_timer_t global_timer;
+static xbt_os_timer_t global_timer;
static std::vector<std::string> privatize_libs_paths;
// No instance gets manually created; check also the smpirun.in script as
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_memory, smpi, "Memory layout support for SMPI");
-char* smpi_data_exe_start = nullptr;
-size_t smpi_data_exe_size = 0;
-SmpiPrivStrategies smpi_privatize_global_variables;
+static char* smpi_data_exe_start = nullptr; // start of the data+bss segment of the executable
+static size_t smpi_data_exe_size = 0; // size of the data+bss segment of the executable
+static SmpiPrivStrategies smpi_privatize_global_variables;
static void* smpi_data_exe_copy;
// Initialized by smpi_prepare_global_memory_segment().
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_shared, smpi, "Logging specific to SMPI (shared memory macros)");
-namespace{
+namespace {
/** Some location in the source code
*
* This information is used by SMPI_SHARED_MALLOC to allocate some shared memory for all simulated processes.
int smpi_shared_malloc_bogusfile = -1;
int smpi_shared_malloc_bogusfile_huge_page = -1;
unsigned long smpi_shared_malloc_blocksize = 1UL << 20;
-}
+} // namespace
void smpi_shared_destroy()
{
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)");
-extern std::string surf_parsed_filename;
-extern int surf_parse_lineno;
-
-namespace simgrid::smpi::utils {
+namespace {
double total_benched_time=0;
unsigned long total_malloc_size=0;
};
alloc_metadata_t max_malloc;
-F2C* current_handle = nullptr;
+simgrid::smpi::F2C* current_handle = nullptr;
current_buffer_metadata_t current_buffer1;
current_buffer_metadata_t current_buffer2;
std::unordered_map<int, std::vector<std::string>> collective_calls;
+} // namespace
+
+namespace simgrid::smpi::utils {
+
void add_benched_time(double time){
total_benched_time += time;
}
extern std::map<std::string, SgFlow*, std::less<>> flow_from_sock;
extern std::map<std::string, ns3::ApplicationContainer, std::less<>> sink_from_sock;
-static ns3::InternetStackHelper stack;
-
static int number_of_links = 1;
static int number_of_networks = 1;
NetPointNs3::NetPointNs3()
{
+ static ns3::InternetStackHelper stack;
stack.Install(ns3_node_);
}
/* Trace related stuff */
XBT_PRIVATE std::unordered_map<std::string, simgrid::kernel::profile::Profile*> traces_set_list;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_avail;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_speed;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_avail;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
+static std::unordered_map<std::string, std::string> trace_connect_list_host_avail;
+static std::unordered_map<std::string, std::string> trace_connect_list_host_speed;
+static std::unordered_map<std::string, std::string> trace_connect_list_link_avail;
+static std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
+static std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* trace_connect)
{
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module");
std::string surf_parsed_filename; // Currently parsed file (for the error messages)
-std::vector<simgrid::s4u::LinkInRoute> parsed_link_list; /* temporary store of current link list of a route */
+static std::vector<simgrid::s4u::LinkInRoute> parsed_link_list; /* temporary store of current link list of a route */
/* Helping functions */
void surf_parse_assert(bool cond, const std::string& msg)
/* make sure these symbols are defined as strong ones in this file so that the linker can resolve them */
-std::vector<std::unordered_map<std::string, std::string>> property_sets;
+static std::vector<std::unordered_map<std::string, std::string>> property_sets;
-FILE *surf_file_to_parse = nullptr;
+static FILE* surf_file_to_parse = nullptr;
/* Stuff relative to storage */
void STag_surfxml_storage()
void ETag_surfxml_model___prop(){/* Nothing to do */}
/* Open and Close parse file */
-YY_BUFFER_STATE surf_input_buffer;
+static YY_BUFFER_STATE surf_input_buffer;
void surf_parse_open(const std::string& file)
{