Skip to content

Commit

Permalink
getting the greater checks the right way around
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-seaice committed Aug 29, 2024
1 parent ef3b5d1 commit 7e29e07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions payu/models/cesm_cmeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def setup(self):
rootpe = int(self.runconfig.get("PELAYOUT_attributes", f"{realm}_rootpe"))
pestride = int(self.runconfig.get("PELAYOUT_attributes", f"{realm}_pestride"))
#rootpe is zero-based
if cpucount >= (rootpe + ntasks*pestride):
if cpucount <= (rootpe + ntasks*pestride):
raise ValueError(
f"Insufficient cpus for the {realm} pelayout in nuopc.runconfig"
)
Expand All @@ -182,14 +182,14 @@ def setup(self):
else:
# if nc_type is netcdf, only one pe is needed
ioroot=int(self.runconfig.get(io_section, "pio_root"))
if cpucount > int(ioroot):
if cpucount <= int(ioroot):
raise ValueError(
f"Insufficient cpus for the {io_section} ioroot pe in nuopc.runconfig"
)
if nc_type == "netcdf4p":
niotasks=int(self.runconfig.get(io_section, "pio_numiotasks"))
iostride=int(self.runconfig.get(io_section, "pio_stride"))
if cpucount >= (ioroot + niotasks*iostride):
if cpucount <= (ioroot + niotasks*iostride):
raise ValueError(
f"The iolayout for {io_section} in nuopc.runconfig is requesting out of range cpus"
)
Expand Down

0 comments on commit 7e29e07

Please sign in to comment.