-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from GEOS-ESM/feature/mathomp4/update-ctm-to-p…
…resent Updates for CTM to Bring in-line with GCM v10.19.0
- Loading branch information
Showing
42 changed files
with
1,776 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,63 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
version: 2.1 | ||
|
||
executors: | ||
gcc-build-env: | ||
docker: | ||
- image: gmao/geos-build-env-gcc-source:6.0.4 | ||
- image: gmao/ubuntu20-geos-env-mkl:v6.1.0-openmpi_4.0.5-gcc_10.2.0 | ||
auth: | ||
username: $DOCKERHUB_USER | ||
password: $DOCKERHUB_AUTH_TOKEN | ||
environment: | ||
OMPI_ALLOW_RUN_AS_ROOT: 1 | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | ||
OMPI_MCA_btl_vader_single_copy_mechanism: none | ||
resource_class: large | ||
#MEDIUM# resource_class: medium | ||
|
||
workflows: | ||
version: 2.1 | ||
build-test: | ||
jobs: | ||
- build-GEOSctm: | ||
context: | ||
- docker-hub-creds | ||
|
||
jobs: | ||
build-GEOSctm: | ||
executor: gcc-build-env | ||
working_directory: /root/project | ||
steps: | ||
- checkout | ||
- checkout: | ||
path: GEOSctm | ||
- run: | ||
name: "Versions etc" | ||
command: mpirun --version && gfortran --version && echo $BASEDIR && pwd && ls | ||
- run: | ||
name: "Mepo clone external repos" | ||
command: | | ||
mepo init | ||
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSctm | ||
mepo clone | ||
mepo status | ||
- run: | ||
name: "Mepo checkout-if-exists" | ||
command: | | ||
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSctm | ||
echo "${CIRCLE_BRANCH}" | ||
if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "master" ] && [ "${CIRCLE_BRANCH}" != "main" ] | ||
then | ||
mepo checkout-if-exists ${CIRCLE_BRANCH} | ||
fi | ||
mepo status | ||
- run: | ||
name: "CMake" | ||
command: | | ||
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSctm | ||
mkdir build | ||
cd build | ||
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug | ||
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF | ||
- run: | ||
name: "Build" | ||
command: | | ||
cd build | ||
make -j2 install | ||
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSctm/build | ||
make -j"$(nproc)" install | ||
#MEDIUM# make -j4 install |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Build Tests | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
# Do not run if the only files changed cannot affect the build | ||
paths-ignore: | ||
- "**.md" | ||
- "parallel_build.csh" | ||
- ".github/CODEOWNERS" | ||
- ".codebuild/**" | ||
- ".circleci/**" | ||
|
||
jobs: | ||
build_ctm: | ||
name: Build GEOSctm | ||
if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')" | ||
runs-on: ubuntu-latest | ||
container: | ||
image: gmao/ubuntu20-geos-env-mkl:v6.1.0-openmpi_4.0.5-gcc_10.2.0 | ||
credentials: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
env: | ||
OMPI_ALLOW_RUN_AS_ROOT: 1 | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | ||
OMPI_MCA_btl_vader_single_copy_mechanism: none | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Checkout CTM | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Versions etc. | ||
run: | | ||
gfortran --version | ||
mpirun --version | ||
echo $BASEDIR | ||
- name: Mepo clone external repos | ||
run: | | ||
mepo clone | ||
mepo status | ||
mepo status | ||
- name: Update other branches | ||
if: | ||
"!contains('refs/heads/main,refs/heads/develop', github.ref)" | ||
run: | | ||
mepo checkout-if-exists ${GITHUB_HEAD_REF} | ||
mepo status | ||
- name: CMake | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DMPIEXEC_PREFLAGS='--oversubscribe' -DUSE_F2PY=OFF | ||
- name: Build | ||
run: | | ||
cd build | ||
make -j4 install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
*~ | ||
/@cmake/ | ||
/@modules/ | ||
/cmake/ | ||
/cmake@/ | ||
/@env/ | ||
/BUILD/ | ||
/build*/ | ||
/install*/ | ||
parallel_build.o* | ||
/env/ | ||
/env@/ | ||
/.mepo/ | ||
parallel_build.o* | ||
log.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,9 @@ | |
|
||
In your `.bashrc` or `.tcshrc` or other rc file add a line: | ||
|
||
##### NCCS (SLES11) | ||
|
||
##### NCCS | ||
``` | ||
module use -a /discover/swdev/gmao_SIteam/modulefiles-SLES11 | ||
module use -a /discover/swdev/gmao_SIteam/modulefiles-SLES12 | ||
``` | ||
|
||
##### NAS | ||
|
@@ -33,19 +32,74 @@ Now load the `GEOSenv` module: | |
``` | ||
module load GEOSenv | ||
``` | ||
which obtains the latest `git`, `CMake`, and `manage_externals` modules. | ||
which obtains the latest `git`, `CMake`, and `mepo` modules. | ||
|
||
#### Obtain the Model | ||
|
||
On GitHub, there are three ways to clone the model: SSH, HTTPS, or GitHub CLI. | ||
The first two are "git protocols" which determine how `git` communicates with | ||
GitHub: either through https or ssh. (The latter is a CLI that uses either ssh or | ||
https protocol underneath.) | ||
|
||
For developers of GEOS, the SSH git protocol is recommended as it can avoid some issues if | ||
[two-factor authentication | ||
(2FA)](https://docs.github.com/en/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa) | ||
is enabled on GitHub. | ||
|
||
##### SSH | ||
|
||
To clone the GEOSctm using the SSH url (starts with `[email protected]`), you run: | ||
``` | ||
git clone [email protected]:GEOS-ESM/GEOSctm.git | ||
``` | ||
|
||
###### Permission denied (publickey) | ||
|
||
If this is your first time using GitHub with any SSH URL, you might get this | ||
error: | ||
``` | ||
Permission denied (publickey). | ||
fatal: Could not read from remote repository. | ||
Please make sure you have the correct access rights | ||
and the repository exists. | ||
``` | ||
|
||
If you do see this, you need to [upload an ssh | ||
key](https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account) | ||
to your GitHub account. This needs to be done on any machine that you want to | ||
use the SSH URL through. | ||
|
||
|
||
##### HTTPS | ||
|
||
To clone the model through HTTPS you run: | ||
|
||
``` | ||
git clone https://github.com/GEOS-ESM/GEOSctm.git | ||
``` | ||
|
||
Note that if you use the HTTPS URL and have 2FA set up on GitHub, you will need | ||
to use [personal access | ||
tokens](https://docs.github.com/en/github/authenticating-to-github/accessing-github-using-two-factor-authentication#authenticating-on-the-command-line-using-https) | ||
as a password. | ||
|
||
##### GitHub CLI | ||
|
||
You can also use the [GitHub CLI](https://cli.github.com/) with: | ||
``` | ||
gh repo clone GEOS-ESM/GEOSctm | ||
``` | ||
|
||
Note that when you first use `gh`, it will ask what your preferred git protocol | ||
is (https or ssh) to use "underneath". The caveats above will apply to whichever | ||
you choose. | ||
|
||
--- | ||
|
||
### Single Step Building of the Model | ||
|
||
If all you wish is to build the model, you can run `parallel_build.csh` from a head node. Doing so will checkout all the external repositories of the model and build it. When done, the resulting model build will be found in `build/` and the installation will be found in `install/` with setup scripts like `gcm_setup` and `fvsetup` in `install/bin`. | ||
If all you wish is to build the model, you can run `parallel_build.csh` from a head node. Doing so will checkout all the external repositories of the model and build it. When done, the resulting model build will be found in `build/` and the installation will be found in `install/` with setup scripts like `ctm_setup` in `install/bin`. | ||
|
||
#### Debug Version of GEOS | ||
|
||
|
@@ -57,12 +111,21 @@ To obtain a debug version, you can run `parallel_build.csh -debug` which will bu | |
|
||
The steps detailed below are essentially those that `parallel_build.csh` performs for you. Either method should yield identical builds. | ||
|
||
##### Checkout externals | ||
#### Mepo | ||
|
||
The GEOS CTM is comprised of a set of sub-repositories. These are | ||
managed by a tool called [mepo](https://github.com/GEOS-ESM/mepo). To | ||
clone all the sub-repos, you can run `mepo clone` inside the fixture: | ||
|
||
``` | ||
cd GEOSctm | ||
checkout_externals | ||
mepo clone | ||
``` | ||
|
||
The first command initializes the multi-repository and the second one | ||
clones and assembles all the sub-repositories according to | ||
`components.yaml` | ||
|
||
#### Build the Model | ||
|
||
##### Load Compiler, MPI Stack, and Baselibs | ||
|
@@ -96,6 +159,14 @@ and CMake will install there. | |
|
||
##### Build and Install with Make | ||
``` | ||
make -j6 install | ||
make -jN install | ||
``` | ||
where `N` is the number of parallel processes. On discover head nodes, this should only be as high as 2 due to limits on the head nodes. On a compute node, you can set `N` has high as you like, though 8-12 is about the limit of parallelism in our model's make system. | ||
|
||
### Run the CTM | ||
|
||
Once the model has built successfully, you will have an `install/` directory in your checkout. To run `ctm_setup` go to the `install/bin/` directory and run it there: | ||
``` | ||
cd install/bin | ||
./ctm_setup | ||
``` |
Oops, something went wrong.