X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8be7ea3f9e71cd563e91b6aba63f5c70f043fbd5..9f20930b9d7f7ba08b0e365209c2f4c72f9d047f:/src/simix/smx_network_private.h diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 72bcffa824..cc6e381ec2 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team. +/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -7,114 +7,46 @@ #ifndef _SIMIX_NETWORK_PRIVATE_H #define _SIMIX_NETWORK_PRIVATE_H +#include +#include + #include "simgrid/simix.h" -#include "smx_smurf_private.h" +#include "popping_private.h" /** @brief Rendez-vous point datatype */ -typedef struct s_smx_rvpoint { +typedef struct s_smx_mailbox { char *name; - xbt_fifo_t comm_fifo; + std::deque *comm_queue; void *data; smx_process_t permanent_receiver; //process which the mailbox is attached to - xbt_fifo_t done_comm_fifo;//messages already received in the permanent receive mode -} s_smx_rvpoint_t; - -void SIMIX_network_init(void); -void SIMIX_network_exit(void); - -#ifdef HAVE_LATENCY_BOUND_TRACKING -XBT_INLINE XBT_PUBLIC(int) SIMIX_comm_is_latency_bounded(smx_action_t comm); -#endif - -smx_rdv_t SIMIX_rdv_create(const char *name); -void SIMIX_rdv_destroy(smx_rdv_t rdv); -smx_rdv_t SIMIX_rdv_get_by_name(const char *name); -void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm); -int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host); -smx_action_t SIMIX_rdv_get_head(smx_rdv_t rdv); -void SIMIX_rdv_set_receiver(smx_rdv_t rdv, smx_process_t proc); -smx_process_t SIMIX_rdv_get_receiver(smx_rdv_t rdv); -void SIMIX_comm_start(smx_action_t action); -smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, - double task_size, double rate, - void *src_buff, size_t src_buff_size, - int (*match_fun)(void *, void *, smx_action_t), - void (*clean_fun)(void *), // used to free the action in case of problem after a detached send - void *data, - int detached); -smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, - void *dst_buff, size_t *dst_buff_size, - int (*)(void *, void *, smx_action_t), void *data); -smx_action_t SIMIX_comm_irecv_bounded(smx_process_t dst_proc, smx_rdv_t rdv, + std::deque *done_comm_queue;//messages already received in the permanent receive mode +} s_smx_mailbox_t; + +XBT_PRIVATE void SIMIX_mailbox_exit(void); + +XBT_PRIVATE smx_mailbox_t SIMIX_mbox_create(const char *name); +XBT_PRIVATE smx_mailbox_t SIMIX_mbox_get_by_name(const char *name); +XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t comm); +XBT_PRIVATE smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox); +XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t proc); +XBT_PRIVATE smx_process_t SIMIX_mbox_get_receiver(smx_mailbox_t mbox); +XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, - int (*)(void *, void *, smx_action_t), void *data, double rate); -void SIMIX_comm_destroy(smx_action_t action); -void SIMIX_comm_destroy_internal_actions(smx_action_t action); -smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int src, - int tag, int (*match_fun)(void *, void *, smx_action_t), void *data); -void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double timeout); -void SIMIX_pre_comm_waitany(smx_simcall_t simcall, xbt_dynar_t actions); -void SIMIX_post_comm(smx_action_t action); -void SIMIX_pre_comm_test(smx_simcall_t simcall, smx_action_t action); -void SIMIX_pre_comm_testany(smx_simcall_t simcall, xbt_dynar_t actions); -void SIMIX_comm_cancel(smx_action_t action); -double SIMIX_comm_get_remains(smx_action_t action); -e_smx_state_t SIMIX_comm_get_state(smx_action_t action); -void SIMIX_comm_suspend(smx_action_t action); -void SIMIX_comm_resume(smx_action_t action); -smx_process_t SIMIX_comm_get_src_proc(smx_action_t action); -smx_process_t SIMIX_comm_get_dst_proc(smx_action_t action); + int (*)(void *, void *, smx_synchro_t), + void (*copy_data_fun)(smx_synchro_t, void*, size_t), + void *data, double rate); +XBT_PRIVATE void SIMIX_comm_destroy(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_destroy_internal_actions(smx_synchro_t synchro); +XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src, + int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data); +XBT_PRIVATE void SIMIX_post_comm(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_cancel(smx_synchro_t synchro); +XBT_PRIVATE double SIMIX_comm_get_remains(smx_synchro_t synchro); +XBT_PRIVATE e_smx_state_t SIMIX_comm_get_state(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_suspend(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_resume(smx_synchro_t synchro); +XBT_PRIVATE smx_process_t SIMIX_comm_get_src_proc(smx_synchro_t synchro); +XBT_PRIVATE smx_process_t SIMIX_comm_get_dst_proc(smx_synchro_t synchro); -// pre prototypes -smx_action_t SIMIX_pre_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv, - int src, int tag, - int (*match_fun)(void *, void *, smx_action_t), - void *data); -smx_rdv_t SIMIX_pre_rdv_create(smx_simcall_t simcall, const char *name); -void SIMIX_pre_rdv_destroy(smx_simcall_t simcall, smx_rdv_t rdv); -smx_rdv_t SIMIX_pre_rdv_get_by_name(smx_simcall_t simcall, const char *name); -int SIMIX_pre_rdv_comm_count_by_host(smx_simcall_t simcall, smx_rdv_t rdv, smx_host_t host); -smx_action_t SIMIX_pre_rdv_get_head(smx_simcall_t simcall, smx_rdv_t rdv); -smx_process_t SIMIX_pre_rdv_get_receiver(smx_simcall_t simcall, smx_rdv_t rdv); -void SIMIX_pre_rdv_set_receiver(smx_simcall_t simcall, smx_rdv_t rdv, - smx_process_t process); -void SIMIX_pre_comm_send(smx_simcall_t simcall, smx_rdv_t rdv, - double task_size, double rate, - void *src_buff, size_t src_buff_size, - int (*match_fun)(void *, void *,smx_action_t), - void *data, double timeout); -smx_action_t SIMIX_pre_comm_isend(smx_simcall_t simcall, smx_rdv_t rdv, - double task_size, double rate, - void *src_buff, size_t src_buff_size, - int (*match_fun)(void *, void *,smx_action_t), - void (*clean_fun)(void *), - void *data, int detached); -void SIMIX_pre_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv, - void *dst_buff, size_t *dst_buff_size, - int (*match_fun)(void *, void *, smx_action_t), - void *data, double timeout); -void SIMIX_pre_comm_recv_bounded(smx_simcall_t simcall, smx_rdv_t rdv, - void *dst_buff, size_t *dst_buff_size, - int (*match_fun)(void *, void *, smx_action_t), - void *data, double timeout, double rate); -smx_action_t SIMIX_pre_comm_irecv(smx_simcall_t simcall, smx_rdv_t rdv, - void *dst_buff, size_t *dst_buff_size, - int (*match_fun)(void *, void *, smx_action_t), - void *data); -smx_action_t SIMIX_pre_comm_irecv_bounded(smx_simcall_t simcall, smx_rdv_t rdv, - void *dst_buff, size_t *dst_buff_size, - int (*match_fun)(void *, void *, smx_action_t), - void *data, double rate); -void SIMIX_pre_comm_destroy(smx_simcall_t simcall, smx_action_t action); -void SIMIX_pre_comm_cancel(smx_simcall_t simcall, smx_action_t action); -double SIMIX_pre_comm_get_remains(smx_simcall_t simcall, smx_action_t action); -e_smx_state_t SIMIX_pre_comm_get_state(smx_simcall_t simcall, smx_action_t action); -void* SIMIX_pre_comm_get_src_data(smx_simcall_t simcall, smx_action_t action); -void* SIMIX_pre_comm_get_dst_data(smx_simcall_t simcall, smx_action_t action); -smx_process_t SIMIX_pre_comm_get_src_proc(smx_simcall_t simcall, smx_action_t action); -smx_process_t SIMIX_pre_comm_get_dst_proc(smx_simcall_t simcall, smx_action_t action); -#ifdef HAVE_LATENCY_BOUND_TRACKING -int SIMIX_pre_comm_is_latency_bounded(smx_simcall_t simcall, smx_action_t action); -#endif #endif