1 /* Copyright (c) 2013-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "workstation_interface.hpp"
8 #include "storage_interface.hpp"
9 #include "cpu_interface.hpp"
10 #include "network_interface.hpp"
12 #ifndef SURF_WORKSTATION_CLM03_HPP_
13 #define SURF_WORKSTATION_CLM03_HPP_
19 class WorkstationCLM03Model;
20 typedef WorkstationCLM03Model *WorkstationCLM03ModelPtr;
22 class WorkstationCLM03;
23 typedef WorkstationCLM03 *WorkstationCLM03Ptr;
25 class WorkstationCLM03Action;
26 typedef WorkstationCLM03Action *WorkstationCLM03ActionPtr;
32 class WorkstationCLM03Model : public WorkstationModel {
34 WorkstationCLM03Model(const char *name);
35 WorkstationCLM03Model();
36 ~WorkstationCLM03Model();
37 void parseInit(sg_platf_host_cbarg_t host);
38 WorkstationPtr createResource(const char *name);
39 double shareResources(double now);
41 void updateActionsState(double now, double delta);
43 ActionPtr executeParallelTask(int workstation_nb,
44 void **workstation_list,
45 double *computation_amount,
46 double *communication_amount,
48 xbt_dynar_t getRoute(WorkstationPtr src, WorkstationPtr dst);
49 ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
56 class WorkstationCLM03 : public Workstation {
58 WorkstationCLM03(WorkstationModelPtr model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu);
60 void updateState(tmgr_trace_event_t event_type, double value, double date);
62 virtual ActionPtr execute(double size);
63 virtual ActionPtr sleep(double duration);
64 e_surf_resource_state_t getState();
71 void getParams(ws_params_t params);
72 void setParams(ws_params_t params);
80 class WorkstationCLM03Action : public WorkstationAction {
82 WorkstationCLM03Action(ModelPtr model, double cost, bool failed)
83 : WorkstationAction(model, cost, failed) {}
87 #endif /* SURF_WORKSTATION_CLM03_HPP_ */