Skip to content

Set wrf.exe namelist values and mpirun arguments from the environment - #90

Closed
aethr wants to merge 2 commits into
om-metrics-entrypointfrom
wrf-namelist-overrides
Closed

aethr wants to merge 2 commits into
om-metrics-entrypointfrom
wrf-namelist-overrides

Conversation

@aethr

@aethr aethr commented Oct 8, 2026

Copy link
Copy Markdown

Stacked on #88, so that the image for this PR carries the [om-metrics] instrumentation as well. It's for the experiments in #89.

Changes

  • WRF_NAMELIST_OVERRIDES: Fortran namelist text, applied to namelist.input after real.exe has run. For example:
    &time_control history_begin_h = 12, use_netcdf_classic = .true., debug_level = 0 / &namelist_quilt nio_tasks_per_group = 1 /
    
    It's applied after real.exe so the values reach wrf.exe only. real.exe reads the same file on a single rank and can't set aside I/O servers.
  • Quilting: I/O servers come out of the mpirun total, so the default rank count is now safe_mpi_tasks() over the CPUs left, plus the I/O tasks. Setting NCPUS overrides this as before, and must include the I/O tasks.
  • MPI_EXTRA_ARGS: passed to wrf.exe's mpirun, for options such as -bind-to core.

With neither variable set, the generated namelist and run.sh behave exactly as before.

Testing

  • Unit tests for apply_namelist_overrides() and quilt_tasks(). make test: 42 passed.
  • Rendered run.sh from the template and ran it against a stub mpirun. With no variables set it gives -np 64 ./wrf.exe; with MPI_EXTRA_ARGS="-bind-to core" NCPUS=32 it gives -bind-to core -np 32 ./wrf.exe.
  • Not yet run end to end. The first wrf.exe spends over half its run writing history output; cut that before sizing ranks #89 scenario in sandbox will be the real test.

🤖 Generated with Claude Code

aethr and others added 2 commits October 9, 2026 07:59
WRF_NAMELIST_OVERRIDES takes Fortran namelist text and sets those values
on namelist.input after real.exe has run, so they reach wrf.exe only:
real.exe reads the same file on a single rank and cannot set aside the
I/O servers that quilting asks for. Those I/O servers come out of the
mpirun total, so the default rank count now leaves room for them.

MPI_EXTRA_ARGS is passed to wrf.exe's mpirun, for options such as
-bind-to core.

Both serve the output and rank experiments in #89.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aethr

aethr commented Oct 9, 2026

Copy link
Copy Markdown
Author

Closing, as the perf testing this was made for is concluded. Results are in #89 .

@aethr aethr closed this Oct 9, 2026
@aethr
aethr deleted the wrf-namelist-overrides branch October 12, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant