X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/656ccde4d843648bc5c5d2a10cbbf767c1183a93..eed33b5980ef79e3f979b80564fbd5314c47902d:/include/msg/msg.h diff --git a/include/msg/msg.h b/include/msg/msg.h index 41b94838d7..986a463507 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -43,16 +43,16 @@ XBT_PUBLIC(void) MSG_config(const char *key, const char *value); * * We allow to link against compiled versions that differ in the patch level. */ -#define MSG_init(argc,argv) { \ - int ver_major,ver_minor,ver_patch; \ - sg_version(&ver_major,&ver_minor,&ver_patch); \ - if ((ver_major != SIMGRID_VERSION_MAJOR) || \ - (ver_minor != SIMGRID_VERSION_MINOR)) { \ - fprintf(stderr,"FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, and then linked against SimGrid %d.%d.%d. Please fix this.\n", \ - SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH,ver_major,ver_minor,ver_patch); \ - } \ - MSG_init_nocheck(argc,argv); \ - } +#define MSG_init(argc,argv) { \ + int ver_major,ver_minor,ver_patch; \ + sg_version(&ver_major,&ver_minor,&ver_patch); \ + if ((ver_major != SIMGRID_VERSION_MAJOR) || \ + (ver_minor != SIMGRID_VERSION_MINOR)) { \ + fprintf(stderr,"FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, and then linked against SimGrid %d.%d.%d. Please fix this.\n", \ + SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH,ver_major,ver_minor,ver_patch); \ + } \ + MSG_init_nocheck(argc,argv); \ + } XBT_PUBLIC(void) MSG_init_nocheck(int *argc, char **argv); XBT_PUBLIC(msg_error_t) MSG_main(void); @@ -195,6 +195,8 @@ XBT_PUBLIC(msg_error_t) MSG_task_destroy(msg_task_t task); XBT_PUBLIC(msg_error_t) MSG_task_receive_from_host(msg_task_t * task, const char *alias, msg_host_t host); +XBT_PUBLIC(msg_error_t) MSG_task_receive_from_host_bounded(msg_task_t * task, const char *alias, + msg_host_t host, double rate); XBT_PUBLIC(msg_error_t) MSG_task_execute(msg_task_t task); XBT_PUBLIC(msg_error_t) MSG_parallel_task_execute(msg_task_t task); @@ -205,6 +207,9 @@ XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec); XBT_PUBLIC(double) MSG_task_get_compute_duration(msg_task_t task); XBT_PUBLIC(void) MSG_task_set_compute_duration(msg_task_t task, double compute_duration); +XBT_PUBLIC(void) MSG_task_set_data_size(msg_task_t task, + double data_size); + XBT_PUBLIC(double) MSG_task_get_remaining_computation(msg_task_t task); XBT_PUBLIC(double) MSG_task_get_remaining_communication(msg_task_t task); XBT_PUBLIC(int) MSG_task_is_latency_bounded(msg_task_t task); @@ -223,14 +228,31 @@ XBT_PUBLIC(msg_error_t) MSG_task_receive(msg_task_t * task, const char *alias); #define MSG_task_recv(t,a) MSG_task_receive(t,a) + + +XBT_PUBLIC(msg_error_t) + MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, double timeout, + msg_host_t host, double rate); + +XBT_PUBLIC(msg_error_t) + MSG_task_receive_with_timeout_bounded(msg_task_t * task, const char *alias, + double timeout, double rate); + +XBT_PUBLIC(msg_error_t) + MSG_task_receive_bounded(msg_task_t * task, const char *alias,double rate); +#define MSG_task_recv_bounded(t,a,r) MSG_task_receive_bounded(t,a,r) + XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias); +XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate); XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(msg_task_t task, const char *alias, int (*match_fun)(void*,void*, smx_action_t), void *match_data); XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup); +XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate); XBT_PUBLIC(msg_comm_t) MSG_task_irecv(msg_task_t * task, const char *alias); +XBT_PUBLIC(msg_comm_t) MSG_task_irecv_bounded(msg_task_t * task, const char *alias, double rate); XBT_PUBLIC(int) MSG_comm_test(msg_comm_t comm); XBT_PUBLIC(int) MSG_comm_testany(xbt_dynar_t comms); XBT_PUBLIC(void) MSG_comm_destroy(msg_comm_t comm); @@ -250,6 +272,10 @@ XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout(msg_task_t task, const char *alias, double timeout); +XBT_PUBLIC(msg_error_t) + MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alias, + double timeout, double maxrate); + XBT_PUBLIC(msg_error_t) MSG_task_send(msg_task_t task, const char *alias); @@ -266,6 +292,10 @@ XBT_PUBLIC(msg_error_t) MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task, msg_host_t host, double timeout); +XBT_PUBLIC(msg_error_t) + MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t *task, + msg_host_t host, double timeout, double rate); + XBT_PUBLIC(msg_error_t) MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task, double timeout);