Skip to content

Bugfix/gmake endian#721

Merged
JessicaMeixner-NOAA merged 4 commits into
NOAA-EMC:developfrom
ukmo-waves:bugfix/gmake_endian
May 31, 2022
Merged

Bugfix/gmake endian#721
JessicaMeixner-NOAA merged 4 commits into
NOAA-EMC:developfrom
ukmo-waves:bugfix/gmake_endian

Conversation

@ukmo-ccbunney
Copy link
Copy Markdown
Collaborator

@ukmo-ccbunney ukmo-ccbunney commented May 25, 2022

Pull Request Summary

Fixes broken gmake build after PR #680

Description

The gmake build is broken after PR #680 - the ENDIANNESS string is not being replaced by the pre-processor in constants.ftn.

This PR adds a choice of endian in the cmplr.env file. I have set this to default to "native".
I have removed instances of compiler flags that set the endianness and have set this via the new endian environment variable in cmplr.env instead.

No changes are expected in the output files or regression tests.

Issue(s) addressed

Commit Message

Added choice of endian for binaray I/O when building with gmake

Check list

Testing

  • How were these changes tested? Regtests
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?) No
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)? Cray HPC; GNU Fortran

Regtest results

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_02/./work_PR2_UNO_MPI_c                     (53 files differ)
mww3_test_02/./work_PR2_UNO_MPI_d                     (3 files differ)
mww3_test_02/./work_PR2_UNO_MPI_b                     (53 files differ)
mww3_test_03/./work_PR2_UQ_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (9 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (8 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR1_MPI_e                     (1 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (11 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (10 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (10 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e_c                     (1 files differ)

mww3_test_02 differences are due to PR #716 - my baseline regression tests were taken from commit feb333d where the gmake build was last working.

@ukmo-ccbunney ukmo-ccbunney requested a review from aliabdolali May 25, 2022 16:01
@ukmo-ccbunney ukmo-ccbunney self-assigned this May 25, 2022
@ukmo-ccbunney ukmo-ccbunney added the bug Something isn't working label May 25, 2022
@aliabdolali
Copy link
Copy Markdown
Contributor

@ukmo-ccbunney
I ran the tests with run_tests instead of run_cmake_test.
There are two types of failures. I have a fix for 1.

  1. Could you do the following changes in regtests/bin/run_test
1262,1269c1262
< 
<         if [ $nml_input ] && [ ! -z "`ls ${path_i}/${prog}*.nml 2>/dev/null`" ]
<           then
<           inputs_tmp=`( ls ${path_i}/${prog}${gu}*nml)`
<          else
<           inputs_tmp=`( ls ${path_i}/${prog}${gu}*inp)`
<         fi
< 
---
>         inputs_tmp=`( ls ${path_i}/${prog}${gu}* )`
  1. for ww3_tp2.14, we need to change the arguments in matrix.base to avoid the following:
 Create required model subdirectories

Finished setting up WAVEWATCH III

need four arguments:
$1 : path_i
$2 : path_w
$3 : switch
$4 : ww3_dir

ERROR: Error occured during WW3  build

to reproduce:
run_test -b slurm -o all -c hera.intel -S -T -s OASACM4 -i input_oasacm4 -w work_OASACM4 -C OASIS -f -p srun -n 24 ../model11 ww3_tp2.14

Could you check it?

@ukmo-ccbunney
Copy link
Copy Markdown
Collaborator Author

@aliabdolali - The issue with tp2.14 is that prep_env.sh now calls CMake regardless.
I think the only way around this is to have a separate prep_env_gmake.sh (or similar) script that provides the old functionality.

@aliabdolali
Copy link
Copy Markdown
Contributor

@aliabdolali - The issue with tp2.14 is that prep_env.sh now calls CMake regardless. I think the only way around this is to have a separate prep_env_gmake.sh (or similar) script that provides the old functionality.

@ukmo-ccbunney I think we can skip it as gnu build is not used for our regtesting and gnu build will be retired soon.

@ukmo-ccbunney
Copy link
Copy Markdown
Collaborator Author

@aliabdolali - The issue with tp2.14 is that prep_env.sh now calls CMake regardless. I think the only way around this is to have a separate prep_env_gmake.sh (or similar) script that provides the old functionality.

@ukmo-ccbunney I think we can skip it as gnu build is not used for our regtesting and gnu build will be retired soon.

OK - I've pushed up the fix for run_test.

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator

Regression test comparisons with cmake:
matrixDiff.txt
matrixCompFull.txt
matrixCompSummary.txt

are as expected:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR2_UNO_MPI_d2                     (9 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (15 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (15 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (15 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (15 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (15 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (15 files differ)
ww3_ta1/./work_UPD0F_U                     (0 files differ)
ww3_tp2.10/./work_MPI_OMPH                     (7 files differ)
ww3_tp2.16/./work_MPI_OMPH                     (4 files differ)
ww3_tp2.17/./work_a                     (1 files differ)
ww3_tp2.17/./work_c                     (1 files differ)
ww3_tp2.17/./work_b                     (1 files differ)
ww3_tp2.6/./work_ST0                     (1 files differ)
ww3_tp2.6/./work_ST4                     (1 files differ)
ww3_tp2.6/./work_pdlib                     (1 files differ)
ww3_ufs1.3/./work_a                     (1 files differ)

The gnu make regression tests passed with the exception of the known issue of tp2.14

@JessicaMeixner-NOAA JessicaMeixner-NOAA merged commit b057440 into NOAA-EMC:develop May 31, 2022
@ukmo-ccbunney ukmo-ccbunney deleted the bugfix/gmake_endian branch April 28, 2023 13:45
kestonsmith-noaa pushed a commit to kestonsmith-noaa/WW3 that referenced this pull request Jun 17, 2025
* Update InputsOutputs.rst, Codeoverview
* Stampede update (NOAA-EMC#15)
* Fix build env setup in Chapter 3 (NOAA-EMC#16)
* cleanup and reorg of 2.2 Directory Structure

Co-authored-by: BinLi-NOAA <bin.li@noaa.gov>
Co-authored-by: jiandewang <jiande.wang@noaa.gov>
Co-authored-by: Ali.Abdolali <37336972+aliabdolali@users.noreply.github.com>
Co-authored-by: Ali Abdolali <ali.abdolali@noaa.gov>
Co-authored-by: Jun Wang <junwang-noaa@users.noreply.github.com>
Co-authored-by: Minsuk Ji <57227195+MinsukJi-NOAA@users.noreply.github.com>
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 this pull request may close these issues.

GMAKE build failing after #680

3 participants