On 02/06/13 04:29, Siegmar Gross wrote:
Hi

thank you very much for your answer. I have compiled your program
and get different behaviours for openmpi-1.6.4rc3 and openmpi-1.9.

Yes, something else seems to be going on for 1.9.

For 1.6, try the attached patch. It works for me, but my machines have flatter (less interesting) topology. It'd be great if you could try

  % mpirun --report-bindings --rankfile myrankfile ./a.out

with that check program I sent and with the following rankfiles:

rank 0=sunpc1 slot=0:0
rank 0=sunpc1 slot=0:1
rank 0=sunpc1 slot=0:0-1
rank 0=sunpc1 slot=1:0
rank 0=sunpc1 slot=1:1
rank 0=sunpc1 slot=1:0-1
rank 0=sunpc1 slot=0:0-1,1:0-1

where each line represents a different rankfile.
Index: opal/mca/hwloc/hwloc132/hwloc/src/topology-solaris.c
===================================================================
--- opal/mca/hwloc/hwloc132/hwloc/src/topology-solaris.c	(revision 28036)
+++ opal/mca/hwloc/hwloc132/hwloc/src/topology-solaris.c	(working copy)
@@ -137,6 +137,7 @@
   int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE);
   int n;
   int i;
+  processorid_t binding;

   if (depth < 0) {
     errno = ENOSYS;
@@ -146,6 +147,15 @@
   hwloc_bitmap_zero(hwloc_set);
   n = hwloc_get_nbobjs_by_depth(topology, depth);

+  /* first check if processor_bind() was used to bind to a single processor rather than to an lgroup */
+
+  if ( processor_bind(idtype, id, PBIND_QUERY, &binding) == 0 && binding != PBIND_NONE ) {
+    hwloc_bitmap_only(hwloc_set, binding);
+    return 0;
+  }
+
+  /* if not, check lgroups */
+
   for (i = 0; i < n; i++) {
     hwloc_obj_t obj = hwloc_get_obj_by_depth(topology, depth, i);
     lgrp_affinity_t aff = lgrp_affinity_get(idtype, id, obj->os_index);

Reply via email to