X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/eae2ca68b485c809c971f5861f4e73b9406fa20a..7ad85b03568dabade546f7948aaf7279059e9269:/src/simix/smx_network.c diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index fd2a61b2b4..0b057045c9 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2014. The SimGrid Team. +/* Copyright (c) 2009-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -7,9 +7,8 @@ #include "smx_private.h" #include "xbt/log.h" #include "mc/mc.h" -#include "mc/mc_replay.h" +#include "src/mc/mc_replay.h" #include "xbt/dict.h" -#include "smpi/private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization"); @@ -335,31 +334,19 @@ void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_rdv int (*match_fun)(void *, void *,smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double timeout){ - smx_synchro_t comm = SIMIX_comm_isend(src, rdv, task_size, rate, + smx_synchro_t comm = simcall_HANDLER_comm_isend(simcall, src, rdv, task_size, rate, src_buff, src_buff_size, match_fun, NULL, copy_data_fun, data, 0); SIMCALL_SET_MC_VALUE(simcall, 0); simcall_HANDLER_comm_wait(simcall, comm, timeout); } -smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src, smx_rdv_t rdv, +smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, 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_synchro_t), - void (*clean_fun)(void *), - void (*copy_data_fun)(smx_synchro_t, void*, size_t), - void *data, int detached){ - return SIMIX_comm_isend(src, rdv, task_size, rate, src_buff, - src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); - -} -smx_synchro_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_synchro_t), - void (*clean_fun)(void *), // used to free the synchro in case of problem after a detached send - void (*copy_data_fun)(smx_synchro_t, void*, size_t), // used to copy data if not default one - void *data, - int detached) + void (*clean_fun)(void *), // used to free the synchro in case of problem after a detached send + void (*copy_data_fun)(smx_synchro_t, void*, size_t),// used to copy data if not default one + void *data, int detached) { XBT_DEBUG("send from %p", rdv); @@ -430,25 +417,25 @@ smx_synchro_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, return (detached ? NULL : other_synchro); } -void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv, +void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double timeout, double rate) { - smx_synchro_t comm = SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff, + smx_synchro_t comm = SIMIX_comm_irecv(receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); SIMCALL_SET_MC_VALUE(simcall, 0); simcall_HANDLER_comm_wait(simcall, comm, timeout); } -smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_rdv_t rdv, +smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double rate) { - return SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff, dst_buff_size, + return SIMIX_comm_irecv(receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); } @@ -843,8 +830,8 @@ void SIMIX_comm_finish(smx_synchro_t synchro) XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) detached:%d", synchro, - synchro->comm.src_proc ? sg_host_name(synchro->comm.src_proc->host) : NULL, - synchro->comm.dst_proc ? sg_host_name(synchro->comm.dst_proc->host) : NULL, + synchro->comm.src_proc ? sg_host_get_name(synchro->comm.src_proc->host) : NULL, + synchro->comm.dst_proc ? sg_host_get_name(synchro->comm.dst_proc->host) : NULL, simcall->issuer->name, simcall->issuer, synchro->comm.detached); if (synchro->comm.src_proc == simcall->issuer) { XBT_DEBUG("I'm source"); @@ -1103,9 +1090,9 @@ void SIMIX_comm_copy_data(smx_synchro_t comm) XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm, - comm->comm.src_proc ? sg_host_name(comm->comm.src_proc->host) : "a finished process", + comm->comm.src_proc ? sg_host_get_name(comm->comm.src_proc->host) : "a finished process", comm->comm.src_buff, - comm->comm.dst_proc ? sg_host_name(comm->comm.dst_proc->host) : "a finished process", + comm->comm.dst_proc ? sg_host_get_name(comm->comm.dst_proc->host) : "a finished process", comm->comm.dst_buff, buff_size); /* Copy at most dst_buff_size bytes of the message to receiver's buffer */