-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
};
}
-static void memcpy_private(void* dest, const void* src, std::vector<std::pair<size_t, size_t>>& private_blocks)
+static void memcpy_private(void* dest, const void* src, const std::vector<std::pair<size_t, size_t>>& private_blocks)
{
for (auto const& block : private_blocks)
memcpy((uint8_t*)dest+block.first, (uint8_t*)src+block.first, block.second-block.first);
}
-static void check_blocks(std::vector<std::pair<size_t, size_t>> &private_blocks, size_t buff_size) {
+static void check_blocks(const std::vector<std::pair<size_t, size_t>>& private_blocks, size_t buff_size)
+{
for (auto const& block : private_blocks)
xbt_assert(block.first <= block.second && block.second <= buff_size, "Oops, bug in shared malloc.");
}
}
// NOTE: We cannot use a map here, as we must obey the order of the counters
- // This is important for PAPI: We need to map the values of counters back
- // to the event_names (so, when PAPI_read() has finished)!
+ // This is important for PAPI: We need to map the values of counters back to the event_names (so, when PAPI_read()
+ // has finished)!
papi_counter_t counters2values;
- // Iterate over all counters that were specified for this specific
- // unit.
- // Note that we need to remove the name of the unit
- // (that could also be the "default" value), which always comes first.
- // Hence, we start at ++(events.begin())!
+ // Iterate over all counters that were specified for this specific unit.
+ // Note that we need to remove the name of the unit (that could also be the "default" value), which always comes
+ // first. Hence, we start at ++(events.begin())!
for (Tokenizer::iterator events_it = ++(event_tokens.begin()); events_it != event_tokens.end(); ++events_it) {
-
int event_code = PAPI_NULL;
char* event_name = const_cast<char*>((*events_it).c_str());
if (PAPI_event_name_to_code(event_name, &event_code) != PAPI_OK) {
if (got == -1) {
xbt_assert(errno == EINTR, "Cannot read from %s", src.c_str());
} else {
- char* p = buf;
+ const char* p = buf;
int todo = got;
while (int done = write(fdout, p, todo)) {
if (done == -1) {
/* This is a ... heavy way to count the MPI ranks */
int rank_counts = 0;
- simgrid::s4u::Actor::on_creation.connect([&rank_counts](simgrid::s4u::Actor& actor) {
+ simgrid::s4u::Actor::on_creation.connect([&rank_counts](const simgrid::s4u::Actor& actor) {
if (not actor.is_daemon())
rank_counts++;
});
if (MC_is_active()) {
MC_run();
} else {
-
SIMIX_run();
xbt_os_walltimer_stop(global_timer);