Skip to content

Commit

Permalink
regtesting: Fix visible_gpu_devices
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Jul 5, 2021
1 parent 14a0b91 commit 2ff7a53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/regtesting/do_regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ def launch_exe(
) -> Coroutine[Any, Any, Process]:
env = os.environ.copy()
if self.num_gpus > self.mpiranks:
visible_gpu_devices = []
visible_gpu_devices: List[str] = []
for _ in range(self.mpiranks): # Utilize all available GPU devices.
self.next_gpu = (self.next_gpu + 1) % self.num_gpus
visible_gpu_devices.append(f"{self.next_gpu}")
env["CUDA_VISIBLE_DEVICES"] = ",".join(visible_gpu_devices)
env["HIP_VISIBLE_DEVICES"] = ",".join(visible_gpu_devices)
visible_gpu_devices.append(str(self.next_gpu))
env["CUDA_VISIBLE_DEVICES"] = ",".join(visible_gpu_devices)
env["HIP_VISIBLE_DEVICES"] = ",".join(visible_gpu_devices)
env["OMP_NUM_THREADS"] = str(self.ompthreads)
exe = self.cp2k_root / "exe" / self.arch / f"{exe_stem}.{self.version}"
cmd = ["mpiexec", f"-np={self.mpiranks}", exe] if self.use_mpi else [exe]
Expand Down

0 comments on commit 2ff7a53

Please sign in to comment.