Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [hwloc-users] Trying to get last cpu location
From: Fabio Tordini (tordini_at_[hidden])
Date: 2013-03-05 16:13:35


Yep, you were right! I probably got confused as I'm running 1.6.1 on my
desktop machine but the 1.1rc6 is installed in the remote machine I'm
working on.
I'll ask for an update as soon as possible!

Thanks a lot!

On 05/03/13 22:02, Brice Goglin wrote:
> I don't see any obvious problem in the code.
> Are you sure you're not using an old hwloc by mistake?
> Can you add this after #include <hwloc.h> and compile again ?
> #if HWLOC_API_VERSION < 0x00010200
> #error Too old
> #endif
>
> Brice
>
>
>
> Le 05/03/2013 21:58, Fabio Tordini a écrit :
>> I'm using release 1.6.1 and, as I said, it is the only weird behaviour
>> I'm experiencing.
>>
>> the test program is actually very straight and easy: I load and
>> initialise the topology, perform some checks on current bindings and
>> the try to get the current thread's location, so that I can bind it to
>> the nodeset it belongs to:
>>
>> hwloc_topology_init(&topo);
>> hwloc_topology_load(topo);
>>
>> ...
>>
>> hwloc_bitmap_t cpuset = hwloc_bitmap_alloc();
>> hwloc_bitmap_t nodeset = hwloc_bitmap_alloc();
>> char *str;
>>
>> ...
>>
>> if( hwloc_get_last_cpu_location(topology, cpuset,
>> HWLOC_CPUBIND_THREAD) < 0 )
>> abort();
>> hwloc_bitmap_asprintf(&str, cpuset);
>> printf("current thread running on cpuset %s\n", str);
>> free(str);
>>
>> hwloc_cpuset_from_nodeset(topology, cpuset, nodeset);
>> if( hwloc_set_membind_nodeset(topology, nodeset, HWLOC_MEMBIND_BIND,
>> HWLOC_MEMBIND_THREAD) < 0 )
>> abort();
>>
>> ...
>>
>>
>> if( hwloc_get_last_cpu_location(topology, cpuset,
>> HWLOC_CPUBIND_THREAD) < 0 )
>> abort();
>> hwloc_bitmap_asprintf(&str, cpuset);
>> printf("current thread running on cpuset %s\n", str);
>> free(str);
>>
>> hwloc_cpuset_from_nodeset(topology, cpuset, nodeset);
>> if( hwloc_set_membind_nodeset(topology, nodeset, HWLOC_MEMBIND_BIND,
>> HWLOC_MEMBIND_THREAD) < 0 )
>> abort();
>>
>> ...
>>
>> I omitted some out-of-the-scope parts, but this is mostly it: is there
>> something wrong?
>> Fabio
>>
>>
>> On 05/03/13 18:25, Brice Goglin wrote:
>>> Hello Fabio,
>>> Which hwloc release are you using ? get_last_cpu_location() was only
>>> added in hwloc v1.2. It has always been available since then, even on
>>> when not supported (it will return -1 with errno=ENOSYS in this case).
>>> If this doesn't help, can you send your test program?
>>> Brice
>>>
>>>
>>>
>>> Le 05/03/2013 18:01, Fabio Tordini a écrit :
>>>> Hello,
>>>>
>>>> I'm experiencing a problem using the function
>>>> 'hwloc_get_last_cpu_location(...)': when compiling i first get a
>>>> warning about an implicit declaration of the function, and then it
>>>> gives an "undefined reference" error.
>>>> Everything else works just fine and I was thinking whether I have to
>>>> link some other libraries or perform some other actions in order to be
>>>> able to use the function.
>>>>
>>>> The tests I'm executing are run on a x86_64 GNU/Linux machine, and as
>>>> far as I know that function should be totally supported on Linux
>>>> systems.
>>>>
>>>> thanks,
>>>> Fabio
>>>>
>>>> _______________________________________________
>>>> hwloc-users mailing list
>>>> hwloc-users_at_[hidden]
>>>> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users

-- 
Fabio Tordini
PhD Candidate
Computer Science Department
University of Torino