Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for KMP_AFFINITY=disabled and KMP_TOPOLOGY_METHOD=hwloc
With these settings, the create_hwloc_map() method was being called causing an assert(). After some consideration, it was determined that disabling affinity explicitly should just disable hwloc as well. i.e., KMP_AFFINITY overrides KMP_TOPOLOGY_METHOD. This lets the user know that the Hwloc mechanism is being ignored when KMP_AFFINITY=disabled. Differential Revision: https://reviews.llvm.org/D33208 llvm-svn: 304344
- Loading branch information
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: %libomp-compile && env KMP_AFFINITY=disabled KMP_TOPOLOGY_METHOD=hwloc %libomp-run | ||
// REQUIRES: hwloc | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
// Test will assert() without fix | ||
int test_affinity_disabled_plus_hwloc() { | ||
#pragma omp parallel | ||
{} | ||
return 1; | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
int i, j; | ||
int failed = 0; | ||
|
||
if (!test_affinity_disabled_plus_hwloc()) { | ||
failed = 1; | ||
} | ||
return failed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters