diff --git a/CIME/case/case_setup.py b/CIME/case/case_setup.py index c6a35779832..6ca33d6cabc 100644 --- a/CIME/case/case_setup.py +++ b/CIME/case/case_setup.py @@ -392,7 +392,7 @@ def _case_setup_impl( # ---------------------------------------------------------------------------------------------------------- # Sanity check for a GPU run: # 1. GPU_TYPE and GPU_OFFLOAD must both be defined to use GPUs - # 2. If the NGPUS_PER_NODE XML variable in the env_mach_pes.xml file is larger than + # 2. If the NGPUS_PER_NODE XML variable in the env_mach_pes.xml file is larger than # the value of MAX_GPUS_PER_NODE, set it to MAX_GPUS_PER_NODE automatically. # 3. If the NGPUS_PER_NODE XML variable is equal to 0, it will be updated to 1 automatically. # ---------------------------------------------------------------------------------------------------------- @@ -401,13 +401,19 @@ def _case_setup_impl( openacc_gpu_offload = case.get_value("OPENACC_GPU_OFFLOAD") openmp_gpu_offload = case.get_value("OPENMP_GPU_OFFLOAD") kokkos_gpu_offload = case.get_value("KOKKOS_GPU_OFFLOAD") - gpu_offload = (openacc_gpu_offload or openmp_gpu_offload or kokkos_gpu_offload) + gpu_offload = ( + openacc_gpu_offload or openmp_gpu_offload or kokkos_gpu_offload + ) ngpus_per_node = case.get_value("NGPUS_PER_NODE") if gpu_type and str(gpu_type).lower() != "none": if max_gpus_per_node <= 0: - raise RuntimeError(f"MAX_GPUS_PER_NODE must be larger than 0 for machine={mach} and compiler={compiler} in order to configure a GPU run") + raise RuntimeError( + f"MAX_GPUS_PER_NODE must be larger than 0 for machine={mach} and compiler={compiler} in order to configure a GPU run" + ) if not gpu_offload: - raise RuntimeError("GPU_TYPE is defined but none of the GPU OFFLOAD options are enabled") + raise RuntimeError( + "GPU_TYPE is defined but none of the GPU OFFLOAD options are enabled" + ) case.gpu_enabled = True if ngpus_per_node >= 0: case.set_value( @@ -417,9 +423,13 @@ def _case_setup_impl( else max_gpus_per_node, ) elif gpu_offload: - raise RuntimeError("GPU_TYPE is not defined but at least one GPU OFFLOAD option is enabled") + raise RuntimeError( + "GPU_TYPE is not defined but at least one GPU OFFLOAD option is enabled" + ) elif ngpus_per_node and ngpus_per_node != 0: - raise RuntimeError(f"ngpus_per_node is expected to be 0 for a pure CPU run ; {ngpus_per_node} is provided instead ;") + raise RuntimeError( + f"ngpus_per_node is expected to be 0 for a pure CPU run ; {ngpus_per_node} is provided instead ;" + ) # May need to select new batch settings if pelayout changed (e.g. problem is now too big for prev-selected queue) env_batch = case.get_env("batch") @@ -559,7 +569,6 @@ def case_setup(self, clean=False, test_mode=False, reset=False, keep=None): def _create_case_repo(self, caseroot): - self._gitinterface = GitInterface(caseroot, logger, branch=self.get_value("CASE")) if self._gitinterface and not os.path.exists(os.path.join(caseroot, ".gitignore")): safe_copy(