-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2014. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
} s_SD_link_t;
/* Workstation */
+typedef s_xbt_dictelm_t s_SD_workstation_t;
typedef struct SD_workstation {
- void *surf_workstation; /* surf object */
void *data; /* user data */
e_SD_workstation_access_mode_t access_mode;
xbt_fifo_t task_fifo; /* only used in sequential mode */
SD_task_t current_task; /* only used in sequential mode */
-} s_SD_workstation_t;
+} s_SD_workstation_priv_t, *SD_workstation_priv_t;
+
+static inline SD_workstation_priv_t SD_workstation_priv(SD_workstation_t host){
+ return xbt_lib_get_level(host, SD_HOST_LEVEL);
+}
+
+/* Storage */
+typedef s_xbt_dictelm_t s_SD_storage_t;
+typedef struct SD_storage {
+ void *data; /* user data */
+ const char *host;
+} s_SD_storage_priv_t, *SD_storage_priv_t;
+
+static inline SD_storage_priv_t SD_storage_priv(SD_storage_t storage){
+ return xbt_lib_get_level(storage, SD_STORAGE_LEVEL);
+}
/* Task */
typedef struct SD_task {
char *name;
int kind;
double amount;
+ double alpha; /* used by typed parallel tasks */
double remains;
double start_time;
double finish_time;
/* dependencies */
xbt_dynar_t tasks_before;
xbt_dynar_t tasks_after;
- unsigned int unsatisfied_dependencies;
+ int unsatisfied_dependencies;
unsigned int is_not_ready;
/* scheduling parameters (only exist in state SD_SCHEDULED) */
double rate;
#ifdef HAVE_TRACING
+ long long int counter; /* task unique identifier for instrumentation */
char *category; /* sd task category for instrumentation */
#endif
} s_SD_task_t;
return task->state_set == sd_global->running_task_set;
}
+/********** Storage **********/
+SD_storage_t __SD_storage_create(void *surf_storage, void *data);
+void __SD_storage_destroy(void *storage);
+
+/********** Tracing **********/
+/* declaration of instrumentation functions from sd_task_instr.c */
+void TRACE_sd_task_create(SD_task_t task);
+void TRACE_sd_task_execute_start(SD_task_t task);
+void TRACE_sd_task_execute_end(SD_task_t task);
+void TRACE_sd_task_destroy(SD_task_t task);
+
+
#endif