/* 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 <cstdlib>
+
+#include <algorithm>
+
#include "host_clm03.hpp"
#include "cpu_cas01.hpp"
typeid(surf_network_model).name(), min_by_net,
typeid(surf_storage_model).name(), min_by_sto);
- double res = max(max(min_by_cpu, min_by_net), min_by_sto);
+ double res = std::max(std::max(min_by_cpu, min_by_net), min_by_sto);
if (min_by_cpu >= 0.0 && min_by_cpu < res)
res = min_by_cpu;
if (min_by_net >= 0.0 && min_by_net < res)
/* 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 <cstdlib>
+
+#include <algorithm>
+
#include "host_ptask_L07.hpp"
#include "cpu_interface.hpp"
if (m_rate < 0)
lmm_update_variable_bound(ptask_maxmin_system, getVariable(), lat_bound);
else
- lmm_update_variable_bound(ptask_maxmin_system, getVariable(), min(m_rate, lat_bound));
+ lmm_update_variable_bound(ptask_maxmin_system, getVariable(),
+ std::min(m_rate, lat_bound));
}
}
/* 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 <cstdlib>
+
+#include <vector>
+
#include <xbt/base.h>
#include "host_interface.hpp"
void setPriority(double priority);
double getRemains();
- vector<RoutingEdge*> * p_edgeList = new vector<RoutingEdge*>();
+ std::vector<RoutingEdge*> * p_edgeList = new std::vector<RoutingEdge*>();
double *p_computationAmount;
double *p_communicationAmount;
double m_latency;
/* 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 <algorithm>
+
#include "network_cm02.hpp"
#include "maxmin_private.hpp"
#include "simgrid/sg_config.h"
link = static_cast<NetworkCm02Link*>(_link);
double bb = bandwidthFactor(size) * link->getBandwidth();
bandwidth_bound =
- (bandwidth_bound < 0.0) ? bb : min(bandwidth_bound, bb);
+ (bandwidth_bound < 0.0) ? bb : std::min(bandwidth_bound, bb);
}
action->m_latCurrent = action->m_latency;
if (action->m_rate < 0) {
lmm_update_variable_bound(p_maxminSystem, action->getVariable(), (action->m_latCurrent > 0) ? sg_tcp_gamma / (2.0 * action->m_latCurrent) : -1.0);
} else {
- lmm_update_variable_bound(p_maxminSystem, action->getVariable(), (action->m_latCurrent > 0) ? min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)) : action->m_rate);
+ lmm_update_variable_bound(p_maxminSystem, action->getVariable(), (action->m_latCurrent > 0) ? std::min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)) : action->m_rate);
}
xbt_dynar_foreach(route, i, _link) {
lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(), sg_tcp_gamma / (2.0 * action->m_latCurrent));
else {
lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(),
- min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)));
+ std::min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)));
if (action->m_rate < sg_tcp_gamma / (2.0 * action->m_latCurrent)) {
XBT_INFO("Flow is limited BYBANDWIDTH");
/* 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 <algorithm>
+#include <utility>
+
#include "network_ib.hpp"
#include "simgrid/sg_config.h"
#include "maxmin_private.hpp"
xbt_die("could not find dst node active comms !");
// act_dst->rate=rate;
- ((NetworkIBModel*)surf_network_model)->active_comms[action]=make_pair(act_src, act_dst);
+ ((NetworkIBModel*)surf_network_model)->active_comms[action]=std::make_pair(act_src, act_dst);
//post the action in the second dist, to retrieve in the other callback
XBT_DEBUG("IB callback - action %p init", action);
my_penalty_out = num_comm_out * Bs;
}
- max_penalty_out = max(max_penalty_out,my_penalty_out);
+ max_penalty_out = std::max(max_penalty_out,my_penalty_out);
}
for (std::vector<ActiveComm*>::iterator it= root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
* Be
* (*it)->destination->ActiveCommsDown.size();//number of different nodes sending to dest
- double penalty=max(my_penalty_in,max_penalty_out);
+ double penalty = std::max(my_penalty_in,max_penalty_out);
double rate_before_update = (*it)->action->getBound();
//save initial rate of the action
/* 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 <algorithm>
+
#include "network_interface.hpp"
#include "simgrid/sg_config.h"
}
#endif
if (action->m_latency > 0) {
- minRes = (minRes < 0) ? action->m_latency : min(minRes, action->m_latency);
+ minRes = (minRes < 0) ? action->m_latency : std::min(minRes, action->m_latency);
}
}
/* 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 <cstddef>
+
+#include <algorithm>
+
+#include <xbt/log.h>
+
#include "network_smpi.hpp"
#include "simgrid/sg_config.h"
double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
{
- return rate < 0 ? bound : min(bound, rate * bandwidthFactor(size));
+ return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
}
/************
#ifdef __cplusplus
+#include <cstdint>
+
#include "ns3/core-module.h"
#include "my-point-to-point-helper.h"
#include "ns3/inet-socket-address.h"
#include "ns3/tcp-socket-factory.h"
-using namespace ns3;
-using namespace std;
-
struct MySocket{
- uint32_t bufferedBytes;
- uint32_t sentBytes;
- uint32_t remaining;
- uint32_t totalBytes;
+ std::uint32_t bufferedBytes;
+ std::uint32_t sentBytes;
+ std::uint32_t remaining;
+ std::uint32_t totalBytes;
char finished;
void* action;
};
public:
NS3Sim();
~NS3Sim();
- void create_flow_NS3(Ptr<Node> src,
- Ptr<Node> dst,
- uint16_t port_number,
+ void create_flow_NS3(ns3::Ptr<ns3::Node> src,
+ ns3::Ptr<ns3::Node> dst,
+ std::uint16_t port_number,
double start,
const char *addr,
- uint32_t TotalBytes,
+ std::uint32_t TotalBytes,
void * action);
void simulator_start(double min);
void* get_action_from_socket(void *socket);
extern XBT_PRIVATE tmgr_history_t history;
#define NO_MAX_DURATION -1.0
-using namespace std;
-
/*********
* Utils *
*********/
+#include <cstdlib>
+
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
+#include <iostream>
+
#include "surf_routing_cluster_fat_tree.hpp"
#include "xbt/lib.h"
void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t
cluster) {
- std::vector<string> parameters;
- std::vector<string> tmp;
+ std::vector<std::string> parameters;
+ std::vector<std::string> tmp;
boost::split(parameters, cluster->topo_parameters, boost::is_any_of(";"));
}
-void AsClusterFatTree::generateDotFile(const string& filename) const {
- ofstream file;
+void AsClusterFatTree::generateDotFile(const std::string& filename) const {
+ std::ofstream file;
/* Maybe should we get directly a char*, as open takes strings only beginning
* with C++11...
*/
- file.open(filename.c_str(), ios::out | ios::trunc);
+ file.open(filename.c_str(), std::ios::out | std::ios::trunc);
if(file.is_open()) {
file << "graph AsClusterFatTree {\n";
#ifndef SURF_ROUTING_CLUSTER_FAT_TREE_HPP_
#define SURF_ROUTING_CLUSTER_FAT_TREE_HPP_
+#include <string>
+#include <map>
+#include <vector>
+
#include <xbt/base.h>
#include "surf_routing_cluster.hpp"
/** \brief Add a processing node.
*/
void addProcessingNode(int id);
- void generateDotFile(const string& filename = "fatTree.dot") const;
+ void generateDotFile(const std::string& filename = "fatTree.dot") const;
private:
/* 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 <cstdlib>
+
+#include <algorithm>
+
+#include <xbt/dict.h>
+#include <xbt/log.h>
+#include <xbt/sysdep.h>
+#include <xbt/dynar.h>
+#include <xbt/graph.h>
+
#include "simgrid/platf_interface.h" // platform creation API internal interface
#include "surf_routing_generic.hpp"
#include "network_interface.hpp"
-#include "xbt/graph.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
int max_index_src = path_src->used - 1;
int max_index_dst = path_dst->used - 1;
- int max_index = max(max_index_src, max_index_dst);
+ int max_index = std::max(max_index_src, max_index_dst);
int i, max;
for (max = 0; max <= max_index; max++) {
/* 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 <algorithm>
+
#include "cpu_cas01.hpp"
#include "vm_hl13.hpp"
typeid(surf_network_model).name(), min_by_net,
typeid(surf_storage_model).name(), min_by_sto);
- double ret = max(max(min_by_cpu, min_by_net), min_by_sto);
+ double ret = std::max(std::max(min_by_cpu, min_by_net), min_by_sto);
if (min_by_cpu >= 0.0 && min_by_cpu < ret)
ret = min_by_cpu;
if (min_by_net >= 0.0 && min_by_net < ret)