forked from esmf-org/esmf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'esmf-org:develop' into test
- Loading branch information
Showing
666 changed files
with
55,238 additions
and
10,214 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
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
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,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::" |
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,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::" |
Oops, something went wrong.