[hwloc-users] hwloc_get_last_cpu_location on AIX

2012-05-08 Thread Hendryk Bockelmann

Hello,

I just ran into trouble using hwloc_get_last_cpu_location on our POWER6 
cluster with AIX6.1
My plan is to find out if the binding of the job-scheduler was correct 
for MPI-tasks and OpenMP-threads. This is what I want to use:


support = hwloc_topology_get_support(topology);
ret = hwloc_get_cpubind(topology, set, HWLOC_CPUBIND_THREAD);
if (support->cpubind->get_thisthread_cpubind) {
  hwloc_bitmap_asprintf(, set);
  printf("--> cpuset (thread %d) is %s \n",omp_get_thread_num(),str);
}
if (support->cpubind->get_thisthread_last_cpu_location) {
  ret = hwloc_set_cpubind(topology, set, HWLOC_CPUBIND_THREAD);
  last = hwloc_bitmap_alloc();
  ret = hwloc_get_last_cpu_location(topology,last,HWLOC_CPUBIND_THREAD);
  hwloc_bitmap_asprintf(, last);
  printf("--> cpu_loca (thread %d) is %s \n",omp_get_thread_num(),str);
}

this is what I found in src/tests/hwloc_get_last_cpu_location.c

Running this on my local linux machine gives e.g.:

--> cpuset (thread 1) is 0x0005
--> cpuset (thread 0) is 0x0005
--> cpu_loca (thread 0) is 0x0004
--> cpu_loca (thread 1) is 0x0001

hence, (support->cpubind->get_thisthread_cpubind) and 
(support->cpubind->get_thisthread_last_cpu_location) are both true


but on the AIX cluster I just get:

--> cpuset (thread 0) is 0x0003
--> cpuset (thread 1) is 0x0003

hence, (support->cpubind->get_thisthread_last_cpu_location) is false.
Now the question is whether this is related to my install of hwloc-1.4.1 
or a general problem on AIX?
Furthermore, I would like to know if there is any other change to use 
hwloc to check correct task/thread binding?


Best,
Hendryk



smime.p7s
Description: S/MIME Cryptographic Signature


Re: [hwloc-users] [hwloc-announce] Hardware Locality (hwloc) v1.2.1rc1 released

2011-08-02 Thread Hendryk Bockelmann

Hi Samuel,

I will test hwloc-1.2.1rc1r3567.tar.gz in the next days on our POWER6 
cluster running AIX6.1 and report the results to you resp. to the list


Hendryk

On 02/08/11 03:12, Samuel Thibault wrote:

Brice Goglin, le Mon 01 Aug 2011 22:07:33 +0200, a écrit :

The Hardware Locality (hwloc) team is pleased to announce the first
release candidate of version 1.2.1

 http://www.open-mpi.org/projects/hwloc/


Could someone test on AIX?

Samuel




smime.p7s
Description: S/MIME Cryptographic Signature


Re: [hwloc-users] Problem getting cpuset of MPI task

2011-02-10 Thread Hendryk Bockelmann

Hey Brice,

I already though so, but thank you for the explanation.
On our clusters the job scheduler binds the MPI tasks, but it is not 
always clear to which resources. So for us it would be great to know 
where a task runs such that we might adopt the MPI communicators to 
increase performance.
Maybe just a note on the hwloc output on the cluster: while on my locale 
machine all MPI tasks are able to explore the whole topology, on the 
cluster each task only sees itself, e.g. for task 7:


7:Machine#0(Backend=AIXOSName=AIXOSRelease=1OSVersion=6HostName=p191Architecture=00C83AC24C00), 
cpuset: 0xc000

7:  NUMANode#0, cpuset: 0xc000
7:L2Cache#0(0KB line=0), cpuset: 0xc000
7:  Core#0, cpuset: 0xc000
7:PU, cpuset: 0x4000
7:PU#0, cpuset: 0x8000
7:--> root_cpuset of process 7 is 0xc000

Nevertheless, all MPI-tasks have different cpusets and since the nodes 
are homogeneous one can guess the whole binding using the information of 
lstopo and the HostName of each task. Perhaps you can tell me whether 
such a restricted topology is due to hwloc or due to the fixed binding 
by the job scheduler?


Greetings,
Hendryk

On 09/02/11 17:12, Brice Goglin wrote:

Le 09/02/2011 16:53, Hendryk Bockelmann a écrit :

Since I am new to hwloc there might be a misunderstanding from my
side, but I have a problem getting the cpuset of MPI tasks. I just
want to run a simple MPI program to see on which cores (or CPUs in
case of hyperthreading or SMT) the tasks run, so that I can arrange my
MPI communicators.

For the program below I get the following output:

Process 0 of 2 on tide
Process 1 of 2 on tide
--> cpuset of process 0 is 0x000f
--> cpuset of process 0 after singlify is 0x0001
--> cpuset of process 1 is 0x000f
--> cpuset of process 1 after singlify is 0x0001

So why do both MPI tasks report the same cpuset?


Hello Hendryk,

Your processes are not bound, there may run anywhere they want.
hwloc_get_cpubind() tells you where they are bound. That's why the
cpuset is 0xf first (all the existing logical processors in the
machine).

You want to know where they actually run. It's different from where
there are bound. The former is included in the latter. The former is a
single processor, while the later may be any combination of any processors).

hwloc cannot tell you where a task run. But I am looking at implementing
it. I actually sent a patch to hwloc-devel about it yesterday [1]. You
would just have to replace get_cpubind with get_cpuexec (or whatever the
final function name is).

You should note that such a function would not be guaranteed to return
something true since the process may migrate to another processor in the
meantime.

Also note that hwloc_bitmap_singlify is usually used to "simplify" a
cpuset (to avoid migration between multiple SMT for instance) before
binding a task (calling set_cpubind). It's useless in your code above.

Brice

[1] http://www.open-mpi.org/community/lists/hwloc-devel/2011/02/1915.php




Here is the program (attached you find the output of
hwloc-gather-topology.sh):

#include 
#include 
#include "hwloc.h"
#include "mpi.h"

int main(int argc, char* argv[]) {

hwloc_topology_t topology;
hwloc_bitmap_t cpuset;
char *str = NULL;
int myid, numprocs, namelen;
char procname[MPI_MAX_PROCESSOR_NAME];

MPI_Init(,);
MPI_Comm_size(MPI_COMM_WORLD,);
MPI_Comm_rank(MPI_COMM_WORLD,);
MPI_Get_processor_name(procname,);

printf("Process %d of %d on %s\n", myid, numprocs, procname);

hwloc_topology_init();
hwloc_topology_load(topology);

/* get native cpuset of this process */
cpuset = hwloc_bitmap_alloc();
hwloc_get_cpubind(topology, cpuset, 0);
hwloc_bitmap_asprintf(, cpuset);
printf("--> cpuset of process %d is %s\n", myid, str);
free(str);
hwloc_bitmap_singlify(cpuset);
hwloc_bitmap_asprintf(, cpuset);
printf("--> cpuset of process %d after singlify is %s\n", myid, str);
free(str);

hwloc_bitmap_free(cpuset);
hwloc_topology_destroy(topology);

MPI_Finalize();
return 0;
}




smime.p7s
Description: S/MIME Cryptographic Signature