A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Do not trigger errors in MC_automaton_new_propositional_symbol() when MC is...
[simgrid.git]
/
src
/
surf
/
network_constant.cpp
diff --git
a/src/surf/network_constant.cpp
b/src/surf/network_constant.cpp
index
ed5663f
..
06001ba
100644
(file)
--- a/
src/surf/network_constant.cpp
+++ b/
src/surf/network_constant.cpp
@@
-1,3
+1,9
@@
+/* Copyright (c) 2013-2014. 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 "network_constant.hpp"
#include "surf/random_mgr.h"
#include "network_constant.hpp"
#include "surf/random_mgr.h"
@@
-18,7
+24,7
@@
void surf_network_model_init_Constant()
sg_platf_host_add_cb(netcste_count_hosts);
sg_platf_host_add_cb(netcste_count_hosts);
- ModelPtr model = s
tatic_cast<ModelPtr>(surf_network_model)
;
+ ModelPtr model = s
urf_network_model
;
xbt_dynar_push(model_list, &model);
}
xbt_dynar_push(model_list, &model);
}
@@
-31,12
+37,8
@@
double NetworkConstantModel::shareResources(double /*now*/)
for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
; it != itend ; ++it) {
action = static_cast<NetworkConstantActionPtr>(&*it);
for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
; it != itend ; ++it) {
action = static_cast<NetworkConstantActionPtr>(&*it);
- if (action->m_latency > 0) {
- if (min < 0)
- min = action->m_latency;
- else if (action->m_latency < min)
- min = action->m_latency;
- }
+ if (action->m_latency > 0 && (min < 0 || action->m_latency < min))
+ min = action->m_latency;
}
return min;
}
return min;
@@
-52,7
+54,7
@@
void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
action = static_cast<NetworkConstantActionPtr>(&*it);
if (action->m_latency > 0) {
if (action->m_latency > delta) {
action = static_cast<NetworkConstantActionPtr>(&*it);
if (action->m_latency > 0) {
if (action->m_latency > delta) {
- double_update(&(action->m_latency), delta);
+ double_update(&(action->m_latency), delta
, sg_surf_precision
);
} else {
action->m_latency = 0.0;
}
} else {
action->m_latency = 0.0;
}
@@
-61,7
+63,7
@@
void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
if (action->getMaxDuration() != NO_MAX_DURATION)
action->updateMaxDuration(delta);
if (action->getMaxDuration() != NO_MAX_DURATION)
action->updateMaxDuration(delta);
- if (action->getRemains() <= 0) {
+ if (action->getRemains
NoUpdate
() <= 0) {
action->finish();
action->setState(SURF_ACTION_DONE);
} else if ((action->getMaxDuration() != NO_MAX_DURATION)
action->finish();
action->setState(SURF_ACTION_DONE);
} else if ((action->getMaxDuration() != NO_MAX_DURATION)
@@
-82,6
+84,7
@@
ActionPtr NetworkConstantModel::communicate(RoutingEdgePtr src, RoutingEdgePtr d
NetworkConstantActionPtr action = new NetworkConstantAction(this, size, sg_latency_factor);
XBT_OUT();
NetworkConstantActionPtr action = new NetworkConstantAction(this, size, sg_latency_factor);
XBT_OUT();
+ surf_callback_emit(networkCommunicateCallbacks, action, src, dst, size, rate);
return action;
}
return action;
}
@@
-138,12
+141,10
@@
void NetworkConstantAction::cancel()
return;
}
return;
}
-#ifdef HAVE_TRACING
void NetworkConstantAction::setCategory(const char */*category*/)
{
//ignore completely the categories in constant model, they are not traced
}
void NetworkConstantAction::setCategory(const char */*category*/)
{
//ignore completely the categories in constant model, they are not traced
}
-#endif
void NetworkConstantAction::suspend()
{
void NetworkConstantAction::suspend()
{