A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Regenerate with flexml 1.7
[simgrid.git]
/
src
/
surf
/
workstation.c
diff --git
a/src/surf/workstation.c
b/src/surf/workstation.c
index
9a02483
..
8229535
100644
(file)
--- a/
src/surf/workstation.c
+++ b/
src/surf/workstation.c
@@
-12,6
+12,9
@@
#include "cpu_private.h"
#include "network_private.h"
#include "cpu_private.h"
#include "network_private.h"
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
+ "Logging specific to the SURF workstation module");
+
surf_workstation_model_t surf_workstation_model = NULL;
xbt_dict_t workstation_set = NULL;
surf_workstation_model_t surf_workstation_model = NULL;
xbt_dict_t workstation_set = NULL;
@@
-34,7
+37,7
@@
static void workstation_free(void *workstation)
free(workstation);
}
free(workstation);
}
-
static
void create_workstations(void)
+void create_workstations(void)
{
xbt_dict_cursor_t cursor = NULL;
char *name = NULL;
{
xbt_dict_cursor_t cursor = NULL;
char *name = NULL;
@@
-62,19
+65,22
@@
static const char *get_resource_name(void *resource_id)
static int resource_used(void *resource_id)
{
static int resource_used(void *resource_id)
{
- xbt_assert0(0,
- "Workstation is a virtual model. I should not be there!");
- return 0;
+ THROW_IMPOSSIBLE; /* This model does not implement parallel tasks */
+}
+
+static void parallel_action_cancel(surf_action_t action)
+{
+ THROW_UNIMPLEMENTED; /* This model does not implement parallel tasks */
}
static int parallel_action_free(surf_action_t action)
{
}
static int parallel_action_free(surf_action_t action)
{
- xbt_assert0(0, "This model does not implement parallel tasks");
+ THROW_UNIMPLEMENTED; /* This model does not implement parallel tasks */
}
static void parallel_action_use(surf_action_t action)
{
}
static void parallel_action_use(surf_action_t action)
{
- xbt_assert0(0, "This model does not implement parallel tasks");
+ THROW_UNIMPLEMENTED; /* This model does not implement parallel tasks */
}
static int action_free(surf_action_t action)
}
static int action_free(surf_action_t action)
@@
-113,7
+119,7
@@
static void action_cancel(surf_action_t action)
surf_cpu_model->common_public->action_cancel(action);
else if (action->model_type ==
(surf_model_t) surf_workstation_model)
surf_cpu_model->common_public->action_cancel(action);
else if (action->model_type ==
(surf_model_t) surf_workstation_model)
- parallel_action_
use
(action);
+ parallel_action_
cancel
(action);
else
DIE_IMPOSSIBLE;
return;
else
DIE_IMPOSSIBLE;
return;
@@
-155,8
+161,7
@@
static void update_resource_state(void *id,
tmgr_trace_event_t event_type,
double value)
{
tmgr_trace_event_t event_type,
double value)
{
- xbt_assert0(0, "This model does not implement parallel tasks");
- return;
+ THROW_IMPOSSIBLE; /* This model does not implement parallel tasks */
}
static surf_action_t execute(void *workstation, double size)
}
static surf_action_t execute(void *workstation, double size)
@@
-249,6
+254,12
@@
static double get_available_speed(void *workstation)
get_available_speed(((workstation_CLM03_t) workstation)->cpu);
}
get_available_speed(((workstation_CLM03_t) workstation)->cpu);
}
+static xbt_dict_t get_properties(void *workstation)
+{
+ return surf_cpu_model->common_public->
+ get_properties(((workstation_CLM03_t) workstation)->cpu);
+}
+
static surf_action_t execute_parallel_task(int workstation_nb,
void **workstation_list,
double *computation_amount,
static surf_action_t execute_parallel_task(int workstation_nb,
void **workstation_list,
double *computation_amount,
@@
-256,7
+267,7
@@
static surf_action_t execute_parallel_task(int workstation_nb,
double amount,
double rate)
{
double amount,
double rate)
{
- xbt_assert0(0, "This model does not implement parallel tasks");
+ THROW_UNIMPLEMENTED; /* This model does not implement parallel tasks */
}
}
@@
-381,6
+392,10
@@
static void surf_workstation_model_init_internal(void)
surf_workstation_model->extension_public->get_speed = get_speed;
surf_workstation_model->extension_public->get_available_speed =
get_available_speed;
surf_workstation_model->extension_public->get_speed = get_speed;
surf_workstation_model->extension_public->get_available_speed =
get_available_speed;
+
+ /*manage the properties of the workstation*/
+ surf_workstation_model->common_public->get_properties = get_properties;
+
surf_workstation_model->extension_public->communicate = communicate;
surf_workstation_model->extension_public->execute_parallel_task =
execute_parallel_task;
surf_workstation_model->extension_public->communicate = communicate;
surf_workstation_model->extension_public->execute_parallel_task =
execute_parallel_task;
@@
-412,7
+427,7
@@
void surf_workstation_model_init_CLM03(const char *filename)
surf_workstation_model_init_internal();
surf_cpu_model_init_Cas01(filename);
surf_network_model_init_CM02(filename);
surf_workstation_model_init_internal();
surf_cpu_model_init_Cas01(filename);
surf_network_model_init_CM02(filename);
- create_workstations();
+
//
create_workstations();
update_model_description(surf_workstation_model_description,
surf_workstation_model_description_size,
"CLM03",
update_model_description(surf_workstation_model_description,
surf_workstation_model_description_size,
"CLM03",