X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b4cdae298b5a8f436f8c3ddf4c761529603df71a..2a41467d430bb218977c5770afe71147c1432075:/include/simdag/simdag.h diff --git a/include/simdag/simdag.h b/include/simdag/simdag.h index 9b6d259f5b..ca1af6375a 100644 --- a/include/simdag/simdag.h +++ b/include/simdag/simdag.h @@ -1,3 +1,9 @@ +/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #ifndef SIMDAG_SIMDAG_H #define SIMDAG_SIMDAG_H @@ -62,17 +68,20 @@ XBT_PUBLIC(xbt_dict_t) SD_workstation_get_properties(SD_workstation_t workstation); XBT_PUBLIC(const char *) SD_workstation_get_property_value(SD_workstation_t workstation, - const char *name); - + const char + *name); +XBT_PUBLIC(void) SD_workstation_dump(SD_workstation_t ws); XBT_PUBLIC(const SD_link_t *) SD_route_get_list(SD_workstation_t src, SD_workstation_t dst); -XBT_PUBLIC(int) SD_route_get_size(SD_workstation_t src, SD_workstation_t dst); +XBT_PUBLIC(int) SD_route_get_size(SD_workstation_t src, + SD_workstation_t dst); XBT_PUBLIC(double) SD_workstation_get_power(SD_workstation_t workstation); XBT_PUBLIC(double) SD_workstation_get_available_power(SD_workstation_t workstation); XBT_PUBLIC(e_SD_workstation_access_mode_t) - SD_workstation_get_access_mode(SD_workstation_t workstation); -XBT_PUBLIC(void) SD_workstation_set_access_mode(SD_workstation_t workstation, + SD_workstation_get_access_mode(SD_workstation_t workstation); +XBT_PUBLIC(void) SD_workstation_set_access_mode(SD_workstation_t + workstation, e_SD_workstation_access_mode_t access_mode); @@ -89,6 +98,8 @@ XBT_PUBLIC(double) SD_route_get_communication_time(SD_workstation_t src, double communication_amount); +XBT_PUBLIC(SD_task_t) SD_workstation_get_current_task(SD_workstation_t + workstation); /** @} */ /************************** Task handling ************************************/ @@ -113,6 +124,7 @@ XBT_PUBLIC(void *) SD_task_get_data(SD_task_t task); XBT_PUBLIC(void) SD_task_set_data(SD_task_t task, void *data); XBT_PUBLIC(e_SD_task_state_t) SD_task_get_state(SD_task_t task); XBT_PUBLIC(const char *) SD_task_get_name(SD_task_t task); +XBT_PUBLIC(void) SD_task_set_name(SD_task_t task, const char *name); XBT_PUBLIC(void) SD_task_watch(SD_task_t task, e_SD_task_state_t state); XBT_PUBLIC(void) SD_task_unwatch(SD_task_t task, e_SD_task_state_t state); XBT_PUBLIC(double) SD_task_get_amount(SD_task_t task); @@ -120,25 +132,57 @@ XBT_PUBLIC(double) SD_task_get_remaining_amount(SD_task_t task); XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task, int workstation_nb, const SD_workstation_t * - workstation_list, const double + workstation_list, + const double *computation_amount, const double - *communication_amount, - double rate); + *communication_amount); +XBT_PUBLIC(int) SD_task_get_kind(SD_task_t task); XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb, - const SD_workstation_t * workstation_list, + const SD_workstation_t * + workstation_list, const double *computation_amount, const double *communication_amount, double rate); XBT_PUBLIC(void) SD_task_unschedule(SD_task_t task); XBT_PUBLIC(double) SD_task_get_start_time(SD_task_t task); XBT_PUBLIC(double) SD_task_get_finish_time(SD_task_t task); +XBT_PUBLIC(xbt_dynar_t) SD_task_get_parents(SD_task_t task); +XBT_PUBLIC(xbt_dynar_t) SD_task_get_children(SD_task_t task); +XBT_PUBLIC(int) SD_task_get_workstation_count(SD_task_t task); +XBT_PUBLIC(SD_workstation_t *) SD_task_get_workstation_list(SD_task_t + task); XBT_PUBLIC(void) SD_task_destroy(SD_task_t task); XBT_PUBLIC(void) SD_task_dump(SD_task_t task); - -XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char*name,void *data,double amount); -XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char*name,void *data,double amount); -XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count, const SD_workstation_t*list); +XBT_PUBLIC(void) SD_task_dotty(SD_task_t task, void *out_FILE); + +XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char *name, void *data, + double amount); +XBT_PUBLIC(SD_task_t) SD_task_create_comp_par_amdahl(const char *name, + void *data, + double amount, + double alpha); +XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char *name, void *data, + double amount); + +XBT_PUBLIC(void) SD_task_distribute_comp_amdhal(SD_task_t task, int ws_count); +XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count, + const SD_workstation_t * list); XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...); +XBT_PUBLIC(void) SD_task_set_category (SD_task_t task, const char *category); +XBT_PUBLIC(const char *) SD_task_get_category (SD_task_t task); + + +/** @brief A constant to use in SD_task_schedule to mean that there is no cost. + * + * For example, create a pure computation task (no comm) like this: + * + * SD_task_schedule(task, my_workstation_nb, + * my_workstation_list, + * my_computation_amount, + * SD_TASK_SCHED_NO_COST, + * my_rate); + */ +#define SD_SCHED_NO_COST NULL /** @} */ @@ -154,7 +198,8 @@ XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...); XBT_PUBLIC(void) SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst); XBT_PUBLIC(void) SD_task_dependency_remove(SD_task_t src, SD_task_t dst); -XBT_PUBLIC(void *) SD_task_dependency_get_data(SD_task_t src, SD_task_t dst); +XBT_PUBLIC(void *) SD_task_dependency_get_data(SD_task_t src, + SD_task_t dst); XBT_PUBLIC(int) SD_task_dependency_exists(SD_task_t src, SD_task_t dst); /** @} */ @@ -171,12 +216,18 @@ XBT_PUBLIC(int) SD_task_dependency_exists(SD_task_t src, SD_task_t dst); XBT_PUBLIC(void) SD_init(int *argc, char **argv); XBT_PUBLIC(void) SD_application_reinit(void); XBT_PUBLIC(void) SD_create_environment(const char *platform_file); -XBT_PUBLIC(SD_task_t *) SD_simulate(double how_long); +XBT_PUBLIC(void) SD_load_environment_script(const char *script_file); +XBT_PUBLIC(xbt_dynar_t) SD_simulate(double how_long); XBT_PUBLIC(double) SD_get_clock(void); XBT_PUBLIC(void) SD_exit(void); -XBT_PUBLIC(xbt_dynar_t) SD_daxload(const char*filename); +XBT_PUBLIC(xbt_dynar_t) SD_daxload(const char *filename); +XBT_PUBLIC(xbt_dynar_t) SD_dotload(const char *filename); +XBT_PUBLIC(xbt_dynar_t) SD_dotload_with_sched(const char *filename); +XBT_PUBLIC(void) uniq_transfer_task_name(SD_task_t task); /** @} */ +#include "instr/instr.h" + SG_END_DECL() #endif