Msg.info("Initialize Cpu Constant Model");
}
- public Cpu createCpu(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace, XbtDict cpu_properties) {
+ public Cpu createCpu(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace) {
Msg.info("New Cpu("+name+", "+power_peak[pstate]+", "+power_scale+")");
- CpuConstant res = new CpuConstant(this, name, cpu_properties, core, power_peak[pstate], power_scale);
+ CpuConstant res = new CpuConstant(this, name, core, power_peak[pstate], power_scale);
cpus.add(res);
return res;
}
public class CpuConstant extends Cpu {
private List<CpuConstantAction> actions = new ArrayList<CpuConstantAction>();
- public CpuConstant(CpuConstantModel model, String name, XbtDict props,
+ public CpuConstant(CpuConstantModel model, String name,
int core, double powerPeak, double powerScale) {
- super(model, name, props, core, powerPeak, powerScale);
+ super(model, name, core, powerPeak, powerScale);
}
public void remove(CpuConstantAction action){
SurfJNI.Cpu_change_ownership(this, swigCPtr, true);
}
- public Cpu(Model model, String name, XbtDict props, LmmConstraint constraint, int core, double powerPeak, double powerScale) {
- this(SurfJNI.new_Cpu__SWIG_0(Model.getCPtr(model), model, name, XbtDict.getCPtr(props), props, LmmConstraint.getCPtr(constraint), constraint, core, powerPeak, powerScale), true);
+ public Cpu(Model model, String name, LmmConstraint constraint, int core, double powerPeak, double powerScale) {
+ this(SurfJNI.new_Cpu__SWIG_0(Model.getCPtr(model), model, name, LmmConstraint.getCPtr(constraint), constraint, core, powerPeak, powerScale), true);
SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true);
}
- public Cpu(Model model, String name, XbtDict props, int core, double powerPeak, double powerScale) {
- this(SurfJNI.new_Cpu__SWIG_1(Model.getCPtr(model), model, name, XbtDict.getCPtr(props), props, core, powerPeak, powerScale), true);
+ public Cpu(Model model, String name, int core, double powerPeak, double powerScale) {
+ this(SurfJNI.new_Cpu__SWIG_1(Model.getCPtr(model), model, name, core, powerPeak, powerScale), true);
SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true);
}
SurfJNI.CpuModel_director_connect(this, swigCPtr, swigCMemOwn, true);
}
- public Cpu createCpu(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace, XbtDict cpu_properties) {
- long cPtr = SurfJNI.CpuModel_createCpu(swigCPtr, this, name, power_peak, pstate, power_scale, TmgrTrace.getCPtr(power_trace), power_trace, core, state_initial.swigValue(), TmgrTrace.getCPtr(state_trace), state_trace, XbtDict.getCPtr(cpu_properties), cpu_properties);
+ public Cpu createCpu(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace) {
+ long cPtr = SurfJNI.CpuModel_createCpu(swigCPtr, this, name, power_peak, pstate, power_scale, TmgrTrace.getCPtr(power_trace), power_trace, core, state_initial.swigValue(), TmgrTrace.getCPtr(state_trace), state_trace);
return (cPtr == 0) ? null : new Cpu(cPtr, false);
}
SurfJNI.Link_updateLatency__SWIG_1(swigCPtr, this, value);
}
+ public XbtDict getProperties() {
+ long cPtr = SurfJNI.Link_getProperties(swigCPtr, this);
+ return (cPtr == 0) ? null : new XbtDict(cPtr, false);
+ }
+
}
return (cPtr == 0) ? null : new LmmConstraint(cPtr, false);
}
- public XbtDict getProperties() {
- long cPtr = SurfJNI.Resource_getProperties(swigCPtr, this);
- return (cPtr == 0) ? null : new XbtDict(cPtr, false);
- }
-
public void updateState(TmgrTraceEvent event_type, double value, double date) {
SurfJNI.Resource_updateState(swigCPtr, this, TmgrTraceEvent.getCPtr(event_type), event_type, value, date);
}
public final static native void delete_Model(long jarg1);
public final static native long new_CpuModel();
public final static native void delete_CpuModel(long jarg1);
- public final static native long CpuModel_createCpu(long jarg1, CpuModel jarg1_, String jarg2, double[] jarg3, int jarg4, double jarg5, long jarg6, TmgrTrace jarg6_, int jarg7, int jarg8, long jarg9, TmgrTrace jarg9_, long jarg10, XbtDict jarg10_);
+ public final static native long CpuModel_createCpu(long jarg1, CpuModel jarg1_, String jarg2, double[] jarg3, int jarg4, double jarg5, long jarg6, TmgrTrace jarg6_, int jarg7, int jarg8, long jarg9, TmgrTrace jarg9_);
public final static native void CpuModel_director_connect(CpuModel obj, long cptr, boolean mem_own, boolean weak_global);
public final static native void CpuModel_change_ownership(CpuModel obj, long cptr, boolean take_or_release);
public final static native String Resource_getName(long jarg1, Resource jarg1_);
public final static native long Resource_getModel(long jarg1, Resource jarg1_);
public final static native int Resource_getState(long jarg1, Resource jarg1_);
public final static native long Resource_getConstraint(long jarg1, Resource jarg1_);
- public final static native long Resource_getProperties(long jarg1, Resource jarg1_);
public final static native void Resource_updateState(long jarg1, Resource jarg1_, long jarg2, TmgrTraceEvent jarg2_, double jarg3, double jarg4);
public final static native void delete_Resource(long jarg1);
- public final static native long new_Cpu__SWIG_0(long jarg1, Model jarg1_, String jarg2, long jarg3, XbtDict jarg3_, long jarg4, LmmConstraint jarg4_, int jarg5, double jarg6, double jarg7);
- public final static native long new_Cpu__SWIG_1(long jarg1, Model jarg1_, String jarg2, long jarg3, XbtDict jarg3_, int jarg4, double jarg5, double jarg6);
+ public final static native long new_Cpu__SWIG_0(long jarg1, Model jarg1_, String jarg2, long jarg3, LmmConstraint jarg3_, int jarg4, double jarg5, double jarg6);
+ public final static native long new_Cpu__SWIG_1(long jarg1, Model jarg1_, String jarg2, int jarg3, double jarg4, double jarg5);
public final static native void delete_Cpu(long jarg1);
public final static native double Cpu_getCurrentPowerPeak(long jarg1, Cpu jarg1_);
public final static native double Cpu_getCurrentPowerPeakSwigExplicitCpu(long jarg1, Cpu jarg1_);
public final static native double Link_getLatency(long jarg1, Link jarg1_);
public final static native void Link_updateLatency__SWIG_0(long jarg1, Link jarg1_, double jarg2, double jarg3);
public final static native void Link_updateLatency__SWIG_1(long jarg1, Link jarg1_, double jarg2);
+ public final static native long Link_getProperties(long jarg1, Link jarg1_);
public final static native long new_Action(long jarg1, Model jarg1_, double jarg2, boolean jarg3);
public final static native void delete_Action(long jarg1);
public final static native long Action_getModel(long jarg1, Action jarg1_);
public static void SwigDirector_CpuModel_addTraces(CpuModel self) {
self.addTraces();
}
- public static long SwigDirector_CpuModel_createCpu(CpuModel self, String name, double[] power_peak, int pstate, double power_scale, long power_trace, int core, int state_initial, long state_trace, long cpu_properties) {
- return Cpu.getCPtr(self.createCpu(name, power_peak, pstate, power_scale, (power_trace == 0) ? null : new TmgrTrace(power_trace, false), core, ResourceState.swigToEnum(state_initial), (state_trace == 0) ? null : new TmgrTrace(state_trace, false), (cpu_properties == 0) ? null : new XbtDict(cpu_properties, false)));
+ public static long SwigDirector_CpuModel_createCpu(CpuModel self, String name, double[] power_peak, int pstate, double power_scale, long power_trace, int core, int state_initial, long state_trace) {
+ return Cpu.getCPtr(self.createCpu(name, power_peak, pstate, power_scale, (power_trace == 0) ? null : new TmgrTrace(power_trace, false), core, ResourceState.swigToEnum(state_initial), (state_trace == 0) ? null : new TmgrTrace(state_trace, false)));
}
public static boolean SwigDirector_Cpu_isUsed(Cpu self) {
return self.isUsed();
}
-simgrid::surf::Cpu *SwigDirector_CpuModel::createCpu(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace, s_xbt_dict *cpu_properties) {
+simgrid::surf::Cpu *SwigDirector_CpuModel::createCpu(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace) {
simgrid::surf::Cpu *c_result = 0 ;
jlong jresult = 0 ;
JNIEnvWrapper swigjnienv(this) ;
jint jcore ;
jint jstate_initial ;
jlong jstate_trace = 0 ;
- jlong jcpu_properties = 0 ;
if (!swig_override[8]) {
SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::createCpu.");
jcore = (jint) core;
jstate_initial = (jint) state_initial;
*((tmgr_trace **)&jstate_trace) = (tmgr_trace *) state_trace;
- *((s_xbt_dict **)&jcpu_properties) = (s_xbt_dict *) cpu_properties;
- jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[17], swigjobj, jname, jpower_peak, jpstate, jpower_scale, jpower_trace, jcore, jstate_initial, jstate_trace, jcpu_properties);
+ jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[17], swigjobj, jname, jpower_peak, jpstate, jpower_scale, jpower_trace, jcore, jstate_initial, jstate_trace);
if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
c_result = *(simgrid::surf::Cpu **)&jresult;
} else {
"addTraces", "()V", NULL
},
{
- "createCpu", "(Ljava/lang/String;[DIDLorg/simgrid/surf/TmgrTrace;ILorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/TmgrTrace;Lorg/simgrid/surf/XbtDict;)Lorg/simgrid/surf/Cpu;", NULL
+ "createCpu", "(Ljava/lang/String;[DIDLorg/simgrid/surf/TmgrTrace;ILorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/TmgrTrace;)Lorg/simgrid/surf/Cpu;", NULL
}
};
}
-SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, s_xbt_dict *props, lmm_constraint *constraint, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, props, constraint, core, powerPeak, powerScale), Swig::Director(jenv) {
+SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, lmm_constraint *constraint, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, constraint, core, powerPeak, powerScale), Swig::Director(jenv) {
}
-SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, s_xbt_dict *props, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, props, core, powerPeak, powerScale), Swig::Director(jenv) {
+SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, int core, double powerPeak, double powerScale) : simgrid::surf::Cpu(model, name, core, powerPeak, powerScale), Swig::Director(jenv) {
}
bool SwigDirector_Cpu::isUsed() {
}
-SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1createCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jdoubleArray jarg3, jint jarg4, jdouble jarg5, jlong jarg6, jobject jarg6_, jint jarg7, jint jarg8, jlong jarg9, jobject jarg9_, jlong jarg10, jobject jarg10_) {
+SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1createCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jdoubleArray jarg3, jint jarg4, jdouble jarg5, jlong jarg6, jobject jarg6_, jint jarg7, jint jarg8, jlong jarg9, jobject jarg9_) {
jlong jresult = 0 ;
simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
char *arg2 = (char *) 0 ;
int arg7 ;
e_surf_resource_state_t arg8 ;
tmgr_trace *arg9 = (tmgr_trace *) 0 ;
- s_xbt_dict *arg10 = (s_xbt_dict *) 0 ;
DoubleDynar *argp3 ;
simgrid::surf::Cpu *result = 0 ;
(void)jarg1_;
(void)jarg6_;
(void)jarg9_;
- (void)jarg10_;
arg1 = *(simgrid::surf::CpuModel **)&jarg1;
arg2 = 0;
if (jarg2) {
arg7 = (int)jarg7;
arg8 = (e_surf_resource_state_t)jarg8;
arg9 = *(tmgr_trace **)&jarg9;
- arg10 = *(s_xbt_dict **)&jarg10;
- result = (simgrid::surf::Cpu *)(arg1)->createCpu((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+ result = (simgrid::surf::Cpu *)(arg1)->createCpu((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
*(simgrid::surf::Cpu **)&jresult = result;
{
}
-SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getProperties(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
- jlong jresult = 0 ;
- simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
- s_xbt_dict *result = 0 ;
-
- (void)jenv;
- (void)jcls;
- (void)jarg1_;
- arg1 = *(simgrid::surf::Resource **)&jarg1;
- result = (s_xbt_dict *)(arg1)->getProperties();
- *(s_xbt_dict **)&jresult = result;
- return jresult;
-}
-
-
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1updateState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jdouble jarg3, jdouble jarg4) {
simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
tmgr_trace_event *arg2 = (tmgr_trace_event *) 0 ;
}
-SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jint jarg5, jdouble jarg6, jdouble jarg7) {
+SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jint jarg4, jdouble jarg5, jdouble jarg6) {
jlong jresult = 0 ;
simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
char *arg2 = (char *) 0 ;
- s_xbt_dict *arg3 = (s_xbt_dict *) 0 ;
- lmm_constraint *arg4 = (lmm_constraint *) 0 ;
- int arg5 ;
+ lmm_constraint *arg3 = (lmm_constraint *) 0 ;
+ int arg4 ;
+ double arg5 ;
double arg6 ;
- double arg7 ;
simgrid::surf::Cpu *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg3_;
- (void)jarg4_;
arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return 0;
}
- arg3 = *(s_xbt_dict **)&jarg3;
- arg4 = *(lmm_constraint **)&jarg4;
- arg5 = (int)jarg5;
+ arg3 = *(lmm_constraint **)&jarg3;
+ arg4 = (int)jarg4;
+ arg5 = (double)jarg5;
arg6 = (double)jarg6;
- arg7 = (double)jarg7;
- result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
+ result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
*(simgrid::surf::Cpu **)&jresult = result;
{
}
-SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jint jarg4, jdouble jarg5, jdouble jarg6) {
+SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jdouble jarg4, jdouble jarg5) {
jlong jresult = 0 ;
simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
char *arg2 = (char *) 0 ;
- s_xbt_dict *arg3 = (s_xbt_dict *) 0 ;
- int arg4 ;
+ int arg3 ;
+ double arg4 ;
double arg5 ;
- double arg6 ;
simgrid::surf::Cpu *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- (void)jarg3_;
arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return 0;
}
- arg3 = *(s_xbt_dict **)&jarg3;
- arg4 = (int)jarg4;
+ arg3 = (int)jarg3;
+ arg4 = (double)jarg4;
arg5 = (double)jarg5;
- arg6 = (double)jarg6;
- result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
+ result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5);
*(simgrid::surf::Cpu **)&jresult = result;
{
}
+SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getProperties(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
+ s_xbt_dict *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
+ result = (s_xbt_dict *)(arg1)->getProperties();
+ *(s_xbt_dict **)&jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) {
jlong jresult = 0 ;
simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
"SwigDirector_CpuModel_addTraces", "(Lorg/simgrid/surf/CpuModel;)V"
},
{
- "SwigDirector_CpuModel_createCpu", "(Lorg/simgrid/surf/CpuModel;Ljava/lang/String;[DIDJIIJJ)J"
+ "SwigDirector_CpuModel_createCpu", "(Lorg/simgrid/surf/CpuModel;Ljava/lang/String;[DIDJIIJ)J"
},
{
"SwigDirector_Cpu_isUsed", "(Lorg/simgrid/surf/Cpu;)Z"
virtual simgrid::surf::ActionList *getRunningActionSet();
virtual void addTraces();
virtual ~SwigDirector_CpuModel();
- virtual simgrid::surf::Cpu *createCpu(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace, s_xbt_dict *cpu_properties);
+ virtual simgrid::surf::Cpu *createCpu(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace);
public:
bool swig_overrides(int n) {
return (n < 9 ? swig_override[n] : false);
public:
void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global);
- SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, s_xbt_dict *props, lmm_constraint *constraint, int core, double powerPeak, double powerScale);
- SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, s_xbt_dict *props, int core, double powerPeak, double powerScale);
+ SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, lmm_constraint *constraint, int core, double powerPeak, double powerScale);
+ SwigDirector_Cpu(JNIEnv *jenv, simgrid::surf::Model *model, char const *name, int core, double powerPeak, double powerScale);
virtual bool isUsed();
virtual e_surf_resource_state_t getState();
virtual void updateState(tmgr_trace_event *event_type, double value, double date);
int pstate, double power_scale,
tmgr_trace *power_trace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace *state_trace,
- s_xbt_dict *cpu_properties)=0;
+ tmgr_trace *state_trace)=0;
};
class Resource {
virtual e_surf_resource_state_t getState();
lmm_constraint *getConstraint();
- s_xbt_dict *getProperties();
virtual void updateState(tmgr_trace_event *event_type, double value, double date)=0;
};
%feature("director") Cpu;
class Cpu : public Resource {
public:
- Cpu(simgrid::surf::Model *model, const char *name, s_xbt_dict *props,
+ Cpu(simgrid::surf::Model *model, const char *name,
lmm_constraint *constraint, int core, double powerPeak, double powerScale);
- Cpu(simgrid::surf::Model *model, const char *name, s_xbt_dict *props,
+ Cpu(simgrid::surf::Model *model, const char *name,
int core, double powerPeak, double powerScale);
virtual ~Cpu();
virtual double getCurrentPowerPeak();
void updateBandwidth(double value, double date=surf_get_clock());
double getLatency();
void updateLatency(double value, double date=surf_get_clock());
+ s_xbt_dict *getProperties();
};
%nodefaultctor Action;
return surf_resource_name((surf_cpp_resource_t)cpu);
}
-/** @brief Get the properties of a surf resource (cpu, host, network, …) */
-XBT_PUBLIC(xbt_dict_t) surf_resource_get_properties(surf_cpp_resource_t resource);
-static XBT_INLINE xbt_dict_t surf_host_get_properties(surf_host_t host) {
- return surf_resource_get_properties((surf_cpp_resource_t)host);
-}
+/** @brief Get the properties of an host */
+XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host);
/** @brief Get the state of a surf resource (cpu, host, network, …) */
*/
XBT_PUBLIC(sg_size_t) surf_storage_get_used_size(surf_resource_t resource);
+/** @brief return the properties set associated to that storage */
+XBT_PUBLIC(xbt_dict_t) surf_storage_get_properties(surf_resource_t resource);
/**
* @brief Get the data associated to the action
*/
xbt_dict_t SD_workstation_get_properties(SD_workstation_t workstation)
{
- return surf_host_get_properties(surf_host_resource_priv(workstation));
+ return sg_host_get_properties(workstation);
}
}
xbt_dict_t SIMIX_host_get_properties(sg_host_t host){
- return surf_host_get_properties(surf_host_resource_priv(host));
+ return sg_host_get_properties(host);
}
}
xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage){
- xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
- return (xbt_dict_t) surf_resource_get_properties((surf_cpp_resource_t)
- surf_storage_resource_priv(storage));
+ return surf_storage_get_properties(storage);
}
const char* SIMIX_storage_get_name(smx_storage_t storage){
int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace,
- xbt_dict_t cpu_properties)
+ tmgr_trace_t state_trace)
{
xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0,
"Speed has to be >0.0. Did you forget to specify the mandatory power attribute?");
xbt_assert(core > 0, "Invalid number of cores %d. Must be larger than 0", core);
- Cpu *cpu = new CpuCas01(this, name, speedPeak, pstate, speedScale, speedTrace, core, state_initial, state_trace, cpu_properties);
+ Cpu *cpu = new CpuCas01(this, name, speedPeak, pstate, speedScale, speedTrace, core, state_initial, state_trace);
return cpu;
}
************/
CpuCas01::CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
- e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
- xbt_dict_t properties)
-: Cpu(model, name, properties,
+ e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace)
+: Cpu(model, name,
lmm_constraint_new(model->getMaxminSystem(), this, core * speedScale * xbt_dynar_get_as(speedPeak, pstate, double)),
core, xbt_dynar_get_as(speedPeak, pstate, double), speedScale,
stateInitial) {
double speedScale,
tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace,
- xbt_dict_t cpu_properties);
+ tmgr_trace_t state_trace);
double shareResourcesFull(double now);
void addTraces();
ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
public:
CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
- e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
- xbt_dict_t properties) ;
+ e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace) ;
~CpuCas01();
void updateState(tmgr_trace_event_t event_type, double value, double date);
CpuAction *execute(double size);
}
-Cpu::Cpu(Model *model, const char *name, xbt_dict_t props,
+Cpu::Cpu(Model *model, const char *name,
int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial)
- : Resource(model, name, props, stateInitial)
+ : Resource(model, name, stateInitial)
, m_core(core)
, m_speedPeak(speedPeak)
, m_speedScale(speedScale)
}
-Cpu::Cpu(Model *model, const char *name, xbt_dict_t props,
+Cpu::Cpu(Model *model, const char *name,
lmm_constraint_t constraint, int core, double speedPeak,
double speedScale, e_surf_resource_state_t stateInitial)
- : Resource(model, name, props, constraint, stateInitial)
+ : Resource(model, name, constraint, stateInitial)
, m_core(core)
, m_speedPeak(speedPeak)
, m_speedScale(speedScale)
}
}
-Cpu::Cpu(Model *model, const char *name, xbt_dict_t props,
+Cpu::Cpu(Model *model, const char *name,
lmm_constraint_t constraint, int core, double speedPeak, double speedScale)
-: Cpu(model, name, props, constraint, core, speedPeak, speedScale, SURF_RESOURCE_ON)
+: Cpu(model, name, constraint, core, speedPeak, speedScale, SURF_RESOURCE_ON)
{}
-Cpu::Cpu(Model *model, const char *name, xbt_dict_t props,
+Cpu::Cpu(Model *model, const char *name,
int core, double speedPeak, double speedScale)
-: Cpu(model, name, props, core, speedPeak, speedScale, SURF_RESOURCE_ON)
+: Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
{}
Cpu::~Cpu(){
* @param core The number of core of this Cpu
* @param state_initial [TODO]
* @param state_trace [TODO]
- * @param cpu_properties Dictionary of properties associated to this Cpu
*/
virtual Cpu *createCpu(const char *name, xbt_dynar_t speedPeak,
int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace,
- xbt_dict_t cpu_properties)=0;
+ tmgr_trace_t state_trace)=0;
void updateActionsStateLazy(double now, double delta);
void updateActionsStateFull(double now, double delta);
*
* @param model The CpuModel associated to this Cpu
* @param name The name of the Cpu
- * @param props Dictionary of properties associated to this Cpu
* @param constraint The lmm constraint associated to this Cpu if it is part of a LMM component
* @param core The number of core of this Cpu
* @param speedPeak The speed peak of this Cpu in flops (max speed)
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
- Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name,
lmm_constraint_t constraint, int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial);
*
* @param model The CpuModel associated to this Cpu
* @param name The name of the Cpu
- * @param props Dictionary of properties associated to this Cpu
* @param core The number of core of this Cpu
* @param speedPeak The speed peak of this Cpu in flops (max speed)
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
- Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name,
int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial);
- Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name,
lmm_constraint_t constraint, int core, double speedPeak, double speedScale);
- Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name,
int core, double speedPeak, double speedScale);
~Cpu();
tmgr_trace_t speedTrace,
int core,
e_surf_resource_state_t stateInitial,
- tmgr_trace_t stateTrace,
- xbt_dict_t cpuProperties)
+ tmgr_trace_t stateTrace)
{
xbt_assert(core==1,"Multi-core not handled with this model yet");
xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0,
"Speed has to be >0.0. Did you forget to specify the mandatory speed attribute?");
CpuTi *cpu = new CpuTi(this, name, speedPeak, pstate, speedScale, speedTrace,
- core, stateInitial, stateTrace, cpuProperties);
+ core, stateInitial, stateTrace);
return cpu;
}
************/
CpuTi::CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
- e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
- xbt_dict_t properties)
- : Cpu(model, name, properties, core, 0, speedScale, stateInitial)
+ e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace)
+ : Cpu(model, name, core, 0, speedScale, stateInitial)
{
p_speedEvent = NULL;
m_speedScale = speedScale;
CpuTi() {};
CpuTi(CpuTiModel *model, const char *name, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
- e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
- xbt_dict_t properties) ;
+ e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace) ;
~CpuTi();
void updateState(tmgr_trace_event_t event_type, double value, double date);
int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace,
- xbt_dict_t cpu_properties);
+ tmgr_trace_t state_trace);
double shareResources(double now);
void updateActionsState(double now, double delta);
void addTraces();
namespace simgrid {
namespace surf {
-Host *HostCLM03Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu){
- Host *host = new simgrid::surf::HostCLM03(surf_host_model, name, NULL,
+Host *HostCLM03Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props){
+ Host *host = new simgrid::surf::HostCLM03(surf_host_model, name, props,
(xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
netElm, cpu);
XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
public:
HostCLM03Model(): HostModel(){}
~HostCLM03Model() {}
- Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu);
- double shareResources(double now);
+ Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override;
+ double shareResources(double now) override;
void updateActionsState(double now, double delta);
Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu)
- : Resource(model, name, props)
- , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
+ : Resource(model, name)
+ , p_storage(storage), p_netElm(netElm), p_cpu(cpu), p_properties(props)
{
p_params.ramsize = 0;
}
Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu)
- : Resource(model, name, props, constraint)
- , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
+ : Resource(model, name, constraint)
+ , p_storage(storage), p_netElm(netElm), p_cpu(cpu), p_properties(props)
{
p_params.ramsize = 0;
}
Host::~Host(){
surf_callback_emit(hostDestructedCallbacks, this);
+ xbt_dict_free(&p_properties);
}
void Host::attach(simgrid::Host* host)
xbt_dict_t Host::getProperties()
{
- return p_cpu->getProperties();
+ if (p_properties==NULL)
+ p_properties = xbt_dict_new();
+ return p_properties;
}
simgrid::surf::Storage *Host::findStorageOnMountList(const char* mount)
HostModel() : Model() {}
~HostModel() {}
- virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu)=0;
+ virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu, xbt_dict_t props)=0;
void addTraces(){DIE_IMPOSSIBLE;}
virtual void adjustWeightOfDummyCpuActions();
RoutingEdge *p_netElm;
Cpu *p_cpu;
simgrid::Host* p_host = nullptr;
+ xbt_dict_t p_properties = NULL;
/** @brief Get the list of virtual machines on the current Host */
xbt_dynar_t getVms();
return action;
}
-Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu)
+Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props)
{
- return new HostL07(this, name, NULL, netElm, cpu);
+ return new HostL07(this, name, props, netElm, cpu);
}
Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst,
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)
+ tmgr_trace_t state_trace)
{
double power_initial = xbt_dynar_get_as(powerPeak, pstate, double);
- CpuL07 *cpu = new CpuL07(this, name, cpu_properties,
- power_initial, power_scale, power_trace,
+ CpuL07 *cpu = new CpuL07(this, name, power_initial, power_scale, power_trace,
core, state_initial, state_trace);
return cpu;
}
{
}
-CpuL07::CpuL07(CpuL07Model *model, const char* name, xbt_dict_t props,
+CpuL07::CpuL07(CpuL07Model *model, const char* name,
double speedInitial, double speedScale, tmgr_trace_t speedTrace,
int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace)
- : Cpu(model, name, props, lmm_constraint_new(ptask_maxmin_system, this, speedInitial * speedScale),
+ : Cpu(model, name, lmm_constraint_new(ptask_maxmin_system, this, speedInitial * speedScale),
core, speedInitial, speedScale, state_initial)
{
xbt_assert(m_speedScale > 0, "Power has to be >0");
double shareResources(double now);
void updateActionsState(double now, double delta);
- Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu);
+ Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override;
Action *executeParallelTask(int host_nb,
sg_host_t *host_list,
double *flops_amount,
double *bytes_amount,
- double rate);
+ double rate) override;
xbt_dynar_t getRoute(Host *src, Host *dst);
void addTraces();
};
int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace,
- xbt_dict_t cpu_properties);
+ tmgr_trace_t state_trace) override;
void addTraces() {DIE_IMPOSSIBLE;};
HostL07Model *p_hostModel;
NetworkL07Model(HostL07Model *hmodel) : NetworkModel() {p_hostModel = hmodel;};
~NetworkL07Model() {surf_network_model = NULL;};
Link* createLink(const char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- e_surf_resource_state_t
- state_initial,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t
- policy, xbt_dict_t properties);
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ e_surf_resource_state_t state_initial,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t policy,
+ xbt_dict_t properties) override;
Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
void addTraces() {DIE_IMPOSSIBLE;};
tmgr_trace_event_t p_stateEvent;
tmgr_trace_event_t p_speedEvent;
public:
- CpuL07(CpuL07Model *model, const char* name, xbt_dict_t properties,
+ CpuL07(CpuL07Model *model, const char* name,
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();
************/
Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props)
-: Resource(model, name, props)
+: Resource(model, name),
+ p_properties(props)
{
links->insert({name, this});
lmm_constraint_t constraint,
tmgr_history_t history,
tmgr_trace_t state_trace)
-: Resource(model, name, props, constraint)
+: Resource(model, name, constraint),
+ p_properties(props)
{
if (state_trace)
p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
Link::~Link()
{
surf_callback_emit(networkLinkDestructedCallbacks, this);
+ xbt_dict_free(&p_properties);
}
bool Link::isUsed()
surf_callback_emit(networkLinkStateChangedCallbacks, this, old, state);
}
+xbt_dict_t Link::getProperties()
+{
+ if (p_properties==NULL)
+ p_properties = xbt_dict_new();
+ return p_properties;
+}
+
/**********
* Action *
**********/
private:
void *userData = NULL;
+public:
+ xbt_dict_t getProperties();
+protected:
+ xbt_dict_t p_properties = NULL;
+
/* List of all links */
private:
static boost::unordered_map<std::string, Link *> *links;
host->speed_trace,
host->core_amount,
host->initial_state,
- host->state_trace,
- host->properties);
+ host->state_trace);
cpu->plug(h);
- surf_host_model->createHost(host->id, net, cpu)->attach(h);
+ surf_host_model->createHost(host->id, net, cpu, host->properties)->attach(h);
if (TRACE_is_enabled() && TRACE_needs_platform())
sg_instr_new_host(host);
}
((storage_type_t) stype)->type_id,
storage->content,
storage->content_type,
- storage->properties);
+ storage->properties);
surf_storage_model->createStorage(storage->id,
((storage_type_t) stype)->type_id,
storage->content,
storage->content_type,
- storage->properties,
+ storage->properties,
storage->attach);
}
void sg_platf_new_storage_type(sg_platf_storage_type_cbarg_t storage_type){
Storage::Storage(Model *model, const char *name, xbt_dict_t props,
const char* type_id, char *content_name, char *content_type,
sg_size_t size)
- : Resource(model, name, props)
+ : Resource(model, name)
, p_contentType(content_type)
, m_size(size), m_usedSize(0)
, p_typeId(xbt_strdup(type_id))
, p_writeActions(xbt_dynar_new(sizeof(Action*),NULL))
+ , p_properties(props)
{
p_content = parseContent(content_name);
setState(SURF_RESOURCE_ON);
lmm_system_t maxminSystem, double bread, double bwrite,
double bconnection, const char* type_id, char *content_name,
char *content_type, sg_size_t size, char *attach)
- : Resource(model, name, props, lmm_constraint_new(maxminSystem, this, bconnection))
+ : Resource(model, name, lmm_constraint_new(maxminSystem, this, bconnection))
, p_contentType(content_type)
, m_size(size), m_usedSize(0)
, p_typeId(xbt_strdup(type_id))
- , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL)) {
+ , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL))
+ , p_properties(props)
+{
p_content = parseContent(content_name);
p_attach = xbt_strdup(attach);
setState(SURF_RESOURCE_ON);
Storage::~Storage(){
surf_callback_emit(storageDestructedCallbacks, this);
xbt_dict_free(&p_content);
+ xbt_dict_free(&p_properties);
xbt_dynar_free(&p_writeActions);
free(p_typeId);
free(p_contentType);
return m_usedSize;
}
+xbt_dict_t Storage::getProperties()
+{
+ if (p_properties==NULL)
+ p_properties = xbt_dict_new();
+ return p_properties;
+}
+
/**********
* Action *
**********/
lmm_constraint_t p_constraintWrite; /* Constraint for maximum write bandwidth*/
lmm_constraint_t p_constraintRead; /* Constraint for maximum write bandwidth*/
+
+public:
+ xbt_dict_t getProperties();
+protected:
+ xbt_dict_t p_properties = NULL;
+
};
/**********
return resource->getName();
}
-xbt_dict_t surf_resource_get_properties(surf_cpp_resource_t resource){
- return resource->getProperties();
-}
-
e_surf_resource_state_t surf_resource_get_state(surf_cpp_resource_t resource){
return resource->getState();
}
return get_casted_host(host)->sleep(duration);
}
+xbt_dict_t sg_host_get_properties(sg_host_t host) {
+ return get_casted_host(host)->getProperties();
+}
+
double surf_host_get_speed(sg_host_t host, double load){
return sg_host_surfcpu(host)->getSpeed(load);
}
return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getUsedSize();
}
+xbt_dict_t surf_storage_get_properties(surf_resource_t resource){
+ return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getProperties();
+}
+
const char* surf_storage_get_host(surf_resource_t resource){
return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->p_attach;
}
namespace surf {
Resource::Resource()
-: p_name(NULL), p_properties(NULL), p_model(NULL)
+: p_name(NULL), p_model(NULL)
{}
-Resource::Resource(Model *model, const char *name, xbt_dict_t props)
- : Resource(model, name, props, SURF_RESOURCE_ON)
+Resource::Resource(Model *model, const char *name)
+ : Resource(model, name, SURF_RESOURCE_ON)
{}
-Resource::Resource(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
- : Resource(model, name, props, constraint, SURF_RESOURCE_ON)
+Resource::Resource(Model *model, const char *name, lmm_constraint_t constraint)
+ : Resource(model, name, constraint, SURF_RESOURCE_ON)
{}
Resource::Resource(
- Model *model, const char *name, xbt_dict_t props,
+ Model *model, const char *name,
lmm_constraint_t constraint, e_surf_resource_state_t stateInit)
- : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
+ : p_name(xbt_strdup(name)), p_model(model)
, m_running(true), m_stateCurrent(stateInit), p_constraint(constraint)
{}
-Resource::Resource(Model *model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
- : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
+Resource::Resource(Model *model, const char *name, e_surf_resource_state_t stateInit)
+ : p_name(xbt_strdup(name)), p_model(model)
, m_running(true), m_stateCurrent(stateInit)
{}
Resource::~Resource() {
xbt_free((void*)p_name);
- xbt_dict_free(&p_properties);
}
e_surf_resource_state_t Resource::getState()
return p_name;
}
-xbt_dict_t Resource::getProperties() {
- if (p_properties==NULL)
- p_properties = xbt_dict_new();
- return p_properties;
-}
-
lmm_constraint_t Resource::getConstraint() {
return p_constraint;
}
*
* @param model Model associated to this Resource
* @param name The name of the Resource
- * @param props Dictionary of properties associated to this Resource
*/
- Resource(Model *model, const char *name, xbt_dict_t props);
+ Resource(Model *model, const char *name);
/**
* @brief Constructor of LMM Resources
*
* @param model Model associated to this Resource
* @param name The name of the Resource
- * @param props Dictionary of properties associated to this Resource
* @param constraint The lmm constraint associated to this Resource if it is part of a LMM component
*/
- Resource(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint);
+ Resource(Model *model, const char *name, lmm_constraint_t constraint);
- Resource(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, e_surf_resource_state_t stateInit);
+ Resource(Model *model, const char *name, lmm_constraint_t constraint, e_surf_resource_state_t stateInit);
/**
* @brief Resource constructor
*
* @param model Model associated to this Resource
* @param name The name of the Resource
- * @param props Dictionary of properties associated to this Resource
* @param stateInit the initial state of the Resource
*/
- Resource(Model *model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit);
+ Resource(Model *model, const char *name, e_surf_resource_state_t stateInit);
virtual ~Resource();
/** @brief Get the name of the current Resource */
const char *getName();
- /** @brief Get the properties of the current Resource */
- virtual xbt_dict_t getProperties();
-
/**
* @brief Update the state of the current Resource
* @details [TODO]
private:
const char *p_name;
- xbt_dict_t p_properties;
Model *p_model;
bool m_running;
e_surf_resource_state_t m_stateCurrent;
VMModel() :HostModel(){}
~VMModel(){};
- Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu){DIE_IMPOSSIBLE;}
+ Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu,xbt_dict_t props) override {DIE_IMPOSSIBLE;}
/**
* @brief Create a new VM
NULL, // host->power_trace,
1, // host->core_amount,
SURF_RESOURCE_ON, // host->initial_state,
- NULL, // host->state_trace,
- NULL); // host->properties,
+ NULL); // host->state_trace,
p_cpu->plug(host);
/* We create cpu_action corresponding to a VM process on the host operating system. */