<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: More information on pthread_setaffinity_np and sched_setaffinity</title>
	<atom:link href="http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/</link>
	<description>A Blog on Parallel Programming and Concurrency by Michael Suess</description>
	<pubDate>Wed, 09 Jul 2008 02:27:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: antx</title>
		<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-64132</link>
		<dc:creator>antx</dc:creator>
		<pubDate>Fri, 06 Jun 2008 00:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-64132</guid>
		<description>After inspecting my headers a week ago I found that the pthread_setaffinity_np() is located inside a #ifdef GNU or something similar,
then after some googling I found that in order to link the function you MUST use -D_GNU_SOURCE, so try appending it to GCC!

Luck &#38; Happy hacking.</description>
		<content:encoded><![CDATA[<p>After inspecting my headers a week ago I found that the pthread_setaffinity_np() is located inside a #ifdef GNU or something similar,<br />
then after some googling I found that in order to link the function you MUST use -D_GNU_SOURCE, so try appending it to GCC!</p>
<p>Luck &amp; Happy hacking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bert Wesarg</title>
		<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-6287</link>
		<dc:creator>Bert Wesarg</dc:creator>
		<pubDate>Wed, 11 Apr 2007 13:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-6287</guid>
		<description>two notes:

(1) pthread_setaffinity_np() is just a wrapper around sched_setaffinity() with the tid from the thread described by the pthread_t. this can be see here http://tinyurl.com/2slkve and here http://tinyurl.com/yobmfb (first note).

(2) because of this, the sched_setaffinity() call can not handle the whole affinity mask of the process, so it is impossible to move a process with many threads with one sched_setaffinity() call to an other set of cpus. and the kernel does also not make a different between a process and a thread, which can be see here http://tinyurl.com/2kdu4f.</description>
		<content:encoded><![CDATA[<p>two notes:</p>
<p>(1) pthread_setaffinity_np() is just a wrapper around sched_setaffinity() with the tid from the thread described by the pthread_t. this can be see here <a href="http://tinyurl.com/2slkve" rel="nofollow">http://tinyurl.com/2slkve</a> and here <a href="http://tinyurl.com/yobmfb" rel="nofollow">http://tinyurl.com/yobmfb</a> (first note).</p>
<p>(2) because of this, the sched_setaffinity() call can not handle the whole affinity mask of the process, so it is impossible to move a process with many threads with one sched_setaffinity() call to an other set of cpus. and the kernel does also not make a different between a process and a thread, which can be see here <a href="http://tinyurl.com/2kdu4f" rel="nofollow">http://tinyurl.com/2kdu4f</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charles</title>
		<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-3060</link>
		<dc:creator>charles</dc:creator>
		<pubDate>Thu, 01 Mar 2007 22:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-3060</guid>
		<description>you have to #include "nptl/pthread.h" not pthread.h, which will probably use the linuxthreads header file which doesn't have the affinity methods.  you will also need to do a -I/usr/include/nptl and -L/usr/lib/nptl.  be aware you're breaking your program's compatibility with linuxthreads as a result.  http://osmirrors.cerias.purdue.edu/pub/slackware/slackware-10.2/README.NPTL explains it all.</description>
		<content:encoded><![CDATA[<p>you have to #include &#8220;nptl/pthread.h&#8221; not pthread.h, which will probably use the linuxthreads header file which doesn&#8217;t have the affinity methods.  you will also need to do a -I/usr/include/nptl and -L/usr/lib/nptl.  be aware you&#8217;re breaking your program&#8217;s compatibility with linuxthreads as a result.  <a href="http://osmirrors.cerias.purdue.edu/pub/slackware/slackware-10.2/README.NPTL" rel="nofollow">http://osmirrors.cerias.purdue.edu/pub/slackware/slackware-10.2/README.NPTL</a> explains it all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Suess</title>
		<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-2673</link>
		<dc:creator>Michael Suess</dc:creator>
		<pubDate>Wed, 21 Feb 2007 21:48:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-2673</guid>
		<description>Nils: are you sure you included pthread.h in your program? And did you link it using -lpthread? Other than that, you should have to do nothing to get it to work on Ubuntu Edgy...</description>
		<content:encoded><![CDATA[<p>Nils: are you sure you included pthread.h in your program? And did you link it using -lpthread? Other than that, you should have to do nothing to get it to work on Ubuntu Edgy&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nils</title>
		<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-2613</link>
		<dc:creator>Nils</dc:creator>
		<pubDate>Tue, 20 Feb 2007 22:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-2613</guid>
		<description>I have

nils@virtualdream:~$ getconf GNU_LIBPTHREAD_VERSION
NPTL 2.4


But the compiler still does not know the pthread_setaffinity_np function..

any ideas? my distro is ubuntu edgy</description>
		<content:encoded><![CDATA[<p>I have</p>
<p>nils@virtualdream:~$ getconf GNU_LIBPTHREAD_VERSION<br />
NPTL 2.4</p>
<p>But the compiler still does not know the pthread_setaffinity_np function..</p>
<p>any ideas? my distro is ubuntu edgy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Suess</title>
		<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-17</link>
		<dc:creator>Michael Suess</dc:creator>
		<pubDate>Mon, 21 Aug 2006 20:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-17</guid>
		<description>Christopher, this is certainly an interesting project (and I was not aware that it existed). Nevertheless, the first thought that came to my mind when I read up on it was: "It gives a bad impression on the state of processor affinity in the Linux kernel when a project like this becomes necessary." And this is how I still feel about it...</description>
		<content:encoded><![CDATA[<p>Christopher, this is certainly an interesting project (and I was not aware that it existed). Nevertheless, the first thought that came to my mind when I read up on it was: &#8220;It gives a bad impression on the state of processor affinity in the Linux kernel when a project like this becomes necessary.&#8221; And this is how I still feel about it&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Aycock</title>
		<link>http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-16</link>
		<dc:creator>Christopher Aycock</dc:creator>
		<pubDate>Sat, 19 Aug 2006 09:49:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.thinkingparallel.com/2006/08/18/more-information-on-pthread_setaffinity_np-and-sched_setaffinity/#comment-16</guid>
		<description>I thought I should include a link to the Portable Linux Processor Affinity from the same team behind Open MPI: http://www.open-mpi.org/software/plpa/

They claim that this package provides a more portable, as well as more consistent, version of sched_setaffinity().</description>
		<content:encoded><![CDATA[<p>I thought I should include a link to the Portable Linux Processor Affinity from the same team behind Open MPI: <a href="http://www.open-mpi.org/software/plpa/" rel="nofollow">http://www.open-mpi.org/software/plpa/</a></p>
<p>They claim that this package provides a more portable, as well as more consistent, version of sched_setaffinity().</p>
]]></content:encoded>
	</item>
</channel>
</rss>
