Skip to content

fix: Use foreach/doSNOW for restart write.ensemble.configs to restore logger output#4018

Open
S1DDHEY wants to merge 2 commits into
PecanProject:developfrom
S1DDHEY:fix/3581-restart-write-configs-foreach
Open

fix: Use foreach/doSNOW for restart write.ensemble.configs to restore logger output#4018
S1DDHEY wants to merge 2 commits into
PecanProject:developfrom
S1DDHEY:fix/3581-restart-write-configs-foreach

Conversation

@S1DDHEY
Copy link
Copy Markdown
Contributor

@S1DDHEY S1DDHEY commented May 31, 2026

Description

Fixes #3581
Replaces the restart-path parallel dispatch for write.ensemble.configs() in sda.enkf_MultiSite.R from furrr::future_map2() to foreach + doSNOW, matching the existing non-restart code path.

This fixes missing/delayed PEcAn.logger output

Testing

  • Ran module test successfully (0 Failed)
  • Verified worker-side logging from write.ensemble.configs() is emitted by reproducing the “multi-path input with no <samplingspace>” error under foreach/doSNOW (captured via PEcAn.logger::logger.setOutputFile() from the worker).

@mdietze mdietze requested a review from DongchenZ June 1, 2026 13:28
Copy link
Copy Markdown
Contributor

@DongchenZ DongchenZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@mdietze mdietze enabled auto-merge June 1, 2026 16:46
Copy link
Copy Markdown
Member

@infotroph infotroph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to jump in after approval, but this looks to me like it will make sda.enkf.multisite stop respecting the run_parallel flag and instead use n-1 cores no matter what the user requests. @DongchenZ am I missing another place the parallel setting gets passed around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The message will not be printed if we run the write.config function inside the future_map.

3 participants