Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Begin to add an interface to instanciate SMPI programatically.
[simgrid.git] / src / smpi / smpi_group.c
index e88ffa1..921f719 100644 (file)
@@ -1,8 +1,8 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2013-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 * under the terms of the license (GNU LGPL) which comes with this package. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.h"
 
@@ -30,7 +30,7 @@ MPI_Group smpi_group_new(int size)
   MPI_Group group;
   int i, count;
 
-  count = smpi_process_count();
+  count = SIMIX_process_count();
   group = xbt_new(s_smpi_mpi_group_t, 1);
   group->size = size;
   group->rank_to_index_map = xbt_new(int, size);
@@ -75,7 +75,6 @@ MPI_Group smpi_group_copy(MPI_Group origin)
 
 void smpi_group_destroy(MPI_Group group)
 {
-  XBT_VERB("trying to free group %p, refcount = %d", group, group->refcount);
   if(group!= smpi_comm_group(MPI_COMM_WORLD)
           && group != MPI_GROUP_NULL
           && group != smpi_comm_group(MPI_COMM_SELF)
@@ -85,7 +84,7 @@ void smpi_group_destroy(MPI_Group group)
 
 void smpi_group_set_mapping(MPI_Group group, int index, int rank)
 {
-  if (rank < group->size && index < smpi_process_count()) {
+  if (rank < group->size && index < SIMIX_process_count()) {
     group->rank_to_index_map[rank] = index;
     if(index!=MPI_UNDEFINED)group->index_to_rank_map[index] = rank;
   }
@@ -104,10 +103,7 @@ int smpi_group_index(MPI_Group group, int rank)
 int smpi_group_rank(MPI_Group group, int index)
 {
   int rank = MPI_UNDEFINED;
-
-  if (index < smpi_process_count()) {
-    rank = group->index_to_rank_map[index];
-  }
+  rank = group->index_to_rank_map[index];
   return rank;
 }
 
@@ -121,7 +117,6 @@ int smpi_group_unuse(MPI_Group group)
 {
   group->refcount--;
   if (group->refcount <= 0) {
-    XBT_VERB("freeing group %p", group);
     xbt_free(group->rank_to_index_map);
     xbt_free(group->index_to_rank_map);
     xbt_free(group);