mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
openmpCheckPhaseHook: init
This commit is contained in:
parent
096dc2d2a2
commit
8ff970916b
2 changed files with 23 additions and 0 deletions
11
pkgs/by-name/op/openmpCheckPhaseHook/omp-check-hook.sh
Normal file
11
pkgs/by-name/op/openmpCheckPhaseHook/omp-check-hook.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
preCheckHooks+=('setupOmpCheck')
|
||||
preInstallCheckHooks+=('setupOmpCheck')
|
||||
|
||||
|
||||
setupOmpCheck() {
|
||||
# Limit number of OpenMP threads. Default is "all cores".
|
||||
# Using all cores causes high load on builders if checks are executed with NIX_BUILD_CORE parallelism.
|
||||
# This gets even worse if multiple builds are scheduled on the same machine, potentially growing O(n^3) without explicit core limits.
|
||||
export OMP_NUM_THREADS="${OMP_NUM_THREADS:-1}"
|
||||
}
|
||||
|
||||
12
pkgs/by-name/op/openmpCheckPhaseHook/package.nix
Normal file
12
pkgs/by-name/op/openmpCheckPhaseHook/package.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
makeSetupHook,
|
||||
}:
|
||||
|
||||
makeSetupHook {
|
||||
name = "omp-checkPhase-hook";
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
meta.license = lib.licenses.mit;
|
||||
} ./omp-check-hook.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue