X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ce1289d4421b08ce6f69d8203784ee648671972e..e058e06362ce27135c41d3657840f9fd78667687:/src/surf/network_smpi.cpp diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index e5967be727..c0d682f238 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -1,9 +1,15 @@ -/* Copyright (c) 2013-2014. The SimGrid Team. +/* Copyright (c) 2013-2015. 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 + +#include + +#include + #include "network_smpi.hpp" #include "simgrid/sg_config.h" @@ -77,14 +83,17 @@ void surf_network_model_init_SMPI(void) if (surf_network_model) return; - surf_network_model = new NetworkSmpiModel(); + surf_network_model = new simgrid::surf::NetworkSmpiModel(); net_define_callbacks(); - xbt_dynar_push(model_list, &surf_network_model); + 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); } +namespace simgrid { +namespace surf { + NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model() { m_haveGap=true; @@ -104,12 +113,11 @@ NetworkSmpiModel::~NetworkSmpiModel(){ } } -void NetworkSmpiModel::gapAppend(double size, const NetworkLinkPtr link, NetworkActionPtr action) +void NetworkSmpiModel::gapAppend(double size, Link* link, NetworkAction *act) { const char *src = link->getName(); xbt_fifo_t fifo; - //surf_action_network_CM02_t last_action; - //double bw; + NetworkCm02Action *action= static_cast(act); if (sg_sender_gap > 0.0) { if (!gap_lookup) { @@ -141,11 +149,11 @@ void NetworkSmpiModel::gapAppend(double size, const NetworkLinkPtr link, Network } } -void NetworkSmpiModel::gapRemove(ActionPtr lmm_action) +void NetworkSmpiModel::gapRemove(Action *lmm_action) { xbt_fifo_t fifo; size_t size; - NetworkCm02ActionPtr action = static_cast(lmm_action); + NetworkCm02Action *action = static_cast(lmm_action); if (sg_sender_gap > 0.0 && action->p_senderLinkName && action->p_senderFifoItem) { @@ -209,7 +217,7 @@ double NetworkSmpiModel::latencyFactor(double size) 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)); } /************ @@ -221,3 +229,6 @@ double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double s /********** * Action * **********/ + +} +}