#define SG_PLATF_TYPES_H
#include <xbt.h>
-#include <simgrid/host.h>
#ifdef __cplusplus
+namespace simgrid {
+namespace surf {
+
class Cpu;
class RoutingEdge;
+class As;
-#else
+}
+}
-typedef struct Cpu Cpu;
-typedef struct RoutingEdge RoutingEdge;
+typedef simgrid::surf::Cpu surf_Cpu;
+typedef simgrid::surf::RoutingEdge surf_RoutingEdge;
+typedef simgrid::surf::As surf_As;
-#endif
+#else
-typedef Cpu *surf_cpu_t;
-typedef RoutingEdge *routing_edge_t;
-typedef RoutingEdge *sg_routing_edge_t;
+typedef struct surf_Cpu surf_Cpu;
+typedef struct surf_RoutingEdge surf_RoutingEdge;
+typedef struct surf_As surf_As;
+#endif
+typedef surf_Cpu *surf_cpu_t;
+typedef surf_RoutingEdge *routing_edge_t;
+typedef surf_RoutingEdge *sg_routing_edge_t;
+typedef surf_As *AS_t;
// Types which are in fact dictelmt:
#include <xbt/dynar.h>
#include <simgrid/forward.h>
-#include <surf/surf.h>
SG_BEGIN_DECL()
}
XBT_PUBLIC(xbt_dynar_t) sg_hosts_as_dynar(void);
-#ifdef __cplusplus
-#define DEFINE_EXTERNAL_CLASS(klass) class klass;
-class Cpu;
-#else
-#define DEFINE_EXTERNAL_CLASS(klass) typedef struct klass klass;
-#endif
// ========== User Data ==============
XBT_PUBLIC(void*) sg_host_user(sg_host_t host);
XBT_PUBLIC(void) sg_host_user_set(sg_host_t host, void* userdata);
XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
XBT_PUBLIC(double) sg_host_get_consumed_energy(sg_host_t host);
-
SG_END_DECL()
#endif /* SIMGRID_HOST_H_ */
#ifdef __cplusplus
+
+namespace simgrid {
+namespace surf {
+
class Link;
+
+}
+}
+typedef simgrid::surf::Link Link;
+
#else
typedef struct Link Link;
#endif
#include "xbt.h"
#include "xbt/lib.h"
+#include "simgrid/forward.h"
#include "simgrid/simix.h"
#include "simgrid/platf.h"
typedef struct s_smx_rvpoint *msg_mailbox_t;
/* ******************************** Environment ************************************ */
-typedef struct As *msg_as_t;
+typedef surf_As *msg_as_t;
/* ******************************** Host ************************************ */
package org.simgrid.surf;
-/**
- * An action created by a Resource (e.g., a communication, an execution)
- * @see Model
- * @see Resource
- */
public class Action {
private long swigCPtr;
protected boolean swigCMemOwn;
}
}
- protected static long[] cArrayUnwrap(Action[] arrayWrapper) {
- long[] cArray = new long[arrayWrapper.length];
- for (int i=0; i<arrayWrapper.length; i++)
- cArray[i] = Action.getCPtr(arrayWrapper[i]);
- return cArray;
- }
-
- protected static Action[] cArrayWrap(long[] cArray, boolean cMemoryOwn) {
- Action[] arrayWrapper = new Action[cArray.length];
- for (int i=0; i<cArray.length; i++)
- arrayWrapper[i] = new Action(cArray[i], cMemoryOwn);
- return arrayWrapper;
- }
-
-
- /**
- * Action constructor
- * @param model The model associated
- * @param cost The cost of the action (e.g., flops, bytes)
- * @param failed If the action has failed
- */
public Action(Model model, double cost, boolean failed) {
this(SurfJNI.new_Action(Model.getCPtr(model), model, cost, failed), true);
}
-
- /**
- * @return The model associated
- */
public Model getModel() {
long cPtr = SurfJNI.Action_getModel(swigCPtr, this);
return (cPtr == 0) ? null : new Model(cPtr, false);
}
-
- /**
- * @return The variable associatied (if using LMM)
- */
public LmmVariable getVariable() {
long cPtr = SurfJNI.Action_getVariable(swigCPtr, this);
return (cPtr == 0) ? null : new LmmVariable(cPtr, false);
}
-
- /**
- * @return The state of the action
- */
public ActionState getState() {
return ActionState.swigToEnum(SurfJNI.Action_getState(swigCPtr, this));
}
-
- /**
- * @return True if suspended
- */
public boolean isSuspended() {
return SurfJNI.Action_isSuspended(swigCPtr, this);
}
-
- /**
- * @return TODO
- */
public double getBound() {
return SurfJNI.Action_getBound(swigCPtr, this);
}
-
- /**
- * @param bound TODO
- */
public void setBound(double bound) {
SurfJNI.Action_setBound(swigCPtr, this, bound);
}
-
- /**
- * Update remaining amount of cost to do
- * @param delta Difference of time since last call to this function
- */
public void updateRemains(double delta) {
SurfJNI.Action_updateRemains(swigCPtr, this, delta);
}
-
- /**
- * @return The remaining amount of cost to do
- */
public double getRemains() {
return SurfJNI.Action_getRemains(swigCPtr, this);
}
-
- /**
- * @param priority The new priority of the action
- */
public void setPriority(double priority) {
SurfJNI.Action_setPriority(swigCPtr, this, priority);
}
-
- /**
- * @param state The new state
- */
public void setState(ActionState state) {
SurfJNI.Action_setState(swigCPtr, this, state.swigValue());
}
package org.simgrid.surf;
-/**
- * A generic resource for the cpu component
- * @see CpuModel
- * @see CpuAction
- */
public class Cpu extends Resource {
private long swigCPtr;
SurfJNI.Cpu_change_ownership(this, swigCPtr, true);
}
-
- /**
- * A cpu constructor (using LMM)
- * @param model
- * @param name
- * @param props
- * @param constraint
- * @param core
- * @param powerPeak
- * @param powerScale
- */
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);
SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true);
}
-
- /**
- * A cpu constructor
- * @param model
- * @param name
- * @param props
- * @param core
- * @param powerPeak
- * @param powerScale
- */
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);
SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true);
}
-
- /**
- * @return The current power peak
- */
public double getCurrentPowerPeak() {
return (getClass() == Cpu.class) ? SurfJNI.Cpu_getCurrentPowerPeak(swigCPtr, this) : SurfJNI.Cpu_getCurrentPowerPeakSwigExplicitCpu(swigCPtr, this);
}
-
- /**
- * Execute some quantity of computation
- * @param size The processing amount (in flop) needed to process
- * @return A cpu action representing code execution
- */
public CpuAction execute(double size) {
- long cPtr = SurfJNI.Cpu_execute(swigCPtr, this, size);
- return (CpuAction)Surf.getCpuDirector(cPtr);
-}
+ long cPtr = SurfJNI.Cpu_execute(swigCPtr, this, size);
+ return (cPtr == 0) ? null : new CpuAction(cPtr, false);
+ }
-
- /**
- * Make a process sleep for duration
- * @param duration The number of seconds to sleep
- * @return A cpu action representing sleeping
- */
public CpuAction sleep(double duration) {
- long cPtr = SurfJNI.Cpu_sleep(swigCPtr, this, duration);
- return (CpuAction)Surf.getCpuDirector(cPtr);
-}
+ long cPtr = SurfJNI.Cpu_sleep(swigCPtr, this, duration);
+ return (cPtr == 0) ? null : new CpuAction(cPtr, false);
+ }
-
- /**
- * @return The number of cores on the cpu
- */
public int getCore() {
return (getClass() == Cpu.class) ? SurfJNI.Cpu_getCore(swigCPtr, this) : SurfJNI.Cpu_getCoreSwigExplicitCpu(swigCPtr, this);
}
-
- /**
- * TODO
- * @param load
- */
public double getSpeed(double load) {
return (getClass() == Cpu.class) ? SurfJNI.Cpu_getSpeed(swigCPtr, this, load) : SurfJNI.Cpu_getSpeedSwigExplicitCpu(swigCPtr, this, load);
}
-
- /**
- * TODO
- */
public double getAvailableSpeed() {
return (getClass() == Cpu.class) ? SurfJNI.Cpu_getAvailableSpeed(swigCPtr, this) : SurfJNI.Cpu_getAvailableSpeedSwigExplicitCpu(swigCPtr, this);
}
-
- /**
- * @param pstate_index index of power peak to get
- * @return Power peak at index
- */
public double getPowerPeakAt(int pstate_index) {
return SurfJNI.Cpu_getPowerPeakAt(swigCPtr, this, pstate_index);
}
-
- /**
- * @return Number of power peak
- */
public int getNbPstates() {
return SurfJNI.Cpu_getNbPstates(swigCPtr, this);
}
return SurfJNI.Cpu_getPstate(swigCPtr, this);
}
-
- /**
- * @param state The new state of the cpu
- */
public void setState(ResourceState state) {
SurfJNI.Cpu_setState(swigCPtr, this, state.swigValue());
}
package org.simgrid.surf;
-/**
- * An cpu action created by a Cpu
- * @see CpuModel
- * @see Cpu
- */
public class CpuAction extends Action {
private long swigCPtr;
SurfJNI.CpuAction_change_ownership(this, swigCPtr, true);
}
-
- /**
- * CpuAction constructor
- * @param model The model associated
- * @param cost The cost of the action (e.g., flops, bytes)
- * @param failed If the action has failed
- */
public CpuAction(Model model, double cost, boolean failed) {
this(SurfJNI.new_CpuAction(Model.getCPtr(model), model, cost, failed), true);
SurfJNI.CpuAction_director_connect(this, swigCPtr, swigCMemOwn, true);
}
-
- /**
- * @return The associated cpu
- */
public Cpu getCpu() {
- long cPtr = SurfJNI.CpuAction_getCpu(swigCPtr, this);
- return (Cpu)Surf.getCpuDirector(cPtr);
-}
+ long cPtr = SurfJNI.CpuAction_getCpu(swigCPtr, this);
+ return (cPtr == 0) ? null : new Cpu(cPtr, false);
+ }
}
package org.simgrid.surf;
-/**
- * The generic model for the Cpu component
- * @see Cpu
- * @see CpuAction
- */
public class CpuModel extends Model {
private long swigCPtr;
SurfJNI.CpuModel_director_connect(this, swigCPtr, swigCMemOwn, true);
}
-
- /**
- * Create a new Cpu
- *
- * @param name
- * @param power_peak
- * @param pstate
- * @param power_scale
- * @param power_trace
- * @param core
- * @param state_initial
- * @param state_trace
- * @param cpu_properties
- * @return The new Cpu
- * @see Cpu
- */
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);
- return (Cpu)Surf.getCpuDirector(cPtr);
-}
+ 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);
+ return (cPtr == 0) ? null : new Cpu(cPtr, false);
+ }
}
package org.simgrid.surf;
-/**
- * A generic resource for the network component
- */
public class Link extends Resource {
private long swigCPtr;
return arrayWrapper;
}
-
- /**
- * @return The bandwidth of the link
- */
public double getBandwidth() {
return SurfJNI.Link_getBandwidth(swigCPtr, this);
}
-
- /**
- * @param value The new bandwidth
- */
public void updateBandwidth(double value, double date) {
SurfJNI.Link_updateBandwidth__SWIG_0(swigCPtr, this, value, date);
}
-
- /**
- * @param value The new bandwidth
- */
public void updateBandwidth(double value) {
SurfJNI.Link_updateBandwidth__SWIG_1(swigCPtr, this, value);
}
-
- /**
- * @return The latency of the link
- */
public double getLatency() {
return SurfJNI.Link_getLatency(swigCPtr, this);
}
-
- /**
- * @param value The new latency
- */
public void updateLatency(double value, double date) {
SurfJNI.Link_updateLatency__SWIG_0(swigCPtr, this, value, date);
}
-
- /**
- * @param value The new latency
- */
public void updateLatency(double value) {
SurfJNI.Link_updateLatency__SWIG_1(swigCPtr, this, value);
}
package org.simgrid.surf;
-/**
- * A component (e.g., Cpu, Network, Storage, ...) is composed of three classes:
- * <ul>
- * <li> Model: It handle the interactions between resoucses and actions</li>
- * <li> Resource: A resource used by the model (e.g., a cpu, a network link)</li>
- * <li> Action: An action generated by the resources (e.g., execution, communication)</li>
- * </ul>
- * @see Resource
- * @see Action
- */
public class Model {
private long swigCPtr;
protected boolean swigCMemOwn;
}
}
-
- /**
- * Share the resources between the actions
- * @param now the current time
- * @return the date of the next action of the model will finish
- */
public double shareResources(double now) {
return SurfJNI.Model_shareResources(swigCPtr, this, now);
}
return SurfJNI.Model_shareResourcesFull(swigCPtr, this, now);
}
-
- /**
- * Update time of actions and eventually their states
- * @param now the new current time
- * @param delta the delta between previous and new current time
- */
public void updateActionsState(double now, double delta) {
SurfJNI.Model_updateActionsState(swigCPtr, this, now, delta);
}
SurfJNI.Model_updateActionsStateFull(swigCPtr, this, now, delta);
}
-
- /**
- * Get the List of running Actions
- */
public ActionList getRunningActionSet() {
long cPtr = SurfJNI.Model_getRunningActionSet(swigCPtr, this);
return (cPtr == 0) ? null : new ActionList(cPtr, false);
package org.simgrid.surf;
-/**
- * An network action created by network model
- * @see Link
- */
public class NetworkAction extends Action {
private long swigCPtr;
super.delete();
}
-
- /**
- * @return The latency of the action
- */
public double getLatency() {
return SurfJNI.NetworkAction_getLatency(swigCPtr, this);
}
package org.simgrid.surf;
-/**
- * A resource used by a model (e.g., a cpu, a network link)
- * @see Model
- * @see Action
- */
public class Resource {
private long swigCPtr;
protected boolean swigCMemOwn;
}
}
-
- /**
- * @return The name of the resource
- */
public String getName() {
return SurfJNI.Resource_getName(swigCPtr, this);
}
-
- /**
- * @return True if the Resource is used
- */
public boolean isUsed() {
return SurfJNI.Resource_isUsed(swigCPtr, this);
}
-
- /**
- * @return The model associated to this Resource
- */
public Model getModel() {
long cPtr = SurfJNI.Resource_getModel(swigCPtr, this);
return (cPtr == 0) ? null : new Model(cPtr, false);
}
-
- /**
- * @return The state of the resource
- * @see ResourceState
- */
public ResourceState getState() {
return ResourceState.swigToEnum(SurfJNI.Resource_getState(swigCPtr, this));
}
-
- /**
- * @return The constraint associatied (if using LMM)
- */
public LmmConstraint getConstraint() {
long cPtr = SurfJNI.Resource_getConstraint(swigCPtr, this);
return (cPtr == 0) ? null : new LmmConstraint(cPtr, false);
}
-
- /**
- * @return The XbtDict of properties associated to this Resource
- */
public XbtDict getProperties() {
long cPtr = SurfJNI.Resource_getProperties(swigCPtr, this);
return (cPtr == 0) ? null : new XbtDict(cPtr, false);
}
-
- /**
- * Update the state of the Resource
- * @param event_type
- * @param value
- * @param date
- */
public void updateState(TmgrTraceEvent event_type, double value, double date) {
SurfJNI.Resource_updateState(swigCPtr, this, TmgrTraceEvent.getCPtr(event_type), event_type, value, date);
}
}
public static CpuModel getCpuModel() {
- long cPtr = SurfJNI.getCpuModel();
- return (CpuModel)Surf.getCpuModelDirector(cPtr);
-}
+ long cPtr = SurfJNI.getCpuModel();
+ return (cPtr == 0) ? null : new CpuModel(cPtr, false);
+ }
public static void setCpuModel(CpuModel cpuModel) {
SurfJNI.setCpuModel(CpuModel.getCPtr(cpuModel), cpuModel);
typedef struct lmm_constraint *lmm_constraint_t;
typedef xbt_dynar_t DoubleDynar;
-SWIGINTERN ActionArrayPtr ActionList_getArray(ActionList *self){
+SWIGINTERN ActionArrayPtr simgrid_surf_ActionList_getArray(simgrid::surf::ActionList *self){
return self;
}
SWIGINTERN unsigned int tmgr_trace_event_getIdx(tmgr_trace_event *self){return 0;}
-SWIGINTERN Cpu *CpuAction_getCpu(CpuAction *self){return getActionCpu(self);}
-SWIGINTERN double NetworkAction_getLatency(NetworkAction *self){return self->m_latency;}
+SWIGINTERN simgrid::surf::Cpu *simgrid_surf_CpuAction_getCpu(simgrid::surf::CpuAction *self){return getActionCpu(self);}
+SWIGINTERN double simgrid_surf_NetworkAction_getLatency(simgrid::surf::NetworkAction *self){return self->m_latency;}
SWIGINTERN double lmm_constraint_getUsage(lmm_constraint *self){return lmm_constraint_get_usage(self);}
SWIGINTERN double lmm_variable_getValue(lmm_variable *self){return lmm_variable_getvalue(self);}
SWIGINTERN char *s_xbt_dict_getValue(s_xbt_dict *self,char *key){return (char*)xbt_dict_get_or_null(self, key);}
}
-void SwigDirector_Plugin::cpuCreatedCallback(Cpu *cpu) {
+void SwigDirector_Plugin::cpuCreatedCallback(simgrid::surf::Cpu *cpu) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((Cpu **)&jcpu) = (Cpu *) cpu;
+ *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[0], swigjobj, jcpu);
if (jenv->ExceptionCheck() == JNI_TRUE) return ;
} else {
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::cpuDestructedCallback(Cpu *cpu) {
+void SwigDirector_Plugin::cpuDestructedCallback(simgrid::surf::Cpu *cpu) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((Cpu **)&jcpu) = (Cpu *) cpu;
+ *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[1], swigjobj, jcpu);
if (jenv->ExceptionCheck() == JNI_TRUE) return ;
} else {
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) {
+void SwigDirector_Plugin::cpuStateChangedCallback(simgrid::surf::Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((Cpu **)&jcpu) = (Cpu *) cpu;
+ *((simgrid::surf::Cpu **)&jcpu) = (simgrid::surf::Cpu *) cpu;
jarg1 = (jint) arg1;
jarg2 = (jint) arg2;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[2], swigjobj, jcpu, jarg1, jarg2);
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2) {
+void SwigDirector_Plugin::cpuActionStateChangedCallback(simgrid::surf::CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((CpuAction **)&jaction) = (CpuAction *) action;
+ *((simgrid::surf::CpuAction **)&jaction) = (simgrid::surf::CpuAction *) action;
jarg1 = (jint) arg1;
jarg2 = (jint) arg2;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[3], swigjobj, jaction, jarg1, jarg2);
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::networkLinkCreatedCallback(Link *link) {
+void SwigDirector_Plugin::networkLinkCreatedCallback(simgrid::surf::Link *link) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((Link **)&jlink) = (Link *) link;
+ *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[4], swigjobj, jlink);
if (jenv->ExceptionCheck() == JNI_TRUE) return ;
} else {
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::networkLinkDestructedCallback(Link *link) {
+void SwigDirector_Plugin::networkLinkDestructedCallback(simgrid::surf::Link *link) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((Link **)&jlink) = (Link *) link;
+ *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[5], swigjobj, jlink);
if (jenv->ExceptionCheck() == JNI_TRUE) return ;
} else {
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::networkLinkStateChangedCallback(Link *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) {
+void SwigDirector_Plugin::networkLinkStateChangedCallback(simgrid::surf::Link *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((Link **)&jlink) = (Link *) link;
+ *((simgrid::surf::Link **)&jlink) = (simgrid::surf::Link *) link;
jarg1 = (jint) arg1;
jarg2 = (jint) arg2;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[6], swigjobj, jlink, jarg1, jarg2);
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {
+void SwigDirector_Plugin::networkActionStateChangedCallback(simgrid::surf::NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((NetworkAction **)&jaction) = (NetworkAction *) action;
+ *((simgrid::surf::NetworkAction **)&jaction) = (simgrid::surf::NetworkAction *) action;
jold = (jint) old;
jcur = (jint) cur;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[7], swigjobj, jaction, jold, jcur);
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-void SwigDirector_Plugin::networkCommunicateCallback(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate) {
+void SwigDirector_Plugin::networkCommunicateCallback(simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate) {
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
- *((NetworkAction **)&jaction) = (NetworkAction *) action;
- *((RoutingEdge **)&jsrc) = (RoutingEdge *) src;
- *((RoutingEdge **)&jdst) = (RoutingEdge *) dst;
+ *((simgrid::surf::NetworkAction **)&jaction) = (simgrid::surf::NetworkAction *) action;
+ *((simgrid::surf::RoutingEdge **)&jsrc) = (simgrid::surf::RoutingEdge *) src;
+ *((simgrid::surf::RoutingEdge **)&jdst) = (simgrid::surf::RoutingEdge *) dst;
jsize = (jdouble) size;
jrate = (jdouble) rate;
jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[8], swigjobj, jaction, jsrc, jdst, jsize, jrate);
}
-SwigDirector_CpuModel::SwigDirector_CpuModel(JNIEnv *jenv) : CpuModel(), Swig::Director(jenv) {
+SwigDirector_CpuModel::SwigDirector_CpuModel(JNIEnv *jenv) : simgrid::surf::CpuModel(), Swig::Director(jenv) {
}
double SwigDirector_CpuModel::shareResources(double now) {
jdouble jnow ;
if (!swig_override[0]) {
- return Model::shareResources(now);
+ return simgrid::surf::Model::shareResources(now);
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jdouble jnow ;
if (!swig_override[1]) {
- return Model::shareResourcesLazy(now);
+ return simgrid::surf::Model::shareResourcesLazy(now);
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jdouble jnow ;
if (!swig_override[2]) {
- return Model::shareResourcesFull(now);
+ return simgrid::surf::Model::shareResourcesFull(now);
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jdouble jdelta ;
if (!swig_override[3]) {
- Model::updateActionsState(now,delta);
+ simgrid::surf::Model::updateActionsState(now,delta);
return;
}
swigjobj = swig_get_self(jenv);
jdouble jdelta ;
if (!swig_override[4]) {
- Model::updateActionsStateLazy(now,delta);
+ simgrid::surf::Model::updateActionsStateLazy(now,delta);
return;
}
swigjobj = swig_get_self(jenv);
jdouble jdelta ;
if (!swig_override[5]) {
- Model::updateActionsStateFull(now,delta);
+ simgrid::surf::Model::updateActionsStateFull(now,delta);
return;
}
swigjobj = swig_get_self(jenv);
if (swigjobj) jenv->DeleteLocalRef(swigjobj);
}
-ActionList *SwigDirector_CpuModel::getRunningActionSet() {
- ActionList *c_result = 0 ;
+simgrid::surf::ActionList *SwigDirector_CpuModel::getRunningActionSet() {
+ simgrid::surf::ActionList *c_result = 0 ;
jlong jresult = 0 ;
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jobject swigjobj = (jobject) NULL ;
if (!swig_override[6]) {
- return Model::getRunningActionSet();
+ return simgrid::surf::Model::getRunningActionSet();
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[15], swigjobj);
if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
- c_result = *(ActionList **)&jresult;
+ c_result = *(simgrid::surf::ActionList **)&jresult;
} else {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
}
jobject swigjobj = (jobject) NULL ;
if (!swig_override[7]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method CpuModel::addTraces.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::addTraces.");
return;
}
swigjobj = swig_get_self(jenv);
}
-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) {
- Cpu *c_result = 0 ;
+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 *c_result = 0 ;
jlong jresult = 0 ;
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jlong jcpu_properties = 0 ;
if (!swig_override[8]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method CpuModel::createCpu.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::CpuModel::createCpu.");
return c_result;
}
swigjobj = swig_get_self(jenv);
*((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);
if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
- c_result = *(Cpu **)&jresult;
+ c_result = *(simgrid::surf::Cpu **)&jresult;
} else {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
}
}
-SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, Model *model, char const *name, s_xbt_dict *props, lmm_constraint *constraint, int core, double powerPeak, double powerScale) : Cpu(model, name, props, constraint, core, powerPeak, powerScale), Swig::Director(jenv) {
+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, Model *model, char const *name, s_xbt_dict *props, int core, double powerPeak, double powerScale) : Cpu(model, name, props, 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) {
}
bool SwigDirector_Cpu::isUsed() {
jobject swigjobj = (jobject) NULL ;
if (!swig_override[0]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::isUsed.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::isUsed.");
return c_result;
}
swigjobj = swig_get_self(jenv);
jobject swigjobj = (jobject) NULL ;
if (!swig_override[1]) {
- return Resource::getState();
+ return simgrid::surf::Resource::getState();
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jdouble jdate ;
if (!swig_override[2]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::updateState.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::updateState.");
return;
}
swigjobj = swig_get_self(jenv);
jobject swigjobj = (jobject) NULL ;
if (!swig_override[3]) {
- return Cpu::getCurrentPowerPeak();
+ return simgrid::surf::Cpu::getCurrentPowerPeak();
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
return c_result;
}
-CpuAction *SwigDirector_Cpu::execute(double size) {
- CpuAction *c_result = 0 ;
+simgrid::surf::CpuAction *SwigDirector_Cpu::execute(double size) {
+ simgrid::surf::CpuAction *c_result = 0 ;
jlong jresult = 0 ;
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jdouble jsize ;
if (!swig_override[4]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::execute.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::execute.");
return c_result;
}
swigjobj = swig_get_self(jenv);
jsize = (jdouble) size;
jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[22], swigjobj, jsize);
if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
- c_result = *(CpuAction **)&jresult;
+ c_result = *(simgrid::surf::CpuAction **)&jresult;
} else {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
}
return c_result;
}
-CpuAction *SwigDirector_Cpu::sleep(double duration) {
- CpuAction *c_result = 0 ;
+simgrid::surf::CpuAction *SwigDirector_Cpu::sleep(double duration) {
+ simgrid::surf::CpuAction *c_result = 0 ;
jlong jresult = 0 ;
JNIEnvWrapper swigjnienv(this) ;
JNIEnv * jenv = swigjnienv.getJNIEnv() ;
jdouble jduration ;
if (!swig_override[5]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::sleep.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::sleep.");
return c_result;
}
swigjobj = swig_get_self(jenv);
jduration = (jdouble) duration;
jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[23], swigjobj, jduration);
if (jenv->ExceptionCheck() == JNI_TRUE) return c_result;
- c_result = *(CpuAction **)&jresult;
+ c_result = *(simgrid::surf::CpuAction **)&jresult;
} else {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object");
}
jobject swigjobj = (jobject) NULL ;
if (!swig_override[6]) {
- return Cpu::getCore();
+ return simgrid::surf::Cpu::getCore();
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jdouble jload ;
if (!swig_override[7]) {
- return Cpu::getSpeed(load);
+ return simgrid::surf::Cpu::getSpeed(load);
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jobject swigjobj = (jobject) NULL ;
if (!swig_override[8]) {
- return Cpu::getAvailableSpeed();
+ return simgrid::surf::Cpu::getAvailableSpeed();
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jint jpstate_index ;
if (!swig_override[9]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::getPowerPeakAt.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPowerPeakAt.");
return c_result;
}
swigjobj = swig_get_self(jenv);
jobject swigjobj = (jobject) NULL ;
if (!swig_override[10]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::getNbPstates.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getNbPstates.");
return c_result;
}
swigjobj = swig_get_self(jenv);
jint jpstate_index ;
if (!swig_override[11]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::setPstate.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::setPstate.");
return;
}
swigjobj = swig_get_self(jenv);
jobject swigjobj = (jobject) NULL ;
if (!swig_override[12]) {
- SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::getPstate.");
+ SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method simgrid::surf::Cpu::getPstate.");
return c_result;
}
swigjobj = swig_get_self(jenv);
}
-SwigDirector_CpuAction::SwigDirector_CpuAction(JNIEnv *jenv, Model *model, double cost, bool failed) : CpuAction(model, cost, failed), Swig::Director(jenv) {
+SwigDirector_CpuAction::SwigDirector_CpuAction(JNIEnv *jenv, simgrid::surf::Model *model, double cost, bool failed) : simgrid::surf::CpuAction(model, cost, failed), Swig::Director(jenv) {
}
SwigDirector_CpuAction::~SwigDirector_CpuAction() {
jobject swigjobj = (jobject) NULL ;
if (!swig_override[0]) {
- return Action::getRemains();
+ return simgrid::surf::Action::getRemains();
}
swigjobj = swig_get_self(jenv);
if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) {
jdouble jpriority ;
if (!swig_override[1]) {
- Action::setPriority(priority);
+ simgrid::surf::Action::setPriority(priority);
return;
}
swigjobj = swig_get_self(jenv);
jint jstate ;
if (!swig_override[2]) {
- Action::setState(state);
+ simgrid::surf::Action::setState(state);
return;
}
swigjobj = swig_get_self(jenv);
#endif
JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) {
- Action * action = (Action *)jarg1;
+ simgrid::surf::Action * action = (simgrid::surf::Action *)jarg1;
jobject res;
- CpuAction *cpu_action = dynamic_cast<CpuAction*>(action);
+ simgrid::surf::CpuAction *cpu_action =
+ dynamic_cast<simgrid::surf::CpuAction*>(action);
if (cpu_action) {
- SwigDirector_CpuAction *dir_cpu_action = dynamic_cast<SwigDirector_CpuAction*>(cpu_action);
+ SwigDirector_CpuAction *dir_cpu_action =
+ dynamic_cast<SwigDirector_CpuAction*>(cpu_action);
if (dir_cpu_action) {
res = dir_cpu_action->swig_get_self(env);\
} else {
#define GETDIRECTOR(NAME) \
JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\
{\
- NAME * arg1 = (NAME*)jarg1;\
+ simgrid::surf::NAME * arg1 = (simgrid::surf::NAME*)jarg1;\
SwigDirector_ ##NAME *director = dynamic_cast<SwigDirector_ ##NAME *>(arg1);\
jobject res;\
if (director) {\
SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_ActionList_1getArray(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlongArray jresult = 0 ;
- ActionList *arg1 = (ActionList *) 0 ;
+ simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ;
ActionArrayPtr result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(ActionList **)&jarg1;
- result = (ActionArrayPtr)ActionList_getArray(arg1);
+ arg1 = *(simgrid::surf::ActionList **)&jarg1;
+ result = (ActionArrayPtr)simgrid_surf_ActionList_getArray(arg1);
{
long l = 0;
- for(ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
+ for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
l++;
}
jresult = jenv->NewLongArray(l);
jlong *elts = jenv->GetLongArrayElements(jresult, NULL);
l = 0;
- for(ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
- elts[l++] = (jlong)static_cast<Action*>(&*it);
+ for(simgrid::surf::ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) {
+ elts[l++] = (jlong)static_cast<simgrid::surf::Action*>(&*it);
}
jenv->ReleaseLongArrayElements(jresult, elts, 0);
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1ActionList(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
- ActionList *result = 0 ;
+ simgrid::surf::ActionList *result = 0 ;
(void)jenv;
(void)jcls;
- result = (ActionList *)new ActionList();
- *(ActionList **)&jresult = result;
+ result = (simgrid::surf::ActionList *)new simgrid::surf::ActionList();
+ *(simgrid::surf::ActionList **)&jresult = result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1ActionList(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- ActionList *arg1 = (ActionList *) 0 ;
+ simgrid::surf::ActionList *arg1 = (simgrid::surf::ActionList *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(ActionList **)&jarg1;
+ arg1 = *(simgrid::surf::ActionList **)&jarg1;
delete arg1;
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_getCpuModel(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
- CpuModel *result = 0 ;
+ simgrid::surf::CpuModel *result = 0 ;
(void)jenv;
(void)jcls;
- result = (CpuModel *)getCpuModel();
- *(CpuModel **)&jresult = result;
+ result = (simgrid::surf::CpuModel *)getCpuModel();
+ *(simgrid::surf::CpuModel **)&jresult = result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
- CpuModel *arg1 = (CpuModel *) 0 ;
+ simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(CpuModel **)&jarg1;
+ arg1 = *(simgrid::surf::CpuModel **)&jarg1;
setCpuModel(arg1);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpu(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2, jobject jarg2_) {
char *arg1 = (char *) 0 ;
- Cpu *arg2 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
(void)jenv;
(void)jcls;
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
if (!arg1) return ;
}
- arg2 = *(Cpu **)&jarg2;
+ arg2 = *(simgrid::surf::Cpu **)&jarg2;
setCpu(arg1,arg2);
{
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Cpu *arg2 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Cpu **)&jarg2;
+ arg2 = *(simgrid::surf::Cpu **)&jarg2;
(arg1)->cpuCreatedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Cpu *arg2 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Cpu **)&jarg2;
+ arg2 = *(simgrid::surf::Cpu **)&jarg2;
(arg1)->Plugin::cpuCreatedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Cpu *arg2 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Cpu **)&jarg2;
+ arg2 = *(simgrid::surf::Cpu **)&jarg2;
(arg1)->cpuDestructedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Cpu *arg2 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Cpu **)&jarg2;
+ arg2 = *(simgrid::surf::Cpu **)&jarg2;
(arg1)->Plugin::cpuDestructedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- Cpu *arg2 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
e_surf_resource_state_t arg3 ;
e_surf_resource_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Cpu **)&jarg2;
+ arg2 = *(simgrid::surf::Cpu **)&jarg2;
arg3 = (e_surf_resource_state_t)jarg3;
arg4 = (e_surf_resource_state_t)jarg4;
(arg1)->cpuStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- Cpu *arg2 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg2 = (simgrid::surf::Cpu *) 0 ;
e_surf_resource_state_t arg3 ;
e_surf_resource_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Cpu **)&jarg2;
+ arg2 = *(simgrid::surf::Cpu **)&jarg2;
arg3 = (e_surf_resource_state_t)jarg3;
arg4 = (e_surf_resource_state_t)jarg4;
(arg1)->Plugin::cpuStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- CpuAction *arg2 = (CpuAction *) 0 ;
+ simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ;
e_surf_action_state_t arg3 ;
e_surf_action_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(CpuAction **)&jarg2;
+ arg2 = *(simgrid::surf::CpuAction **)&jarg2;
arg3 = (e_surf_action_state_t)jarg3;
arg4 = (e_surf_action_state_t)jarg4;
(arg1)->cpuActionStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- CpuAction *arg2 = (CpuAction *) 0 ;
+ simgrid::surf::CpuAction *arg2 = (simgrid::surf::CpuAction *) 0 ;
e_surf_action_state_t arg3 ;
e_surf_action_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(CpuAction **)&jarg2;
+ arg2 = *(simgrid::surf::CpuAction **)&jarg2;
arg3 = (e_surf_action_state_t)jarg3;
arg4 = (e_surf_action_state_t)jarg4;
(arg1)->Plugin::cpuActionStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Link *arg2 = (Link *) 0 ;
+ simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Link **)&jarg2;
+ arg2 = *(simgrid::surf::Link **)&jarg2;
(arg1)->networkLinkCreatedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Link *arg2 = (Link *) 0 ;
+ simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Link **)&jarg2;
+ arg2 = *(simgrid::surf::Link **)&jarg2;
(arg1)->Plugin::networkLinkCreatedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Link *arg2 = (Link *) 0 ;
+ simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Link **)&jarg2;
+ arg2 = *(simgrid::surf::Link **)&jarg2;
(arg1)->networkLinkDestructedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
Plugin *arg1 = (Plugin *) 0 ;
- Link *arg2 = (Link *) 0 ;
+ simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Link **)&jarg2;
+ arg2 = *(simgrid::surf::Link **)&jarg2;
(arg1)->Plugin::networkLinkDestructedCallback(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- Link *arg2 = (Link *) 0 ;
+ simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
e_surf_resource_state_t arg3 ;
e_surf_resource_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Link **)&jarg2;
+ arg2 = *(simgrid::surf::Link **)&jarg2;
arg3 = (e_surf_resource_state_t)jarg3;
arg4 = (e_surf_resource_state_t)jarg4;
(arg1)->networkLinkStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- Link *arg2 = (Link *) 0 ;
+ simgrid::surf::Link *arg2 = (simgrid::surf::Link *) 0 ;
e_surf_resource_state_t arg3 ;
e_surf_resource_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(Link **)&jarg2;
+ arg2 = *(simgrid::surf::Link **)&jarg2;
arg3 = (e_surf_resource_state_t)jarg3;
arg4 = (e_surf_resource_state_t)jarg4;
(arg1)->Plugin::networkLinkStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- NetworkAction *arg2 = (NetworkAction *) 0 ;
+ simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
e_surf_action_state_t arg3 ;
e_surf_action_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(NetworkAction **)&jarg2;
+ arg2 = *(simgrid::surf::NetworkAction **)&jarg2;
arg3 = (e_surf_action_state_t)jarg3;
arg4 = (e_surf_action_state_t)jarg4;
(arg1)->networkActionStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) {
Plugin *arg1 = (Plugin *) 0 ;
- NetworkAction *arg2 = (NetworkAction *) 0 ;
+ simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
e_surf_action_state_t arg3 ;
e_surf_action_state_t arg4 ;
(void)jarg1_;
(void)jarg2_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(NetworkAction **)&jarg2;
+ arg2 = *(simgrid::surf::NetworkAction **)&jarg2;
arg3 = (e_surf_action_state_t)jarg3;
arg4 = (e_surf_action_state_t)jarg4;
(arg1)->Plugin::networkActionStateChangedCallback(arg2,arg3,arg4);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) {
Plugin *arg1 = (Plugin *) 0 ;
- NetworkAction *arg2 = (NetworkAction *) 0 ;
- RoutingEdge *arg3 = (RoutingEdge *) 0 ;
- RoutingEdge *arg4 = (RoutingEdge *) 0 ;
+ simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
+ simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ;
+ simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ;
double arg5 ;
double arg6 ;
(void)jarg3_;
(void)jarg4_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(NetworkAction **)&jarg2;
- arg3 = *(RoutingEdge **)&jarg3;
- arg4 = *(RoutingEdge **)&jarg4;
+ arg2 = *(simgrid::surf::NetworkAction **)&jarg2;
+ arg3 = *(simgrid::surf::RoutingEdge **)&jarg3;
+ arg4 = *(simgrid::surf::RoutingEdge **)&jarg4;
arg5 = (double)jarg5;
arg6 = (double)jarg6;
(arg1)->networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) {
Plugin *arg1 = (Plugin *) 0 ;
- NetworkAction *arg2 = (NetworkAction *) 0 ;
- RoutingEdge *arg3 = (RoutingEdge *) 0 ;
- RoutingEdge *arg4 = (RoutingEdge *) 0 ;
+ simgrid::surf::NetworkAction *arg2 = (simgrid::surf::NetworkAction *) 0 ;
+ simgrid::surf::RoutingEdge *arg3 = (simgrid::surf::RoutingEdge *) 0 ;
+ simgrid::surf::RoutingEdge *arg4 = (simgrid::surf::RoutingEdge *) 0 ;
double arg5 ;
double arg6 ;
(void)jarg3_;
(void)jarg4_;
arg1 = *(Plugin **)&jarg1;
- arg2 = *(NetworkAction **)&jarg2;
- arg3 = *(RoutingEdge **)&jarg3;
- arg4 = *(RoutingEdge **)&jarg4;
+ arg2 = *(simgrid::surf::NetworkAction **)&jarg2;
+ arg3 = *(simgrid::surf::RoutingEdge **)&jarg3;
+ arg4 = *(simgrid::surf::RoutingEdge **)&jarg4;
arg5 = (double)jarg5;
arg6 = (double)jarg6;
(arg1)->Plugin::networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6);
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResources(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
jdouble jresult = 0 ;
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
result = (double)(arg1)->shareResources(arg2);
jresult = (jdouble)result;
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
jdouble jresult = 0 ;
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
result = (double)(arg1)->shareResourcesLazy(arg2);
jresult = (jdouble)result;
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
jdouble jresult = 0 ;
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
result = (double)(arg1)->shareResourcesFull(arg2);
jresult = (jdouble)result;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
double arg3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
arg3 = (double)jarg3;
(arg1)->updateActionsState(arg2,arg3);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
double arg3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
arg3 = (double)jarg3;
(arg1)->updateActionsStateLazy(arg2,arg3);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
double arg3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
arg3 = (double)jarg3;
(arg1)->updateActionsStateFull(arg2,arg3);
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Model_1getRunningActionSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
- Model *arg1 = (Model *) 0 ;
- ActionList *result = 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
+ simgrid::surf::ActionList *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
- result = (ActionList *)(arg1)->getRunningActionSet();
- *(ActionList **)&jresult = result;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
+ result = (simgrid::surf::ActionList *)(arg1)->getRunningActionSet();
+ *(simgrid::surf::ActionList **)&jresult = result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1addTraces(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
(arg1)->addTraces();
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Model(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
delete arg1;
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuModel(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
- CpuModel *result = 0 ;
+ simgrid::surf::CpuModel *result = 0 ;
(void)jenv;
(void)jcls;
- result = (CpuModel *)new SwigDirector_CpuModel(jenv);
- *(CpuModel **)&jresult = result;
+ result = (simgrid::surf::CpuModel *)new SwigDirector_CpuModel(jenv);
+ *(simgrid::surf::CpuModel **)&jresult = result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- CpuModel *arg1 = (CpuModel *) 0 ;
+ simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(CpuModel **)&jarg1;
+ arg1 = *(simgrid::surf::CpuModel **)&jarg1;
delete arg1;
}
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_) {
jlong jresult = 0 ;
- CpuModel *arg1 = (CpuModel *) 0 ;
+ simgrid::surf::CpuModel *arg1 = (simgrid::surf::CpuModel *) 0 ;
char *arg2 = (char *) 0 ;
DoubleDynar arg3 ;
int arg4 ;
tmgr_trace *arg9 = (tmgr_trace *) 0 ;
s_xbt_dict *arg10 = (s_xbt_dict *) 0 ;
DoubleDynar *argp3 ;
- Cpu *result = 0 ;
+ simgrid::surf::Cpu *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg6_;
(void)jarg9_;
(void)jarg10_;
- arg1 = *(CpuModel **)&jarg1;
+ arg1 = *(simgrid::surf::CpuModel **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
arg8 = (e_surf_resource_state_t)jarg8;
arg9 = *(tmgr_trace **)&jarg9;
arg10 = *(s_xbt_dict **)&jarg10;
- result = (Cpu *)(arg1)->createCpu((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
- *(Cpu **)&jresult = result;
+ result = (simgrid::surf::Cpu *)(arg1)->createCpu((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+ *(simgrid::surf::Cpu **)&jresult = result;
{
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
- CpuModel *obj = *((CpuModel **)&objarg);
+ simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg);
(void)jcls;
SwigDirector_CpuModel *director = dynamic_cast<SwigDirector_CpuModel *>(obj);
if (director) {
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
- CpuModel *obj = *((CpuModel **)&objarg);
+ simgrid::surf::CpuModel *obj = *((simgrid::surf::CpuModel **)&objarg);
SwigDirector_CpuModel *director = dynamic_cast<SwigDirector_CpuModel *>(obj);
(void)jcls;
if (director) {
SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jstring jresult = 0 ;
- Resource *arg1 = (Resource *) 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
char *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Resource **)&jarg1;
+ arg1 = *(simgrid::surf::Resource **)&jarg1;
result = (char *)(arg1)->getName();
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1isUsed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jboolean jresult = 0 ;
- Resource *arg1 = (Resource *) 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
bool result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Resource **)&jarg1;
+ arg1 = *(simgrid::surf::Resource **)&jarg1;
result = (bool)(arg1)->isUsed();
jresult = (jboolean)result;
return jresult;
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
- Resource *arg1 = (Resource *) 0 ;
- Model *result = 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
+ simgrid::surf::Model *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Resource **)&jarg1;
- result = (Model *)(arg1)->getModel();
- *(Model **)&jresult = result;
+ arg1 = *(simgrid::surf::Resource **)&jarg1;
+ result = (simgrid::surf::Model *)(arg1)->getModel();
+ *(simgrid::surf::Model **)&jresult = result;
return jresult;
}
SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
- Resource *arg1 = (Resource *) 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
e_surf_resource_state_t result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Resource **)&jarg1;
+ arg1 = *(simgrid::surf::Resource **)&jarg1;
result = (e_surf_resource_state_t)(arg1)->getState();
jresult = (jint)result;
return jresult;
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
- Resource *arg1 = (Resource *) 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
lmm_constraint *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Resource **)&jarg1;
+ arg1 = *(simgrid::surf::Resource **)&jarg1;
result = (lmm_constraint *)(arg1)->getConstraint();
*(lmm_constraint **)&jresult = result;
return jresult;
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getProperties(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
- Resource *arg1 = (Resource *) 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
s_xbt_dict *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Resource **)&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) {
- Resource *arg1 = (Resource *) 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
tmgr_trace_event *arg2 = (tmgr_trace_event *) 0 ;
double arg3 ;
double arg4 ;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
- arg1 = *(Resource **)&jarg1;
+ arg1 = *(simgrid::surf::Resource **)&jarg1;
arg2 = *(tmgr_trace_event **)&jarg2;
arg3 = (double)jarg3;
arg4 = (double)jarg4;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Resource(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- Resource *arg1 = (Resource *) 0 ;
+ simgrid::surf::Resource *arg1 = (simgrid::surf::Resource *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(Resource **)&jarg1;
+ arg1 = *(simgrid::surf::Resource **)&jarg1;
delete arg1;
}
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) {
jlong jresult = 0 ;
- Model *arg1 = (Model *) 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 ;
double arg6 ;
double arg7 ;
- Cpu *result = 0 ;
+ simgrid::surf::Cpu *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg3_;
(void)jarg4_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
arg5 = (int)jarg5;
arg6 = (double)jarg6;
arg7 = (double)jarg7;
- result = (Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
- *(Cpu **)&jresult = result;
+ result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
+ *(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) {
jlong jresult = 0 ;
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
char *arg2 = (char *) 0 ;
s_xbt_dict *arg3 = (s_xbt_dict *) 0 ;
int arg4 ;
double arg5 ;
double arg6 ;
- Cpu *result = 0 ;
+ simgrid::surf::Cpu *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg3_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
arg4 = (int)jarg4;
arg5 = (double)jarg5;
arg6 = (double)jarg6;
- result = (Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
- *(Cpu **)&jresult = result;
+ result = (simgrid::surf::Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
+ *(simgrid::surf::Cpu **)&jresult = result;
{
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Cpu(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
delete arg1;
}
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeak(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
result = (double)(arg1)->getCurrentPowerPeak();
jresult = (jdouble)result;
return jresult;
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeakSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
- result = (double)(arg1)->Cpu::getCurrentPowerPeak();
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
+ result = (double)(arg1)->simgrid::surf::Cpu::getCurrentPowerPeak();
jresult = (jdouble)result;
return jresult;
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1execute(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
jlong jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double arg2 ;
- CpuAction *result = 0 ;
+ simgrid::surf::CpuAction *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
arg2 = (double)jarg2;
- result = (CpuAction *)(arg1)->execute(arg2);
- *(CpuAction **)&jresult = result;
+ result = (simgrid::surf::CpuAction *)(arg1)->execute(arg2);
+ *(simgrid::surf::CpuAction **)&jresult = result;
return jresult;
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
jlong jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double arg2 ;
- CpuAction *result = 0 ;
+ simgrid::surf::CpuAction *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
arg2 = (double)jarg2;
- result = (CpuAction *)(arg1)->sleep(arg2);
- *(CpuAction **)&jresult = result;
+ result = (simgrid::surf::CpuAction *)(arg1)->sleep(arg2);
+ *(simgrid::surf::CpuAction **)&jresult = result;
return jresult;
}
SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCore(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
int result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
result = (int)(arg1)->getCore();
jresult = (jint)result;
return jresult;
SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCoreSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
int result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
- result = (int)(arg1)->Cpu::getCore();
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
+ result = (int)(arg1)->simgrid::surf::Cpu::getCore();
jresult = (jint)result;
return jresult;
}
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
jdouble jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double arg2 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
arg2 = (double)jarg2;
result = (double)(arg1)->getSpeed(arg2);
jresult = (jdouble)result;
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
jdouble jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double arg2 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
arg2 = (double)jarg2;
- result = (double)(arg1)->Cpu::getSpeed(arg2);
+ result = (double)(arg1)->simgrid::surf::Cpu::getSpeed(arg2);
jresult = (jdouble)result;
return jresult;
}
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
result = (double)(arg1)->getAvailableSpeed();
jresult = (jdouble)result;
return jresult;
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
- result = (double)(arg1)->Cpu::getAvailableSpeed();
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
+ result = (double)(arg1)->simgrid::surf::Cpu::getAvailableSpeed();
jresult = (jdouble)result;
return jresult;
}
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPowerPeakAt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
jdouble jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
int arg2 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
arg2 = (int)jarg2;
result = (double)(arg1)->getPowerPeakAt(arg2);
jresult = (jdouble)result;
SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getNbPstates(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
int result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
result = (int)(arg1)->getNbPstates();
jresult = (jint)result;
return jresult;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
int arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
arg2 = (int)jarg2;
(arg1)->setPstate(arg2);
}
SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPstate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
int result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
result = (int)(arg1)->getPstate();
jresult = (jint)result;
return jresult;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
- Cpu *arg1 = (Cpu *) 0 ;
+ simgrid::surf::Cpu *arg1 = (simgrid::surf::Cpu *) 0 ;
e_surf_resource_state_t arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Cpu **)&jarg1;
+ arg1 = *(simgrid::surf::Cpu **)&jarg1;
arg2 = (e_surf_resource_state_t)jarg2;
(arg1)->setState(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
- Cpu *obj = *((Cpu **)&objarg);
+ simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg);
(void)jcls;
SwigDirector_Cpu *director = dynamic_cast<SwigDirector_Cpu *>(obj);
if (director) {
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
- Cpu *obj = *((Cpu **)&objarg);
+ simgrid::surf::Cpu *obj = *((simgrid::surf::Cpu **)&objarg);
SwigDirector_Cpu *director = dynamic_cast<SwigDirector_Cpu *>(obj);
(void)jcls;
if (director) {
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Link(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- Link *arg1 = (Link *) 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(Link **)&jarg1;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
delete arg1;
}
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getBandwidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Link *arg1 = (Link *) 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Link **)&jarg1;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
result = (double)(arg1)->getBandwidth();
jresult = (jdouble)result;
return jresult;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateBandwidth_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
- Link *arg1 = (Link *) 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
double arg2 ;
double arg3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Link **)&jarg1;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
arg2 = (double)jarg2;
arg3 = (double)jarg3;
(arg1)->updateBandwidth(arg2,arg3);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateBandwidth_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
- Link *arg1 = (Link *) 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
double arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Link **)&jarg1;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
arg2 = (double)jarg2;
(arg1)->updateBandwidth(arg2);
}
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Link_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Link *arg1 = (Link *) 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Link **)&jarg1;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
result = (double)(arg1)->getLatency();
jresult = (jdouble)result;
return jresult;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateLatency_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) {
- Link *arg1 = (Link *) 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
double arg2 ;
double arg3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Link **)&jarg1;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
arg2 = (double)jarg2;
arg3 = (double)jarg3;
(arg1)->updateLatency(arg2,arg3);
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Link_1updateLatency_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
- Link *arg1 = (Link *) 0 ;
+ simgrid::surf::Link *arg1 = (simgrid::surf::Link *) 0 ;
double arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Link **)&jarg1;
+ arg1 = *(simgrid::surf::Link **)&jarg1;
arg2 = (double)jarg2;
(arg1)->updateLatency(arg2);
}
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 ;
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
bool arg3 ;
- Action *result = 0 ;
+ simgrid::surf::Action *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
arg3 = jarg3 ? true : false;
- result = (Action *)new Action(arg1,arg2,arg3);
- *(Action **)&jresult = result;
+ result = (simgrid::surf::Action *)new simgrid::surf::Action(arg1,arg2,arg3);
+ *(simgrid::surf::Action **)&jresult = result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
delete arg1;
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
- Action *arg1 = (Action *) 0 ;
- Model *result = 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
+ simgrid::surf::Model *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
- result = (Model *)(arg1)->getModel();
- *(Model **)&jresult = result;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
+ result = (simgrid::surf::Model *)(arg1)->getModel();
+ *(simgrid::surf::Model **)&jresult = result;
return jresult;
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
lmm_variable *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
result = (lmm_variable *)(arg1)->getVariable();
*(lmm_variable **)&jresult = result;
return jresult;
SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
e_surf_action_state_t result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
result = (e_surf_action_state_t)(arg1)->getState();
jresult = (jint)result;
return jresult;
SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Action_1isSuspended(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jboolean jresult = 0 ;
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
bool result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
result = (bool)(arg1)->isSuspended();
jresult = (jboolean)result;
return jresult;
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
result = (double)(arg1)->getBound();
jresult = (jdouble)result;
return jresult;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
double arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
arg2 = (double)jarg2;
(arg1)->setBound(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1updateRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
double arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
arg2 = (double)jarg2;
(arg1)->updateRemains(arg2);
}
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
result = (double)(arg1)->getRemains();
jresult = (jdouble)result;
return jresult;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setPriority(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) {
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
double arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
arg2 = (double)jarg2;
(arg1)->setPriority(arg2);
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
- Action *arg1 = (Action *) 0 ;
+ simgrid::surf::Action *arg1 = (simgrid::surf::Action *) 0 ;
e_surf_action_state_t arg2 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Action **)&jarg1;
+ arg1 = *(simgrid::surf::Action **)&jarg1;
arg2 = (e_surf_action_state_t)jarg2;
(arg1)->setState(arg2);
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) {
jlong jresult = 0 ;
- Model *arg1 = (Model *) 0 ;
+ simgrid::surf::Model *arg1 = (simgrid::surf::Model *) 0 ;
double arg2 ;
bool arg3 ;
- CpuAction *result = 0 ;
+ simgrid::surf::CpuAction *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(Model **)&jarg1;
+ arg1 = *(simgrid::surf::Model **)&jarg1;
arg2 = (double)jarg2;
arg3 = jarg3 ? true : false;
- result = (CpuAction *)new SwigDirector_CpuAction(jenv,arg1,arg2,arg3);
- *(CpuAction **)&jresult = result;
+ result = (simgrid::surf::CpuAction *)new SwigDirector_CpuAction(jenv,arg1,arg2,arg3);
+ *(simgrid::surf::CpuAction **)&jresult = result;
return jresult;
}
SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1getCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
- CpuAction *arg1 = (CpuAction *) 0 ;
- Cpu *result = 0 ;
+ simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ;
+ simgrid::surf::Cpu *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(CpuAction **)&jarg1;
- result = (Cpu *)CpuAction_getCpu(arg1);
- *(Cpu **)&jresult = result;
+ arg1 = *(simgrid::surf::CpuAction **)&jarg1;
+ result = (simgrid::surf::Cpu *)simgrid_surf_CpuAction_getCpu(arg1);
+ *(simgrid::surf::Cpu **)&jresult = result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- CpuAction *arg1 = (CpuAction *) 0 ;
+ simgrid::surf::CpuAction *arg1 = (simgrid::surf::CpuAction *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(CpuAction **)&jarg1;
+ arg1 = *(simgrid::surf::CpuAction **)&jarg1;
delete arg1;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) {
- CpuAction *obj = *((CpuAction **)&objarg);
+ simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg);
(void)jcls;
SwigDirector_CpuAction *director = dynamic_cast<SwigDirector_CpuAction *>(obj);
if (director) {
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {
- CpuAction *obj = *((CpuAction **)&objarg);
+ simgrid::surf::CpuAction *obj = *((simgrid::surf::CpuAction **)&objarg);
SwigDirector_CpuAction *director = dynamic_cast<SwigDirector_CpuAction *>(obj);
(void)jcls;
if (director) {
SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jdouble jresult = 0 ;
- NetworkAction *arg1 = (NetworkAction *) 0 ;
+ simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ;
double result;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(NetworkAction **)&jarg1;
- result = (double)NetworkAction_getLatency(arg1);
+ arg1 = *(simgrid::surf::NetworkAction **)&jarg1;
+ result = (double)simgrid_surf_NetworkAction_getLatency(arg1);
jresult = (jdouble)result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1NetworkAction(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- NetworkAction *arg1 = (NetworkAction *) 0 ;
+ simgrid::surf::NetworkAction *arg1 = (simgrid::surf::NetworkAction *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(NetworkAction **)&jarg1;
+ arg1 = *(simgrid::surf::NetworkAction **)&jarg1;
delete arg1;
}
SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_RoutingEdge_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jstring jresult = 0 ;
- RoutingEdge *arg1 = (RoutingEdge *) 0 ;
+ simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ;
char *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
- arg1 = *(RoutingEdge **)&jarg1;
+ arg1 = *(simgrid::surf::RoutingEdge **)&jarg1;
result = (char *)(arg1)->getName();
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1RoutingEdge(JNIEnv *jenv, jclass jcls, jlong jarg1) {
- RoutingEdge *arg1 = (RoutingEdge *) 0 ;
+ simgrid::surf::RoutingEdge *arg1 = (simgrid::surf::RoutingEdge *) 0 ;
(void)jenv;
(void)jcls;
- arg1 = *(RoutingEdge **)&jarg1;
+ arg1 = *(simgrid::surf::RoutingEdge **)&jarg1;
delete arg1;
}
jlong baseptr = 0;
(void)jenv;
(void)jcls;
- *(Model **)&baseptr = *(CpuModel **)&jarg1;
+ *(simgrid::surf::Model **)&baseptr = *(simgrid::surf::CpuModel **)&jarg1;
return baseptr;
}
jlong baseptr = 0;
(void)jenv;
(void)jcls;
- *(Resource **)&baseptr = *(Cpu **)&jarg1;
+ *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Cpu **)&jarg1;
return baseptr;
}
jlong baseptr = 0;
(void)jenv;
(void)jcls;
- *(Resource **)&baseptr = *(Link **)&jarg1;
+ *(simgrid::surf::Resource **)&baseptr = *(simgrid::surf::Link **)&jarg1;
return baseptr;
}
jlong baseptr = 0;
(void)jenv;
(void)jcls;
- *(Action **)&baseptr = *(CpuAction **)&jarg1;
+ *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::CpuAction **)&jarg1;
return baseptr;
}
jlong baseptr = 0;
(void)jenv;
(void)jcls;
- *(Action **)&baseptr = *(NetworkAction **)&jarg1;
+ *(simgrid::surf::Action **)&baseptr = *(simgrid::surf::NetworkAction **)&jarg1;
return baseptr;
}
void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global);
SwigDirector_Plugin(JNIEnv *jenv);
virtual ~SwigDirector_Plugin();
- virtual void cpuCreatedCallback(Cpu *cpu);
- virtual void cpuDestructedCallback(Cpu *cpu);
- virtual void cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2);
- virtual void cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2);
- virtual void networkLinkCreatedCallback(Link *link);
- virtual void networkLinkDestructedCallback(Link *link);
- virtual void networkLinkStateChangedCallback(Link *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2);
- virtual void networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur);
- virtual void networkCommunicateCallback(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate);
+ virtual void cpuCreatedCallback(simgrid::surf::Cpu *cpu);
+ virtual void cpuDestructedCallback(simgrid::surf::Cpu *cpu);
+ virtual void cpuStateChangedCallback(simgrid::surf::Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2);
+ virtual void cpuActionStateChangedCallback(simgrid::surf::CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2);
+ virtual void networkLinkCreatedCallback(simgrid::surf::Link *link);
+ virtual void networkLinkDestructedCallback(simgrid::surf::Link *link);
+ virtual void networkLinkStateChangedCallback(simgrid::surf::Link *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2);
+ virtual void networkActionStateChangedCallback(simgrid::surf::NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur);
+ virtual void networkCommunicateCallback(simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate);
public:
bool swig_overrides(int n) {
return (n < 9 ? swig_override[n] : false);
bool swig_override[9];
};
-class SwigDirector_CpuModel : public CpuModel, public Swig::Director {
+class SwigDirector_CpuModel : public simgrid::surf::CpuModel, public Swig::Director {
public:
void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global);
virtual void updateActionsState(double now, double delta);
virtual void updateActionsStateLazy(double now, double delta);
virtual void updateActionsStateFull(double now, double delta);
- virtual ActionList *getRunningActionSet();
+ virtual simgrid::surf::ActionList *getRunningActionSet();
virtual void addTraces();
virtual ~SwigDirector_CpuModel();
- virtual 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, s_xbt_dict *cpu_properties);
public:
bool swig_overrides(int n) {
return (n < 9 ? swig_override[n] : false);
bool swig_override[9];
};
-class SwigDirector_Cpu : public Cpu, public Swig::Director {
+class SwigDirector_Cpu : public simgrid::surf::Cpu, public Swig::Director {
public:
void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global);
- SwigDirector_Cpu(JNIEnv *jenv, Model *model, char const *name, s_xbt_dict *props, lmm_constraint *constraint, int core, double powerPeak, double powerScale);
- SwigDirector_Cpu(JNIEnv *jenv, 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, 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);
virtual bool isUsed();
virtual e_surf_resource_state_t getState();
virtual void updateState(tmgr_trace_event *event_type, double value, double date);
virtual ~SwigDirector_Cpu();
virtual double getCurrentPowerPeak();
- virtual CpuAction *execute(double size);
- virtual CpuAction *sleep(double duration);
+ virtual simgrid::surf::CpuAction *execute(double size);
+ virtual simgrid::surf::CpuAction *sleep(double duration);
virtual int getCore();
virtual double getSpeed(double load);
virtual double getAvailableSpeed();
bool swig_override[13];
};
-class SwigDirector_CpuAction : public CpuAction, public Swig::Director {
+class SwigDirector_CpuAction : public simgrid::surf::CpuAction, public Swig::Director {
public:
void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global);
- SwigDirector_CpuAction(JNIEnv *jenv, Model *model, double cost, bool failed);
+ SwigDirector_CpuAction(JNIEnv *jenv, simgrid::surf::Model *model, double cost, bool failed);
virtual ~SwigDirector_CpuAction();
virtual double getRemains();
virtual void setPriority(double priority);
#endif
JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) {
- Action * action = (Action *)jarg1;
+ simgrid::surf::Action * action = (simgrid::surf::Action *)jarg1;
jobject res;
- CpuAction *cpu_action = dynamic_cast<CpuAction*>(action);
+ simgrid::surf::CpuAction *cpu_action =
+ dynamic_cast<simgrid::surf::CpuAction*>(action);
if (cpu_action) {
- SwigDirector_CpuAction *dir_cpu_action = dynamic_cast<SwigDirector_CpuAction*>(cpu_action);
+ SwigDirector_CpuAction *dir_cpu_action =
+ dynamic_cast<SwigDirector_CpuAction*>(cpu_action);
if (dir_cpu_action) {
res = dir_cpu_action->swig_get_self(env);\
} else {
#define GETDIRECTOR(NAME) \
JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\
{\
- NAME * arg1 = (NAME*)jarg1;\
+ simgrid::surf::NAME * arg1 = (simgrid::surf::NAME*)jarg1;\
SwigDirector_ ##NAME *director = dynamic_cast<SwigDirector_ ##NAME *>(arg1);\
jobject res;\
if (director) {\
}
%typemap(out) ActionArrayPtr {
long l = 0;
- for(ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) {
+ for(simgrid::surf::ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) {
l++;
}
$result = jenv->NewLongArray(l);
jlong *elts = jenv->GetLongArrayElements($result, NULL);
l = 0;
- for(ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) {
- elts[l++] = (jlong)static_cast<Action*>(&*it);
+ for(simgrid::surf::ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) {
+ elts[l++] = (jlong)static_cast<simgrid::surf::Action*>(&*it);
}
jenv->ReleaseLongArrayElements($result, elts, 0);
}
+namespace simgrid {
+namespace surf {
+
class ActionList {
public:
//void push_front(Action &action);
}
};
+}
+}
+
/* Handle xbt_dynar_t of Link */
-JAVA_ARRAYSOFCLASSES(Link);
-%apply Link[] {LinkDynar};
+JAVA_ARRAYSOFCLASSES(simgrid::surf::Link);
+%apply simgrid::surf::Link[] {LinkDynar};
%typemap(jstype) LinkDynar "Link[]"
%typemap(javain) LinkDynar "Link.cArrayUnwrap($javainput)"
%typemap(javaout) LinkDynar {
%include "src/bindings/java/surf_swig.hpp"
+namespace simgrid {
+namespace surf {
+
+class Model;
+class CpuModel;
+class HostModel;
+class VMModel;
+class NetworkModel;
+class StorageModel;
+class Resource;
+class ResourceLmm;
+class Host;
+class HostCLM03;
+class NetworkCm02Link;
+class Action;
+class ActionLmm;
+class StorageActionLmm;
+class As;
+class RoutingPlatf;
+
+}
+}
+
%rename tmgr_trace TmgrTrace;
%nodefaultctor tmgr_trace;
struct tmgr_trace {
}
};
+namespace simgrid {
+namespace surf {
+
%nodefaultctor Model;
class Model {
public:
virtual void updateActionsStateLazy(double now, double delta);
virtual void updateActionsStateFull(double now, double delta);
- virtual ActionList *getRunningActionSet();
+ virtual simgrid::surf::ActionList *getRunningActionSet();
virtual void addTraces()=0;
};
public:
CpuModel();
virtual ~CpuModel();
- virtual Cpu *createCpu(const char *name, DoubleDynar power_peak,
+ virtual simgrid::surf::Cpu *createCpu(const char *name,
+ DoubleDynar power_peak,
int pstate, double power_scale,
tmgr_trace *power_trace, int core,
e_surf_resource_state_t state_initial,
Resource();
const char *getName();
virtual bool isUsed()=0;
- Model *getModel();
+ simgrid::surf::Model *getModel();
virtual e_surf_resource_state_t getState();
lmm_constraint *getConstraint();
%feature("director") Cpu;
class Cpu : public Resource {
public:
- Cpu(Model *model, const char *name, s_xbt_dict *props,
+ Cpu(simgrid::surf::Model *model, const char *name, s_xbt_dict *props,
lmm_constraint *constraint, int core, double powerPeak, double powerScale);
- Cpu(Model *model, const char *name, s_xbt_dict *props,
+ Cpu(simgrid::surf::Model *model, const char *name, s_xbt_dict *props,
int core, double powerPeak, double powerScale);
virtual ~Cpu();
virtual double getCurrentPowerPeak();
- virtual CpuAction *execute(double size)=0;
- virtual CpuAction *sleep(double duration)=0;
+ virtual simgrid::surf::CpuAction *execute(double size)=0;
+ virtual simgrid::surf::CpuAction *sleep(double duration)=0;
virtual int getCore();
virtual double getSpeed(double load);
virtual double getAvailableSpeed();
void setState(e_surf_resource_state_t state);
};
-class Link : public Resource {
+class Link : public simgrid::surf::Resource {
public:
Link();
~Link();
public:
CpuAction(Model *model, double cost, bool failed);
%extend {
- Cpu *getCpu() {return getActionCpu($self);}
+ simgrid::surf::Cpu *getCpu() {return getActionCpu($self);}
}
};
virtual char *getName()=0;
};
+}
+}
+
%rename lmm_constraint LmmConstraint;
struct lmm_constraint {
%extend {
SIMIX_clean();
}
-CpuModel *getCpuModel(){
+simgrid::surf::CpuModel *getCpuModel(){
return surf_cpu_model_pm;
}
-CpuModel *java_cpu_model;
+simgrid::surf::CpuModel *java_cpu_model;
static void java_cpu_model_init_preparse() {
surf_cpu_model_pm = java_cpu_model;
xbt_dynar_push(all_existing_models, &java_cpu_model);
}
-void setCpuModel(CpuModel *cpuModel){
+void setCpuModel(simgrid::surf::CpuModel *cpuModel){
java_cpu_model = cpuModel;
surf_cpu_model_init_preparse = java_cpu_model_init_preparse;
}
-void setCpu(char *name, Cpu *cpu) {
+void setCpu(char *name, simgrid::surf::Cpu *cpu) {
sg_host_surfcpu_set(sg_host_by_name(name), cpu);
}
LinkDynar getRoute(char *srcName, char *dstName) {
- RoutingEdge *src = sg_host_edge(sg_host_by_name(srcName));
- RoutingEdge *dst = sg_host_edge(sg_host_by_name(dstName));
+ simgrid::surf::RoutingEdge *src = sg_host_edge(sg_host_by_name(srcName));
+ simgrid::surf::RoutingEdge *dst = sg_host_edge(sg_host_by_name(dstName));
xbt_assert(src,"Cannot get the route from a NULL source");
xbt_assert(dst,"Cannot get the route to a NULL destination");
- xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdge*), NULL);
+ xbt_dynar_t route = xbt_dynar_new(sizeof(simgrid::surf::RoutingEdge*), NULL);
routing_platf->getRouteAndLatency(src, dst, &route, NULL);
return route;
}
-void Plugin::activateCpuCreatedCallback(){
- surf_callback_connect(cpuCreatedCallbacks, std::bind(&Plugin::cpuCreatedCallback, this, _1));
+void Plugin::activateCpuCreatedCallback()
+{
+ surf_callback_connect(simgrid::surf::cpuCreatedCallbacks,
+ std::bind(&Plugin::cpuCreatedCallback, this, _1));
}
-void Plugin::activateCpuDestructedCallback(){
- surf_callback_connect(cpuDestructedCallbacks, std::bind(&Plugin::cpuDestructedCallback, this, _1));
+void Plugin::activateCpuDestructedCallback()
+{
+ surf_callback_connect(simgrid::surf::cpuDestructedCallbacks,
+ std::bind(&Plugin::cpuDestructedCallback, this, _1));
}
-void Plugin::activateCpuStateChangedCallback(){
- surf_callback_connect(cpuStateChangedCallbacks, std::bind(&Plugin::cpuStateChangedCallback, this, _1, _2, _3));
+void Plugin::activateCpuStateChangedCallback()
+{
+ surf_callback_connect(simgrid::surf::cpuStateChangedCallbacks,
+ std::bind(&Plugin::cpuStateChangedCallback, this, _1, _2, _3));
}
-void Plugin::activateCpuActionStateChangedCallback(){
- surf_callback_connect(cpuActionStateChangedCallbacks, std::bind(&Plugin::cpuActionStateChangedCallback, this, _1, _2, _3));
+void Plugin::activateCpuActionStateChangedCallback()
+{
+ surf_callback_connect(simgrid::surf::cpuActionStateChangedCallbacks,
+ std::bind(&Plugin::cpuActionStateChangedCallback, this, _1, _2, _3));
}
-void Plugin::activateLinkCreatedCallback(){
- surf_callback_connect(networkLinkCreatedCallbacks, std::bind(&Plugin::networkLinkCreatedCallback, this, _1));
+void Plugin::activateLinkCreatedCallback()
+{
+ surf_callback_connect(simgrid::surf::networkLinkCreatedCallbacks,
+ std::bind(&Plugin::networkLinkCreatedCallback, this, _1));
}
-void Plugin::activateLinkDestructedCallback(){
- surf_callback_connect(networkLinkDestructedCallbacks, std::bind(&Plugin::networkLinkDestructedCallback, this, _1));
+void Plugin::activateLinkDestructedCallback()
+{
+ surf_callback_connect(simgrid::surf::networkLinkDestructedCallbacks,
+ std::bind(&Plugin::networkLinkDestructedCallback, this, _1));
}
-void Plugin::activateLinkStateChangedCallback(){
- surf_callback_connect(networkLinkStateChangedCallbacks, std::bind(&Plugin::networkLinkStateChangedCallback, this, _1, _2, _3));
+void Plugin::activateLinkStateChangedCallback()
+{
+ surf_callback_connect(simgrid::surf::networkLinkStateChangedCallbacks,
+ std::bind(&Plugin::networkLinkStateChangedCallback, this, _1, _2, _3));
}
-void Plugin::activateNetworkActionStateChangedCallback(){
- surf_callback_connect(networkActionStateChangedCallbacks, std::bind(&Plugin::networkActionStateChangedCallback, this, _1, _2, _3));
+void Plugin::activateNetworkActionStateChangedCallback()
+{
+ surf_callback_connect(simgrid::surf::networkActionStateChangedCallbacks,
+ std::bind(&Plugin::networkActionStateChangedCallback, this, _1, _2, _3));
}
-void Plugin::activateNetworkCommunicateCallback(){
- surf_callback_connect(networkCommunicateCallbacks, std::bind(&Plugin::networkCommunicateCallback, this, _1, _2, _3, _4, _5));
+void Plugin::activateNetworkCommunicateCallback()
+{
+ surf_callback_connect(simgrid::surf::networkCommunicateCallbacks,
+ std::bind(&Plugin::networkCommunicateCallback, this, _1, _2, _3, _4, _5));
}
#include "src/surf/maxmin_private.hpp"
typedef xbt_dynar_t LinkDynar;
-typedef ActionList *ActionArrayPtr;
+typedef simgrid::surf::ActionList *ActionArrayPtr;
double getClock();
void clean();
-CpuModel *getCpuModel();
-void setCpuModel(CpuModel *cpuModel);
+simgrid::surf::CpuModel *getCpuModel();
+void setCpuModel(simgrid::surf::CpuModel *cpuModel);
-void setCpu(char *name, Cpu *cpu);
+void setCpu(char *name, simgrid::surf::Cpu *cpu);
LinkDynar getRoute(char *srcName, char *dstName);
}
void activateCpuCreatedCallback();
- virtual void cpuCreatedCallback(Cpu *cpu) {}
+ virtual void cpuCreatedCallback(simgrid::surf::Cpu *cpu) {}
void activateCpuDestructedCallback();
- virtual void cpuDestructedCallback(Cpu *cpu) {}
+ virtual void cpuDestructedCallback(simgrid::surf::Cpu *cpu) {}
void activateCpuStateChangedCallback();
- virtual void cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t, e_surf_resource_state_t) {}
+ virtual void cpuStateChangedCallback(simgrid::surf::Cpu *cpu, e_surf_resource_state_t, e_surf_resource_state_t) {}
void activateCpuActionStateChangedCallback();
- virtual void cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t, e_surf_action_state_t) {}
+ virtual void cpuActionStateChangedCallback(simgrid::surf::CpuAction *action, e_surf_action_state_t, e_surf_action_state_t) {}
void activateLinkCreatedCallback();
- virtual void networkLinkCreatedCallback(Link *link) {}
+ virtual void networkLinkCreatedCallback(simgrid::surf::Link *link) {}
void activateLinkDestructedCallback();
- virtual void networkLinkDestructedCallback(Link *link) {}
+ virtual void networkLinkDestructedCallback(simgrid::surf::Link *link) {}
void activateLinkStateChangedCallback();
- virtual void networkLinkStateChangedCallback(Link *link, e_surf_resource_state_t, e_surf_resource_state_t) {}
+ virtual void networkLinkStateChangedCallback(simgrid::surf::Link *link, e_surf_resource_state_t, e_surf_resource_state_t) {}
void activateNetworkActionStateChangedCallback();
- virtual void networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {}
+ virtual void networkActionStateChangedCallback(simgrid::surf::NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {}
void activateNetworkCommunicateCallback();
- virtual void networkCommunicateCallback(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate) {}
+ virtual void networkCommunicateCallback(simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate) {}
};
#include "xbt/misc.h"
#include "xbt/config.h"
#include "src/portable.h"
+#include "surf/surf_routing.h"
#include "surf/datatypes.h"
#include "xbt/lib.h"
#include "surf/surf_routing.h"
} e_surf_network_element_type_t;
#ifdef __cplusplus
+
+namespace simgrid {
+namespace surf {
+
class Model;
class CpuModel;
class HostModel;
class StorageActionLmm;
class As;
class RoutingPlatf;
+
+}
+}
+
+typedef simgrid::surf::Model surf_Model;
+typedef simgrid::surf::CpuModel surf_CpuModel;
+typedef simgrid::surf::HostModel surf_HostModel;
+typedef simgrid::surf::VMModel surf_VMModel;
+typedef simgrid::surf::NetworkModel surf_NetworkModel;
+typedef simgrid::surf::StorageModel surf_StorageModel;
+typedef simgrid::surf::Resource surf_Resource;
+typedef simgrid::surf::ResourceLmm surf_ResourceLmm;
+typedef simgrid::surf::Host surf_Host;
+typedef simgrid::surf::HostCLM03 surf_HostCLM03;
+typedef simgrid::surf::NetworkCm02Link surf_NetworkCm02Link;
+typedef simgrid::surf::Action surf_Action;
+typedef simgrid::surf::ActionLmm surf_ActionLmm;
+typedef simgrid::surf::StorageActionLmm surf_StorageActionLmm;
+typedef simgrid::surf::RoutingPlatf surf_RoutingPlatf;
+
#else
-typedef struct Model Model;
-typedef struct CpuModel CpuModel;
-typedef struct HostModel HostModel;
-typedef struct VMModel VMModel;
-typedef struct NetworkModel NetworkModel;
-typedef struct StorageModel StorageModel;
-typedef struct Resource Resource;
-typedef struct ResourceLmm ResourceLmm;
-typedef struct HostCLM03 HostCLM03;
-typedef struct Host Host;
-typedef struct NetworkCm02Link NetworkCm02Link;
-typedef struct Action Action;
-typedef struct ActionLmm ActionLmm;
-typedef struct StorageActionLmm StorageActionLmm;
-typedef struct As As;
-typedef struct RoutingPlatf RoutingPlatf;
+
+typedef struct surf_Model surf_Model;
+typedef struct surf_CpuModel surf_CpuModel;
+typedef struct surf_HostModel surf_HostModel;
+typedef struct surf_VMModel surf_VMModel;
+typedef struct surf_NetworkModel surf_NetworkModel;
+typedef struct surf_StorageModel surf_StorageModel;
+typedef struct surf_Resource surf_Resource;
+typedef struct surf_ResourceLmm surf_ResourceLmm;
+typedef struct surf_HostCLM03 surf_HostCLM03;
+typedef struct surf_Host surf_Host;
+typedef struct surf_NetworkCm02Link surf_NetworkCm02Link;
+typedef struct surf_Action surf_Action;
+typedef struct surf_ActionLmm surf_ActionLmm;
+typedef struct surf_StorageActionLmm surf_StorageActionLmm;
+typedef struct surf_RoutingPlatf surf_RoutingPlatf;
+
#endif
/** @ingroup SURF_c_bindings
* Generic data structure for a model. The hosts,
* the CPUs and the network links are examples of models.
*/
-typedef Model *surf_model_t;
-typedef CpuModel *surf_cpu_model_t;
-typedef HostModel *surf_host_model_t;
-typedef VMModel *surf_vm_model_t;
-
-typedef NetworkModel *surf_network_model_t;
-typedef StorageModel *surf_storage_model_t;
+typedef surf_Model *surf_model_t;
+typedef surf_CpuModel *surf_cpu_model_t;
+typedef surf_HostModel *surf_host_model_t;
+typedef surf_VMModel *surf_vm_model_t;
+typedef surf_NetworkModel *surf_network_model_t;
+typedef surf_StorageModel *surf_storage_model_t;
typedef xbt_dictelm_t surf_resource_t;
-typedef Resource *surf_cpp_resource_t;
-typedef Host *surf_host_t;
-typedef Cpu *surf_cpu_t;
+typedef surf_Resource *surf_cpp_resource_t;
+typedef surf_Host *surf_host_t;
+typedef surf_Cpu *surf_cpu_t;
/** @ingroup SURF_c_bindings
* \brief Action structure
*
* \see e_surf_action_state_t
*/
-typedef Action *surf_action_t;
-
-typedef As *AS_t;
-typedef RoutingPlatf *routing_platf_t;
+typedef surf_Action *surf_action_t;
+typedef surf_RoutingPlatf *routing_platf_t;
typedef struct surf_file *surf_file_t;
/********** Routing **********/
void routing_AS_begin(sg_platf_AS_cbarg_t AS);
void routing_AS_end(void);
-RoutingEdge *routing_add_host(As* as, sg_platf_host_cbarg_t host);
+surf_RoutingEdge* routing_add_host(surf_As* as, sg_platf_host_cbarg_t host);
void routing_cluster_add_backbone(void* bb);
-As* routing_get_current();
+surf_As* routing_get_current();
SG_END_DECL()
#endif /* _SURF_SURF_H */
#include "src/surf/surf_routing.hpp"
static XBT_INLINE void surf_cpu_free(void *r) {
- delete static_cast<Cpu*>(r);
+ delete static_cast<simgrid::surf::Cpu*>(r);
}
static XBT_INLINE void routing_asr_host_free(void *p) {
- delete static_cast<RoutingEdge*>(p);
+ delete static_cast<simgrid::surf::RoutingEdge*>(p);
}
void sg_host_init() {
}
void sg_host_surfcpu_register(sg_host_t host, surf_cpu_t cpu)
{
- surf_callback_emit(cpuCreatedCallbacks, cpu);
- surf_callback_emit(cpuStateChangedCallbacks, cpu, SURF_RESOURCE_ON, cpu->getState());
+ surf_callback_emit(simgrid::surf::cpuCreatedCallbacks, cpu);
+ surf_callback_emit(simgrid::surf::cpuStateChangedCallbacks, cpu, SURF_RESOURCE_ON, cpu->getState());
sg_host_surfcpu_set(host, cpu);
}
void sg_host_surfcpu_destroy(sg_host_t host) {
xbt_lib_unset(host_lib,host->key,SURF_CPU_LEVEL,1);
}
// ========== RoutingEdge ============
-RoutingEdge *sg_host_edge(sg_host_t host) {
- return (RoutingEdge*) xbt_lib_get_level(host, ROUTING_HOST_LEVEL);
+surf_RoutingEdge *sg_host_edge(sg_host_t host) {
+ return (surf_RoutingEdge*) xbt_lib_get_level(host, ROUTING_HOST_LEVEL);
}
-void sg_host_edge_set(sg_host_t host, RoutingEdge *edge) {
+void sg_host_edge_set(sg_host_t host, surf_RoutingEdge *edge) {
xbt_lib_set(host_lib, host->key, ROUTING_HOST_LEVEL, edge);
}
void sg_host_edge_destroy(sg_host_t host, int do_callback) {
void surf_on_host_created(void (*callback)(sg_host_t))
{
- hostCreatedCallbacks.connect([callback](Host* host) {
+ simgrid::surf::hostCreatedCallbacks.connect([callback](simgrid::surf::Host* host) {
const char* id = host->getName();
sg_host_t h = sg_host_by_name(id);
xbt_assert(h != NULL, "Host not found for name %s", id);
void surf_on_storage_created(void (*callback)(sg_storage_t))
{
- storageCreatedCallbacks.connect([callback](Storage* storage) {
+ simgrid::surf::storageCreatedCallbacks.connect([callback](simgrid::surf::Storage* storage) {
const char* id = storage->getName();
// TODO, create sg_storage_by_name
sg_storage_t s = xbt_lib_get_elm_or_null(storage_lib, id);
return;
}
- surf_cpu_model_pm = new CpuCas01Model();
- surf_cpu_model_vm = new CpuCas01Model();
+ surf_cpu_model_pm = new simgrid::surf::CpuCas01Model();
+ surf_cpu_model_vm = new simgrid::surf::CpuCas01Model();
- sg_platf_postparse_add_cb(cpu_add_traces);
+ sg_platf_postparse_add_cb(simgrid::surf::cpu_add_traces);
- Model *model_pm = surf_cpu_model_pm;
- Model *model_vm = surf_cpu_model_vm;
+ simgrid::surf::Model *model_pm = surf_cpu_model_pm;
+ simgrid::surf::Model *model_vm = surf_cpu_model_vm;
xbt_dynar_push(all_existing_models, &model_pm);
xbt_dynar_push(all_existing_models, &model_vm);
}
-CpuCas01Model::CpuCas01Model() : CpuModel()
+namespace simgrid {
+namespace surf {
+
+CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
{
char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
int select = xbt_cfg_get_boolean(_sg_cfg_set, "cpu/maxmin_selective_update");
}
lmm_expand(model->getMaxminSystem(), constraint, getVariable(), 1.0);
}
+
+}
+}
/***********
* Classes *
***********/
+
+namespace simgrid {
+namespace surf {
+
class XBT_PRIVATE CpuCas01Model;
class XBT_PRIVATE CpuCas01;
class XBT_PRIVATE CpuCas01Action;
/*********
* Model *
*********/
-class CpuCas01Model : public CpuModel {
+
+class CpuCas01Model : public simgrid::surf::CpuModel {
public:
CpuCas01Model();
~CpuCas01Model();
~CpuCas01Action() {};
};
+
+}
+}
int autoload_surf_cpu_model = 1;
void_f_void_t surf_cpu_model_init_preparse = NULL;
-CpuModel *surf_cpu_model_pm;
-CpuModel *surf_cpu_model_vm;
+simgrid::surf::CpuModel *surf_cpu_model_pm;
+simgrid::surf::CpuModel *surf_cpu_model_vm;
+
+namespace simgrid {
+namespace surf {
+
/*************
* Callbacks *
*************/
surf_callback(void, Cpu*) cpuDestructedCallbacks;
surf_callback(void, Cpu*, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
surf_callback(void, CpuAction*, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
-
void cpu_add_traces(){
surf_cpu_model_pm->addTraces();
}
/*********
* Model *
*********/
+
void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
{
CpuAction *action;
/************
* Resource *
************/
-
Cpu::Cpu(){
}
Action::setState(state);
surf_callback_emit(cpuActionStateChangedCallbacks, this, old, state);
}
+
+}
+}
/***********
* Classes *
***********/
+
+namespace simgrid {
+namespace surf {
+
class CpuModel;
class Cpu;
class CpuAction;
* @brief SURF cpu resource interface class
* @details A Cpu represent a cpu associated to a host
*/
-XBT_PUBLIC_CLASS Cpu : public Resource {
+XBT_PUBLIC_CLASS Cpu : public simgrid::surf::Resource {
public:
Cpu();
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
- Cpu(Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
lmm_constraint_t constraint, int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial);
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
- Cpu(Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial);
- Cpu(Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
lmm_constraint_t constraint, int core, double speedPeak, double speedScale);
- Cpu(Model *model, const char *name, xbt_dict_t props,
+ Cpu(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
int core, double speedPeak, double speedScale);
~Cpu();
* @param size The value of the processing amount (in flop) needed to process
* @return The CpuAction corresponding to the processing
*/
- virtual Action *execute(double size)=0;
+ virtual simgrid::surf::Action *execute(double size)=0;
/**
* @brief Make a process sleep for duration (in seconds)
* @param duration The number of seconds to sleep
* @return The CpuAction corresponding to the sleeping
*/
- virtual Action *sleep(double duration)=0;
+ virtual simgrid::surf::Action *sleep(double duration)=0;
/** @brief Get the amount of cores */
virtual int getCore();
* @brief SURF Cpu action interface class
* @details A CpuAction represent the execution of code on a Cpu
*/
-XBT_PUBLIC_CLASS CpuAction : public Action {
+XBT_PUBLIC_CLASS CpuAction : public simgrid::surf::Action {
friend XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
public:
/** @brief CpuAction constructor */
- CpuAction(Model *model, double cost, bool failed)
+ CpuAction(simgrid::surf::Model *model, double cost, bool failed)
: Action(model, cost, failed) {} //FIXME:REMOVE
/** @brief CpuAction constructor */
- CpuAction(Model *model, double cost, bool failed, lmm_variable_t var)
+ CpuAction(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var)
: Action(model, cost, failed, var) {}
/**
};
+}
+}
+
#endif /* SURF_CPU_INTERFACE_HPP_ */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu,
"Logging specific to the SURF CPU TRACE INTEGRATION module");
-static void cpu_ti_action_update_index_heap(void *action, int i);
+namespace simgrid {
+namespace surf {
+
+static inline
+void cpu_ti_action_update_index_heap(void *action, int i)
+{
+ ((simgrid::surf::CpuTiAction*)action)->updateIndexHeap(i);
+}
/*********
* Trace *
return low;
}
+}
+}
+
/*************
* CallBacks *
*************/
static void cpu_ti_define_callbacks()
{
- sg_platf_postparse_add_cb(cpu_add_traces);
+ sg_platf_postparse_add_cb(simgrid::surf::cpu_add_traces);
}
/*********
xbt_assert(!surf_cpu_model_pm,"CPU model already initialized. This should not happen.");
xbt_assert(!surf_cpu_model_vm,"CPU model already initialized. This should not happen.");
- surf_cpu_model_pm = new CpuTiModel();
- surf_cpu_model_vm = new CpuTiModel();
+ surf_cpu_model_pm = new simgrid::surf::CpuTiModel();
+ surf_cpu_model_vm = new simgrid::surf::CpuTiModel();
cpu_ti_define_callbacks();
- Model *model_pm = static_cast<Model*>(surf_cpu_model_pm);
- Model *model_vm = static_cast<Model*>(surf_cpu_model_vm);
+ simgrid::surf::Model *model_pm = static_cast<simgrid::surf::Model*>(surf_cpu_model_pm);
+ simgrid::surf::Model *model_vm = static_cast<simgrid::surf::Model*>(surf_cpu_model_vm);
xbt_dynar_push(all_existing_models, &model_pm);
xbt_dynar_push(all_existing_models, &model_vm);
}
+namespace simgrid {
+namespace surf {
+
CpuTiModel::CpuTiModel() : CpuModel()
{
p_runningActionSetThatDoesNotNeedBeingChecked = new ActionList();
* Action *
**********/
-static void cpu_ti_action_update_index_heap(void *action, int i)
-{
-((CpuTiAction*)action)->updateIndexHeap(i);
-}
-
CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed,
CpuTi *cpu)
: CpuAction(model_, cost, failed)
return m_remains;
}
+}
+}
+
#endif /* SURF_MODEL_CPUTI_H_ */
/* Epsilon */
#define EPSILON 0.000000001
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
xbt_heap_t p_tiActionHeap;
protected:
- void NotifyResourceTurnedOn(Resource*){};
- void NotifyResourceTurnedOff(Resource*){};
+ void NotifyResourceTurnedOn(simgrid::surf::Resource*){};
+ void NotifyResourceTurnedOff(simgrid::surf::Resource*){};
void NotifyActionCancel(Action*){};
void NotifyActionResume(Action*){};
void NotifyActionSuspend(Action*){};
};
+
+}
+}
void surf_host_model_init_current_default(void)
{
- surf_host_model = new HostCLM03Model();
+ surf_host_model = new simgrid::surf::HostCLM03Model();
xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "yes");
surf_cpu_model_init_Cas01();
surf_network_model_init_LegrandVelho();
- Model *model = surf_host_model;
+ simgrid::surf::Model *model = surf_host_model;
xbt_dynar_push(all_existing_models, &model);
}
xbt_assert(surf_cpu_model_pm, "No CPU model defined yet!");
xbt_assert(surf_network_model, "No network model defined yet!");
- surf_host_model = new HostCLM03Model();
+ surf_host_model = new simgrid::surf::HostCLM03Model();
xbt_dynar_push(all_existing_models, &surf_host_model);
}
+namespace simgrid {
+namespace surf {
+
Host *HostCLM03Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu){
- Host *host = new HostCLM03(surf_host_model, name, NULL,
+ Host *host = new simgrid::surf::HostCLM03(surf_host_model, name, NULL,
(xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
netElm, cpu);
surf_callback_emit(hostCreatedCallbacks, host);
/**********
* Action *
**********/
+
+}
+}
* Classes *
***********/
+namespace simgrid {
+namespace surf {
+
class XBT_PRIVATE HostCLM03Model;
class XBT_PRIVATE HostCLM03;
class XBT_PRIVATE HostCLM03Action;
* Action *
**********/
-
+}
+}
#endif /* SURF_HOST_CLM03_HPP_ */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf,
"Logging specific to the SURF host module");
-HostModel *surf_host_model = NULL;
+simgrid::surf::HostModel *surf_host_model = NULL;
+
+void host_add_traces(){
+ surf_host_model->addTraces();
+}
/*************
* Callbacks *
*************/
-surf_callback(void, Host*) hostCreatedCallbacks;
-surf_callback(void, Host*) hostDestructedCallbacks;
-surf_callback(void, Host*, e_surf_resource_state_t, e_surf_resource_state_t) hostStateChangedCallbacks;
-surf_callback(void, HostAction*, e_surf_action_state_t, e_surf_action_state_t) hostActionStateChangedCallbacks;
-
-void host_add_traces(){
- surf_host_model->addTraces();
-}
+namespace simgrid {
+namespace surf {
+
+surf_callback(void, simgrid::surf::Host*) hostCreatedCallbacks;
+surf_callback(void, simgrid::surf::Host*) hostDestructedCallbacks;
+surf_callback(void, simgrid::surf::Host*, e_surf_resource_state_t, e_surf_resource_state_t) hostStateChangedCallbacks;
+surf_callback(void, simgrid::surf::HostAction*, e_surf_action_state_t, e_surf_action_state_t) hostActionStateChangedCallbacks;
/*********
* Model *
*********/
+
/* Each VM has a dummy CPU action on the PM layer. This CPU action works as the
* constraint (capacity) of the VM in the PM layer. If the VM does not have any
* active task, the dummy CPU action must be deactivated, so that the VM does
/************
* Resource *
************/
-Host::Host(Model *model, const char *name, xbt_dict_t props,
+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)
p_params.ramsize = 0;
}
-Host::Host(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
+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)
return p_cpu->getProperties();
}
-Storage *Host::findStorageOnMountList(const char* mount)
+simgrid::surf::Storage *Host::findStorageOnMountList(const char* mount)
{
- Storage *st = NULL;
+ simgrid::surf::Storage *st = NULL;
s_mount_t mnt;
unsigned int cursor;
{
XBT_DEBUG("See '%s'",mnt.name);
if(!strcmp(mount,mnt.name)){
- st = static_cast<Storage*>(mnt.storage);
+ st = static_cast<simgrid::surf::Storage*>(mnt.storage);
break;
}
}
char *storage_name = NULL;
xbt_dynar_foreach(p_storage,i,mnt){
- storage_name = (char *)static_cast<Storage*>(mnt.storage)->getName();
+ storage_name = (char *)static_cast<simgrid::surf::Storage*>(mnt.storage)->getName();
xbt_dict_set(storage_list,mnt.name,storage_name,NULL);
}
return storage_list;
xbt_dynar_t result = xbt_dynar_new(sizeof(void*), NULL);
xbt_lib_foreach(storage_lib, cursor, key, data) {
if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
- Storage *storage = static_cast<Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
+ simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
if(!strcmp((const char*)storage->p_attach,this->getName())){
xbt_dynar_push_as(result, void *, (void*)storage->getName());
}
Action *Host::open(const char* fullpath) {
- Storage *st = NULL;
+ simgrid::surf::Storage *st = NULL;
s_mount_t mnt;
unsigned int cursor;
size_t longest_prefix_length = 0;
if(!strcmp(file_mount_name,mnt.name) && strlen(mnt.name)>longest_prefix_length)
{/* The current mount name is found in the full path and is bigger than the previous*/
longest_prefix_length = strlen(mnt.name);
- st = static_cast<Storage*>(mnt.storage);
+ st = static_cast<simgrid::surf::Storage*>(mnt.storage);
}
free(file_mount_name);
}
}
Action *Host::close(surf_file_t fd) {
- Storage *st = findStorageOnMountList(fd->mount);
+ simgrid::surf::Storage *st = findStorageOnMountList(fd->mount);
XBT_DEBUG("CLOSE %s on disk '%s'",fd->name, st->getName());
return st->close(fd);
}
Action *Host::read(surf_file_t fd, sg_size_t size) {
- Storage *st = findStorageOnMountList(fd->mount);
+ simgrid::surf::Storage *st = findStorageOnMountList(fd->mount);
XBT_DEBUG("READ %s on disk '%s'",fd->name, st->getName());
return st->read(fd, size);
}
Action *Host::write(surf_file_t fd, sg_size_t size) {
- Storage *st = findStorageOnMountList(fd->mount);
+ simgrid::surf::Storage *st = findStorageOnMountList(fd->mount);
XBT_DEBUG("WRITE %s on disk '%s'",fd->name, st->getName());
return st->write(fd, size);
}
return -1;
} else {
- Storage *st = findStorageOnMountList(fd->mount);
+ simgrid::surf::Storage *st = findStorageOnMountList(fd->mount);
/* Check if the file is on this storage */
if (!xbt_dict_get_or_null(st->p_content, fd->name)){
XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name,
xbt_dynar_t Host::getInfo( surf_file_t fd)
{
- Storage *st = findStorageOnMountList(fd->mount);
+ simgrid::surf::Storage *st = findStorageOnMountList(fd->mount);
sg_size_t *psize = xbt_new(sg_size_t, 1);
*psize = fd->size;
xbt_dynar_t info = xbt_dynar_new(sizeof(void*), NULL);
xbt_dynar_t Host::getVms()
{
- xbt_dynar_t dyn = xbt_dynar_new(sizeof(VirtualMachine*), NULL);
+ xbt_dynar_t dyn = xbt_dynar_new(sizeof(simgrid::surf::VirtualMachine*), NULL);
/* iterate for all virtual machines */
- for (VMModel::vm_list_t::iterator iter =
- VMModel::ws_vms.begin();
- iter != VMModel::ws_vms.end(); ++iter) {
+ for (simgrid::surf::VMModel::vm_list_t::iterator iter =
+ simgrid::surf::VMModel::ws_vms.begin();
+ iter != simgrid::surf::VMModel::ws_vms.end(); ++iter) {
- VirtualMachine *ws_vm = &*iter;
+ simgrid::surf::VirtualMachine *ws_vm = &*iter;
if (this == ws_vm->p_subWs)
xbt_dynar_push(dyn, &ws_vm);
}
Action::setState(state);
surf_callback_emit(hostActionStateChangedCallbacks, this, old, state);
}
+
+}
+}
* Classes *
***********/
+namespace simgrid {
+namespace surf {
+
class XBT_PRIVATE HostModel;
class XBT_PRIVATE Host;
class XBT_PRIVATE HostAction;
*/
XBT_PUBLIC_DATA(surf_callback(void, HostAction*, e_surf_action_state_t, e_surf_action_state_t)) hostActionStateChangedCallbacks;
+}
+}
+
/*********
* Tools *
*********/
-XBT_PUBLIC_DATA(HostModel*) surf_host_model;
+XBT_PUBLIC_DATA(simgrid::surf::HostModel*) surf_host_model;
XBT_PUBLIC(void) host_add_traces();
/*********
* Model *
*********/
+
+namespace simgrid {
+namespace surf {
+
/** @ingroup SURF_host_interface
* @brief SURF Host model interface class
* @details A model is an object which handle the interactions between its Resources and its Actions
* @brief SURF Host interface class
* @details An host represents a machine with a aggregation of a Cpu, a Link and a Storage
*/
-class Host : public Resource {
+class Host : public simgrid::surf::Resource {
public:
/**
* @brief Host constructor
* @param netElm The RoutingEdge associated to this Host
* @param cpu The Cpu associated to this Host
*/
- Host(Model *model, const char *name, xbt_dict_t props,
+ Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu);
/**
* @param netElm The RoutingEdge associated to this Host
* @param cpu The Cpu associated to this Host
*/
- Host(Model *model, const char *name, xbt_dict_t props,
+ Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
lmm_constraint_t constraint, xbt_dynar_t storage, RoutingEdge *netElm,
Cpu *cpu);
virtual Action *sleep(double duration)=0;
/** @brief Return the storage of corresponding mount point */
- virtual Storage *findStorageOnMountList(const char* storage);
+ virtual simgrid::surf::Storage *findStorageOnMountList(const char* storage);
/** @brief Get the xbt_dict_t of mount_point: Storage */
virtual xbt_dict_t getMountedStorageList();
* @param cost The cost of this HostAction in [TODO]
* @param failed [description]
*/
- HostAction(Model *model, double cost, bool failed)
+ HostAction(simgrid::surf::Model *model, double cost, bool failed)
: Action(model, cost, failed) {}
/**
* @param failed [description]
* @param var The lmm variable associated to this StorageAction if it is part of a LMM component
*/
- HostAction(Model *model, double cost, bool failed, lmm_variable_t var)
+ HostAction(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var)
: Action(model, cost, failed, var) {}
void setState(e_surf_action_state_t state);
};
+}
+}
#endif /* SURF_Host_INTERFACE_HPP_ */
sg_platf_link_add_cb(ptask_netlink_parse_init);
sg_platf_postparse_add_cb(host_add_traces);
- surf_host_model = new HostL07Model();
- Model *model = surf_host_model;
+ surf_host_model = new simgrid::surf::HostL07Model();
+ simgrid::surf::Model *model = surf_host_model;
xbt_dynar_push(all_existing_models, &model);
}
+namespace simgrid {
+namespace surf {
+
HostL07Model::HostL07Model() : HostModel() {
if (!ptask_maxmin_system)
ptask_maxmin_system = lmm_system_new(1);
XBT_OUT();
return m_remains;
}
+
+}
+}
#ifndef HOST_L07_HPP_
#define HOST_L07_HPP_
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
double m_rate;
};
+}
+}
+
#endif /* HOST_L07_HPP_ */
cnst->usage = elem->value / elem->variable->weight;
make_elem_active(elem);
- Action *action = static_cast<Action*>(elem->variable->id);
+ simgrid::surf::Action *action = static_cast<simgrid::surf::Action*>(elem->variable->id);
if (sys->keep_track && !action->is_linked())
sys->keep_track->push_back(*action);
}
s_xbt_swag_t saturated_variable_set; /* a list of lmm_variable_t */
s_xbt_swag_t saturated_constraint_set; /* a list of lmm_constraint_t_t */
- ActionLmmListPtr keep_track;
+ simgrid::surf::ActionLmmListPtr keep_track;
xbt_mallocator_t variable_mallocator;
} s_lmm_system_t;
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor",
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
func_reno_fpi);
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
func_reno2_fpi);
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
func_vegas_fpi);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
}
+namespace simgrid {
+namespace surf {
+
NetworkCm02Model::NetworkCm02Model()
:NetworkModel()
{
m_lastValue = lmm_variable_getvalue(getVariable());
}
+}
+}
#include "xbt/fifo.h"
#include "xbt/graph.h"
+
+
/***********
* Classes *
***********/
+
+namespace simgrid {
+namespace surf {
+
class XBT_PRIVATE NetworkCm02Model;
class XBT_PRIVATE NetworkCm02Action;
class XBT_PRIVATE NetworkSmpiModel;
+}
+}
+
/*********
* Tools *
*********/
/*********
* Model *
*********/
+
+namespace simgrid {
+namespace surf {
+
class NetworkCm02Model : public NetworkModel {
private:
void initialize();
double m_senderGap;
};
+}
+}
+
#endif /* SURF_NETWORK_CM02_HPP_ */
void surf_network_model_init_Constant()
{
xbt_assert(surf_network_model == NULL);
- surf_network_model = new NetworkConstantModel();
+ surf_network_model = new simgrid::surf::NetworkConstantModel();
routing_model_create(NULL);
- hostCreatedCallbacks.connect([](Host*) {
+ simgrid::surf::hostCreatedCallbacks.connect([](simgrid::surf::Host*) {
host_number_int++;
});
sg_platf_link_add_cb(netcste_parse_nolink);
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
}
+namespace simgrid {
+namespace surf {
+
double NetworkConstantModel::shareResources(double /*now*/)
{
NetworkConstantAction *action = NULL;
return m_suspended;
}
+}
+}
#include "network_interface.hpp"
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
+
class XBT_PRIVATE NetworkConstantModel;
class XBT_PRIVATE NetworkConstantAction;
int m_suspended;
};
+}
+}
+
#endif /* NETWORK_CONSTANT_HPP_ */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
-static void IB_create_host_callback(Host* host){
+static void IB_create_host_callback(simgrid::surf::Host* host){
+ using namespace simgrid::surf;
static int id=0;
// pour t->id -> rajouter une nouvelle struct dans le dict, pour stocker les comms actives
}
-static void IB_action_state_changed_callback(NetworkAction *action, e_surf_action_state_t statein, e_surf_action_state_t stateout){
+static void IB_action_state_changed_callback(
+ simgrid::surf::NetworkAction *action,
+ e_surf_action_state_t statein, e_surf_action_state_t stateout)
+{
+ using namespace simgrid::surf;
if(statein!=SURF_ACTION_RUNNING|| stateout!=SURF_ACTION_DONE)
return;
std::pair<IBNode*,IBNode*> pair = ((NetworkIBModel*)surf_network_model)->active_comms[action];
}
-static void IB_action_init_callback(NetworkAction *action,RoutingEdge *src, RoutingEdge *dst, double size, double rate){
+static void IB_action_init_callback(
+ simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst,
+ double size, double rate)
+{
+ using namespace simgrid::surf;
if(((NetworkIBModel*)surf_network_model)->active_nodes==NULL)
xbt_die("IB comm added, without any node connected !");
}
-
-
/*********
* Model *
*********/
/* } */
void surf_network_model_init_IB(void)
{
+ using simgrid::surf::networkActionStateChangedCallbacks;
+ using simgrid::surf::networkCommunicateCallbacks;
+ using simgrid::surf::hostCreatedCallbacks;
if (surf_network_model)
return;
- surf_network_model = new NetworkIBModel();
+ surf_network_model = new simgrid::surf::NetworkIBModel();
net_define_callbacks();
xbt_dynar_push(all_existing_models, &surf_network_model);
- surf_callback_connect(networkActionStateChangedCallbacks, IB_action_state_changed_callback);
- surf_callback_connect(networkCommunicateCallbacks, IB_action_init_callback);
+ surf_callback_connect(networkActionStateChangedCallbacks,
+ IB_action_state_changed_callback);
+ surf_callback_connect(networkCommunicateCallbacks,
+ IB_action_init_callback);
hostCreatedCallbacks.connect(IB_create_host_callback);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
}
+namespace simgrid {
+namespace surf {
+
NetworkIBModel::NetworkIBModel()
: NetworkSmpiModel() {
m_haveGap=false;
delete comm;
xbt_free(updated);
}
+
+}
+}
#include <xbt/base.h>
#include "network_smpi.hpp"
+
+namespace simgrid {
+namespace surf {
+
class XBT_PRIVATE IBNode;
class XBT_PRIVATE ActiveComm{
};
+}
+}
+
#endif
/*********
* C API *
*********/
-SG_BEGIN_DECL()
+
+extern "C" {
+
const char* sg_link_name(Link *link) {
return link->getName();
}
void sg_link_exit(void) {
Link::linksExit();
}
-SG_END_DECL()
+
+}
+
/*****************
* List of links *
*****************/
+namespace simgrid {
+namespace surf {
+
boost::unordered_map<std::string,Link *> *Link::links = new boost::unordered_map<std::string,Link *>();
Link *Link::byName(const char* name) {
Link * res = NULL;
delete (kv.second);
delete links;
}
+
/*************
* Callbacks *
*************/
-surf_callback(void, Link*) networkLinkCreatedCallbacks;
-surf_callback(void, Link*) networkLinkDestructedCallbacks;
-surf_callback(void, Link*, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
-surf_callback(void, NetworkAction*, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
-surf_callback(void, NetworkAction*, RoutingEdge *src, RoutingEdge *dst, double size, double rate) networkCommunicateCallbacks;
+surf_callback(void, simgrid::surf::Link*) networkLinkCreatedCallbacks;
+surf_callback(void, simgrid::surf::Link*) networkLinkDestructedCallbacks;
+surf_callback(void, simgrid::surf::Link*, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
+surf_callback(void, simgrid::surf::NetworkAction*, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
+surf_callback(void, simgrid::surf::NetworkAction*, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate) networkCommunicateCallbacks;
+
+}
+}
void netlink_parse_init(sg_platf_link_cbarg_t link){
if (link->policy == SURF_LINK_FULLDUPLEX) {
* Model *
*********/
-NetworkModel *surf_network_model = NULL;
+simgrid::surf::NetworkModel *surf_network_model = NULL;
+
+namespace simgrid {
+namespace surf {
double NetworkModel::latencyFactor(double /*size*/) {
return sg_latency_factor;
* Resource *
************/
-Link::Link(NetworkModel *model, const char *name, xbt_dict_t props)
+Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props)
: Resource(model, name, props)
{
links->insert({name, this});
XBT_DEBUG("Create link '%s'",name);
}
-Link::Link(NetworkModel *model, const char *name, xbt_dict_t props,
+Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props,
lmm_constraint_t constraint,
tmgr_history_t history,
tmgr_trace_t state_trace)
surf_callback_emit(networkLinkStateChangedCallbacks, this, old, state);
}
-
-
/**********
* Action *
**********/
surf_callback_emit(networkActionStateChangedCallbacks, this, old, state);
}
+}
+}
+
#endif /* NETWORK_INTERFACE_CPP_ */
/***********
* Classes *
***********/
+
+namespace simgrid {
+namespace surf {
+
class NetworkModel;
class NetworkAction;
* @brief Callbacks handler which emits the callbacks after Link creation
* @details Callback functions have the following signature: `void(Link*)`
*/
-XBT_PUBLIC_DATA( surf_callback(void, Link*)) networkLinkCreatedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, simgrid::surf::Link*)) networkLinkCreatedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emits the callbacks after Link destruction
* @details Callback functions have the following signature: `void(Link*)`
*/
-XBT_PUBLIC_DATA( surf_callback(void, Link*)) networkLinkDestructedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, simgrid::surf::Link*)) networkLinkDestructedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emits the callbacks after Link State changed
* @details Callback functions have the following signature: `void(LinkAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
*/
-XBT_PUBLIC_DATA( surf_callback(void, Link*, e_surf_resource_state_t, e_surf_resource_state_t)) networkLinkStateChangedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, simgrid::surf::Link*, e_surf_resource_state_t, e_surf_resource_state_t)) networkLinkStateChangedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emits the callbacks after NetworkAction State changed
* @details Callback functions have the following signature: `void(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
*/
-XBT_PUBLIC_DATA( surf_callback(void, NetworkAction*, e_surf_action_state_t, e_surf_action_state_t)) networkActionStateChangedCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, simgrid::surf::NetworkAction*, e_surf_action_state_t, e_surf_action_state_t)) networkActionStateChangedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emits the callbacks after communication created
* @details Callback functions have the following signature: `void(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate)`
*/
-XBT_PUBLIC_DATA( surf_callback(void, NetworkAction*, RoutingEdge *src, RoutingEdge *dst, double size, double rate)) networkCommunicateCallbacks;
+XBT_PUBLIC_DATA( surf_callback(void, simgrid::surf::NetworkAction*, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, double size, double rate)) networkCommunicateCallbacks;
+
+}
+}
/*********
* Tools *
/*********
* Model *
*********/
+
+namespace simgrid {
+namespace surf {
+
/** @ingroup SURF_network_interface
* @brief SURF network model interface class
* @details A model is an object which handles the interactions between its Resources and its Actions
* @brief SURF network link interface class
* @details A Link represents the link between two [hosts](\ref Host)
*/
-class Link : public Resource {
+class Link : public simgrid::surf::Resource {
public:
/**
* @brief Link constructor
* @param name The name of the Link
* @param props Dictionary of properties associated to this Link
*/
- Link(NetworkModel *model, const char *name, xbt_dict_t props);
+ Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props);
/**
* @brief Link constructor
* @param history [TODO]
* @param state_trace [TODO]
*/
- Link(NetworkModel *model, const char *name, xbt_dict_t props,
+ Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props,
lmm_constraint_t constraint,
tmgr_history_t history,
tmgr_trace_t state_trace);
* @brief SURF network action interface class
* @details A NetworkAction represents a communication between two [hosts](\ref Host)
*/
-class NetworkAction : public Action {
+class NetworkAction : public simgrid::surf::Action {
public:
/** @brief Constructor
*
* @param cost The cost of this NetworkAction in [TODO]
* @param failed [description]
*/
- NetworkAction(Model *model, double cost, bool failed)
- : Action(model, cost, failed) {}
+ NetworkAction(simgrid::surf::Model *model, double cost, bool failed)
+ : simgrid::surf::Action(model, cost, failed) {}
/**
* @brief NetworkAction constructor
* @param var The lmm variable associated to this Action if it is part of a
* LMM component
*/
- NetworkAction(Model *model, double cost, bool failed, lmm_variable_t var)
- : Action(model, cost, failed, var) {};
+ NetworkAction(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var)
+ : simgrid::surf::Action(model, cost, failed, var) {};
void setState(e_surf_action_state_t state);
};
+}
+}
+
#endif /* SURF_NETWORK_INTERFACE_HPP_ */
xbt_free(temp);
}
-static void simgrid_ns3_add_host(Host* host)
+static void simgrid_ns3_add_host(simgrid::surf::Host* host)
{
const char* id = host->getName();
XBT_DEBUG("NS3_ADD_HOST '%s'", id);
link->properties);
}
-static void simgrid_ns3_add_router(RoutingEdge* router)
+static void simgrid_ns3_add_router(simgrid::surf::RoutingEdge* router)
{
const char* router_id = router->getName();
XBT_DEBUG("NS3_ADD_ROUTER '%s'",router_id);
);
}
-static void parse_ns3_add_AS(As* as)
+static void parse_ns3_add_AS(simgrid::surf::As* as)
{
const char* as_id = as->p_name;
XBT_DEBUG("NS3_ADD_AS '%s'", as_id);
xbt_die("There is no routes!");
XBT_DEBUG("Have get_onelink_routes, found %ld routes",onelink_routes->used);
//save them in trace file
- Onelink *onelink;
+ simgrid::surf::Onelink *onelink;
unsigned int iter;
xbt_dynar_foreach(onelink_routes, iter, onelink) {
char *src = onelink->p_src->getName();
char *dst = onelink->p_dst->getName();
- NetworkNS3Link *link = static_cast<NetworkNS3Link *>(onelink->p_link);
+ simgrid::surf::NetworkNS3Link *link =
+ static_cast<simgrid::surf::NetworkNS3Link *>(onelink->p_link);
if (strcmp(src,dst) && link->m_created){
XBT_DEBUG("Route from '%s' to '%s' with link '%s'", src, dst, link->getName());
static void define_callbacks_ns3(void)
{
- hostCreatedCallbacks.connect(simgrid_ns3_add_host);
- routingEdgeCreatedCallbacks.connect(simgrid_ns3_add_router);
+ simgrid::surf::hostCreatedCallbacks.connect(simgrid_ns3_add_host);
+ simgrid::surf::routingEdgeCreatedCallbacks.connect(simgrid_ns3_add_router);
sg_platf_link_add_cb (&parse_ns3_add_link);
sg_platf_cluster_add_cb (&parse_ns3_add_cluster);
-
- asCreatedCallbacks.connect(parse_ns3_add_AS);
-
+ simgrid::surf::asCreatedCallbacks.connect(parse_ns3_add_AS);
sg_platf_postparse_add_cb(&create_ns3_topology); //get_one_link_routes
sg_platf_postparse_add_cb(&parse_ns3_end_platform); //InitializeRoutes
}
*********/
static void free_ns3_link(void * elmts)
{
- delete static_cast<NetworkNS3Link*>(elmts);
+ delete static_cast<simgrid::surf::NetworkNS3Link*>(elmts);
}
static void free_ns3_host(void * elmts)
if (surf_network_model)
return;
- surf_network_model = new NetworkNS3Model();
+ surf_network_model = new simgrid::surf::NetworkNS3Model();
xbt_dynar_push(all_existing_models, &surf_network_model);
}
+namespace simgrid {
+namespace surf {
+
NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
if (ns3_initialize(xbt_cfg_get_string(_sg_cfg_set, "ns3/TcpModel"))) {
xbt_die("Impossible to initialize NS3 interface");
}
return 0;
}
+
+}
+}
/***********
* Classes *
***********/
+
+namespace simgrid {
+namespace surf {
+
class XBT_PRIVATE NetworkNS3Model;
class XBT_PRIVATE NetworkNS3Action;
+}
+}
+
/*********
* Tools *
*********/
* Model *
*********/
+namespace simgrid {
+namespace surf {
+
class NetworkNS3Model : public NetworkModel {
public:
NetworkNS3Model();
RoutingEdge *p_dstElm;
};
+}
+}
#endif /* NETWORK_NS3_HPP_ */
if (surf_network_model)
return;
- surf_network_model = new NetworkSmpiModel();
+ surf_network_model = new simgrid::surf::NetworkSmpiModel();
net_define_callbacks();
xbt_dynar_push(all_existing_models, &surf_network_model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
}
+namespace simgrid {
+namespace surf {
+
NetworkSmpiModel::NetworkSmpiModel()
: NetworkCm02Model() {
m_haveGap=true;
/**********
* Action *
**********/
+
+}
+}
#include "network_cm02.hpp"
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
* Action *
**********/
-
+}
+}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_energy, surf,
"Logging specific to the SURF energy plugin");
-std::map<Host*, HostEnergy*> *surf_energy=NULL;
+namespace simgrid {
+namespace energy {
-static void energyHostCreatedCallback(Host *host){
+std::map<simgrid::surf::Host*, HostEnergy*> *surf_energy = NULL;
+
+}
+}
+
+using simgrid::energy::HostEnergy;
+using simgrid::energy::surf_energy;
+
+static void energyHostCreatedCallback(simgrid::surf::Host *host){
(*surf_energy)[host] = new HostEnergy(host);
}
-static void energyVMCreatedCallback(VirtualMachine* vm) {
- std::map<Host*, HostEnergy*>::iterator host_energy_it = surf_energy->find(vm->p_subWs);
+static void energyVMCreatedCallback(simgrid::surf::VirtualMachine* vm) {
+ std::map<simgrid::surf::Host*, HostEnergy*>::iterator host_energy_it = surf_energy->find(vm->p_subWs);
xbt_assert(host_energy_it != surf_energy->end(), "The host is not in surf_energy.");
(*surf_energy)[vm] = host_energy_it->second;
host_energy_it->second->ref(); // protect the HostEnergy from getting deleted too early
}
/* Computes the consumption so far. Called lazily on need. */
-static void update_consumption(Host *host, HostEnergy *host_energy) {
+static void update_consumption(simgrid::surf::Host *host, HostEnergy *host_energy) {
double cpu_load = lmm_constraint_get_usage(host->p_cpu->getConstraint()) / host->p_cpu->m_speedPeak;
double start_time = host_energy->last_updated;
double finish_time = surf_get_clock();
start_time, finish_time, host->p_cpu->m_speedPeak, previous_energy, energy_this_step);
}
-static void energyHostDestructedCallback(Host *host){
- std::map<Host*, HostEnergy*>::iterator host_energy_it = surf_energy->find(host);
+static void energyHostDestructedCallback(simgrid::surf::Host *host){
+ std::map<simgrid::surf::Host*, HostEnergy*>::iterator host_energy_it = surf_energy->find(host);
xbt_assert(host_energy_it != surf_energy->end(), "The host is not in surf_energy.");
HostEnergy *host_energy = host_energy_it->second;
surf_energy->erase(host_energy_it);
}
-static void energyCpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t cur){
+static void energyCpuActionStateChangedCallback(
+ simgrid::surf::CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t cur)
+{
const char *name = getActionCpu(action)->getName();
- Host *host = static_cast<Host*>(surf_host_resource_priv(sg_host_by_name(name)));
+ simgrid::surf::Host *host = static_cast<simgrid::surf::Host*>(surf_host_resource_priv(sg_host_by_name(name)));
HostEnergy *host_energy = (*surf_energy)[host];
update_consumption(host, host_energy);
}
-static void energyStateChangedCallback(Host *host, e_surf_resource_state_t oldState, e_surf_resource_state_t newState){
+static void energyStateChangedCallback(simgrid::surf::Host *host, e_surf_resource_state_t oldState, e_surf_resource_state_t newState)
+{
HostEnergy *host_energy = (*surf_energy)[host];
if(host_energy->last_updated < surf_get_clock())
* \details Enable energy plugin to get joules consumption of each cpu. You should call this function before #MSG_init().
*/
void sg_energy_plugin_init() {
- if (surf_energy == NULL) {
- surf_energy = new std::map<Host*, HostEnergy*>();
- surf_callback_connect(hostCreatedCallbacks, energyHostCreatedCallback);
- surf_callback_connect(VMCreatedCallbacks, energyVMCreatedCallback);
- surf_callback_connect(hostDestructedCallbacks, energyHostDestructedCallback);
- surf_callback_connect(cpuActionStateChangedCallbacks, energyCpuActionStateChangedCallback);
- surf_callback_connect(surfExitCallbacks, sg_energy_plugin_exit);
- surf_callback_connect(hostStateChangedCallbacks, energyStateChangedCallback);
+ if (simgrid::energy::surf_energy == NULL) {
+ simgrid::energy::surf_energy =
+ new std::map<simgrid::surf::Host*, simgrid::energy::HostEnergy*>();
+ surf_callback_connect(simgrid::surf::hostCreatedCallbacks, energyHostCreatedCallback);
+ surf_callback_connect(simgrid::surf::VMCreatedCallbacks, energyVMCreatedCallback);
+ surf_callback_connect(simgrid::surf::hostDestructedCallbacks, energyHostDestructedCallback);
+ surf_callback_connect(simgrid::surf::cpuActionStateChangedCallbacks, energyCpuActionStateChangedCallback);
+ surf_callback_connect(simgrid::surf::surfExitCallbacks, sg_energy_plugin_exit);
+ surf_callback_connect(simgrid::surf::hostStateChangedCallbacks, energyStateChangedCallback);
}
}
+namespace simgrid {
+namespace energy {
+
/**
*
*/
-HostEnergy::HostEnergy(Host *ptr)
+HostEnergy::HostEnergy(simgrid::surf::Host *ptr)
{
host = ptr;
total_energy = 0;
double HostEnergy::getWattMinAt(int pstate) {
xbt_dynar_t power_range_list = power_range_watts_list;
xbt_assert(power_range_watts_list, "No power range properties specified for host %s", host->getName());
- xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01*>(host->p_cpu)->getPState(), xbt_dynar_t);
+ xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<simgrid::surf::CpuCas01*>(host->p_cpu)->getPState(), xbt_dynar_t);
double min_power = xbt_dynar_get_as(current_power_values, 0, double);
return min_power;
}
double HostEnergy::getWattMaxAt(int pstate) {
xbt_dynar_t power_range_list = power_range_watts_list;
xbt_assert(power_range_watts_list, "No power range properties specified for host %s", host->getName());
- xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01*>(host->p_cpu)->getPState(), xbt_dynar_t);
+ xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<simgrid::surf::CpuCas01*>(host->p_cpu)->getPState(), xbt_dynar_t);
double max_power = xbt_dynar_get_as(current_power_values, 1, double);
return max_power;
}
xbt_assert(power_range_watts_list, "No power range properties specified for host %s", host->getName());
/* retrieve the power values associated with the current pstate */
- xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, static_cast<CpuCas01*>(host->p_cpu)->getPState(), xbt_dynar_t);
+ xbt_dynar_t current_power_values = xbt_dynar_get_as( power_range_list,
+ static_cast<simgrid::surf::CpuCas01*>(host->p_cpu)->getPState(),
+ xbt_dynar_t);
/* min_power corresponds to the idle power (cpu load = 0) */
/* max_power is the power consumed at 100% cpu load */
xbt_dynar_free(&all_power_values);
return power_range_list;
}
+
+}
+}
#ifndef ENERGY_CALLBACK_HPP_
#define ENERGY_CALLBACK_HPP_
+namespace simgrid {
+namespace energy {
+
class XBT_PRIVATE HostEnergy;
-extern XBT_PRIVATE std::map<Host*, HostEnergy*> *surf_energy;
+extern XBT_PRIVATE std::map<simgrid::surf::Host*, HostEnergy*> *surf_energy;
class HostEnergy {
public:
- HostEnergy(Host *ptr);
+ HostEnergy(simgrid::surf::Host *ptr);
~HostEnergy();
double getCurrentWattsValue(double cpu_load);
double watts_off; /*< Consumption when the machine is turned off (shutdown) */
double total_energy; /*< Total energy consumed by the host */
double last_updated; /*< Timestamp of the last energy update event*/
- Host *host;
+ simgrid::surf::Host *host;
void unref() {if (--refcount == 0) delete this;}
void ref() {refcount++;}
int refcount = 1;
};
+}
+}
+
#endif /* ENERGY_CALLBACK_HPP_ */
xbt_assert(! sg_host_by_name(host->id),
"Refusing to create a second host named '%s'.", host->id);
- RoutingEdge *net = NULL;
- As* current_routing = routing_get_current();
+ simgrid::surf::RoutingEdge *net = NULL;
+ simgrid::surf::As* current_routing = routing_get_current();
if (current_routing)
net = routing_add_host(current_routing, host);
- Cpu *cpu = surf_cpu_model_pm->createCpu(
+ simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu(
host->id,
host->speed_peak,
host->pstate,
*/
void sg_platf_new_router(sg_platf_router_cbarg_t router)
{
- As* current_routing = routing_get_current();
+ simgrid::surf::As* current_routing = routing_get_current();
if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
current_routing->p_hierarchy = SURF_ROUTING_BASE;
"Reading a router, processing unit \"%s\" already exists",
router->id);
- RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(router->id),
- -1,
- SURF_NETWORK_ELEMENT_ROUTER,
- current_routing);
+ simgrid::surf::RoutingEdge *info = new simgrid::surf::RoutingEdgeImpl(
+ xbt_strdup(router->id), -1, SURF_NETWORK_ELEMENT_ROUTER, current_routing);
info->setId(current_routing->parsePU(info));
xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, (void *) info);
XBT_DEBUG("Having set name '%s' id '%d'", router->id, info->getId());
- routingEdgeCreatedCallbacks(info);
+ simgrid::surf::routingEdgeCreatedCallbacks(info);
if (router->coord && strcmp(router->coord, "")) {
unsigned int cursor;
xbt_lib_t storage_type_lib;
int ROUTING_STORAGE_TYPE_LEVEL; //Routing for storage_type level
xbt_dynar_t mount_list = NULL;
-StorageModel *surf_storage_model = NULL;
+simgrid::surf::StorageModel *surf_storage_model = NULL;
+
+namespace simgrid {
+namespace surf {
/*************
* Callbacks *
*************/
-surf_callback(void, Storage*) storageCreatedCallbacks;
-surf_callback(void, Storage*) storageDestructedCallbacks;
-surf_callback(void, Storage*, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
-surf_callback(void, StorageAction*, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
+surf_callback(void, simgrid::surf::Storage*) storageCreatedCallbacks;
+surf_callback(void, simgrid::surf::Storage*) storageDestructedCallbacks;
+surf_callback(void, simgrid::surf::Storage*, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
+surf_callback(void, simgrid::surf::StorageAction*, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
/*********
* Model *
Action::setState(state);
surf_callback_emit(storageActionStateChangedCallbacks, this, old, state);
}
+
+}
+}
extern xbt_dynar_t mount_list;
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
* @brief Callbacks handler which emit the callbacks after Storage creation *
* @details Callback functions have the following signature: `void(Storage*)`
*/
-XBT_PUBLIC_DATA(surf_callback(void, Storage*)) storageCreatedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, simgrid::surf::Storage*)) storageCreatedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after Storage destruction *
* @details Callback functions have the following signature: `void(StoragePtr)`
*/
-XBT_PUBLIC_DATA(surf_callback(void, Storage*)) storageDestructedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, simgrid::surf::Storage*)) storageDestructedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after Storage State changed *
* @details Callback functions have the following signature: `void(StorageAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
*/
-XBT_PUBLIC_DATA(surf_callback(void, Storage*, e_surf_resource_state_t, e_surf_resource_state_t)) storageStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, simgrid::surf::Storage*, e_surf_resource_state_t, e_surf_resource_state_t)) storageStateChangedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after StorageAction State changed *
* @details Callback functions have the following signature: `void(StorageAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
*/
-XBT_PUBLIC_DATA(surf_callback(void, StorageAction*, e_surf_action_state_t, e_surf_action_state_t)) storageActionStateChangedCallbacks;
+XBT_PUBLIC_DATA(surf_callback(void, simgrid::surf::StorageAction*, e_surf_action_state_t, e_surf_action_state_t)) storageActionStateChangedCallbacks;
/*********
* Model *
* @brief SURF storage interface class
* @details A Storage represent a storage unit (e.g.: hard drive, usb key)
*/
-class Storage : public Resource {
+class Storage : public simgrid::surf::Resource {
public:
/**
* @brief Storage constructor
double progress;
};
+}
+}
+
typedef struct s_storage_type {
char *model;
char *content;
static XBT_INLINE void surf_storage_resource_free(void *r)
{
// specific to storage
- Storage *storage = static_cast<Storage*>(r);
+ simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(r);
// generic resource
delete storage;
}
void surf_storage_model_init_default(void)
{
- surf_storage_model = new StorageN11Model();
+ surf_storage_model = new simgrid::surf::StorageN11Model();
xbt_dynar_push(all_existing_models, &surf_storage_model);
}
+namespace simgrid {
+namespace surf {
+
StorageN11Model::StorageN11Model() : StorageModel() {
Action *action = NULL;
THROW_UNIMPLEMENTED;
}
+}
+}
#ifndef STORAGE_N11_HPP_
#define STORAGE_N11_HPP_
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
};
+}
+}
+
#endif /* STORAGE_N11_HPP_ */
* TOOLS *
*********/
-static Host *get_casted_host(surf_resource_t resource){
- return static_cast<Host*>(surf_host_resource_priv(resource));
+static simgrid::surf::Host *get_casted_host(surf_resource_t resource){
+ return static_cast<simgrid::surf::Host*>(surf_host_resource_priv(resource));
}
-static VirtualMachine *get_casted_vm(surf_resource_t resource){
- return static_cast<VirtualMachine*>(surf_host_resource_priv(resource));
+static simgrid::surf::VirtualMachine *get_casted_vm(surf_resource_t resource){
+ return static_cast<simgrid::surf::VirtualMachine*>(surf_host_resource_priv(resource));
}
extern double NOW;
double next_event_date = -1.0;
tmgr_trace_event_t event = NULL;
double value = -1.0;
- Resource *resource = NULL;
- Model *model = NULL;
+ simgrid::surf::Resource *resource = NULL;
+ simgrid::surf::Model *model = NULL;
unsigned int iter;
XBT_DEBUG ("First Run! Let's \"purge\" events and put models in the right state");
double next_event_date = -1.0;
double model_next_action_end = -1.0;
double value = -1.0;
- Resource *resource = NULL;
- Model *model = NULL;
+ simgrid::surf::Resource *resource = NULL;
+ simgrid::surf::Model *model = NULL;
tmgr_trace_event_t event = NULL;
unsigned int iter;
surf_model_t surf_resource_model(const void *host, int level) {
/* If level is SURF_WKS_LEVEL, ws is a host_CLM03 object. It has
* surf_resource at the generic_resource field. */
- Resource *ws = static_cast<Resource*>(xbt_lib_get_level((xbt_dictelm_t) host, level));
+ simgrid::surf::Resource *ws = static_cast<simgrid::surf::Resource*>(
+ xbt_lib_get_level((xbt_dictelm_t) host, level));
return ws->getModel();
}
double *flops_amount,
double *bytes_amount,
double rate){
- return static_cast<Action*>(model->executeParallelTask(host_nb, host_list, flops_amount, bytes_amount, rate));
+ return static_cast<simgrid::surf::Action*>(
+ model->executeParallelTask(host_nb, host_list, flops_amount, bytes_amount, rate));
}
xbt_dynar_t surf_host_model_get_route(surf_host_model_t /*model*/,
surf_resource_t src, surf_resource_t dst){
xbt_dynar_t route = NULL;
- routing_platf->getRouteAndLatency(get_casted_host(src)->p_netElm,
- get_casted_host(dst)->p_netElm, &route, NULL);
+ routing_platf->getRouteAndLatency(
+ get_casted_host(src)->p_netElm,
+ get_casted_host(dst)->p_netElm, &route, NULL);
return route;
}
int surf_host_get_pstate(surf_resource_t host){
return sg_host_surfcpu(host)->getPstate();
}
+
+using simgrid::energy::HostEnergy;
+using simgrid::energy::surf_energy;
+
double surf_host_get_wattmin_at(surf_resource_t resource, int pstate){
xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
- std::map<Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
+ std::map<simgrid::surf::Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
return hostIt->second->getWattMinAt(pstate);
}
double surf_host_get_wattmax_at(surf_resource_t resource, int pstate){
xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
- std::map<Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
+ std::map<simgrid::surf::Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
return hostIt->second->getWattMaxAt(pstate);
}
double surf_host_get_consumed_energy(surf_resource_t resource){
xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
- std::map<Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
+ std::map<simgrid::surf::Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
return hostIt->second->getConsumedEnergy();
}
xbt_dynar_t vms = get_casted_host(host)->getVms();
xbt_dynar_t vms_ = xbt_dynar_new(sizeof(sg_host_t), NULL);
unsigned int cpt;
- VirtualMachine *vm;
+ simgrid::surf::VirtualMachine *vm;
xbt_dynar_foreach(vms, cpt, vm) {
sg_host_t vm_ = xbt_lib_get_elm_or_null(host_lib, vm->getName());
xbt_dynar_push(vms_, &vm_);
void surf_vm_destroy(surf_resource_t resource){
/* Before clearing the entries in host_lib, we have to pick up resources. */
- VirtualMachine *vm = get_casted_vm(resource);
+ simgrid::surf::VirtualMachine *vm = get_casted_vm(resource);
char* name = xbt_dict_get_elm_key(resource);
/* We deregister objects from host_lib, without invoking the freeing callback
* of each level.
}
xbt_dict_t surf_storage_get_content(surf_resource_t resource){
- return static_cast<Storage*>(surf_storage_resource_priv(resource))->getContent();
+ return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getContent();
}
sg_size_t surf_storage_get_size(surf_resource_t resource){
- return static_cast<Storage*>(surf_storage_resource_priv(resource))->getSize();
+ return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getSize();
}
sg_size_t surf_storage_get_free_size(surf_resource_t resource){
- return static_cast<Storage*>(surf_storage_resource_priv(resource))->getFreeSize();
+ return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getFreeSize();
}
sg_size_t surf_storage_get_used_size(surf_resource_t resource){
- return static_cast<Storage*>(surf_storage_resource_priv(resource))->getUsedSize();
+ return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->getUsedSize();
}
const char* surf_storage_get_host(surf_resource_t resource){
- return static_cast<Storage*>(surf_storage_resource_priv(resource))->p_attach;
+ return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(resource))->p_attach;
}
surf_action_t surf_cpu_execute(surf_resource_t cpu, double size){
}
void surf_cpu_action_set_affinity(surf_action_t action, surf_resource_t cpu, unsigned long mask) {
- static_cast<CpuAction*>(action)->setAffinity(sg_host_surfcpu(cpu), mask);
+ static_cast<simgrid::surf::CpuAction*>(action)->setAffinity(sg_host_surfcpu(cpu), mask);
}
void surf_cpu_action_set_bound(surf_action_t action, double bound) {
- static_cast<CpuAction*>(action)->setBound(bound);
+ static_cast<simgrid::surf::CpuAction*>(action)->setBound(bound);
}
#ifdef HAVE_LATENCY_BOUND_TRACKING
#endif
surf_file_t surf_storage_action_get_file(surf_action_t action){
- return static_cast<StorageAction*>(action)->p_file;
+ return static_cast<simgrid::surf::StorageAction*>(action)->p_file;
}
xbt_dynar_t host_that_restart = NULL;
xbt_dict_t watched_hosts_lib;
+namespace simgrid {
+namespace surf {
+
surf_callback(void, void) surfExitCallbacks;
+}
+}
+
s_surf_model_description_t surf_plugin_description[] = {
{"Energy", "Cpu energy consumption.", sg_energy_plugin_init},
{NULL, NULL, NULL} /* this array must be NULL terminated */
static XBT_INLINE void surf_host_free(void *r)
{
- delete static_cast<Host*>(r);
+ delete static_cast<simgrid::surf::Host*>(r);
}
static XBT_INLINE void surf_storage_free(void *r)
{
- delete static_cast<Storage*>(r);
+ delete static_cast<simgrid::surf::Storage*>(r);
}
void sg_version_check(int lib_version_major,int lib_version_minor,int lib_version_patch) {
xbt_init(argc, argv);
if (!all_existing_models)
- all_existing_models = xbt_dynar_new(sizeof(Model*), NULL);
+ all_existing_models = xbt_dynar_new(sizeof(simgrid::surf::Model*), NULL);
if (!model_list_invoke)
- model_list_invoke = xbt_dynar_new(sizeof(Model*), NULL);
+ model_list_invoke = xbt_dynar_new(sizeof(simgrid::surf::Model*), NULL);
if (!history)
history = tmgr_history_new();
void surf_exit(void)
{
unsigned int iter;
- Model *model = NULL;
+ simgrid::surf::Model *model = NULL;
TRACE_end(); /* Just in case it was not called by the upper
* layer (or there is no upper layer) */
xbt_dynar_free(&model_list_invoke);
routing_exit();
- surf_callback_emit(surfExitCallbacks);
+ surf_callback_emit(simgrid::surf::surfExitCallbacks);
if (maxmin_system) {
lmm_system_free(maxmin_system);
* Model *
*********/
+namespace simgrid {
+namespace surf {
+
Model::Model()
: p_maxminSystem(NULL)
{
THROW_UNIMPLEMENTED;
}
+}
+}
+
/************
* Resource *
************/
+namespace simgrid {
+namespace surf {
+
Resource::Resource()
: p_name(NULL), p_properties(NULL), p_model(NULL)
{}
return p_constraint;
}
+}
+}
+
/**********
* Action *
**********/
"SURF_ACTION_NOT_IN_THE_SYSTEM"
};
-void Action::initialize(Model *model, double cost, bool failed,
+/* added to manage the communication action's heap */
+void surf_action_lmm_update_index_heap(void *action, int i) {
+ static_cast<simgrid::surf::Action*>(action)->updateIndexHeap(i);
+}
+
+namespace simgrid {
+namespace surf {
+
+void Action::initialize(simgrid::surf::Model *model, double cost, bool failed,
lmm_variable_t var)
{
m_priority = 1.0;
p_stateSet->push_back(*this);
}
-Action::Action(Model *model, double cost, bool failed)
+Action::Action(simgrid::surf::Model *model, double cost, bool failed)
{
initialize(model, cost, failed);
}
-Action::Action(Model *model, double cost, bool failed, lmm_variable_t var)
+Action::Action(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var)
{
initialize(model, cost, failed, var);
}
}
}
-/* added to manage the communication action's heap */
-void surf_action_lmm_update_index_heap(void *action, int i) {
- static_cast<Action*>(action)->updateIndexHeap(i);
-}
-
void Action::updateIndexHeap(int i) {
m_indexHeap = i;
}
double_update(&m_remains, m_lastValue * delta, sg_surf_precision*sg_maxmin_precision);
if (getModel() == surf_cpu_model_pm && TRACE_is_enabled()) {
- Resource *cpu = static_cast<Resource*>(lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
+ simgrid::surf::Resource *cpu = static_cast<simgrid::surf::Resource*>(
+ lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
TRACE_surf_host_set_utilization(cpu->getName(), getCategory(), m_lastValue, m_lastUpdate, now - m_lastUpdate);
}
XBT_DEBUG("Updating action(%p): remains is now %f", this, m_remains);
m_lastUpdate = now;
m_lastValue = lmm_variable_getvalue(getVariable());
}
+
+}
+}
extern XBT_PRIVATE double sg_sender_gap;
+namespace simgrid {
+namespace surf {
+
extern XBT_PRIVATE surf_callback(void, void) surfExitCallbacks;
+}
+}
+
int XBT_PRIVATE __surf_is_absolute_file_path(const char *file_path);
/***********
/**********
* Action *
**********/
+
XBT_PRIVATE void surf_action_lmm_update_index_heap(void *action, int i);
+XBT_PUBLIC_DATA(xbt_dynar_t) all_existing_models;
+
+namespace simgrid {
+namespace surf {
+
/** @ingroup SURF_interface
* @brief SURF action interface class
* @details An action is an event generated by a resource (e.g.: a communication for the network)
/**
* @brief Common initializations for the constructors
*/
- void initialize(Model *model, double cost, bool failed,
+ void initialize(simgrid::surf::Model *model, double cost, bool failed,
lmm_variable_t var = NULL);
public:
* @param cost The cost of the Action
* @param failed If the action is impossible (e.g.: execute something on a switched off host)
*/
- Action(Model *model, double cost, bool failed);
+ Action(simgrid::surf::Model *model, double cost, bool failed);
/**
* @brief Action constructor
* @param failed If the action is impossible (e.g.: execute something on a switched off host)
* @param var The lmm variable associated to this Action if it is part of a LMM component
*/
- Action(Model *model, double cost, bool failed, lmm_variable_t var);
+ Action(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var);
/** @brief Destructor */
virtual ~Action();
s_xbt_swag_hookup_t p_stateHookup;
- Model *getModel() {return p_model;}
+ simgrid::surf::Model *getModel() {return p_model;}
protected:
ActionList* p_stateSet;
int m_latencyLimited; /**< Set to 1 if is limited by latency, 0 otherwise */
#endif
double m_cost;
- Model *p_model;
+ simgrid::surf::Model *p_model;
void *p_data; /**< for your convenience */
/* LMM */
/*********
* Model *
*********/
-XBT_PUBLIC_DATA(xbt_dynar_t) all_existing_models;
/** @ingroup SURF_interface
* @brief SURF model interface class
ActionList* p_doneActionSet; /**< Actions in state SURF_ACTION_DONE */
};
+}
+}
+
/************
* Resource *
************/
tmgr_trace_event_t event; /**< The associated trace event associated to the metric */
} s_surf_metric_t;
+namespace simgrid {
+namespace surf {
+
/** @ingroup SURF_interface
* @brief SURF resource interface class
* @details A resource represent an element of a component (e.g.: a link for the network)
lmm_constraint_t p_constraint;
};
+}
+}
+
#endif /* SURF_MODEL_H_ */
* Callbacks *
*************/
-surf_callback(void, RoutingEdge*) routingEdgeCreatedCallbacks;
-surf_callback(void, As*) asCreatedCallbacks;
+namespace simgrid {
+namespace surf {
+
+surf_callback(void, simgrid::surf::RoutingEdge*) routingEdgeCreatedCallbacks;
+surf_callback(void, simgrid::surf::As*) asCreatedCallbacks;
+
+}
+}
/**
* @ingroup SURF_build_api
*
* Routing edges are either host and routers, whatever
*/
-RoutingEdge *sg_routing_edge_by_name_or_null(const char *name) {
+simgrid::surf::RoutingEdge *sg_routing_edge_by_name_or_null(const char *name)
+{
sg_host_t h = sg_host_by_name(name);
- RoutingEdge *net_elm = h==NULL?NULL: sg_host_edge(h);
+ simgrid::surf::RoutingEdge *net_elm = h==NULL?NULL: sg_host_edge(h);
if (!net_elm)
- net_elm = (RoutingEdge*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
+ net_elm = (simgrid::surf::RoutingEdge*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
return net_elm;
}
/* Global vars */
-RoutingPlatf *routing_platf = NULL;
+simgrid::surf::RoutingPlatf *routing_platf = NULL;
/* global parse functions */
extern xbt_dynar_t mount_list;
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf");
/** The current AS in the parsing */
-static As *current_routing = NULL;
-As* routing_get_current()
+static simgrid::surf::As *current_routing = NULL;
+simgrid::surf::As* routing_get_current()
{
return current_routing;
}
*/
void sg_platf_new_host_link(sg_platf_host_link_cbarg_t host)
{
- RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
+ simgrid::surf::RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
xbt_assert(info, "Host '%s' not found!", host->id);
xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
/**
* \brief Add a "host" to the network element list
*/
-RoutingEdge *routing_add_host(As* current_routing, sg_platf_host_cbarg_t host)
+simgrid::surf::RoutingEdge *routing_add_host(
+ simgrid::surf::As* current_routing, sg_platf_host_cbarg_t host)
{
if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
current_routing->p_hierarchy = SURF_ROUTING_BASE;
xbt_assert(!sg_host_by_name(host->id),
"Reading a host, processing unit \"%s\" already exists", host->id);
- RoutingEdge *routingEdge = new RoutingEdgeImpl(xbt_strdup(host->id),
+ simgrid::surf::RoutingEdge *routingEdge =
+ new simgrid::surf::RoutingEdgeImpl(xbt_strdup(host->id),
-1,
SURF_NETWORK_ELEMENT_HOST,
current_routing);
routingEdge->setId(current_routing->parsePU(routingEdge));
sg_host_edge_set(sg_host_by_name_or_create(host->id), routingEdge);
XBT_DEBUG("Having set name '%s' id '%d'", host->id, routingEdge->getId());
- routingEdgeCreatedCallbacks(routingEdge);
+ simgrid::surf::routingEdgeCreatedCallbacks(routingEdge);
if(mount_list){
xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void *) mount_list);
}
/* make a new routing component */
- As *new_as = model->create();
+ simgrid::surf::As *new_as = model->create();
new_as->p_modelDesc = model;
new_as->p_hierarchy = SURF_ROUTING_NULL;
new_as->p_name = xbt_strdup(AS->id);
- RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(new_as->p_name),
+ simgrid::surf::RoutingEdge *info =
+ new simgrid::surf::RoutingEdgeImpl(xbt_strdup(new_as->p_name),
-1,
SURF_NETWORK_ELEMENT_AS,
current_routing);
current_routing = new_as;
current_routing->p_netElem = info;
- routingEdgeCreatedCallbacks(info);
- asCreatedCallbacks(new_as);
+ simgrid::surf::routingEdgeCreatedCallbacks(info);
+ simgrid::surf::asCreatedCallbacks(new_as);
}
/**
{
xbt_assert(src && dst, "bad parameters for \"elements_father\" method");
#define ELEMENTS_FATHER_MAXDEPTH 16 /* increase if it is not enough */
- As *src_as, *dst_as;
- As *path_src[ELEMENTS_FATHER_MAXDEPTH];
- As *path_dst[ELEMENTS_FATHER_MAXDEPTH];
+ simgrid::surf::As *src_as, *dst_as;
+ simgrid::surf::As *path_src[ELEMENTS_FATHER_MAXDEPTH];
+ simgrid::surf::As *path_dst[ELEMENTS_FATHER_MAXDEPTH];
int index_src = 0;
int index_dst = 0;
- As *current;
- As *current_src;
- As *current_dst;
- As *father;
+ simgrid::surf::As *current;
+ simgrid::surf::As *current_src;
+ simgrid::surf::As *current_dst;
+ simgrid::surf::As *father;
/* (1) find the as where the src and dst are located */
sg_routing_edge_t src_data = src;
* This function is called by "get_route" and "get_latency". It allows to walk
* recursively through the ASes tree.
*/
-static void _get_route_and_latency(RoutingEdge *src, RoutingEdge *dst,
- xbt_dynar_t * links, double *latency)
+static void _get_route_and_latency(
+ simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst,
+ xbt_dynar_t * links, double *latency)
{
s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER;
memset(&route,0,sizeof(route));
XBT_DEBUG("Solve route/latency \"%s\" to \"%s\"", src->getName(), dst->getName());
/* Find how src and dst are interconnected */
- As *common_father, *src_father, *dst_father;
+ simgrid::surf::As *common_father, *src_father, *dst_father;
elements_father(src, dst, &common_father, &src_father, &dst_father);
XBT_DEBUG("elements_father: common father '%s' src_father '%s' dst_father '%s'",
common_father->p_name, src_father->p_name, dst_father->p_name);
route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
// Find the net_card corresponding to father
- RoutingEdge *src_father_net_elm = src_father->p_netElem;
- RoutingEdge *dst_father_net_elm = dst_father->p_netElem;
+ simgrid::surf::RoutingEdge *src_father_net_elm = src_father->p_netElem;
+ simgrid::surf::RoutingEdge *dst_father_net_elm = dst_father->p_netElem;
common_father->getRouteAndLatency(src_father_net_elm, dst_father_net_elm,
&route, latency);
return edge->getRcType();
}
+namespace simgrid {
+namespace surf {
/**
* \brief Find a route between hosts
* walk through the routing components tree and find a route between hosts
* by calling the differents "get_route" functions in each routing component.
*/
-void RoutingPlatf::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst,
- xbt_dynar_t* route, double *latency)
+void RoutingPlatf::getRouteAndLatency(
+ simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst,
+ xbt_dynar_t* route, double *latency)
{
XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
if (!*route) {
return ret;
}
+}
+}
+
e_surf_network_element_type_t routing_get_network_element_type(const char *name)
{
- RoutingEdge *rc = sg_routing_edge_by_name_or_null(name);
+ simgrid::surf::RoutingEdge *rc = sg_routing_edge_by_name_or_null(name);
if (rc)
return rc->getRcType();
void routing_model_create( void *loopback)
{
/* config the uniq global routing */
- routing_platf = new RoutingPlatf();
+ routing_platf = new simgrid::surf::RoutingPlatf();
routing_platf->p_root = NULL;
routing_platf->p_loopback = loopback;
routing_platf->p_lastRoute = xbt_dynar_new(sizeof(sg_routing_link_t),NULL);
xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER],
"You have to be in model Cluster to use tag backbone!");
xbt_assert(!static_cast<AsCluster*>(current_routing)->p_backbone, "The backbone link is already defined!");
- static_cast<AsCluster*>(current_routing)->p_backbone = static_cast<Link*>(bb);
+ static_cast<simgrid::surf::AsCluster*>(current_routing)->p_backbone =
+ static_cast<simgrid::surf::Link*>(bb);
XBT_DEBUG("Add a backbone to AS '%s'", current_routing->p_name);
}
void routing_new_cluster(sg_platf_cluster_cbarg_t cluster)
{
+ using simgrid::surf::AsCluster;
+ using simgrid::surf::AsClusterTorus;
+ using simgrid::surf::AsClusterFatTree;
+
char *host_id, *groups, *link_id = NULL;
xbt_dict_t patterns = NULL;
int rankId=0;
info_loop.link_up = Link::byName(tmp_link);
info_loop.link_down = info_loop.link_up;
free(tmp_link);
- xbt_dynar_set(current_routing->p_linkUpDownList, rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node, &info_loop);
+ xbt_dynar_set(current_routing->p_linkUpDownList,
+ rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node, &info_loop);
}
//add a limiter link (shared link to account for maximal bandwidth of the node)
info_lim.link_up = Link::byName(tmp_link);
info_lim.link_down = info_lim.link_up;
free(tmp_link);
+ auto as_cluster = static_cast<AsCluster*>(current_routing);
xbt_dynar_set(current_routing->p_linkUpDownList,
- rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node + static_cast<AsCluster*>(current_routing)->p_has_loopback ,
+ rankId*(as_cluster)->p_nb_links_per_node + as_cluster->p_has_loopback ,
&info_lim);
}
// For fat trees, the links must be created once all nodes have been added
if(cluster->topology == SURF_CLUSTER_FAT_TREE) {
- static_cast<AsClusterFatTree*>(current_routing)->create_links();
+ static_cast<simgrid::surf::AsClusterFatTree*>(current_routing)->create_links();
}
// Add a router. It is magically used thanks to the way in which surf_routing_cluster is written,
// and it's very useful to connect clusters together
bprintf("%s%s_router%s", cluster->prefix, cluster->id,
cluster->suffix);
sg_platf_new_router(&router);
- ((AsCluster*)current_routing)->p_router = (RoutingEdge*) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
+ ((AsCluster*)current_routing)->p_router = (simgrid::surf::RoutingEdge*) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
free(newid);
//Make the backbone
void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
{
+ using simgrid::surf::RoutingEdge;
+ using simgrid::surf::AsCluster;
+
char *host_id = NULL;
char *link_id = NULL;
char *router_id = NULL;
xbt_lib_cursor_t cursor;
char *key;
void **data;
- RoutingEdge *host_elm;
+ simgrid::surf::RoutingEdge *host_elm;
xbt_lib_foreach(storage_lib, cursor, key, data) {
if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
- Storage *storage = static_cast<Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
+ simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
host_elm = sg_routing_edge_by_name_or_null(storage->p_attach);
if(!host_elm)
surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
* This fuction is call by "finalize". It allow to finalize the
* AS or routing components. It delete all the structures.
*/
-static void finalize_rec(As *as) {
+static void finalize_rec(simgrid::surf::As *as) {
xbt_dict_cursor_t cursor = NULL;
char *key;
AS_t elem;
delete routing_platf;
}
+namespace simgrid {
+namespace surf {
+
RoutingPlatf::~RoutingPlatf()
{
xbt_dynar_free(&p_lastRoute);
finalize_rec(p_root);
}
+}
+}
+
AS_t surf_AS_get_routing_root() {
return routing_platf->p_root;
}
-const char *surf_AS_get_name(As *as) {
+const char *surf_AS_get_name(simgrid::surf::As *as) {
return as->p_name;
}
-static As *surf_AS_recursive_get_by_name(As *current, const char * name) {
+static simgrid::surf::As *surf_AS_recursive_get_by_name(
+ simgrid::surf::As *current, const char * name)
+{
xbt_dict_cursor_t cursor = NULL;
char *key;
AS_t elem;
- As *tmp = NULL;
+ simgrid::surf::As *tmp = NULL;
if(!strcmp(current->p_name, name))
return current;
return tmp;
}
-
-As *surf_AS_get_by_name(const char * name) {
- As *as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
+simgrid::surf::As *surf_AS_get_by_name(const char * name)
+{
+ simgrid::surf::As *as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
if(as == NULL)
XBT_WARN("Impossible to find an AS with name %s, please check your input", name);
return as;
}
-xbt_dict_t surf_AS_get_routing_sons(As *as) {
+xbt_dict_t surf_AS_get_routing_sons(simgrid::surf::As *as)
+{
return as->p_routingSons;
}
-const char *surf_AS_get_model(As *as) {
+const char *surf_AS_get_model(simgrid::surf::As *as)
+{
return as->p_modelDesc->name;
}
-xbt_dynar_t surf_AS_get_hosts(As *as) {
+xbt_dynar_t surf_AS_get_hosts(simgrid::surf::As *as)
+{
xbt_dynar_t elms = as->p_indexNetworkElm;
sg_routing_edge_t relm;
xbt_dictelm_t delm;
int count = xbt_dynar_length(elms);
xbt_dynar_t res = xbt_dynar_new(sizeof(xbt_dictelm_t), NULL);
for (index = 0; index < count; index++) {
- relm = xbt_dynar_get_as(elms, index, RoutingEdge*);
+ relm = xbt_dynar_get_as(elms, index, simgrid::surf::RoutingEdge*);
delm = xbt_lib_get_elm_or_null(host_lib, relm->getName());
if (delm!=NULL) {
xbt_dynar_push(res, &delm);
XBT_PUBLIC(void) routing_model_create( void *loopback);
-/* ************************************************************************** */
-/* ************************* GRAPH EXPORTING FUNCTIONS ********************** */
-XBT_PRIVATE xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes);
-XBT_PRIVATE xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
+namespace simgrid {
+namespace surf {
/***********
* Classes *
* @brief A routing edge
* @details [long description]
*/
-struct RoutingEdge {
+class RoutingEdge {
public:
virtual ~RoutingEdge(){};
virtual int getId()=0;
* @param into [description]
* @param latency [description]
*/
- virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency)=0;
+ virtual void getRouteAndLatency(
+ RoutingEdge *src, RoutingEdge *dst,
+ sg_platf_route_cbarg_t into, double *latency)=0;
virtual xbt_dynar_t getOneLinkRoutes()=0;
virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0;
- virtual sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat)=0;
+ virtual sg_platf_route_cbarg_t getBypassRoute(
+ RoutingEdge *src, RoutingEdge *dst,
+ double *lat)=0;
/* The parser calls the following functions to inform the routing models
* that a new element is added to the AS currently built.
*
* Of course, only the routing model of this AS is informed, not every ones */
virtual int parsePU(RoutingEdge *elm)=0; /* A host or a router, whatever */
- virtual int parseAS( RoutingEdge *elm)=0;
+ virtual int parseAS(RoutingEdge *elm)=0;
virtual void parseRoute(sg_platf_route_cbarg_t route)=0;
virtual void parseASroute(sg_platf_route_cbarg_t route)=0;
virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
XBT_PUBLIC_DATA(surf_callback(void, RoutingEdge*)) routingEdgeCreatedCallbacks;
XBT_PUBLIC_DATA(surf_callback(void, As*)) asCreatedCallbacks;
+}
+}
+
#endif /* NETWORK_ROUTING_HPP_ */
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "surf_routing_cluster.hpp"
+#include "surf_routing_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
AS_t model_cluster_create(void)
{
- return new AsCluster();
+ return new simgrid::surf::AsCluster();
}
+namespace simgrid {
+namespace surf {
+
/* Creation routing model functions */
AsCluster::AsCluster() : AsNone()
{
}
if (p_backbone) {
- xbt_dynar_push_as(route->link_list, void *, static_cast<Resource*>(p_backbone));
+ xbt_dynar_push_as(route->link_list, void *,
+ static_cast<simgrid::surf::Resource*>(p_backbone));
if (lat)
*lat += p_backbone->getLatency();
}
if (info.link_up) { // link up
- const char *link_name = static_cast<Resource*>(info.link_up)->getName();
+ const char *link_name = static_cast<simgrid::surf::Resource*>(
+ info.link_up)->getName();
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);
}
if (info.link_down) { // link down
- const char *link_name = static_cast<Resource*>(info.link_down)->getName();
+ const char *link_name = static_cast<simgrid::surf::Resource*>(
+ info.link_down)->getName();
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);
return xbt_dynar_length(p_indexNetworkElm)-1;
}
+}
+}
#include "surf_routing_none.hpp"
#include "network_interface.hpp"
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
-class XBT_PRIVATE AsCluster;
+class XBT_PRIVATE AsCluster;
/* ************************************************** */
/* ************** Cluster ROUTING **************** */
};
+}
+}
#endif /* SURF_ROUTING_CLUSTER_HPP_ */
AS_t model_fat_tree_cluster_create(void)
{
- return new AsClusterFatTree();
+ return new simgrid::surf::AsClusterFatTree();
}
+namespace simgrid {
+namespace surf {
+
AsClusterFatTree::AsClusterFatTree() : levels(0) {
XBT_DEBUG("Creating a new fat tree.");
}
uniqueId++;
free((void*)linkTemplate.id);
}
+
+}
+}
#include "surf_routing_cluster.hpp"
+namespace simgrid {
+namespace surf {
/** \file surf_routing_cluster_fat_tree.cpp
* The class AsClusterFatTree describes PGFT, as introduced by Eitan Zahavi
bool areRelated(FatTreeNode *parent, FatTreeNode *child);
bool isInSubTree(FatTreeNode *root, FatTreeNode *node);
};
+
+}
+}
+
#endif
AS_t model_torus_cluster_create(void)
{
- return new AsClusterTorus();
+ return new simgrid::surf::AsClusterTorus();
}
+namespace simgrid {
+namespace surf {
+
/* Creation routing model functions */
AsClusterTorus::AsClusterTorus() : AsCluster()
{
return;
}
+
+}
+}
#include "network_interface.hpp"
#include "surf_routing_cluster.hpp"
-class XBT_PRIVATE AsClusterTorus: public AsCluster {
+namespace simgrid {
+namespace surf {
+
+class XBT_PRIVATE AsClusterTorus: public simgrid::surf::AsCluster {
public:
AsClusterTorus();
virtual ~AsClusterTorus();
virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency);
void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster);
-
-
xbt_dynar_t p_dimensions;
-
};
+}
+}
#endif
}
AS_t model_dijkstra_create(void){
- return new AsDijkstra(0);
+ return new simgrid::surf::AsDijkstra(0);
}
AS_t model_dijkstracache_create(void){
- return new AsDijkstra(1);
+ return new simgrid::surf::AsDijkstra(1);
}
void model_dijkstra_both_end(AS_t as)
{
- AsDijkstra *THIS_AS = static_cast<AsDijkstra*>(as);
+ simgrid::surf::AsDijkstra *THIS_AS
+ = static_cast<simgrid::surf::AsDijkstra*>(as);
xbt_node_t node = NULL;
unsigned int cursor2;
xbt_dynar_t nodes = NULL;
/* Utility functions */
+namespace simgrid {
+namespace surf {
+
xbt_node_t AsDijkstra::routeGraphNewNode(int id, int graph_id)
{
xbt_node_t node = NULL;
}
xbt_dynar_free(&route->link_list);
}
+
+}
+}
int size;
} s_route_cache_element_t, *route_cache_element_t;
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
+
class XBT_PRIVATE AsDijkstra;
class AsDijkstra : public AsGeneric {
int m_cached;
};
+}
+}
+
#endif /* SURF_ROUTING_DIJKSTRA_HPP_ */
AS_t model_floyd_create(void)
{
- return new AsFloyd();
+ return new simgrid::surf::AsFloyd();
}
void model_floyd_end(AS_t current_routing)
{
- static_cast<AsFloyd*>(current_routing)->end();
+ static_cast<simgrid::surf::AsFloyd*>(current_routing)->end();
}
+namespace simgrid {
+namespace surf {
+
AsFloyd::AsFloyd(): AsGeneric() {
p_predecessorTable = NULL;
p_costTable = NULL;
}
}
}
+
+}
+}
#include "surf_routing_generic.hpp"
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
sg_platf_route_cbarg_t *p_linkTable;
};
-
+}
+}
#endif /* SURF_ROUTING_FLOYD_HPP_ */
AS_t model_full_create(void)
{
- return new AsFull();
+ return new simgrid::surf::AsFull();
}
void model_full_end(AS_t _routing)
sg_platf_route_cbarg_t e_route;
/* set utils vars */
- AsFull *routing = static_cast<AsFull*>(_routing);
+ simgrid::surf::AsFull *routing = static_cast<simgrid::surf::AsFull*>(_routing);
int table_size = (int)xbt_dynar_length(routing->p_indexNetworkElm);
/* Create table if necessary */
}
}
+namespace simgrid {
+namespace surf {
+
AsFull::AsFull(){
p_routingTable = 0;
}
xbt_dynar_free(&route->link_list);
}
-
-
-
+}
+}
#include "surf_routing_generic.hpp"
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
//virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
};
+}
+}
#endif /* SURF_ROUTING_FULL_HPP_ */
#include "simgrid/platf_interface.h" // platform creation API internal interface
#include "surf_routing_generic.hpp"
+#include "surf_routing_private.hpp"
#include "network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
}
}
+namespace simgrid {
+namespace surf {
+
void AsGeneric::parseRoute(sg_platf_route_cbarg_t /*route*/){
THROW_IMPOSSIBLE;
}
xbt_free(route_name);
}
+}
+}
+
/* ************************************************************************** */
/* *********************** GENERIC BUSINESS METHODS ************************* */
-xbt_dynar_t AsGeneric::getOneLinkRoutes() { // FIXME: kill that stub
- xbt_die("\"generic_get_onelink_routes\" not implemented yet");
- return NULL;
-}
-
static const char *instr_node_name(xbt_node_t node)
{
void *data = xbt_graph_node_get_data(node);
return ret;
}
+namespace simgrid {
+namespace surf {
+
+xbt_dynar_t AsGeneric::getOneLinkRoutes() { // FIXME: kill that stub
+ xbt_die("\"generic_get_onelink_routes\" not implemented yet");
+ return NULL;
+}
+
void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
{
int src, dst;
}
xbt_dynar_foreach(route->link_list, cpt, link) {
- const char *link_name = static_cast<Resource*>(link)->getName();
+ const char *link_name = static_cast<simgrid::surf::Resource*>(
+ link)->getName();
current = new_xbt_graph_node(graph, link_name, nodes);
current_name = link_name;
new_xbt_graph_edge(graph, previous, current, edges);
dst_as->p_name,
p_name);
}
+
+}
+}
#ifndef SURF_ROUTING_GENERIC_HPP_
#define SURF_ROUTING_GENERIC_HPP_
-class XBT_PRIVATE AsGeneric;
+namespace simgrid {
+namespace surf {
-void generic_free_route(sg_platf_route_cbarg_t route);
+class XBT_PRIVATE AsGeneric;
class XBT_PRIVATE AsGeneric : public AsNone {
public:
virtual void srcDstCheck(RoutingEdge *src, RoutingEdge *dst);
};
+}
+}
+
#endif /* SURF_ROUTING_GENERIC_HPP_ */
AS_t model_none_create(void)
{
- return new AsNone();
+ return new simgrid::surf::AsNone();
}
+namespace simgrid {
+namespace surf {
+
xbt_dynar_t AsNone::getOneLinkRoutes() {
return NULL;
}
xbt_dynar_free(&p_linkUpDownList);
}
+}
+}
#ifndef SURF_ROUTING_NONE_HPP_
#define SURF_ROUTING_NONE_HPP_
+namespace simgrid {
+namespace surf {
+
class XBT_PRIVATE AsNone : public As {
public:
AsNone();
void parseBypassroute(sg_platf_route_cbarg_t e_route);
};
+}
+}
#endif /* SURF_ROUTING_NONE_HPP_ */
/* ************************************************** */
/* ************** Cluster ROUTING **************** */
-XBT_PRIVATE As *model_cluster_create(void); /* create structures for cluster routing model */
-XBT_PRIVATE As *model_torus_cluster_create(void);
-XBT_PRIVATE As *model_fat_tree_cluster_create(void);
+XBT_PRIVATE surf_As *model_cluster_create(void); /* create structures for cluster routing model */
+XBT_PRIVATE surf_As *model_torus_cluster_create(void);
+XBT_PRIVATE surf_As *model_fat_tree_cluster_create(void);
/* ************************************************** */
/* ************** Vivaldi ROUTING **************** */
AS_t model_vivaldi_create(void)
{
- return new AsVivaldi();
+ return new simgrid::surf::AsVivaldi();
}
+namespace simgrid {
+namespace surf {
+
void AsVivaldi::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat)
{
s_surf_parsing_link_up_down_t info;
xbt_dynar_push_as(p_indexNetworkElm, sg_routing_edge_t, elm);
return xbt_dynar_length(p_indexNetworkElm)-1;
}
+
+}
+}
#define ROUTER_PEER(peername) bprintf("router_%s", peername)
#define LINK_PEER(peername) bprintf("link_%s", peername)
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
//virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
};
+}
+}
#endif /* SURF_ROUTING_VIVALDI_HPP_ */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf,
"Logging specific to the SURF VM module");
-VMModel *surf_vm_model = NULL;
+simgrid::surf::VMModel *surf_vm_model = NULL;
+
+namespace simgrid {
+namespace surf {
/*************
* Callbacks *
*************/
-surf_callback(void, VirtualMachine*) VMCreatedCallbacks;
-surf_callback(void, VirtualMachine*) VMDestructedCallbacks;
-surf_callback(void, VirtualMachine*) VMStateChangedCallbacks;
+surf_callback(void, simgrid::surf::VirtualMachine*) VMCreatedCallbacks;
+surf_callback(void, simgrid::surf::VirtualMachine*) VMDestructedCallbacks;
+surf_callback(void, simgrid::surf::VirtualMachine*) VMStateChangedCallbacks;
/*********
* Model *
//FIME:: handle action cancel
+}
+}
#define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
// It corresponds to the cost of a VM running no tasks.
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
/** @ingroup SURF_callbacks
* @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)`
*/
-extern XBT_PRIVATE surf_callback(void, VirtualMachine*) VMCreatedCallbacks;
+extern XBT_PRIVATE surf_callback(void, simgrid::surf::VirtualMachine*) VMCreatedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)`
*/
-extern XBT_PRIVATE surf_callback(void, VirtualMachine*) VMDestructedCallbacks;
+extern XBT_PRIVATE surf_callback(void, simgrid::surf::VirtualMachine*) VMDestructedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)`
*/
-extern XBT_PRIVATE surf_callback(void, VirtualMachine*) VMStateChangedCallbacks;
+extern XBT_PRIVATE surf_callback(void, simgrid::surf::VirtualMachine*) VMStateChangedCallbacks;
/************
* Resource *
* @param netElm The RoutingEdge associated to this VM
* @param cpu The Cpu associated to this VM
*/
- VirtualMachine(Model *model, const char *name, xbt_dict_t props,
+ VirtualMachine(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
RoutingEdge *netElm, Cpu *cpu);
/** @brief Destructor */
* Action *
**********/
+}
+}
+
#endif /* VM_INTERFACE_HPP_ */
void surf_vm_model_init_HL13(void){
if (surf_cpu_model_vm) {
- surf_vm_model = new VMHL13Model();
- Model *model = surf_vm_model;
-
+ surf_vm_model = new simgrid::surf::VMHL13Model();
+ simgrid::surf::Model *model = surf_vm_model;
xbt_dynar_push(all_existing_models, &model);
}
}
+namespace simgrid {
+namespace surf {
+
/*********
* Model *
*********/
Action *VMHL13::sleep(double duration) {
return p_cpu->sleep(duration);
}
+
+}
+}
#define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
// It corresponds to the cost of a VM running no tasks.
+namespace simgrid {
+namespace surf {
+
/***********
* Classes *
***********/
* Action *
**********/
+}
+}
+
#endif /* SURF_VM_HPP_ */