Two independent patches to the source code

We have received criticism for large, monolithic commits instead of creating smaller independent patches. We have taken this criticism into consideration and now have some small independent patches ready for review.

  1. hier_barrier_fix.patch – This patch has a couple small fixes to the hierarchical barrier, predominately used on the Intel® MIC Architecture, in the context of teams and infinite blocktime. The value of 0 for nesting level is used in the parallel region that consists of the team masters, and hierarchical barrier did not take that into consideration.

  2. balanced_affinity.patch – This patch enables the use of KMP_AFFINITY=balanced on non-MIC Architectures. The restriction for using balanced affinity on non-MIC architectures is it only works for one-package machines.

To apply the patches:

Put them in the directory that contatins offload/, runtime/, etc.

$ patch –p0 < hier_barrier_fix.patch

$ patch –p0 < balanced_affinity.patch

Please leave feedback!

– Johnny

hier_barrier_fix.patch (1.19 KB)

balanced_affinity.patch (8.52 KB)

From: "Jonathan L Peyton" <jonathan.l.peyton@intel.com>
To: openmp-dev@dcs-maillist2.engr.illinois.edu
Sent: Monday, December 15, 2014 5:31:33 PM
Subject: [Openmp-dev] Two independent patches to the source code

We have received criticism for large, monolithic commits instead of
creating smaller independent patches. We have taken this criticism
into consideration and now have some small independent patches ready
for review.

Great, thanks!

1) hier_barrier_fix.patch – This patch has a couple small fixes to
the hierarchical barrier, predominately used on the Intel® MIC
Architecture, in the context of teams and infinite blocktime. The
value of 0 for nesting level is used in the parallel region that
consists of the team masters, and hierarchical barrier did not take
that into consideration.

2) balanced_affinity.patch – This patch enables the use of
KMP_AFFINITY=balanced on non-MIC Architectures. The restriction for
using balanced affinity on non-MIC architectures is it only works
for one-package machines.

I realize that this is not particular to this patch (which is just removing the #if KMP_MIC), but:

        case affinity_balanced:
        // Balanced works only for the case of a single package and uniform topology
        if( nPackages > 1 ) {
            if( __kmp_affinity_verbose || __kmp_affinity_warnings ) {
                KMP_WARNING( AffBalancedNotAvail, "KMP_AFFINITY" );
            }
            __kmp_affinity_type = affinity_none;
            return;
        } else if( __kmp_affinity_uniform_topology() ) {
            break;
        } else { // Non-uniform topology

            // Save the depth for further usage
            __kmp_aff_depth = depth;
            ...

It looks like the comment "Balanced works only for the case of a single package and uniform topology" should just read "Balanced works only for the case of a single package" because the non-uniform topology case is not only supported, but where all of the non-trivial logic actually is.

Thanks again,
Hal

Thanks for pointing that out Hal.
Here is an updated patch that changes that comment.

-- Johnny

balanced_affinity.patch (8.72 KB)