Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
if smpi is ungrouped, processes behavior is registered as child of root type
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Sun, 10 Apr 2011 07:59:48 +0000 (09:59 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Sun, 10 Apr 2011 07:59:48 +0000 (09:59 +0200)
details:
- some checks in recursive get container

src/instr/instr_paje.c
src/instr/instr_smpi.c

index 8b300ed..1bc7133 100644 (file)
@@ -233,6 +233,7 @@ container_t newContainer (const char *name, e_container_types kind, container_t
 
 static container_t recursiveGetContainer (const char *name, container_t root)
 {
+  if (name == NULL || root == NULL) return NULL;
   if (strcmp (root->name, name) == 0) return root;
 
   xbt_dict_cursor_t cursor = NULL;
@@ -247,6 +248,7 @@ static container_t recursiveGetContainer (const char *name, container_t root)
 
 container_t getContainer (const char *name)
 {
+  if (name == NULL) return NULL;
   return recursiveGetContainer(name, rootContainer);
 }
 
index 130bc26..c06d40a 100644 (file)
@@ -111,7 +111,7 @@ void TRACE_smpi_init(int rank)
   if (TRACE_smpi_is_grouped()){
     father = getContainer (SIMIX_host_self_get_name());
   }else{
-    father = getContainer ("0");
+    father = getRootContainer ();
   }
   xbt_assert(father!=NULL,
       "Could not find a parent for mpi rank %s at function %s", str, __FUNCTION__);