Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link_workfow.sh generates unbound variable error on Hera #1090

Closed
RussTreadon-NOAA opened this issue Oct 24, 2022 · 0 comments · Fixed by #1092
Closed

link_workfow.sh generates unbound variable error on Hera #1090

RussTreadon-NOAA opened this issue Oct 24, 2022 · 0 comments · Fixed by #1092
Labels
bug Something isn't working

Comments

@RussTreadon-NOAA
Copy link
Contributor

Expected behavior
./link_workf.sh should execute without error.

Current behavior
./link_workflow.sh returns the following error message on Hera

[Russ.Treadon@hfe01 sorc]$ ./link_workflow.sh
gfs_utils.fd/ush/detect_machine.sh: line 44: COMPILER: unbound variable
[Russ.Treadon@hfe01 sorc]$

Machines affected
Error discovered on Hera. Based on logic in detect_machine.sh the error will probably occur on Cheyenne.

To Reproduce

  1. git clone https://github.com/NOAA-EMC/global-workflow.git .
  2. cd sorc
  3. ./checkout.sh -g
  4. ./build_all.sh
  5. ./link_workfow.sh

Execution of link_workflow.sh returns the unbound variable message shown above.

Additional Information
Line 44 of gfs_utils.fd/ush/detect_machine.sh is the COMPILER line shown below

# Append compiler (only on machines that have multiple compilers)
if [ $MACHINE_ID = hera ] || [ $MACHINE_ID = cheyenne ]; then
    MACHINE_ID=${MACHINE_ID}.${COMPILER}
fi

Possible Implementation
Script sorc/build_all.sh sets COMPILER before executing detect_machine.sh as shown below

#------------------------------------
# GET MACHINE
#------------------------------------
export COMPILER="intel"
# shellcheck disable=SC1091
source gfs_utils.fd/ush/detect_machine.sh
# shellcheck disable=
if [[ -z "${MACHINE_ID}" ]]; then
  echo "FATAL: Unable to determine target machine"
  exit 1
fi

In contrast, link_workflow.sh has

# shellcheck disable=SC1091
source gfs_utils.fd/ush/detect_machine.sh  # (sets MACHINE_ID)
# shellcheck disable=
machine=$(echo "${MACHINE_ID}" | cut -d. -f1)

A possible fix is to add export COMPILER="intel" to link_workflow.sh as is done in build_all.sh.

A different solution would be to modify detect_machine.sh so that it does not reference COMPILER for Hera or Cheyenne.

@RussTreadon-NOAA RussTreadon-NOAA added the bug Something isn't working label Oct 24, 2022
WalterKolczynski-NOAA added a commit to WalterKolczynski-NOAA/global-workflow that referenced this issue Oct 24, 2022
The new detect_machine script in gfs-utils requires COMPILER be set.

Fixes NOAA-EMC#1090
WalterKolczynski-NOAA added a commit that referenced this issue Oct 24, 2022
The new detect_machine script in gfs-utils requires COMPILER be set.

Also added the gfs-utils scripts to the git ignore list.

Fixes #1090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant