${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkLink.java
${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkAction.java
+ ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ActionState.java
+ ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ResourceState.java
+
${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/LmmConstraint.java
${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/XbtDict.java
)
Msg.info("Trace: Cpu destructed "+cpu.getName());
}
- public void cpuStateChangedCallback(Cpu cpu){
+ public void cpuStateChangedCallback(Cpu cpu, ResourceState old, ResourceState cur){
Msg.info("Trace: Cpu state changed "+cpu.getName());
}
- public void cpuActionStateChangedCallback(CpuAction action){
+ public void cpuActionStateChangedCallback(CpuAction action, ActionState old, ActionState cur){
Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
}
Msg.info("Trace: NetworkLink destructed "+link.getName());
}
- public void networkLinkStateChangedCallback(NetworkLink link){
+ public void networkLinkStateChangedCallback(NetworkLink link, ResourceState old, ResourceState cur){
Msg.info("Trace: NetworkLink state changed "+link.getName());
}
- public void networkActionStateChangedCallback(NetworkAction action){
+ public void networkActionStateChangedCallback(NetworkAction action, ActionState old, ActionState cur){
Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
}
Msg.info("Trace: Cpu destructed "+cpu.getName());
}
- public void cpuStateChangedCallback(Cpu cpu){
+ public void cpuStateChangedCallback(Cpu cpu, ResourceState old, ResourceState cur){
Msg.info("Trace: Cpu state changed "+cpu.getName());
}
- public void cpuActionStateChangedCallback(CpuAction action){
+ public void cpuActionStateChangedCallback(CpuAction action, ActionState old, ActionState cur){
Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
}
Msg.info("Trace: NetworkLink destructed "+link.getName());
}
- public void networkLinkStateChangedCallback(NetworkLink link){
+ public void networkLinkStateChangedCallback(NetworkLink link, ResourceState old, ResourceState cur){
Msg.info("Trace: NetworkLink state changed "+link.getName());
}
- public void networkActionStateChangedCallback(NetworkAction action){
+ public void networkActionStateChangedCallback(NetworkAction action, ActionState old, ActionState cur){
Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
}
char *getValue(char *key) {return (char*)xbt_dict_get_or_null($self, key);}
}
};
+
+%rename e_surf_action_state_t ActionState;
+typedef enum {
+ SURF_ACTION_READY = 0, /**< Ready */
+ SURF_ACTION_RUNNING, /**< Running */
+ SURF_ACTION_FAILED, /**< Task Failure */
+ SURF_ACTION_DONE, /**< Completed */
+ SURF_ACTION_TO_FREE, /**< Action to free in next cleanup */
+ SURF_ACTION_NOT_IN_THE_SYSTEM
+ /**< Not in the system anymore. Why did you ask ? */
+} e_surf_action_state_t;
+
+%rename e_surf_resource_state_t ResourceState;
+typedef enum {
+ SURF_RESOURCE_ON = 1, /**< Up & ready */
+ SURF_RESOURCE_OFF = 0 /**< Down & broken */
+} e_surf_resource_state_t;
}
void Plugin::activateCpuStateChangedCallback(){
- surf_callback_connect(cpuStateChangedCallbacks, boost::bind(&Plugin::cpuStateChangedCallback, this, _1));
+ surf_callback_connect(cpuStateChangedCallbacks, boost::bind(&Plugin::cpuStateChangedCallback, this, _1, _2, _3));
}
void Plugin::activateCpuActionStateChangedCallback(){
- surf_callback_connect(cpuActionStateChangedCallbacks, boost::bind(&Plugin::cpuActionStateChangedCallback, this, _1));
+ surf_callback_connect(cpuActionStateChangedCallbacks, boost::bind(&Plugin::cpuActionStateChangedCallback, this, _1, _2, _3));
}
}
void Plugin::activateNetworkLinkStateChangedCallback(){
- surf_callback_connect(networkLinkStateChangedCallbacks, boost::bind(&Plugin::networkLinkStateChangedCallback, this, _1));
+ surf_callback_connect(networkLinkStateChangedCallbacks, boost::bind(&Plugin::networkLinkStateChangedCallback, this, _1, _2, _3));
}
void Plugin::activateNetworkActionStateChangedCallback(){
- surf_callback_connect(networkActionStateChangedCallbacks, boost::bind(&Plugin::networkActionStateChangedCallback, this, _1));
+ surf_callback_connect(networkActionStateChangedCallbacks, boost::bind(&Plugin::networkActionStateChangedCallback, this, _1, _2, _3));
}
virtual void cpuDestructedCallback(Cpu *cpu) {}
void activateCpuStateChangedCallback();
- virtual void cpuStateChangedCallback(Cpu *cpu) {}
+ virtual void cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t, e_surf_resource_state_t) {}
void activateCpuActionStateChangedCallback();
- virtual void cpuActionStateChangedCallback(CpuAction *action) {}
+ virtual void cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t, e_surf_action_state_t) {}
void activateNetworkLinkCreatedCallback();
virtual void networkLinkDestructedCallback(NetworkLink *link) {}
void activateNetworkLinkStateChangedCallback();
- virtual void networkLinkStateChangedCallback(NetworkLink *link) {}
+ virtual void networkLinkStateChangedCallback(NetworkLink *link, e_surf_resource_state_t, e_surf_resource_state_t) {}
void activateNetworkActionStateChangedCallback();
- virtual void networkActionStateChangedCallback(NetworkAction *action) {}
+ virtual void networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {}
};
surf_callback(void, CpuPtr) cpuCreatedCallbacks;
surf_callback(void, CpuPtr) cpuDestructedCallbacks;
-surf_callback(void, CpuPtr) cpuStateChangedCallbacks;
-surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks;
+surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
+surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
/*********
* Model *
void Cpu::setState(e_surf_resource_state_t state)
{
+ e_surf_resource_state_t old = Resource::getState();
Resource::setState(state);
- surf_callback_emit(cpuStateChangedCallbacks, this);
+ surf_callback_emit(cpuStateChangedCallbacks, this, old, state);
}
/**********
* Action *
}
void CpuAction::setState(e_surf_action_state_t state){
+ e_surf_action_state_t old = getState();
Action::setState(state);
- surf_callback_emit(cpuActionStateChangedCallbacks, this);
+ surf_callback_emit(cpuActionStateChangedCallbacks, this, old, state);
}
CpuPtr getActionCpu(CpuActionPtr action);
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu creation *
+ * @brief Callbacks handler which emit the callbacks after Cpu creation *
* @details Callback functions have the following signature: `void(CpuPtr)`
*/
extern surf_callback(void, CpuPtr) cpuCreatedCallbacks;
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu destruction *
+ * @brief Callbacks handler which emit the callbacks after Cpu destruction *
* @details Callback functions have the following signature: `void(CpuPtr)`
*/
extern surf_callback(void, CpuPtr) cpuDestructedCallbacks;
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu State changed *
- * @details Callback functions have the following signature: `void(CpuActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after Cpu State changed *
+ * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
*/
-extern surf_callback(void, CpuPtr) cpuStateChangedCallbacks;
+extern surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
- * @details Callback functions have the following signature: `void(CpuActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
+ * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
*/
-extern surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks;
+extern surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
/*********
* Model *
public:
/**
* @brief CpuModel constructor
- *
+ *
* @param name The name of the model
*/
CpuModel(const char *name) : Model(name) {};
/**
* @brief Create a Cpu
- *
+ *
* @param name The name of the Cpu
- *
+ *
* @return The created Cpu
*/
CpuPtr createResource(string name);
/**
* @brief Cpu constructor
- *
+ *
* @param model The CpuModel associated to this Cpu
* @param name The name of the Cpu
* @param props Dictionary of properties associated to this Cpu
/**
* @brief Cpu constructor
- *
+ *
* @param model The CpuModel associated to this Cpu
* @param name The name of the Cpu
* @param props Dictionary of properties associated to this Cpu
/**
* @brief Execute some quantity of computation
- *
+ *
* @param size The value of the processing amount (in flop) needed to process
* @return The CpuAction corresponding to the processing
*/
/**
* @brief Make a process sleep for duration (in seconds)
- *
+ *
* @param duration The number of seconds to sleep
* @return The CpuAction corresponding to the sleeping
*/
/**
* @brief Get the number of cores of the current Cpu
- *
+ *
* @return The number of cores of the current Cpu
*/
virtual int getCore();
/**
* @brief Get the speed of the current Cpu
* @details [TODO] load * m_powerPeak
- *
+ *
* @param load [TODO]
- *
+ *
* @return The speed of the current Cpu
*/
virtual double getSpeed(double load);
/**
* @brief Get the available speed of the current Cpu
* @details [TODO]
- *
+ *
* @return The available speed of the current Cpu
*/
virtual double getAvailableSpeed();
/**
* @brief Get the current Cpu power peak
- *
+ *
* @return The current Cpu power peak
*/
virtual double getCurrentPowerPeak()=0;
virtual double getPowerPeakAt(int pstate_index)=0;
-
+
virtual int getNbPstates()=0;
-
+
virtual void setPowerPeakAt(int pstate_index)=0;
void setState(e_surf_resource_state_t state);
/**
* @brief CpuAction constructor
- *
+ *
* @param model The CpuModel associated to this CpuAction
* @param cost [TODO]
* @param failed [TODO]
/**
* @brief CpuAction constructor
- *
+ *
* @param model The CpuModel associated to this CpuAction
* @param cost [TODO]
* @param failed [TODO]
/**
* @brief Set the affinity of the current CpuAction
* @details [TODO]
- *
+ *
* @param cpu [TODO]
* @param mask [TODO]
*/
surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
-surf_callback(void, NetworkLinkPtr) networkLinkStateChangedCallbacks;
-surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks;
+surf_callback(void, NetworkLinkPtr, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
+surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
/*********
* Model *
}
void NetworkLink::setState(e_surf_resource_state_t state){
+ e_surf_resource_state_t old = Resource::getState();
Resource::setState(state);
- surf_callback_emit(networkLinkStateChangedCallbacks, this);
+ surf_callback_emit(networkLinkStateChangedCallbacks, this, old, state);
}
/**********
**********/
void NetworkAction::setState(e_surf_action_state_t state){
+ e_surf_action_state_t old = getState();
Action::setState(state);
- surf_callback_emit(networkActionStateChangedCallbacks, this);
+ surf_callback_emit(networkActionStateChangedCallbacks, this, old, state);
+
}
#endif /* NETWORK_INTERFACE_CPP_ */
*************/
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink creation *
+ * @brief Callbacks handler which emit the callbacks after NetworkLink creation
* @details Callback functions have the following signature: `void(NetworkLinkPtr)`
*/
extern surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink destruction *
+ * @brief Callbacks handler which emit the callbacks after NetworkLink destruction
* @details Callback functions have the following signature: `void(NetworkLinkPtr)`
*/
extern surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink State changed *
- * @details Callback functions have the following signature: `void(NetworkLinkActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after NetworkLink State changed
+ * @details Callback functions have the following signature: `void(NetworkLinkActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
*/
-extern surf_callback(void, NetworkLinkPtr) networkLinkStateChangedCallbacks;
+extern surf_callback(void, NetworkLinkPtr, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkAction State changed *
- * @details Callback functions have the following signature: `void(NetworkActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after NetworkAction State changed
+ * @details Callback functions have the following signature: `void(NetworkActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
*/
-extern surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks;
+extern surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
/*********
* Tools *
/**
* @brief NetworkModel constructor
- *
+ *
* @param name The name of the NetworkModel
*/
NetworkModel(const char *name) : Model(name) {
/**
* @brief Create a NetworkLink
- *
+ *
* @param name The name of the NetworkLink
* @param bw_initial The initial bandwidth of the NetworkLink in bytes per second
* @param bw_trace The trace associated to the NetworkLink bandwidth [TODO]
/**
* @brief Create a communication between two [TODO]
* @details [TODO]
- *
+ *
* @param src The source [TODO]
* @param dst The destination [TODO]
* @param size The size of the communication in bytes
- * @param rate The
+ * @param rate The
* @return The action representing the communication
*/
virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
/**
* @brief Function pointer to the function to use to solve the lmm_system_t
- *
+ *
* @param system The lmm_system_t to solve
*/
void (*f_networkSolve)(lmm_system_t);
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param size [description]
* @return [description]
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param size [description]
* @return [description]
*/
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param rate [description]
* @param bound [description]
* @param size [description]
public:
/**
* @brief NetworkLink constructor
- *
+ *
* @param model The CpuModel associated to this NetworkLink
* @param name The name of the NetworkLink
* @param props Dictionary of properties associated to this NetworkLink
/**
* @brief NetworkLink constructor
- *
+ *
* @param model The CpuModel associated to this NetworkLink
* @param name The name of the NetworkLink
* @param props Dictionary of properties associated to this NetworkLink
/**
* @brief Get the bandwidth in bytes per second of current NetworkLink
- *
+ *
* @return The bandwith in bytes per second of the current NetworkLink
*/
virtual double getBandwidth();
/**
* @brief Get the latency in seconds of current NetworkLink
- *
+ *
* @return The latency in seconds of the current NetworkLink
*/
virtual double getLatency();
/**
* @brief Check if the NetworkLink is shared
* @details [long description]
- *
+ *
* @return true if the current NetwokrLink is shared, false otherwise
*/
virtual bool isShared();
/**
* @brief Check if the NetworkLink is used
- *
+ *
* @return true if the current NetwokrLink is used, false otherwise
*/
bool isUsed();
public:
/**
* @brief NetworkAction constructor
- *
+ *
* @param model The NetworkModel associated to this NetworkAction
* @param cost The cost of this NetworkAction in [TODO]
* @param failed [description]
/**
* @brief NetworkAction constructor
- *
+ *
* @param model The NetworkModel associated to this NetworkAction
* @param cost The cost of this NetworkAction in [TODO]
* @param failed [description]
#include "../cpu_cas01.hpp"
/** @addtogroup SURF_plugin_energy
- *
- *
+ *
+ *
* BlaBla energy
*/
surf_energy->erase(cpuIt);
}
-static void energyCpuActionStateChangedCallback(CpuActionPtr action){
+static void energyCpuActionStateChangedCallback(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t cur){
CpuPtr cpu = getActionCpu(action);
CpuEnergyPtr cpu_energy = (*surf_energy)[cpu];
surf_callback(void, StoragePtr) storageCreatedCallbacks;
surf_callback(void, StoragePtr) storageDestructedCallbacks;
-surf_callback(void, StoragePtr) storageStateChangedCallbacks;
-surf_callback(void, StorageActionPtr) storageActionStateChangedCallbacks;
+surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
+surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
/*********
* Model *
void Storage::setState(e_surf_resource_state_t state)
{
+ e_surf_resource_state_t old = Resource::getState();
Resource::setState(state);
- surf_callback_emit(storageStateChangedCallbacks, this);
+ surf_callback_emit(storageStateChangedCallbacks, this, old, state);
}
xbt_dict_t Storage::getContent()
}
void StorageAction::setState(e_surf_action_state_t state){
+ e_surf_action_state_t old = getState();
Action::setState(state);
- surf_callback_emit(storageActionStateChangedCallbacks, this);
+ surf_callback_emit(storageActionStateChangedCallbacks, this, old, state);
}
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after Storage State changed *
- * @details Callback functions have the following signature: `void(StorageActionPtr)`
+ * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
*/
-extern surf_callback(void, StoragePtr) storageStateChangedCallbacks;
+extern surf_callback(void, StoragePtr, 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(StorageActionPtr)`
+ * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
*/
-extern surf_callback(void, StorageActionPtr) storageActionStateChangedCallbacks;
+extern surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
/*********
* Model *
/**
* @brief Create a Storage
- *
+ *
* @param id [description]
* @param type_id [description]
* @param content_name [description]
public:
/**
* @brief Storage constructor
- *
+ *
* @param model StorageModel associated to this Storage
* @param name The name of the Storage
* @param props Dictionary of properties associated to this Storage
/**
* @brief Storage constructor
- *
+ *
* @param model StorageModel associated to this Storage
* @param name The name of the Storage
* @param props Dictionary of properties associated to this Storage
/**
* @brief Check if the Storage is used
- *
+ *
* @return true if the current Storage is used, false otherwise
*/
bool isUsed();
/**
* @brief Update the state of the current Storage
- *
+ *
* @param event_type [description]
* @param value [description]
* @param date [description]
/**
* @brief Open a file
- *
+ *
* @param mount The mount point
* @param path The path to the file
- *
+ *
* @return The StorageAction corresponding to the opening
*/
virtual StorageActionPtr open(const char* mount, const char* path)=0;
/**
* @brief Close a file
- *
+ *
* @param fd The file descriptor to close
* @return The StorageAction corresponding to the closing
*/
/**
* @brief List directory contents of a path
* @details [long description]
- *
+ *
* @param path The path to the directory
* @return The StorageAction corresponding to the ls action
*/
/**
* @brief Read a file
- *
+ *
* @param fd The file descriptor to read
* @param size The size in bytes to read
* @return The StorageAction corresponding to the reading
/**
* @brief Write a file
- *
+ *
* @param fd The file descriptor to write
* @param size The size in bytes to write
* @return The StorageAction corresponding to the writing
/**
* @brief Get the content of the current Storage
- *
+ *
* @return A xbt_dict_t with path as keys and size in bytes as values
*/
virtual xbt_dict_t getContent();
/**
* @brief Get the size in bytes of the current Storage
- *
+ *
* @return The size in bytes of the current Storage
*/
virtual sg_size_t getSize();
/**
* @brief StorageAction constructor
- *
+ *
* @param model The StorageModel associated to this StorageAction
* @param cost The cost of this NetworkAction in [TODO]
* @param failed [description]
/**
* @brief StorageAction constructor
- *
+ *
* @param model The StorageModel associated to this StorageAction
* @param cost The cost of this StorageAction in [TODO]
* @param failed [description]
surf_callback(void, WorkstationPtr) workstationCreatedCallbacks;
surf_callback(void, WorkstationPtr) workstationDestructedCallbacks;
-surf_callback(void, WorkstationPtr) workstationStateChangedCallbacks;
-surf_callback(void, WorkstationActionPtr) workstationActionStateChangedCallbacks;
+surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t) workstationStateChangedCallbacks;
+surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t) workstationActionStateChangedCallbacks;
/*********
* Model *
}
void Workstation::setState(e_surf_resource_state_t state){
+ e_surf_resource_state_t old = Resource::getState();
Resource::setState(state);
- surf_callback_emit(workstationStateChangedCallbacks, this);
+ surf_callback_emit(workstationStateChangedCallbacks, this, old, state);
}
int Workstation::getCore(){
**********/
void WorkstationAction::setState(e_surf_action_state_t state){
+ e_surf_action_state_t old = getState();
Action::setState(state);
- surf_callback_emit(workstationActionStateChangedCallbacks, this);
+ surf_callback_emit(workstationActionStateChangedCallbacks, this, old, state);
}
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after Workstation State changed *
- * @details Callback functions have the following signature: `void(WorkstationActionPtr)`
+ * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
*/
-extern surf_callback(void, WorkstationPtr) workstationStateChangedCallbacks;
+extern surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t) workstationStateChangedCallbacks;
/** @ingroup SURF_callbacks
* @brief Callbacks handler which emit the callbacks after WorkstationAction State changed *
- * @details Callback functions have the following signature: `void(WorkstationActionPtr)`
+ * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
*/
-extern surf_callback(void, WorkstationActionPtr) workstationActionStateChangedCallbacks;
+extern surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t) workstationActionStateChangedCallbacks;
/*********
* Tools *
*/
class WorkstationModel : public Model {
public:
- /**
+ /**
* @brief WorkstationModel constructor
- *
+ *
* @param name the name of the model
*/
WorkstationModel(const char *name);
* @details [long description]
*/
virtual void adjustWeightOfDummyCpuActions();
-
+
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param workstation_nb [description]
* @param workstation_list [description]
* @param computation_amount [description]
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param src [description]
* @param dst [description]
* @param size [description]
/**
* @brief Workstation constructor
- *
+ *
* @param model WorkstationModel associated to this Workstation
* @param name The name of the Workstation
* @param props Dictionary of properties associated to this Workstation
/**
* @brief Workstation constructor
- *
+ *
* @param model WorkstationModel associated to this Workstation
* @param name The name of the Workstation
* @param props Dictionary of properties associated to this Workstation
/**
* @brief Execute some quantity of computation
- *
+ *
* @param size The value of the processing amount (in flop) needed to process
* @return The CpuAction corresponding to the processing
* @see Cpu
/**
* @brief Make a process sleep for duration seconds
- *
+ *
* @param duration The number of seconds to sleep
* @return The CpuAction corresponding to the sleeping
* @see Cpu
/**
* @brief Get the number of cores of the associated Cpu
- *
+ *
* @return The number of cores of the associated Cpu
* @see Cpu
*/
/**
* @brief Get the speed of the associated Cpu
- *
+ *
* @param load [TODO]
* @return The speed of the associated Cpu
* @see Cpu
/**
* @brief Get the available speed of the associated Cpu
* @details [TODO]
- *
+ *
* @return The available speed of the associated Cpu
* @see Cpu
*/
/**
* @brief Get the associated Cpu power peak
- *
+ *
* @return The associated Cpu power peak
* @see Cpu
*/
/**
* @brief Return the storage of corresponding mount point
- *
+ *
* @param storage The mount point
* @return The corresponding Storage
*/
/**
* @brief Get the xbt_dict_t of mount_point: Storage
- *
+ *
* @return The xbt_dict_t of mount_point: Storage
*/
virtual xbt_dict_t getMountedStorageList();
/**
* @brief Open a file
- *
+ *
* @param fullpath The full path to the file
- *
+ *
* @return The StorageAction corresponding to the opening
*/
virtual ActionPtr open(const char* fullpath);
/**
* @brief Close a file
- *
+ *
* @param fd The file descriptor to close
* @return The StorageAction corresponding to the closing
*/
/**
* @brief Unlink a file
* @details [long description]
- *
+ *
* @param fd [description]
* @return [description]
*/
/**
* @brief List directory contents of a path
* @details [long description]
- *
+ *
* @param mount [description]
* @param path The path to the directory
* @return The StorageAction corresponding to the ls action
/**
* @brief Get the size in bytes of the file
- *
+ *
* @param fd The file descriptor to read
* @return The size in bytes of the file
*/
/**
* @brief Read a file
- *
+ *
* @param fd The file descriptor to read
* @param size The size in bytes to read
* @return The StorageAction corresponding to the reading
/**
* @brief Write a file
- *
+ *
* @param fd The file descriptor to write
* @param size The size in bytes to write
* @return The StorageAction corresponding to the writing
* - the storage name,
* - the storage typeId,
* - the storage content type
- *
+ *
* @param fd The file descriptor
* @return An xbt_dynar_t with the file informations
*/
/**
* @brief Get the current position of the file descriptor
- *
+ *
* @param fd The file descriptor
* @return The current position of the file descriptor
*/
virtual sg_size_t fileTell(surf_file_t fd);
/**
- * @brief Get the available space of the storage at the mount point
- *
+ * @brief Get the available space of the storage at the mount point
+ *
* @param name The mount point
* @return The amount of availble space in bytes
*/
/**
* @brief Get the used space of the storage at the mount point
- *
+ *
* @param name The mount point
* @return The amount of used space in bytes
*/
/**
* @brief Set the position indictator assiociated with the file descriptor to a new position
* @details [long description]
- *
+ *
* @param fd The file descriptor
* @param offset The offset from the origin
* @param origin Position used as a reference for the offset
/**
* @brief Get the list of virtual machines on the current Workstation
- *
+ *
* @return The list of VMs
*/
xbt_dynar_t getVms();
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param params [description]
*/
void getParams(ws_params_t params);
/**
* @brief [brief description]
* @details [long description]
- *
+ *
* @param params [description]
*/
void setParams(ws_params_t params);
public:
/**
* @brief WorkstationAction constructor
- *
+ *
* @param model The WorkstationModel associated to this WorkstationAction
* @param cost The cost of this WorkstationAction in [TODO]
* @param failed [description]
/**
* @brief WorkstationAction constructor
- *
+ *
* @param model The WorkstationModel associated to this WorkstationAction
* @param cost The cost of this WorkstationAction in [TODO]
* @param failed [description]