Skip to content

Commit

Permalink
Disable SVML AVX-512 routines in the pyna update script (#1444)
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 authored Jan 5, 2024
1 parent fbeddb3 commit fc72214
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions networks/update_pynucastro_nets.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/usr/bin/env python3
"""Update all the pynucastro networks in the current directory."""

import os
import subprocess
import sys
from pathlib import Path

# Disable slightly-less-precise AVX-512 SVML routines to avoid roundoff diffs
# when different machines regenerate the networks. Accuracy is important here,
# and these calculations aren't a bottleneck. See pynucastro/conftest.py for
# more details.
env = os.environ.copy()
env["NPY_DISABLE_CPU_FEATURES"] = "AVX512F AVX512CD AVX512_SKX"

cwd = Path.cwd()
for net_file in sorted(cwd.glob("**/pynucastro.net")):
network_dir = net_file.parent
Expand All @@ -23,6 +31,7 @@
result = subprocess.run(
[sys.executable, update_script],
cwd=network_dir,
env=env,
capture_output=False,
check=False,
)
Expand Down

0 comments on commit fc72214

Please sign in to comment.