XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
-xbt_dynar_t smpi_bw_factor = NULL;
-xbt_dynar_t smpi_lat_factor = NULL;
+xbt_dynar_t smpi_bw_factor = nullptr;
+xbt_dynar_t smpi_lat_factor = nullptr;
typedef struct s_smpi_factor *smpi_factor_t;
typedef struct s_smpi_factor { // FIXME: s_smpi_factor_multival (defined in smpi_base) should be used instead to dedupplicate this code
double value;
} s_smpi_factor_t;
-xbt_dict_t gap_lookup = NULL;
+xbt_dict_t gap_lookup = nullptr;
static int factor_cmp(const void *pa, const void *pb)
{
#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
static xbt_dynar_t parse_factor(const char *smpi_coef_string)
{
- char *value = NULL;
+ char *value = nullptr;
unsigned int iter = 0;
s_smpi_factor_t fact;
- xbt_dynar_t smpi_factor, radical_elements, radical_elements2 = NULL;
+ xbt_dynar_t smpi_factor, radical_elements, radical_elements2 = nullptr;
- smpi_factor = xbt_dynar_new(sizeof(s_smpi_factor_t), NULL);
+ smpi_factor = xbt_dynar_new(sizeof(s_smpi_factor_t), nullptr);
radical_elements = xbt_str_split(smpi_coef_string, ";");
xbt_dynar_foreach(radical_elements, iter, value) {
if (surf_network_model)
return;
- simgrid::surf::on_link.connect(netlink_parse_init);
surf_network_model = new simgrid::surf::NetworkSmpiModel();
xbt_dynar_push(all_existing_models, &surf_network_model);
- xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6);
- xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
+ xbt_cfg_setdefault_double("network/sender-gap", 10e-6);
+ xbt_cfg_setdefault_double("network/weight-S", 8775);
}
namespace simgrid {
NetworkSmpiModel::NetworkSmpiModel()
: NetworkCm02Model() {
- m_haveGap=true;
+ haveGap_=true;
}
NetworkSmpiModel::~NetworkSmpiModel(){
if (sg_sender_gap > 0.0) {
if (!gap_lookup) {
- gap_lookup = xbt_dict_new_homogeneous(NULL);
+ gap_lookup = xbt_dict_new_homogeneous(nullptr);
}
fifo = (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup, src);
- action->m_senderGap = 0.0;
+ action->senderGap_ = 0.0;
if (fifo && xbt_fifo_size(fifo) > 0) {
/* Compute gap from last send */
/*last_action =
(surf_action_network_CM02_t)
xbt_fifo_get_item_content(xbt_fifo_get_last_item(fifo));*/
// bw = net_get_link_bandwidth(link);
- action->m_senderGap = sg_sender_gap;
+ action->senderGap_ = sg_sender_gap;
/* max(sg_sender_gap,last_action->sender.size / bw);*/
- action->m_latency += action->m_senderGap;
+ action->latency_ += action->senderGap_;
}
/* Append action as last send */
/*action->sender.link_name = link->lmm_resource.generic_resource.name;
action->sender.link_name);
if (!fifo) {
fifo = xbt_fifo_new();
- xbt_dict_set(gap_lookup, action->sender.link_name, fifo, NULL);
+ xbt_dict_set(gap_lookup, action->sender.link_name, fifo, nullptr);
}
action->sender.fifo_item = xbt_fifo_push(fifo, action);*/
- action->m_senderSize = size;
+ action->senderSize_ = size;
}
}
size_t size;
NetworkCm02Action *action = static_cast<NetworkCm02Action*>(lmm_action);
- if (sg_sender_gap > 0.0 && action->p_senderLinkName
- && action->p_senderFifoItem) {
+ if (sg_sender_gap > 0.0 && action->senderLinkName_
+ && action->senderFifoItem_) {
fifo =
(xbt_fifo_t) xbt_dict_get_or_null(gap_lookup,
- action->p_senderLinkName);
- xbt_fifo_remove_item(fifo, action->p_senderFifoItem);
+ action->senderLinkName_);
+ xbt_fifo_remove_item(fifo, action->senderFifoItem_);
size = xbt_fifo_size(fifo);
if (size == 0) {
xbt_fifo_free(fifo);
- xbt_dict_remove(gap_lookup, action->p_senderLinkName);
+ xbt_dict_remove(gap_lookup, action->senderLinkName_);
size = xbt_dict_length(gap_lookup);
if (size == 0) {
xbt_dict_free(&gap_lookup);
double NetworkSmpiModel::bandwidthFactor(double size)
{
if (!smpi_bw_factor)
- smpi_bw_factor =
- parse_factor(sg_cfg_get_string("smpi/bw_factor"));
+ smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw-factor"));
unsigned int iter = 0;
s_smpi_factor_t fact;
double NetworkSmpiModel::latencyFactor(double size)
{
if (!smpi_lat_factor)
- smpi_lat_factor =
- parse_factor(sg_cfg_get_string("smpi/lat_factor"));
+ smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
unsigned int iter = 0;
s_smpi_factor_t fact;