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

Set up ParaGridIO_Xios as a copy of ParaGridIO for now #758

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,43 @@ jobs:
cd test
python3 ThermoIntegration_test.py
./run_test_jan2010_integration_test.sh python3
cd -

test-ubuntu-mpi:
test-ubuntu-mpi-noxios:

runs-on: ubuntu-22.04
container:
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest

steps:
- uses: actions/checkout@v2

- name: build and compile with MPI but not XIOS
run: |
. /opt/spack-environment/activate.sh
mkdir -p build && cd build
cmake -DENABLE_MPI=ON -DENABLE_XIOS=OFF -DCMAKE_CXX_COMPILER="$(which mpic++)" ..
make -j 4

- name: run MPI tests
run: |
. /opt/spack-environment/activate.sh
apt update
apt install -y wget
cd build
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc")
for component in core physics dynamics
do
cd $component/test
for file in $(find test* -maxdepth 0 -type f)
do
echo $file
nprocs=$(echo $file | sed -r "s/.*MPI([0-9]+)/\1/")
mpirun --allow-run-as-root --oversubscribe -n $nprocs ./$file
done
cd -
done

test-ubuntu-mpi-xios:

runs-on: ubuntu-22.04
container:
Expand Down Expand Up @@ -86,7 +120,6 @@ jobs:
done
cd -
done
cd -

test-mac-serial:

Expand Down Expand Up @@ -138,4 +171,3 @@ jobs:
cd test
python ThermoIntegration_test.py
./run_test_jan2010_integration_test.sh python
cd -
8 changes: 7 additions & 1 deletion core/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Sources for the main neXtSIM model

if(ENABLE_XIOS)
set(ParaGridIO_Impl "ParaGridIO_Xios")
else()
set(ParaGridIO_Impl "ParaGridIO")
endif()

Copy link
Collaborator

Choose a reason for hiding this comment

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

Posibbly add the .cpp suffix here to make it clear this is a source file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 1291ae4.

set(BaseSources
"Logged.cpp"
"ModelConfig.cpp"
Expand All @@ -11,7 +17,7 @@ set(BaseSources
"CommandLineParser.cpp"
"CommonRestartMetadata.cpp"
"RectGridIO.cpp"
"ParaGridIO.cpp"
"${ParaGridIO_Impl}.cpp"
"FileCallbackCloser.cpp"
"Finalizer.cpp"
"DevStep.cpp"
Expand Down
4 changes: 3 additions & 1 deletion core/src/ParaGridIO.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*!
* @file ParaGridIO.cpp
*
* @date Oct 24, 2022
* @date 09 Dec 2024
* @author Tim Spain <timothy.spain@nersc.no>
*/

#ifndef USE_XIOS
#include "include/ParaGridIO.hpp"

#include "include/CommonRestartMetadata.hpp"
Expand Down Expand Up @@ -513,3 +514,4 @@ void ParaGridIO::closeAllFiles()
}

} /* namespace Nextsim */
#endif /* not USE_XIOS */
Loading
Loading