Skip to content

Commit

Permalink
Merge pull request #7 from dustinswales/ufs-dev-PR184-djs
Browse files Browse the repository at this point in the history
Changes for openmpi
  • Loading branch information
grantfirl committed May 30, 2024
2 parents 37f6272 + e54a78a commit 7b8ca91
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 37 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/ci_build_scm_ubuntu_22.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
sp_ROOT: /home/runner/NCEPLIBS-sp
w3emc_ROOT: /home/runner/myw3emc
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
intel_ROOT: /home/runner/intel
suites: SCM_GFS_v15p2,SCM_GFS_v16,SCM_GFS_v17_p8,SCM_HRRR,SCM_RRFS_v1beta,SCM_RAP,SCM_WoFS_v0,SCM_GFS_v15p2_ps,SCM_GFS_v16_ps,SCM_GFS_v17_p8_ps,SCM_HRRR_ps,SCM_RRFS_v1beta_ps,SCM_RAP_ps,SCM_WoFS_v0_ps

# Workflow steps
Expand Down Expand Up @@ -57,33 +56,17 @@ jobs:
#######################################################################################
# Install FORTRAN dependencies
#######################################################################################
- name: Environment for ifort compiler
if: contains(matrix.fortran-compiler, 'ifort')
- name: Install openmpi
run: |
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
echo "NFVERSION=v4.4.4" >> $GITHUB_ENV
- name: Cache Intel compilers
id: cache-intel-compilers
if: contains(matrix.fortran-compiler, 'ifort')
uses: actions/cache@v2
with:
path: /home/runner/intel
key: intel-${{ runner.os }}-compilers-b

# https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html
# List of packages from Docker file at
# https://github.com/intel/oneapi-containers/blob/master/images/docker/hpckit-devel-ubuntu18.04/Dockerfile
- name: Install Intel compilers and libraries
if: contains(matrix.fortran-compiler, 'ifort') && steps.cache-intel-compilers.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install intel-hpckit-getting-started intel-oneapi-clck intel-oneapi-common-licensing intel-oneapi-common-vars
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-itac
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
tar -xvf v4.1.6.tar.gz
cd ompi-4.1.6
./autogen.pl
./configure --prefix=/home/runner/ompi-4.1.6
make -j4
make install
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
Expand Down Expand Up @@ -158,6 +141,11 @@ jobs:
sudo make install
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NFHOME}/lib
- name: Environment for openmpi compiler
run: |
echo "FC=mpif90" >> $GITHUB_ENV
echo "CC=mpicc" >> $GITHUB_ENV
#######################################################################################
# Build SCM.
#######################################################################################
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci_run_scm_DEPHY.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
#######################################################################################
# Install FORTRAN dependencies
#######################################################################################
- name: Install openmpi
run: |
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
tar -xvf v4.1.6.tar.gz
cd ompi-4.1.6
./autogen.pl
./configure --prefix=/home/runner/ompi-4.1.6
make -j4
make install
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
uses: actions/cache@v3
Expand Down Expand Up @@ -128,6 +140,11 @@ jobs:
#######################################################################################
# Build SCM. Run DEPHYv1 case.
#######################################################################################
- name: Environment for openmpi compiler
run: |
echo "FC=mpif90" >> $GITHUB_ENV
echo "CC=mpicc" >> $GITHUB_ENV
- name: Download data for SCM
run: |
cd ${SCM_ROOT}
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/ci_run_scm_rts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,18 @@ jobs:
#######################################################################################
# Install FORTRAN dependencies
#######################################################################################
- name: Environment for gfortran compiler
if: contains(matrix.fortran-compiler, 'gnu')
run: |
echo "FC=gfortran-11" >> $GITHUB_ENV
echo "CC=gcc-11" >> $GITHUB_ENV

- name: Environment for ifort compiler
if: contains(matrix.fortran-compiler, 'intel')
- name: Install openmpi
run: |
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz
tar -xvf v4.1.6.tar.gz
cd ompi-4.1.6
./autogen.pl
./configure --prefix=/home/runner/ompi-4.1.6
make -j4
make install
echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
Expand Down Expand Up @@ -142,6 +143,11 @@ jobs:
sudo make install
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NFHOME}/lib
- name: Environment for openmpi compiler
run: |
echo "FC=mpif90" >> $GITHUB_ENV
echo "CC=mpicc" >> $GITHUB_ENV
#######################################################################################
# Build SCM. Run regression tests.
#######################################################################################
Expand Down
2 changes: 1 addition & 1 deletion scm/src/run_scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def launch_executable(use_gdb, gdb, ignore_error = False):
if use_gdb:
cmd = '(cd {scm_run} && {gdb} {executable})'.format(scm_run=SCM_RUN, gdb=gdb, executable=EXECUTABLE)
else:
cmd = '(cd {scm_run} && time srun -A gmtb -n 1 {executable})'.format(scm_run=SCM_RUN, executable=EXECUTABLE)
cmd = '(cd {scm_run} && time mpirun -n 1 {executable})'.format(scm_run=SCM_RUN, executable=EXECUTABLE)
logging.info('Passing control to "{0}"'.format(cmd))
time.sleep(1)
# This will abort in 'execute' in the event of an error if ignore_error = False
Expand Down

0 comments on commit 7b8ca91

Please sign in to comment.