Skip to content

Commit

Permalink
Set device_query_path for tests and benchmarks on TU cluster
Browse files Browse the repository at this point in the history
Replace this with a brian preference file once brian-team/brian2#1340 is
solved
  • Loading branch information
denisalevi committed Aug 31, 2021
1 parent aee4b08 commit 8b8d3bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion brian2cuda/tests/features/cuda_configuration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import shutil
import sys
import socket
import subprocess
import shlex
Expand Down Expand Up @@ -29,6 +28,13 @@ class CUDAStandaloneConfigurationBase(Configuration):

def before_run(self):
# set brian preferences
slurm_cluster = os.environ.get("SLURM_CLUSTER_NAME", default=None)
if slurm_cluster == "hpc":
device_query_path = "~/cuda-samples/bin/x86_64/linux/release/deviceQuery"
brian2.prefs.devices.cuda_standalone.cuda_backend.device_query_path = (
device_query_path
)

for key, value in self.extra_prefs.items():
brian2.prefs[key] = value
if self.name is None:
Expand Down
9 changes: 9 additions & 0 deletions brian2cuda/tools/test_suite/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Utility funcitons"""
import traceback
import time
import os
import numpy as np
from itertools import chain, combinations

Expand Down Expand Up @@ -132,6 +133,14 @@ def set_preferences(args, prefs, fast_compilation=True, suppress_warnings=True,
prefs['devices.cuda_standalone.cuda_backend.extra_compile_args_nvcc'].extend(compile_args)
prints.append("Suppressing compiler warnings")

slurm_cluster = os.environ.get("SLURM_CLUSTER_NAME", default=None)
if slurm_cluster == "hpc":
device_query_path = "~/cuda-samples/bin/x86_64/linux/release/deviceQuery"
prefs.devices.cuda_standalone.cuda_backend.device_query_path = (
device_query_path
)
prints.append(f"Setting `device_query_path = {device_query_path}")

if args.jobs is not None:
k = 'devices.cpp_standalone.extra_make_args_unix'
if '-j' not in prefs[k]:
Expand Down

0 comments on commit 8b8d3bb

Please sign in to comment.