Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

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 http://svn.open-mpi.org/svn/ompi/trunk/opal/mca/paffinity/
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: http://www.open-mpi.org/community/
lists/devel/2005/11/0562.php

--
{+} Jeff Squyres
{+} The Open MPI Project
{+} http://www.open-mpi.org/