-/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2023. 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. */
#include <simgrid/s4u.hpp>
-namespace sg4 = simgrid::s4u;
-
XBT_LOG_NEW_DEFAULT_CATEGORY(disk_test, "Messages specific for this simulation");
+namespace sg4 = simgrid::s4u;
/** @brief Calculates the bandwidth for disk doing async operations */
static void estimate_bw(const sg4::Disk* disk, int n_flows, bool read)
{15, 239.}}}};
const auto& data = SSD_SPEED.at(op);
+ const auto value = data.find(n);
/* no special bandwidth for this disk sharing N flows, just returns maximal capacity */
- if (data.find(n) != data.end())
- capacity = data.at(n);
-
- return capacity;
+ return value == data.end() ? capacity : value->second;
}
/**
create_sata_disk(bob, "Griffon (SATA II)");
zone->seal();
- simgrid::s4u::Actor::create("", bob, host);
+ sg4::Actor::create("", bob, host);
e.run();
- XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::get_clock());
+ XBT_INFO("Simulated time: %g", sg4::Engine::get_clock());
return 0;
}