From: markls Date: Wed, 29 Aug 2007 07:15:10 +0000 (+0000) Subject: removed some unnecessary waiting X-Git-Tag: v3.3~1234 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c8304965b869fd1264284ea426f02dcd111fb62b?hp=d6ce3162b34f0a964b8844368b9d86df4f1cf89b removed some unnecessary waiting git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4126 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/smpi/private.h b/src/smpi/private.h index 413d6d1c55..091fb009d7 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -90,7 +90,6 @@ void smpi_mpi_finalize(void); void smpi_bench_begin(void); void smpi_bench_end(void); void smpi_barrier(smpi_mpi_communicator_t *comm); -int smpi_comm_rank(smpi_mpi_communicator_t *comm, smx_host_t host); int smpi_create_request(void *buf, int count, smpi_mpi_datatype_t *datatype, int src, int dst, int tag, smpi_mpi_communicator_t *comm, smpi_mpi_request_t **request); int smpi_isend(smpi_mpi_request_t *request); diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index af55a6c5b4..87b1c35dac 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -134,13 +134,6 @@ void smpi_mpi_finalize() } } - // wait for senders/receivers to exit... - SIMIX_mutex_lock(smpi_global->start_stop_mutex); - if (smpi_global->ready_process_count > 0) { - SIMIX_cond_wait(smpi_global->start_stop_cond, smpi_global->start_stop_mutex); - } - SIMIX_mutex_unlock(smpi_global->start_stop_mutex); - SIMIX_mutex_destroy(smpi_mpi_global->mpi_comm_world->simdata->barrier_mutex); SIMIX_cond_destroy(smpi_mpi_global->mpi_comm_world->simdata->barrier_cond); xbt_free(smpi_mpi_global->mpi_comm_world->simdata->processes); @@ -155,6 +148,7 @@ void smpi_mpi_finalize() xbt_free(smpi_mpi_global->mpi_sum); xbt_free(smpi_mpi_global); + } } @@ -249,7 +243,7 @@ void smpi_wait(smpi_mpi_request_t *request, smpi_mpi_status_t *status) if (NULL != request) { SIMIX_mutex_lock(request->simdata->mutex); if (!request->completed) { - SIMIX_cond_wait(request->simdata->cond, request->simdata->mutex); + // SIMIX_cond_wait(request->simdata->cond, request->simdata->mutex); } if (NULL != status) { status->MPI_SOURCE = request->src; diff --git a/src/smpi/smpi_mpi.c b/src/smpi/smpi_mpi.c index b21ccbf4f8..988f2ee9df 100644 --- a/src/smpi/smpi_mpi.c +++ b/src/smpi/smpi_mpi.c @@ -53,7 +53,7 @@ int MPI_Comm_rank(MPI_Comm comm, int *rank) } else if (NULL == rank) { retval = MPI_ERR_ARG; } else { - *rank = smpi_comm_rank(comm, SIMIX_host_self()); + *rank = smpi_mpi_comm_rank(comm, SIMIX_host_self()); } smpi_bench_begin(); diff --git a/src/smpi/smpi_receiver.c b/src/smpi/smpi_receiver.c index f842dd69fd..eb4723fdcc 100644 --- a/src/smpi/smpi_receiver.c +++ b/src/smpi/smpi_receiver.c @@ -99,14 +99,5 @@ stopsearch: } while (0 < running_hosts_count); - SIMIX_mutex_lock(smpi_global->start_stop_mutex); - smpi_global->ready_process_count--; - if (smpi_global->ready_process_count == 0) { - SIMIX_cond_broadcast(smpi_global->start_stop_cond); - } else if (smpi_global->ready_process_count < 0) { - // FIXME: can't happen, abort! - } - SIMIX_mutex_unlock(smpi_global->start_stop_mutex); - return 0; } diff --git a/src/smpi/smpi_sender.c b/src/smpi/smpi_sender.c index 92db17bf8d..a7ea2cd15a 100644 --- a/src/smpi/smpi_sender.c +++ b/src/smpi/smpi_sender.c @@ -103,15 +103,5 @@ int smpi_sender(int argc, char **argv) } while (0 < running_hosts_count); - SIMIX_mutex_lock(smpi_global->start_stop_mutex); - smpi_global->ready_process_count--; - if (smpi_global->ready_process_count == 0) { - SIMIX_cond_broadcast(smpi_global->start_stop_cond); - } else if (smpi_global->ready_process_count < 0) { - // FIXME: can't happen! abort! - } - SIMIX_mutex_unlock(smpi_global->start_stop_mutex); - return 0; } -