From: Paul Bédaride Date: Wed, 26 Feb 2014 09:52:32 +0000 (+0100) Subject: Clean surf code X-Git-Tag: v3_11~255 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1a4fabff9123e7f1ef01fa140bb9d3065ebb223f?hp=3391e8197069a1cd28878aec66d0d33e9c22cf06 Clean surf code --- diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index af08127e14..fc07dd59c7 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -468,11 +468,6 @@ CpuTiPtr CpuTiModel::createResource(const char *name, return cpu; } -CpuTiActionPtr CpuTiModel::createAction(double /*cost*/, bool /*failed*/) -{ - return NULL;//new CpuTiAction(this, cost, failed); -} - double CpuTiModel::shareResources(double now) { void *_cpu, *_cpu_next; diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 4e1ac71e1b..b44ff9713b 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -92,7 +92,6 @@ public: e_surf_resource_state_t state_initial, tmgr_trace_t state_trace, xbt_dict_t cpu_properties); - CpuTiActionPtr createAction(double cost, bool failed); double shareResources(double now); void updateActionsState(double now, double delta); void addTraces(); diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 244b688e1f..49e4c6d248 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -28,13 +28,6 @@ surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks; NetworkModelPtr surf_network_model = NULL; -xbt_dynar_t NetworkModel::getRoute(RoutingEdgePtr src, RoutingEdgePtr dst) -{ - xbt_dynar_t route = NULL; - routing_platf->getRouteAndLatency(src, dst, &route, NULL); - return route; -} - double NetworkModel::latencyFactor(double /*size*/) { return sg_latency_factor; } diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index 994991b3d2..8988357d7c 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -133,17 +133,6 @@ public: virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate)=0; - /** - * @brief Get the route between two RoutingEdge - * @details [TODO] - * - * @param src [TODO] - * @param dst [TODO] - * - * @return A xbt_dynar_t of [TODO] - */ - virtual xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst); //FIXME: kill field? That is done by the routing nowadays - /** * @brief Function pointer to the function to use to solve the lmm_system_t * diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 4e07fe53c7..c23f61df9b 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -496,26 +496,6 @@ void StorageN11::rename(const char *src, const char *dest) XBT_DEBUG("File %s doesn't exist",src); } -xbt_dict_t StorageN11::getContent() -{ - /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */ - /*surf_action_t action = storage_action_execute(storage,0, LS);*/ - - xbt_dict_t content_dict = xbt_dict_new_homogeneous(NULL); - xbt_dict_cursor_t cursor = NULL; - char *file; - sg_size_t *psize; - - xbt_dict_foreach(p_content, cursor, file, psize){ - xbt_dict_set(content_dict,file,psize,NULL); - } - return content_dict; -} - -sg_size_t StorageN11::getSize(){ - return m_size; -} - /********** * Action * **********/ diff --git a/src/surf/storage_n11.hpp b/src/surf/storage_n11.hpp index 5582e961d0..932e505a32 100644 --- a/src/surf/storage_n11.hpp +++ b/src/surf/storage_n11.hpp @@ -56,8 +56,6 @@ public: StorageActionPtr open(const char* mount, const char* path); StorageActionPtr close(surf_file_t fd); StorageActionPtr ls(const char *path); - xbt_dict_t getContent(); - sg_size_t getSize(); StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ?? StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ?? void rename(const char *src, const char *dest); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 1bcc47f1d9..9e7537921e 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -280,7 +280,10 @@ surf_action_t surf_workstation_model_communicate(surf_workstation_model_t model, xbt_dynar_t surf_workstation_model_get_route(surf_workstation_model_t model, surf_resource_t src, surf_resource_t dst){ - return model->getRoute(get_casted_workstation(src), get_casted_workstation(dst)); + xbt_dynar_t route = NULL; + routing_platf->getRouteAndLatency(get_casted_workstation(src)->p_netElm, + get_casted_workstation(dst)->p_netElm, &route, NULL); + return route; } void surf_vm_workstation_model_create(const char *name, surf_resource_t ind_phys_host){ diff --git a/src/surf/vm_workstation_hl13.cpp b/src/surf/vm_workstation_hl13.cpp index baad9aeb82..92b02461a9 100644 --- a/src/surf/vm_workstation_hl13.cpp +++ b/src/surf/vm_workstation_hl13.cpp @@ -31,11 +31,6 @@ void WorkstationVMHL13Model::updateActionsState(double /*now*/, double /*delta*/ return; } -xbt_dynar_t WorkstationVMHL13Model::getRoute(WorkstationPtr src, WorkstationPtr dst){ - XBT_DEBUG("ws_get_route"); - return surf_network_model->getRoute(src->p_netElm, dst->p_netElm); -} - ActionPtr WorkstationVMHL13Model::communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate){ return surf_network_model->communicate(src->p_netElm, dst->p_netElm, size, rate); } diff --git a/src/surf/vm_workstation_hl13.hpp b/src/surf/vm_workstation_hl13.hpp index cf3d23f517..24d6175e70 100644 --- a/src/surf/vm_workstation_hl13.hpp +++ b/src/surf/vm_workstation_hl13.hpp @@ -39,7 +39,6 @@ public: void createResource(const char *name, void *ind_phys_workstation); double shareResources(double now); void adjustWeightOfDummyCpuActions() {}; - xbt_dynar_t getRoute(WorkstationPtr src, WorkstationPtr dst); ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate); ActionPtr executeParallelTask(int workstation_nb, void **workstation_list, diff --git a/src/surf/workstation_clm03.cpp b/src/surf/workstation_clm03.cpp index 1848fd5396..254c1d1755 100644 --- a/src/surf/workstation_clm03.cpp +++ b/src/surf/workstation_clm03.cpp @@ -50,11 +50,6 @@ void surf_workstation_model_init_compound() sg_platf_host_add_cb(workstation_new); } -WorkstationCLM03Model::WorkstationCLM03Model(const char *name) - : WorkstationModel(name) -{} - - WorkstationCLM03Model::WorkstationCLM03Model() : WorkstationModel("Workstation") { @@ -139,13 +134,6 @@ ActionPtr WorkstationCLM03Model::executeParallelTask(int workstation_nb, return NULL; } -/* returns an array of network_link_CM02_t */ -xbt_dynar_t WorkstationCLM03Model::getRoute(WorkstationPtr src, WorkstationPtr dst) -{ - XBT_DEBUG("ws_get_route"); - return surf_network_model->getRoute(src->p_netElm, dst->p_netElm); -} - ActionPtr WorkstationCLM03Model::communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate){ return surf_network_model->communicate(src->p_netElm, dst->p_netElm, size, rate); } diff --git a/src/surf/workstation_clm03.hpp b/src/surf/workstation_clm03.hpp index 0028c52a61..f471b16f5c 100644 --- a/src/surf/workstation_clm03.hpp +++ b/src/surf/workstation_clm03.hpp @@ -31,7 +31,6 @@ typedef WorkstationCLM03Action *WorkstationCLM03ActionPtr; class WorkstationCLM03Model : public WorkstationModel { public: - WorkstationCLM03Model(const char *name); WorkstationCLM03Model(); ~WorkstationCLM03Model(); void parseInit(sg_platf_host_cbarg_t host); @@ -45,7 +44,6 @@ public: double *computation_amount, double *communication_amount, double rate); - xbt_dynar_t getRoute(WorkstationPtr src, WorkstationPtr dst); ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate); }; @@ -77,11 +75,6 @@ public: * Action * **********/ -class WorkstationCLM03Action : public WorkstationAction { -public: - WorkstationCLM03Action(ModelPtr model, double cost, bool failed) - : WorkstationAction(model, cost, failed) {} -}; #endif /* SURF_WORKSTATION_CLM03_HPP_ */ diff --git a/src/surf/workstation_interface.hpp b/src/surf/workstation_interface.hpp index d0546b5394..708cc52792 100644 --- a/src/surf/workstation_interface.hpp +++ b/src/surf/workstation_interface.hpp @@ -107,17 +107,6 @@ public: double *communication_amount, double rate)=0; - /** - * @brief [brief description] - * @details [long description] - * - * @param src [description] - * @param dst [description] - * - * @return [description] - */ - virtual xbt_dynar_t getRoute(WorkstationPtr src, WorkstationPtr dst)=0; - /** * @brief [brief description] * @details [long description] @@ -408,6 +397,7 @@ public: /********** * Action * **********/ + /** @ingroup SURF_workstation_interface * @brief SURF workstation action interface class */