Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
removed some unnecessary waiting
authormarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 29 Aug 2007 07:15:10 +0000 (07:15 +0000)
committermarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 29 Aug 2007 07:15:10 +0000 (07:15 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4126 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_mpi.c
src/smpi/smpi_receiver.c
src/smpi/smpi_sender.c

index 413d6d1..091fb00 100644 (file)
@@ -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);
 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);
 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);
index af55a6c..87b1c35 100644 (file)
@@ -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);
                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);
                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) {
        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;
                }
                if (NULL != status) {
                        status->MPI_SOURCE = request->src;
index b21ccbf..988f2ee 100644 (file)
@@ -53,7 +53,7 @@ int MPI_Comm_rank(MPI_Comm comm, int *rank)
        } else if (NULL == rank) {
                retval = MPI_ERR_ARG;
        } else {
        } 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();
        }
 
        smpi_bench_begin();
index f842dd6..eb4723f 100644 (file)
@@ -99,14 +99,5 @@ stopsearch:
 
        } while (0 < running_hosts_count);
 
 
        } 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;
 }
        return 0;
 }
index 92db17b..a7ea2cd 100644 (file)
@@ -103,15 +103,5 @@ int smpi_sender(int argc, char **argv)
 
        } while (0 < running_hosts_count);
 
 
        } 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;
 }
        return 0;
 }
-