Skip to content

Commit

Permalink
Merge branch 'esmf-org:develop' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
WeirAE authored Nov 2, 2023
2 parents 24e5f79 + ae6d46c commit ea3ae5b
Show file tree
Hide file tree
Showing 666 changed files with 55,238 additions and 10,214 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
tag1:
description: 'First ESMF Tag'
required: true
default: 'v8.3.0'
default: 'v8.6.0'
tag2:
description: 'Second ESMF Tag'
required: true
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/build-esmf-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
uses: actions/checkout@v3
with:
repository: esmf-org/esmf-org.github.io
path: esmf-org.github.io
token: ${{ secrets.ESMF_WEB_TOKEN }}
path: ${{github.workspace}}/esmf-org.github.io
ssh-key: ${{secrets.ESMF_WEB_DEPLOY_KEY}}

- name: Copy docs
run: |
Expand All @@ -66,10 +66,10 @@ jobs:
cp -rf ./dev_guide/dev_guide/* ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/dev_guide/
- name: Commit and publish docs
uses: actions-js/push@master
with:
repository: esmf-org/esmf-org.github.io
directory: ${{ github.workspace }}/esmf-org.github.io
branch: master
github_token: ${{ secrets.ESMF_WEB_TOKEN }}
message: 'Publish ESMF Docs'
run: |
cd ${{ github.workspace }}/esmf-org.github.io
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff-index --quiet HEAD || git commit --message "Publish ESMF Docs"
git push origin
20 changes: 10 additions & 10 deletions .github/workflows/build-esmpy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
with:
name: esmpy-docs
path: ${{ github.workspace }}/artifacts

- name: Checkout esmpy_doc
uses: actions/checkout@v3
with:
repository: esmf-org/esmpy_doc
path: esmpy_doc
token: ${{ secrets.ESMF_WEB_TOKEN }}
path: ${{github.workspace}}/esmpy_doc
ssh-key: ${{secrets.ESMPY_WEB_DEPLOY_KEY}}

- name: Copy docs
run: |
Expand All @@ -60,10 +60,10 @@ jobs:
cp -rf latex/ESMPy.pdf ${{ github.workspace }}/esmpy_doc/docs/nightly/${{ github.ref_name }}/
- name: Commit and publish docs
uses: actions-js/push@master
with:
repository: esmf-org/esmpy_doc
directory: ${{ github.workspace }}/esmpy_doc
branch: master
github_token: ${{ secrets.ESMF_WEB_TOKEN }}
message: 'Publish ESMPy Docs'
run: |
cd ${{ github.workspace }}/esmpy_doc
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff-index --quiet HEAD || git commit --message "Publish ESMPy Docs"
git push origin
80 changes: 80 additions & 0 deletions .github/workflows/scripts/install_oneapi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash

# get arguments
while getopts c: flag
do
case "${flag}" in
c) comp=${OPTARG};;
esac
done

# print out arguments
echo "Compiler: $comp"

# download the key to system keyring
echo "::group::Setup Intel oneAPI Repository"
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | \
gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null

# add signed entry to apt sources and configure the APT client to use Intel repository
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] \
https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list

# update packages list and repository index
sudo apt-get -qq update
echo "::endgroup::"

# exit if it is already installed
if [ -d "/opt/intel/oneapi" ]; then
echo "/opt/intel/oneapi directory exists. Skip installing Intel oneAPI Compiler ..."
sudo apt-get --fix-missing update
exit
fi

# get compiler version
echo "::group::Check Specified Versiion"
compiler_version=`echo "$comp" | awk -F\@ '{print $2}'`
echo "Compiler Version: $compiler_version"

# check the version is available or not
if [ -z "$compiler_version" ]; then
echo "Compiler version needs to be specified! Exiting ..."
exit 1
else
list_compiler_versions=`apt list 2>&1 | grep "intel-basekit-[1-9]" | awk -F\- '{print $3}' | awk -F\/ '{printf $1" "}'`
echo "List of available Intel oneAPI basekit, hpckit versions: $list_compiler_versions"
in_the_list=0
for i in $list_compiler_versions
do
if [[ "$i" == "$compiler_version" ]]; then
in_the_list=1
break
fi
done
if [ $in_the_list == 0 ]; then
echo "Specified compiler version ($compiler_version) is not available! Exiting ..."
exit 1
fi
fi
echo "::endgroup::"

# install
echo "::group::Install Intel oneAPI Base and HPC Kits"
sudo apt-get install -qq intel-basekit-$compiler_version
sudo apt-get install -qq intel-hpckit-$compiler_version
# remove vtune since it is creating issue in cache due to permission issue in the installation files
list_vtune_pkgs=`apt-cache search intel-oneapi-vtune | awk '{print $1}'`
for i in $list_vtune_pkgs
do
echo "Removing package - $i"
sudo apt-get purge $i
done
echo "::endgroup::"

# list content of the installation folders (for debugging)
echo "::group::List Files in Installation Folder"
echo "> ls -al /opt/intel/oneapi/compiler/"
ls -al /opt/intel/oneapi/compiler/
echo "> ls -al /opt/intel/oneapi/mpi/"
ls -al /opt/intel/oneapi/mpi/
echo "::endgroup::"
96 changes: 96 additions & 0 deletions .github/workflows/scripts/run_nuopc_app_proto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/bash

# get arguments
while getopts c:r:s: flag
do
case "${flag}" in
c) comp=${OPTARG};;
r) run_dir=${OPTARG};;
s) spack_install_dir=${OPTARG};;
esac
done

# check for default values
if [[ -z "$comp" || ! -z `echo $comp | grep '^-'` ]]; then
comp="[email protected]"
fi

if [[ -z "$run_dir" || ! -z `echo $run_dir | grep '^-'` ]]; then
run_dir=`pwd`
fi

if [[ -z "$spack_install_dir" || ! -z `echo $spack_install_dir | grep '^-'` ]]; then
spack_install_dir=`pwd`
fi

# print out arguments
echo "Compiler : $comp"
echo "Run Directory : $run_dir";
echo "Spack Install Directory: $spack_install_dir";

# go to directory
cd $run_dir

# output esmf.mk file for debugging
echo "::group::Content of esmf.mk"
cat $spack_install_dir/view/lib/esmf.mk
echo "::endgroup::"

# debug
echo "::group::Prepare Environment and Debug Output for NUOPC Application Prototypes"
export ESMFMKFILE=$spack_install_dir/view/lib/esmf.mk
if [[ "$comp" == *"oneapi"* ]]; then
# this is not correct, need to be changed later
. /opt/intel/oneapi/setvars.sh
export TOOLRUN=""
MPI_FC=mpiifort
else
export PATH=$spack_install_dir/view/bin:$PATH
# set it for OpenMPI to fix not enough slots issue
export TOOLRUN="--oversubscribe --mca btl_tcp_if_include eth0"
MPI_FC=mpif90
fi
which mpirun
cat testProtos.sh | grep "^Test"
echo "::endgroup::"

# test installation by building and running simple MPI job
echo "::group::Test Installation"
echo "program test_mpi" > test_mpi.F90
echo " use mpi" >> test_mpi.F90
echo " integer :: err, p, id" >> test_mpi.F90
echo " call MPI_Init(err)" >> test_mpi.F90
echo " call MPI_Comm_size(MPI_COMM_WORLD, p, err)" >> test_mpi.F90
echo " call MPI_Comm_rank(MPI_COMM_WORLD, id, err)" >> test_mpi.F90
echo " print*, 'Hello from ', id, ' of ', p" >> test_mpi.F90
echo " call MPI_Finalize(err)" >> test_mpi.F90
echo "end program test_mpi" >> test_mpi.F90
$MPI_FC -o test_mpi.x test_mpi.F90
mpirun -np 2 ${TOOLRUN} ./test_mpi.x
echo "::endgroup::"

# run app prototypes
echo "::group::Build and Run NUOPC Application Prototypes"
# make proto script executable
chmod 755 testProtos.sh
# run app prototypes in the background
./testProtos.sh 2>&1 | tee testProtos.log
echo "::endgroup::"

# process output
echo "::group::Process Output of NUOPC Application Prototypes"
sed -n '/== TEST SUMMARY START ==/, /== TEST SUMMARY STOP ==/p' testProtos.log >& testProtos_summary.log
result_fail=`cat testProtos_summary.log | grep "FAIL"`
echo "-------------"
echo "FAILED TESTS:"
echo "-------------"
cat testProtos_summary.log | grep "FAIL"
echo "-------------"
echo "PASSED TESTS:"
echo "-------------"
cat testProtos_summary.log | grep "PASS"
if [[ ! -z "$result_fail" ]]; then
echo "Some of NUOPC app prototypes are failed! Exiting ..."
exit 1
fi
echo "::endgroup::"
Loading

0 comments on commit ea3ae5b

Please sign in to comment.