diff --git a/CrocoDash/case.py b/CrocoDash/case.py index a92c551d..f30e00ff 100644 --- a/CrocoDash/case.py +++ b/CrocoDash/case.py @@ -4,6 +4,7 @@ from datetime import datetime import json import importlib.util +import math import pandas as pd import regional_mom6 as rmom6 from CrocoDash.grid import Grid @@ -860,6 +861,29 @@ def _configure_custom_runoff_grid(self, rof_grid_name): "skip" # to be generated later in process_forcings ) + def _compute_pecount(self): + """Compute the CIME pecount tier based on active ocean points and compset. + + Uses target pts/core ratios derived from tx2_3v3 benchmarks: + - without MARBL: ~170 pts/core + - with MARBL: ~60 pts/core + + MOM6 is allocated full Derecho nodes (128 cores each). The tier string + maps nodes_needed to CIME --pecount keyword. + """ + TASKS_PER_NODE = 128 + pts_per_core = 60 if self.bgc_in_compset else 170 + ocean_pts = int(self.ocn_topo.tmask.sum()) + nodes_needed = math.ceil(ocean_pts / (pts_per_core * TASKS_PER_NODE)) + if nodes_needed < 1: + return "XS" + elif nodes_needed == 1: + return "S" + elif nodes_needed <= 3: + return "M" + else: + return "L" + def _configure_launch(self): """Assign the launch variables for the case.""" @@ -871,6 +895,7 @@ def _configure_launch(self): # Variables that are not included in a stage: cvars["NINST"].value = self.ninst + cvars["PECOUNT"].value = self._compute_pecount() def _apply_final_xmlchanges( self, ntasks_ocn=None, job_queue=None, job_wallclock_time=None diff --git a/CrocoDash/rm6 b/CrocoDash/rm6 index 78f768d1..d8197ce0 160000 --- a/CrocoDash/rm6 +++ b/CrocoDash/rm6 @@ -1 +1 @@ -Subproject commit 78f768d1626451d595469124a86c607dc0dcf3b7 +Subproject commit d8197ce0bad05d8ea08d6e7d4a7453ccb8551945 diff --git a/CrocoDash/visualCaseGen b/CrocoDash/visualCaseGen index cd2103ca..185ad30e 160000 --- a/CrocoDash/visualCaseGen +++ b/CrocoDash/visualCaseGen @@ -1 +1 @@ -Subproject commit cd2103cad15b9506fb9c30eb3ab647512808688c +Subproject commit 185ad30e05dde50bc48ce1f2cf4f58fb8d096847 diff --git a/demos b/demos index 7709a4bd..2f6ce37b 160000 --- a/demos +++ b/demos @@ -1 +1 @@ -Subproject commit 7709a4bd904e686eee1e6b5ba93cdb0192ad3c1b +Subproject commit 2f6ce37b1ac1aaa04ebe6d64c2d21faef9f80348