[m-rev.] For review: Thread pinning improvements.

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Oct 17 01:13:02 AEDT 2011


On Wed, 5 Oct 2011, Paul Bone wrote:

> ---
>
> Improve thread pinning:
>    + Now pins threads intelligently on SMT systems by balancing threads among
>      cores.
>    + performs fewer migrations when pinning threads (If a thread's current
>      CPU is a valid CPU for pinning, then it is not migrated).
>    + Handle cases where the user requests more threads than available CPUs.
>    + Handle cases where the process is restricted to a subset of CPUs by its
>      environment.  (for instance, Linux cpuset(7))
>
> This is largely made possible by the hwloc library
> http://www.open-mpi.org/projects/hwloc/  However, hwloc is not required and the
> runtime system will fall back to sched_setaffinity(), it will simply be less
> intelligent WRT SMT.
>
> runtime/mercury_context.h:
> runtime/mercury_context.c:
>    Do thread pinning either via hwloc or sched_setaffinity.  Previously only
>    sched_setaffinity was used.
>
>    Update thread-pinning algorithm, this:
>
>    Include the general thread pinning code only if MR_HAVE_THREAD_PINNING is
>    defined.
>
>    Use a combination of sysconf and sched_getaffinity to detect the number of
>    processors when hwloc isn't available.  This makes the runtime compatible
>    with Linux cpuset(7) when hwloc isn't available.
>
> configure.in:

I suggest adding an option to configure that allows the the use of hwloc
to be disabled regardless of results of the autodetection test, e.g.

     --without-hwloc

> Mmake.common.in:
>    Detect presence of the hwloc library.
>
> configure.in:
>    Detect sched_getaffinity()
>
> aclocal.m4:
> acinclude.m4:
>    Move aclocal.m4 to acinclude.m4, the aclocal program will build aclocal.m4
>    and retrieve macros from the system and the contents of acinclude.m4.
>
> Mmakefile:
>    Create a make target for aclocal.m4.
>
> runtime/Mmakefile:
>    Link the runtime with libhwloc in low-level C parallel grades.
>
>    Include CFLAGS for libhwloc.
>
> scripts/ml.in:
>    Link programs and libraries with libhwloc in low-level C parallel grades.

It seems very suspicious that there are changes to the ml script but no
corresponding changes to compiler/compile_target_code.m or
scripts/Mercury.config.in.  Did you check that this change works with
mmc --make?

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list