Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
updated internal data structures to allow smpi to run outside of source tree.
authormarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 24 Aug 2007 00:44:35 +0000 (00:44 +0000)
committermarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 24 Aug 2007 00:44:35 +0000 (00:44 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4109 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/private.h
src/smpi/smpi_base.c

index 770c63c..bd4cdb0 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef SMPI_PRIVATE_H
 #define SMPI_PRIVATE_H
 
+#include "simix/simix.h"
 #include "xbt/mallocator.h"
 #include "xbt/xbt_os_time.h"
 #include "smpi.h"
index 84d9ff2..7f64d5a 100644 (file)
@@ -20,7 +20,7 @@ int smpi_mpi_comm_rank(smpi_mpi_communicator_t *comm, smx_host_t host)
 {
        int i;
 
-       for(i = comm->size - 1; i > 0 && host != comm->hosts[i]; i--);
+       for(i = comm->size - 1; i > 0 && host != comm->simdata->hosts[i]; i--);
 
        return i;
 }
@@ -102,7 +102,7 @@ int smpi_sender(int argc, char **argv)
                        message->buf  = xbt_malloc(request->datatype->size * request->count);
                        memcpy(message->buf, request->buf, request->datatype->size * request->count);
 
-                       dhost = request->comm->hosts[request->dst];
+                       dhost = request->comm->simdata->hosts[request->dst];
                        drank = smpi_mpi_comm_rank(smpi_mpi_global->mpi_comm_world, dhost);
 
                        SIMIX_mutex_lock(smpi_global->received_message_queues_mutexes[drank]);
@@ -544,7 +544,7 @@ void smpi_mpi_init()
                }
                SIMIX_mutex_unlock(smpi_global->start_stop_mutex);
 
-               smpi_mpi_global->mpi_comm_world->processes[smpi_mpi_comm_rank_self(smpi_mpi_global->mpi_comm_world)] = process;
+               smpi_mpi_global->mpi_comm_world->simdata->processes[smpi_mpi_comm_rank_self(smpi_mpi_global->mpi_comm_world)] = process;
        }
 
        // wait for all nodes to signal initializatin complete
@@ -591,9 +591,10 @@ void smpi_mpi_finalize()
                }
                SIMIX_mutex_unlock(smpi_global->start_stop_mutex);
 
-               SIMIX_mutex_destroy(smpi_mpi_global->mpi_comm_world->barrier_mutex);
-               SIMIX_cond_destroy(smpi_mpi_global->mpi_comm_world->barrier_cond);
-               xbt_free(smpi_mpi_global->mpi_comm_world->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);
+               xbt_free(smpi_mpi_global->mpi_comm_world->simdata);
                xbt_free(smpi_mpi_global->mpi_comm_world);
 
                xbt_free(smpi_mpi_global->mpi_byte);
@@ -631,7 +632,7 @@ void smpi_bench_end()
        duration       = xbt_os_timer_elapsed(smpi_global->timers[rank]);
        SIMIX_mutex_unlock(smpi_global->timers_mutexes[rank]);
 
-       host           = smpi_mpi_global->mpi_comm_world->hosts[rank];
+       host           = smpi_mpi_global->mpi_comm_world->simdata->hosts[rank];
        compute_action = SIMIX_action_execute(host, NULL, duration * SMPI_DEFAULT_SPEED);
        mutex          = SIMIX_mutex_init();
        cond           = SIMIX_cond_init();
@@ -669,7 +670,7 @@ void smpi_barrier(smpi_mpi_communicator_t *comm)
 int smpi_comm_rank(smpi_mpi_communicator_t *comm, smx_host_t host)
 {
        int i;
-       for(i = 0; i < comm->size && host != comm->hosts[i]; i++);
+       for(i = 0; i < comm->size && host != comm->simdata->hosts[i]; i++);
        if (i >= comm->size) i = -1;
        return i;
 }