Skip to content

porting GDASApp to native AWS#2127

Open
weihuang-jedi wants to merge 12 commits intoNOAA-EMC:developfrom
NOAA-EPIC:feature/on-aws-ec2
Open

porting GDASApp to native AWS#2127
weihuang-jedi wants to merge 12 commits intoNOAA-EMC:developfrom
NOAA-EPIC:feature/on-aws-ec2

Conversation

@weihuang-jedi
Copy link
Copy Markdown
Collaborator

Description

In order for more general users to use GDASApp, we want to make GDASApp being able to compile on native AWS (as a new computing platform, or machine). This is a part of making Global-Workflow porting to native AWS.

Companion PRs

None

Issues

Resolves #2126

Automated CI tests to run in Global Workflow

  • [x ] C96C48_ufs_hybatmDA
  • [x ] C96C48_hybatmsnowDA
  • [ x] C96_gcafs_cycled
  • [x ] C48mx500_3DVarAOWCDA
  • [x ] C48mx500_hybAOWCDA
  • [x ] C96C48_ufsgsi_hybatmDA
  • [ x] C48_ufsenkf_atmDA
  • [x ] C96C48_hybatmDA

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds initial platform detection and module environment support so GDASApp can be built on native AWS EC2 (as aws-ec2), aligning with the broader Global-Workflow porting effort.

Changes:

  • Added aws-ec2 machine detection via hostname/path heuristics.
  • Extended module initialization to support Lmod on AWS EC2.
  • Introduced a new GDAS/aws-ec2.intel modulefile and enabled aws-ec2 as a supported build.sh target.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
ush/module-setup.sh Adds an aws-ec2 branch to initialize Lmod and purge modules.
ush/detect_machine.sh Detects AWS EC2 hosts and sets MACHINE_ID=aws-ec2.
modulefiles/GDAS/aws-ec2.intel.lua New modulefile to load the AWS EC2 Intel/oneAPI environment and set runtime/build env vars.
build.sh Allows aws-ec2 as a build target and adjusts CRTM dummy directory logic for this platform.

setenv('MPIEXEC_EXEC', mpiexec)
setenv('MPIEXEC_NPROC', mpinproc)

setenv("CRTM_FIX", "/lustre/sharedGWdata/fix/crtm/v2.4.0.2")
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The AWS modulefile does not set GDASAPP_TESTDATA / GDASAPP_UNIT_TEST_DATA_PATH (and only sets CRTM_FIX). Many existing workflow/test scripts in this repo rely on GDASAPP_TESTDATA being defined by the loaded GDAS module, consistent with other platform modulefiles, so this will break those scripts on aws-ec2. Please add the missing env vars (and any other required shared-data paths) for AWS, mirroring the other modulefiles/GDAS/*.intel.lua files.

Suggested change
setenv("CRTM_FIX", "/lustre/sharedGWdata/fix/crtm/v2.4.0.2")
local shared_gwdata = "/lustre/sharedGWdata"
local gdasapp_testdata = pathJoin(shared_gwdata, "tests/gdasapp")
setenv("GDASAPP_TESTDATA", gdasapp_testdata)
setenv("GDASAPP_UNIT_TEST_DATA_PATH", gdasapp_testdata)
setenv("CRTM_FIX", pathJoin(shared_gwdata, "fix/crtm/v2.4.0.2"))

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +22
load("stack-oneapi/2024.2.1")
load("stack-intel-oneapi-mpi/2021.13")
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

This modulefile loads stack-oneapi and stack-intel-oneapi-mpi twice: first using stack_oneapi_ver/stack_impi_ver, then immediately again with hard-coded versions. This can override user-provided version overrides and makes the effective environment unclear. Please keep only one mechanism (either env-var-driven pathJoin loads or the fixed load("stack-oneapi/...") lines).

Suggested change
load("stack-oneapi/2024.2.1")
load("stack-intel-oneapi-mpi/2021.13")

Copilot uses AI. Check for mistakes.
Comment thread modulefiles/GDAS/aws-ec2.intel.lua Outdated
Comment on lines +87 to +92
setenv("I_MPI_CC","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icx")
setenv("I_MPI_CXX","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icpx")

setenv("FC","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/ifort")
setenv("CC","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icx")
setenv("CXX","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icpx")
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The compiler variables (FC/CC/CXX and I_MPI_*) are set to full Spack install paths that include a concrete hash. This is very brittle (any rebuild/relocation of the stack will break the modulefile) and differs from other platform modulefiles that use wrapper compilers like mpiicc/mpiifort or generic cc/ftn. Consider setting compilers to the MPI wrapper commands provided by the loaded modules (or deriving paths from stable env vars) instead of hard-coding hashed install paths.

Suggested change
setenv("I_MPI_CC","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icx")
setenv("I_MPI_CXX","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icpx")
setenv("FC","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/ifort")
setenv("CC","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icx")
setenv("CXX","/opt/spack-stack/spack/opt/spack/linux-ubuntu22.04-sapphirerapids/gcc-11.4.0/intel-oneapi-compilers-2024.2.1-j3owv3rsoh7igqvwmvp7ez6i3ozeayvs/compiler/latest/bin/icpx")
setenv("I_MPI_CC","mpiicc")
setenv("I_MPI_CXX","mpiicpc")
setenv("FC","mpiifort")
setenv("CC","mpiicc")
setenv("CXX","mpiicpc")

Copilot uses AI. Check for mistakes.
WalterKolczynski-NOAA and others added 5 commits May 5, 2026 06:45
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.

porting GDASApp to native AWS

4 participants