Open MPI logo

Open MPI Development 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.

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-12-08 17:39:11

On Nov 29, 2005, at 3:04 PM, Bogdan Costescu wrote:

>> Here's the problem: there are 3 different APIs for processor affinity
>> in Linux.
> Could you please list them (at least the ones that you know about) ?

Check out
linux/paffinity_linux.h -- there's a big comment in that file about
the problem, to include descriptions of the 3 APIs.

> In the kernel source, in kernel/sched.c, the sys_sched_setaffinity
> function appears only in 2.6.0 (talking about stable kernels only). I
> can also see it back-ported by Red Hat in their RHEL3 (2.4.21-based)
> kernels, so I would like to know if others have back-ported it as
> well and if their functions differ.
> Both the official 2.6.x and the Red Hat back-ported definition of this
> function is:
> asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
> unsigned long __user
> *user_mask_ptr)
> (the back-ported RHEL3 doesn't have the __user attribute to the last
> parameter, but that's cosmetic)
> The glibc definitions of sched_setaffinity seem to change, I already
> found 2 of them in RHEL3 and RHEL4, but they both call the same
> underlying kernel function. So Open MPI could just bypass glibc and
> call the kernel function directly, for example:

The problem is that there are some 2-parameter variants out there. :-(

Check out Paul Hargrove's solution:

{+} Jeff Squyres
{+} The Open MPI Project