class CollCommParser : public ActionArgParser {
public:
double size;
- double comm_size;
double comp_size;
int send_size;
int recv_size;
+ unsigned comm_size; // size of communicator
int root = 0;
MPI_Datatype datatype1 = MPI_DEFAULT_TYPE;
MPI_Datatype datatype2 = MPI_DEFAULT_TYPE;
action->get_variable()->get_value(), wifi_link->get_host_rate(&action->get_src()),
wifi_link->get_host_rate(&action->get_dst()));
- if(action->get_variable()->get_value()) {
+ if (action->get_variable()->get_value() != 0.0) {
auto it = flowTmp.find(action);
// if the flow has not been registered, initialize it: 0 bytes sent, and not updated since its creation timestamp
* - if idle i.e. get_usage = 0, update P_{stat}
* P_{tot} = P_{dyn}+P_{stat}
*/
- if(link_->get_usage()){
+ if (link_->get_usage() != 0.0) {
eDyn_ += /*duration * */ durUsage * ((wifi_link->get_host_count() * pRx_) + pTx_);
eStat_ += (duration - durUsage) * pIdle_ * (wifi_link->get_host_count() + 1);
XBT_DEBUG("eDyn += %f * ((%d * %f) + %f) | eDyn = %f (durusage =%f)", durUsage, wifi_link->get_host_count(), pRx_,
pTx_, eDyn_, durUsage);
dur_TxRx_ += duration;
- }else{
+ } else {
dur_idle_ += duration;
eStat_ += (duration - (duration * control_duration_)) * pIdle_ * (wifi_link->get_host_count() + 1);
}
#include <simgrid/smpi/smpi_replay.hpp>
#include <src/smpi/include/private.hpp>
+#include <cmath>
+#include <limits>
#include <memory>
#include <numeric>
+#include <tuple>
#include <unordered_map>
#include <vector>
-#include <tuple>
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_replay, smpi, "Trace Replay with SMPI");
// From https://stackoverflow.com/questions/7110301/generic-hash-for-tuples-in-unordered-map-unordered-set
void ReduceArgParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
{
CHECK_ACTION_PARAMS(action, 2, 2)
- comm_size = parse_double(action[2]);
+ double arg2 = trunc(parse_double(action[2]));
+ xbt_assert(0.0 <= arg2 && arg2 <= static_cast<double>(std::numeric_limits<unsigned>::max()));
+ comm_size = static_cast<unsigned>(arg2);
comp_size = parse_double(action[3]);
root = (action.size() > 4) ? std::stoi(action[4]) : 0;
if (action.size() > 5)
void AllReduceArgParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
{
CHECK_ACTION_PARAMS(action, 2, 1)
- comm_size = parse_double(action[2]);
+ double arg2 = trunc(parse_double(action[2]));
+ xbt_assert(0.0 <= arg2 && arg2 <= static_cast<double>(std::numeric_limits<unsigned>::max()));
+ comm_size = static_cast<unsigned>(arg2);
comp_size = parse_double(action[3]);
if (action.size() > 4)
datatype1 = simgrid::smpi::Datatype::decode(action[4]);
void NetworkIBModel::compute_IB_factors(IBNode* root) const
{
- double num_comm_out = root->active_comms_up_.size();
+ size_t num_comm_out = root->active_comms_up_.size();
double max_penalty_out = 0.0;
// first, compute all outbound penalties to get their max
for (ActiveComm const* comm : root->active_comms_up_) {