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

Move compiled WW3 code to the case build directory #6601

Closed
wants to merge 2 commits into from

Conversation

erinethomas
Copy link
Contributor

WW3 code currently compiles in the source code repo. This is severely problematic and creates several issues including:
a) cluttering the source code directory
b) creating problematic 'race-conditions' when more than one case with WW3 need to be compiled (such as running test suites)

This PR simply copies the required directories from the WW3 source code repo (the aux, ftn, and bin directories) to the "build/wav" directory and compiles all WW3 code there.
The compiled .F90 and executable tar files are now located here: "/build/wav/tmp/"

The E3SM commands ./case.build and ./case.build --clean-all correctly compile and clean all WW3 code.

@erinethomas erinethomas added Wave BFB PR leaves answers BFB labels Sep 10, 2024
Copy link
Member

@jgfouca jgfouca 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. Was that warning about ww3 needing a lot of infrastructure updates wrong?

@@ -43,14 +43,23 @@ def buildlib(bldroot, installpath, case):
# Define WW3 repository directories
repodir = "{}/components/ww3/src".format(srcroot)
modeldir = "{}/WW3/model".format(repodir)
builddir = "{}/wav".format(exeroot)
Copy link
Member

Choose a reason for hiding this comment

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

Is this the CIME EXEROOT?

Copy link
Contributor Author

@erinethomas erinethomas Sep 10, 2024

Choose a reason for hiding this comment

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

exeroot here refers to the build directory .. i.e. in env_build.xml: entry id="EXEROOT" value="/lcrc/group/e3sm/ac.ethomas/E3SMv3/Build_ww3_test.G.v3.PiControl/build"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rljacob to clarify: this PR would then place the compiled wave code in the "..../build/wav" directory.... if this is an inappropriate place to put the compiled WW3 code - suggestions for a better place are very welcome.

Copy link
Member

Choose a reason for hiding this comment

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

Thats a good place!

@erinethomas
Copy link
Contributor Author

erinethomas commented Sep 10, 2024

@jgfouca - I'm not sure it was wrong exactly - but this PR provides an easy work around by copying the parts of ww3 needed to compile the code and then changing the way WW3 finds the new code... If we wanted to avoid copying the aux, bin, and ftn directories to the build directory I think we WOULD need to do a significant overhaul of the built-in WW3 code/scripting infrastructure ...

Copy link
Contributor

@sbrus89 sbrus89 left a comment

Choose a reason for hiding this comment

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

Thanks for these changes, @erinethomas. I think this is a good strategy for handling builds with the older version of WW3 we're using.

I just had a couple really minor suggestions:

  1. I think "{}/bin".format(builddir) is more straightforward than "{}/wav/bin".format(exeroot)
  2. Something like shutil.copytree(bindir_from, bindir_to) or shutil.copytree(bindir_source, bindir_dest) may be a little more intuitive than shutil.copytree(bindir1, bindir).

Obviously, these are just cosmetic, so feel free to decide whether you want to adopt them or not.

components/ww3/cime_config/buildlib_cmake Outdated Show resolved Hide resolved
components/ww3/cime_config/buildlib_cmake Outdated Show resolved Hide resolved
components/ww3/cime_config/buildlib_cmake Outdated Show resolved Hide resolved
components/ww3/cime_config/buildlib_cmake Outdated Show resolved Hide resolved
@erinethomas
Copy link
Contributor Author

@sbrus89 Good suggestions - changes made to improve clarity.

Copy link
Contributor

@sbrus89 sbrus89 left a comment

Choose a reason for hiding this comment

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

@erinethomas, I merged to next locally on Chrysalis and tested with e3sm_wav_developer defined as:

    "e3sm_wav_developer" : {
        "time"    : "0:45:00",
        "tests"   : (  
            "ERS.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958",
            "PEM.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958",
            "SMS_D_Ln3.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958",
            )    
    },   

Those tests all PASS when running ./create_test in parallel.

@erinethomas
Copy link
Contributor Author

closing to rename branch according to standards.

@erinethomas erinethomas closed this Oct 3, 2024
@erinethomas erinethomas deleted the WW3_build branch October 3, 2024 16:52
@rljacob
Copy link
Member

rljacob commented Oct 3, 2024

Moved to #6663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB Wave
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants