X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c39f643b5bfb0e99887c209a94e49f841a2daae4..413534bc9aac9b6a61840de0a20f933534552fd7:/src/surf/workstation_ptask_L07.hpp diff --git a/src/surf/workstation_ptask_L07.hpp b/src/surf/workstation_ptask_L07.hpp index 0dcf31e43c..364ed78a54 100644 --- a/src/surf/workstation_ptask_L07.hpp +++ b/src/surf/workstation_ptask_L07.hpp @@ -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 "workstation_interface.hpp" #ifndef WORKSTATION_L07_HPP_ @@ -42,12 +48,7 @@ public: double shareResources(double now); void updateActionsState(double now, double delta); - ResourcePtr createResource(const char *name, double power_scale, - double power_initial, - tmgr_trace_t power_trace, - e_surf_resource_state_t state_initial, - tmgr_trace_t state_trace, - xbt_dict_t cpu_properties); + WorkstationPtr createWorkstation(const char *name); ActionPtr executeParallelTask(int workstation_nb, void **workstation_list, double *computation_amount, @@ -63,12 +64,12 @@ class CpuL07Model : public CpuModel { public: CpuL07Model() : CpuModel("cpuL07") {}; ~CpuL07Model() {surf_cpu_model_pm = NULL;}; - ResourcePtr createResource(const char *name, double power_scale, - double power_initial, - tmgr_trace_t power_trace, - e_surf_resource_state_t state_initial, - tmgr_trace_t state_trace, - xbt_dict_t cpu_properties); + CpuPtr createCpu(const char *name, xbt_dynar_t powerPeak, + int pstate, double power_scale, + tmgr_trace_t power_trace, int core, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + xbt_dict_t cpu_properties); void addTraces() {DIE_IMPOSSIBLE;}; WorkstationL07ModelPtr p_workstationModel; @@ -78,7 +79,7 @@ class NetworkL07Model : public NetworkModel { public: NetworkL07Model() : NetworkModel() {}; ~NetworkL07Model() {surf_network_model = NULL;}; - NetworkLinkPtr createResource(const char *name, + NetworkLinkPtr createNetworkLink(const char *name, double bw_initial, tmgr_trace_t bw_trace, double lat_initial, @@ -114,21 +115,16 @@ public: }; class CpuL07 : public Cpu { -public: - s_surf_metric_t p_power; + friend void WorkstationL07Model::addTraces(); tmgr_trace_event_t p_stateEvent; - + tmgr_trace_event_t p_powerEvent; public: CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t properties, - double power_scale, - double power_initial, tmgr_trace_t power_trace, - e_surf_resource_state_t state_initial, tmgr_trace_t state_trace); + double power_scale, double power_initial, tmgr_trace_t power_trace, + int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace); bool isUsed(); //bool isUsed() {DIE_IMPOSSIBLE;}; void updateState(tmgr_trace_event_t event_type, double value, double date); - e_surf_resource_state_t getState(); - double getSpeed(double load); - double getAvailableSpeed(); CpuActionPtr execute(double /*size*/) {DIE_IMPOSSIBLE;}; CpuActionPtr sleep(double /*duration*/) {DIE_IMPOSSIBLE;}; @@ -137,8 +133,6 @@ public: int getNbPstates() {THROW_UNIMPLEMENTED;}; void setPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; double getConsumedEnergy() {THROW_UNIMPLEMENTED;}; - - double m_powerCurrent; }; class LinkL07 : public NetworkLink { @@ -159,6 +153,8 @@ public: double getBandwidth(); double getLatency(); bool isShared(); + void updateBandwidth(double value, double date=surf_get_clock()); + void updateLatency(double value, double date=surf_get_clock()); double m_latCurrent; tmgr_trace_event_t p_latEvent;