Skip to content

Commit 9bf2146

Browse files
committed
hotfix: check if cache paths are provided before launching exo rasterization on head node.
1 parent 1eaa905 commit 9bf2146

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

sup3r/pipeline/strategy.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,17 @@ def __post_init__(self):
266266
'cached on the head_node. This can take a long time and might be '
267267
'worth doing as an independent preprocessing step instead.'
268268
)
269-
if self.head_node and not all(
270-
(fp is None or os.path.exists(fp))
271-
for fp in self.get_exo_cache_files(model)
272-
):
269+
cache_check = any(
270+
'cache_dir' in v for v in self.exo_handler_kwargs.values()
271+
)
272+
if self.head_node and cache_check:
273273
logger.warning(msg)
274274
warn(msg)
275275
_ = self.timer(self.load_exo_data, log=True)(model)
276276

277277
if not self.head_node:
278+
# This will either load cache files created on the head node or
279+
# directly load the exogenous data if no cache is being used.
278280
hr_shape = self.hr_lat_lon.shape[:-1]
279281
self.gids = np.arange(np.prod(hr_shape)).reshape(hr_shape)
280282
self.exo_data = self.timer(self.load_exo_data, log=True)(model)

0 commit comments

Comments
 (0)