X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/de74e33ac31948d22f805fed0807be831cb8fdbd..83ff63f9a846dd01995a4bbb8979d2fa909ed34b:/src/surf/surf.hpp diff --git a/src/surf/surf.hpp b/src/surf/surf.hpp index 636d6a4327..6deea66080 100644 --- a/src/surf/surf.hpp +++ b/src/surf/surf.hpp @@ -43,6 +43,7 @@ XBT_PUBLIC(void) surf_watched_hosts(void); } #endif +extern double sg_sender_gap; XBT_PUBLIC(int) SURF_CPU_LEVEL; //Surf cpu level /*********** @@ -59,6 +60,22 @@ class Action; typedef Action* ActionPtr; typedef boost::function ActionCallback; +class ActionLmm; +typedef ActionLmm* ActionLmmPtr; + +enum heap_action_type{ + LATENCY = 100, + MAX_DURATION, + NORMAL, + NOTSET +}; + +typedef enum { + UM_FULL, + UM_LAZY, + UM_UNDEFINED +} e_UM_t; + /********* * Trace * *********/ @@ -91,10 +108,18 @@ public: } ResourcePtr createResource(string name); ActionPtr createAction(double _cost, bool _failed); - double shareResources(double now); - void updateActionsState(double now, double delta); + double (Model::*shareResources)(double now); + double shareResourcesLazy(double now); + double shareResourcesFull(xbt_swag_t running_actions, + size_t offset, + lmm_system_t sys, + void (*solve) (lmm_system_t)); + void (Model::*updateActionsState)(double now, double delta); + void updateActionsStateLazy(double now, double delta); + void updateActionsStateFull(double now, double delta); string getName() {return m_name;}; + void gapRemove(ActionLmmPtr action); void addTurnedOnCallback(ResourceCallback rc); void notifyResourceTurnedOn(ResourcePtr r); @@ -109,6 +134,12 @@ public: void addActionSuspendCallback(ActionCallback ac); void notifyActionSuspend(ActionPtr a); + lmm_system_t p_maxminSystem; + e_UM_t p_updateMechanism; + xbt_swag_t p_modifiedSet; + xbt_heap_t p_actionHeap; + int m_selectiveUpdate; + xbt_swag_t p_readyActionSet; /**< Actions in state SURF_ACTION_READY */ xbt_swag_t p_runningActionSet; /**< Actions in state SURF_ACTION_RUNNING */ xbt_swag_t p_failedActionSet; /**< Actions in state SURF_ACTION_FAILED */ @@ -126,8 +157,19 @@ private: /************ * Resource * ************/ + +/** + * Resource which have a metric handled by a maxmin system + */ +typedef struct { + double scale; + double peak; + tmgr_trace_event_t event; +} s_surf_metric_t; + class Resource { public: + Resource() {}; Resource(ModelPtr model, const char *name, xbt_dict_t properties): m_name(name),m_running(true),p_model(model),m_properties(properties) {}; virtual ~Resource() {}; @@ -146,19 +188,29 @@ public: void setName(string name); string getName(); ModelPtr getModel() {return p_model;}; + e_surf_resource_state_t getState(); void printModel() { std::cout << p_model->getName() << "<