public class Cloud {
public static final double task_comp_size = 10;
public static final double task_comm_size = 10;
- public static final int hostNB = 500 ;
+ public static final int hostNB = 89 ;
public static void main(String[] args) throws MsgException {
Msg.init(args);
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
msg_vm_t vm0;
vm0 = MSG_vm_create_core(pm0, "VM0");
-
+ MSG_vm_start(vm0);
//MSG_process_sleep(1);
- launch_computation_worker(pm0);
+ launch_computation_worker(vm0);
while(MSG_get_clock()<100) {
if (atask != NULL)
$ $SG_TEST_EXENV two_tasks_vm$EXEEXT ${srcdir:=.}/simple_plat.xml
> [0.000000] [surf_vm_workstation/INFO] Create VM(VM0)@PM(PM0) with 0 mounted disks
-> [PM0:compute:(2) 0.000000] [msg_test/INFO] PM0:compute task 1 created 0
+> [VM0:compute:(2) 0.000000] [msg_test/INFO] VM0:compute task 1 created 0
> [PM0:master_:(1) 0.000000] [msg_test/INFO] aTask remaining duration: 1e+09
> [PM0:master_:(1) 1.000000] [msg_test/INFO] aTask remaining duration: 9e+08
> [PM0:master_:(1) 2.000000] [msg_test/INFO] aTask remaining duration: 8e+08
> [PM0:master_:(1) 7.000000] [msg_test/INFO] aTask remaining duration: 3e+08
> [PM0:master_:(1) 8.000000] [msg_test/INFO] aTask remaining duration: 2e+08
> [PM0:master_:(1) 9.000000] [msg_test/INFO] aTask remaining duration: 1e+08
-> [PM0:compute:(2) 10.000000] [msg_test/INFO] PM0:compute task 1 executed 10
+> [VM0:compute:(2) 10.000000] [msg_test/INFO] VM0:compute task 1 executed 10
> [PM0:master_:(1) 10.000000] [msg_test/INFO] aTask remaining duration: 0
-> [PM0:compute:(2) 11.000000] [msg_test/INFO] PM0:compute task 2 created 11
+> [VM0:compute:(2) 11.000000] [msg_test/INFO] VM0:compute task 2 created 11
> [PM0:master_:(1) 12.000000] [msg_test/INFO] aTask remaining duration: 9.9e+09
> [PM0:master_:(1) 13.000000] [msg_test/INFO] aTask remaining duration: 9.8e+09
> [PM0:master_:(1) 14.000000] [msg_test/INFO] aTask remaining duration: 9.7e+09
> [PM0:master_:(1) 97.000000] [msg_test/INFO] aTask remaining duration: 1.4e+09
> [PM0:master_:(1) 98.000000] [msg_test/INFO] aTask remaining duration: 1.3e+09
> [PM0:master_:(1) 99.000000] [msg_test/INFO] aTask remaining duration: 1.2e+09
-> [PM0:compute:(2) 111.000000] [msg_test/INFO] PM0:compute task 2 executed 100
+> [VM0:compute:(2) 111.000000] [msg_test/INFO] VM0:compute task 2 executed 100
> [10100.000000] [msg_test/INFO] Bye (simulation time 10100)
xbt_assert(m_core == 1, "FIXME: add power scaling code also for constraint_core[i]");
m_powerScale = value;
- lmm_update_constraint_bound(surf_cpu_model_pm->getMaxminSystem(), getConstraint(),
+ lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(),
m_core * m_powerScale *
m_powerPeak);
#ifdef HAVE_TRACING
m_powerPeak);
#endif
while ((var = lmm_get_var_from_cnst
- (surf_cpu_model_pm->getMaxminSystem(), getConstraint(), &elem))) {
+ (getModel()->getMaxminSystem(), getConstraint(), &elem))) {
CpuCas01ActionPtr action = static_cast<CpuCas01ActionPtr>(static_cast<ActionPtr>(lmm_variable_id(var)));
- lmm_update_variable_bound(surf_cpu_model_pm->getMaxminSystem(),
+ lmm_update_variable_bound(getModel()->getMaxminSystem(),
action->getVariable(),
m_powerScale * m_powerPeak);
}
setState(SURF_RESOURCE_OFF);
- while ((var = lmm_get_var_from_cnst(surf_cpu_model_pm->getMaxminSystem(), cnst, &elem))) {
+ while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), cnst, &elem))) {
ActionPtr action = static_cast<ActionPtr>(lmm_variable_id(var));
if (action->getState() == SURF_ACTION_RUNNING ||
{
XBT_IN("(%s,%g)", getName(), size);
- CpuCas01ActionPtr action = new CpuCas01Action(surf_cpu_model_pm, size, getState() != SURF_RESOURCE_ON,
+ CpuCas01ActionPtr action = new CpuCas01Action(getModel(), size, getState() != SURF_RESOURCE_ON,
m_powerScale * m_powerPeak, getConstraint());
XBT_OUT();
duration = MAX(duration, MAXMIN_PRECISION);
XBT_IN("(%s,%g)", getName(), duration);
- CpuCas01ActionPtr action = new CpuCas01Action(surf_cpu_model_pm, 1.0, getState() != SURF_RESOURCE_ON,
+ CpuCas01ActionPtr action = new CpuCas01Action(getModel(), 1.0, getState() != SURF_RESOURCE_ON,
m_powerScale * m_powerPeak, getConstraint());
action->getStateSet()->push_back(*action);
}
- lmm_update_variable_weight(surf_cpu_model_pm->getMaxminSystem(),
+ lmm_update_variable_weight(getModel()->getMaxminSystem(),
action->getVariable(), 0.0);
- if (surf_cpu_model_pm->getUpdateMechanism() == UM_LAZY) { // remove action from the heap
- action->heapRemove(surf_cpu_model_pm->getActionHeap());
+ if (getModel()->getUpdateMechanism() == UM_LAZY) { // remove action from the heap
+ action->heapRemove(getModel()->getActionHeap());
// this is necessary for a variable with weight 0 since such
// variables are ignored in lmm and we need to set its max_duration
// correctly at the next call to share_resources
- surf_cpu_model_pm->getModifiedSet()->push_front(*action);
+ getModel()->getModifiedSet()->push_front(*action);
}
XBT_OUT();
action->updateMaxDuration(delta);
- if ((action->getRemains() <= 0) &&
+ if ((action->getRemainsNoUpdate() <= 0) &&
(lmm_get_variable_weight(action->getVariable()) > 0)) {
action->finish();
action->setState(SURF_ACTION_DONE);
if (action->getMaxDuration() != NO_MAX_DURATION)
action->updateMaxDuration(delta);
- if (action->getRemains() <= 0) {
+ if (action->getRemainsNoUpdate() <= 0) {
action->finish();
action->setState(SURF_ACTION_DONE);
} else if ((action->getMaxDuration() != NO_MAX_DURATION)
if (action->getMaxDuration() != NO_MAX_DURATION)
action->updateMaxDuration(delta);
- if(action->getRemains() > 0 &&
+ if(action->getRemainsNoUpdate() > 0 &&
lmm_get_variable_weight(action->getVariable()) > 0 &&
action->p_storage->m_usedSize == action->p_storage->m_size)
{
action->finish();
action->setState(SURF_ACTION_FAILED);
- } else if ((action->getRemains() <= 0) &&
+ } else if ((action->getRemainsNoUpdate() <= 0) &&
(lmm_get_variable_weight(action->getVariable()) > 0))
{
action->finish();
value = lmm_variable_getvalue(action->getVariable());
if (value > 0) {
if (action->getRemains() > 0) {
- value = action->getRemains() / value;
+ value = action->getRemainsNoUpdate() / value;
min = now + value;
} else {
value = 0.0;
if (value > 0) {
if (action->getRemains() > 0)
- min = action->getRemains() / value;
+ min = action->getRemainsNoUpdate() / value;
else
min = 0.0;
if ((action->getMaxDuration() >= 0) && (action->getMaxDuration() < min))
value = lmm_variable_getvalue(action->getVariable());
if (value > 0) {
if (action->getRemains() > 0)
- value = action->getRemains() / value;
+ value = action->getRemainsNoUpdate() / value;
else
value = 0.0;
if (value < min) {