int main(int argc, char* argv[])
{
sg4::Engine e(&argc, argv);
- std::string platform = argv[1];
/* create platform */
- if (platform == "torus")
+ if (std::string platform(argv[1]); platform == "torus")
create_torus_cluster();
else if (platform == "fatTree")
create_fatTree_cluster();
*/
// to check if variables were previously set to 0, otherwise paje won't simulate them
- static std::set<std::string, std::less<>> platform_variables;
-
// create a key considering the resource and variable, and check if key exists in the global map:
// if it doesn't, set the variable to zero.
- if (platform_variables.emplace(std::string(resource) + get_name()).second)
+ if (static std::set<std::string, std::less<>> platform_variables;
+ platform_variables.emplace(std::string(resource) + get_name()).second)
set_event(now, 0);
add_event(now, value);
/* Here we are making the assumption that a suitable empty region
following the rw- area is the end of the data segment. It would
be better to check with the size of the data segment. */
- auto j = i + 1;
- if (j != map.end() && j->pathname.empty() && (j->prot & PROT_RWX) == PROT_RW &&
- (char*)j->start_addr == smpi_data_exe_start + smpi_data_exe_size) {
+ if (auto j = i + 1; j != map.end() && j->pathname.empty() && (j->prot & PROT_RWX) == PROT_RW &&
+ (char*)j->start_addr == smpi_data_exe_start + smpi_data_exe_size) {
// Only count the portion of this region not present in the initial map.
auto found = std::find_if(initial_vm_map.begin(), initial_vm_map.end(), [&j](const simgrid::xbt::VmMap& m) {
return j->start_addr <= m.start_addr && m.start_addr < j->end_addr;
if(req->detached_sender_ != nullptr){
//integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
simgrid::s4u::Host* dst_host = simgrid::s4u::Actor::by_pid(req->dst_)->get_host();
- double sleeptime = simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->orecv(
- req->real_size(), req->src_host_, dst_host);
- if (sleeptime > 0.0) {
+ if (double sleeptime = simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->orecv(
+ req->real_size(), req->src_host_, dst_host);
+ sleeptime > 0.0) {
simgrid::s4u::this_actor::sleep_for(sleeptime);
XBT_DEBUG("receiving size of %zu : sleep %f ", req->real_size_, sleeptime);
}
dynar->free_f(_xbt_dynar_elm(dynar, idx));
}
- unsigned long nb_shift = dynar->used - 1 - idx;
-
- if (nb_shift) {
+ if (unsigned long nb_shift = dynar->used - 1 - idx; nb_shift > 0) {
unsigned long offset = nb_shift * dynar->elmsize;
memmove(_xbt_dynar_elm(dynar, idx), _xbt_dynar_elm(dynar, idx + 1), offset);
}