It was passed implicitly through the set of existing netElm and CPU.
xbt_dynar_push(all_existing_models, &model);
}
-Host *HostCLM03Model::createHost(const char *name){
- sg_host_t sg_host = sg_host_by_name(name);
+Host *HostCLM03Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu){
Host *host = new HostCLM03(surf_host_model, name, NULL,
(xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
- sg_host_edge(sg_host),
- sg_host_surfcpu(sg_host));
+ netElm, cpu);
surf_callback_emit(hostCreatedCallbacks, host);
XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, host);
public:
HostCLM03Model(): HostModel(){}
~HostCLM03Model() {}
- Host *createHost(const char *name);
+ Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu);
double shareResources(double now);
void updateActionsState(double now, double delta);
HostModel() : Model() {}
~HostModel() {}
- virtual Host *createHost(const char *name)=0;
+ virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu)=0;
void addTraces(){DIE_IMPOSSIBLE;}
virtual void adjustWeightOfDummyCpuActions();
return action;
}
-Host *HostL07Model::createHost(const char *name)
+Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu)
{
HostL07 *wk = NULL;
sg_host_t sg_host = sg_host_by_name(name);
"Host '%s' declared several times in the platform file.",
name);
- wk = new HostL07(this, name, NULL,
- sg_host_edge(sg_host),
- sg_host_surfcpu(sg_host));
+ wk = new HostL07(this, name, NULL, netElm, cpu);
+
surf_callback_emit(hostCreatedCallbacks, wk);
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, wk);
double shareResources(double now);
void updateActionsState(double now, double delta);
- Host *createHost(const char *name);
+ Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu);
Action *executeParallelTask(int host_nb,
sg_host_t *host_list,
double *flops_amount,
void sg_platf_new_host(sg_platf_host_cbarg_t host)
{
+ RoutingEdge *net = NULL;
As* current_routing = routing_get_current();
if (current_routing)
- routing_add_host(current_routing, host);
- surf_cpu_model_pm->createCpu(
+ net = routing_add_host(current_routing, host);
+
+ Cpu *cpu = surf_cpu_model_pm->createCpu(
host->id,
host->power_peak,
host->pstate,
host->initial_state,
host->state_trace,
host->properties);
- surf_host_model->createHost(host->id);
+ surf_host_model->createHost(host->id, net, cpu);
unsigned int iterator;
sg_platf_host_cb_t fun;
VMModel() :HostModel(){}
~VMModel(){};
- Host *createHost(const char *name){DIE_IMPOSSIBLE;}
+ Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu){DIE_IMPOSSIBLE;}
/**
* @brief Create a new VM