Skip to content
Snippets Groups Projects
Commit 83844050 authored by Dave Moxey's avatar Dave Moxey
Browse files

Nektar++ workbook improvements

parent de31ffc5
No related branches found
No related tags found
No related merge requests found
......@@ -455,10 +455,7 @@ win10-mpi-default-build-and-test:
# correct image version can be grabbed from the container registry.
.dockerhub_build_template: &dockerhub_build_template
image: docker:stable
only:
- master@nektar/nektar
- /^docker\/.*$/@nektar/nektar
- tags@nektar/nektar
<<: *execution-conditions
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- IMAGE=$CI_REGISTRY_IMAGE/${image_name}
......@@ -473,11 +470,8 @@ win10-mpi-default-build-and-test:
# registry on a particular SHA commit.
.dockerhub-test-template: &dockerhub_test_template
image: ${CI_REGISTRY_IMAGE}/${image_name}:$CI_COMMIT_SHORT_SHA
<<: *execution-conditions
stage: package-test
only:
- master@nektar/nektar
- /^docker\/.*$/@nektar/nektar
- tags@nektar/nektar
# Docker Hub deployment template. Only builds for master or tags on the main
# Nektar repository. The strategy is to login to the container registry and pull
......@@ -510,6 +504,7 @@ win10-mpi-default-build-and-test:
dockerhub-build-env:
<<: *dockerhub_build_template
stage: package-env
needs: []
variables:
image_name: nektar-env
dockerfile: docker/nektar-env/Dockerfile
......@@ -560,7 +555,7 @@ dockerhub-test-nektar-dev:
image_name: nektar-dev
script:
- cd $CI_PROJECT_DIR/templates/executable
- ./test.sh /usr/local/lib64/nektar++/cmake 3
- ./test.sh /usr/local/lib64/nektar++/cmake 3 /usr/bin/cmake
# Deployment
dockerhub-deploy-nektar:
......
Changelog
=========
v5.1.1
------
**Python**
- Updates to workbook, fix bugs in StdExpansion and SessionReader with MPI communication
being recreated. (!1296)
v5.1.0
------
**Library**
......
FROM jupyter/scipy-notebook:42f4c82a07ff AS build
FROM jupyter/scipy-notebook:hub-1.4.2 AS build
LABEL maintainer="Nektar++ Development Team <nektar-users@imperial.ac.uk>"
USER root
RUN apt-get update && \
apt-get install -y libgl1-mesa-dev xvfb && \
apt-get install -y libgl1-mesa-dev xvfb openssh-client build-essential && \
rm -rf /var/lib/apt/lists/*
USER $NB_UID
RUN conda install --quiet --yes cmake=3.19.1 boost=1.74.0 occt=7.4.0 gmsh=4.6.0 pyvista=0.27.2 itkwidgets=0.32.0 arpack=3.7.0 fftw=3.3.8 tinyxml jupyter_contrib_nbextensions && \
RUN conda install --quiet --yes jupyterlab=2.3.1 cmake=3.19.1 boost=1.74.0 occt=7.4.0 gmsh=4.6.0 pyvista=0.31.3 \
arpack=3.7.0 fftw=3.3.8 scotch=6.0.9 openmpi=4.1.0 tinyxml=2.6.2 jupyter_contrib_nbextensions=0.5.1 \
ptscotch=6.0.9 hdf5=1.10.6=mpi_openmpi* && \
pip install --no-cache-dir nbgitpuller itkwidgets && \
jupyter contrib nbextension install --sys-prefix && \
jupyter nbextension enable --sys-prefix hide_input/main && \
jupyter nbextension enable --sys-prefix hide_input_all/main && \
jupyter nbextension enable --sys-prefix init_cell/main && \
jupyter nbextension enable --sys-prefix equation-numbering/main
jupyter nbextension enable --sys-prefix equation-numbering/main && \
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib jupyterlab-datawidgets itkwidgets @jupyterlab/toc && \
conda clean --all -f -y && \
jupyter lab clean && \
rm -rf "/home/${NB_USER}/.cache/yarn" && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
USER root
COPY . /tmp/nektar
......@@ -24,11 +33,17 @@ RUN cd /tmp/nektar && mkdir build && cd build && \
-DNEKTAR_BUILD_UTILITIES=ON -DNEKTAR_BUILD_PYTHON=ON \
-DNEKTAR_SOLVER_VORTEXWAVE=OFF -DNEKTAR_LIB_DIR=lib/x86_64-linux-gnu \
-DNEKTAR_BUILD_TESTS=OFF -DNEKTAR_BUILD_UNIT_TESTS=OFF \
-DNEKTAR_BUILD_DEMOS=OFF -DNEKTAR_USE_SCOTCH=OFF -DNEKTAR_USE_MESHGEN=ON \
-DNEKTAR_BUILD_DEMOS=OFF -DNEKTAR_USE_SCOTCH=ON -DNEKTAR_USE_MESHGEN=ON \
-DNEKTAR_USE_ARPACK=ON -DNEKTAR_USE_FFTW=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local .. && \
-DNEKTAR_USE_MPI=ON -DNEKTAR_USE_HDF5=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) install && \
chown -R $NB_UID:$NB_UID /tmp/nektar && \
cd /tmp/nektar/build && sudo -u $NB_USER make nekpy-install-system && cd && ldconfig && rm -R /tmp/nektar
USER $NB_UID
USER root
COPY docker/nektar-workbook/entrypoint.sh /
RUN chmod +x /entrypoint.sh
USER $NB_USER
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
export DISPLAY=:99.0
which Xvfb
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3
exec "$@"
......@@ -37,6 +37,11 @@
using namespace Nektar::LibUtilities;
#ifdef NEKTAR_USE_MPI
#include <LibUtilities/Communication/CommMpi.h>
CommSharedPtr MPICOMM = CommSharedPtr();
#endif
/**
* @brief Thin wrapper around SessionReader to provide a nicer Pythonic
* interface.
......@@ -75,8 +80,30 @@ SessionReaderSharedPtr SessionReader_CreateInstance(py::list &ns)
// segfault.
argv[argc] = NULL;
#ifdef NEKTAR_USE_MPI
// In the case we're using MPI, it may already have been initialised. So to
// handle this, we'll construct our own CommMpi object and pass through to
// the SessionReader. This will persist indefinitely, or at least until the
// library is unloaded by Python.
if (!MPICOMM)
{
MPICOMM = GetCommFactory().CreateInstance("ParallelMPI", argc, argv);
}
std::vector<std::string> filenames(argc-1);
for (i = 1; i < argc; ++i)
{
filenames[i-1] = std::string(argv[i]);
}
// Create session reader.
SessionReaderSharedPtr sr = SessionReader::CreateInstance(
argc, argv, filenames, MPICOMM);
#else
// Create session reader.
SessionReaderSharedPtr sr = SessionReader::CreateInstance(argc, argv);
#endif
// Clean up.
delete [] argv;
......
......@@ -61,7 +61,7 @@ Array<OneD, NekDouble> StdExpansion_IProductWRTBase(
const Array<OneD, const NekDouble> &in)
{
Array<OneD, NekDouble> out(exp->GetNcoeffs());
exp->BwdTrans(in, out);
exp->IProductWRTBase(in, out);
return out;
}
......
......@@ -2,6 +2,14 @@
set -e
if [ "$#" -ne 3 ]; then
echo "Usage: test.sh /path/to/nektar++/cmake/dir ncpus /usr/bin/cmake"
echo ""
echo "Given a path to the Nektar++ CMake files, this script compiles and runs a simulation"
echo "using ncpus, using the CMake executable given in the third parameter."
exit 1
fi
# Create a build directory and compile against Nektar++
rm -rf build && mkdir build && cd build
$3 -DNektar++_DIR=$1 ..
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment