From 80c4f01363cb6d4ce49f7917a6e59ead51087430 Mon Sep 17 00:00:00 2001 From: "Henrique B. R." Date: Wed, 30 Oct 2024 10:08:25 +0000 Subject: [PATCH 1/8] Add conduit build to spack and MFEM options --- scripts/build-platypus-csd3-ampere.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/build-platypus-csd3-ampere.sh b/scripts/build-platypus-csd3-ampere.sh index 174f1ce2..8d36cf17 100755 --- a/scripts/build-platypus-csd3-ampere.sh +++ b/scripts/build-platypus-csd3-ampere.sh @@ -103,6 +103,10 @@ install_spack_deps() { spack install slepc +cuda cuda_arch=80 spack load slepc arch=${ARCH} + echo "Installing Conduit..." + spack install conduit +adios +mpi +parmetis +shared + spack load conduit arch=${ARCH} + echo "Installing netcdf..." spack install netcdf-c +parallel-netcdf spack load netcdf-c arch=${ARCH} @@ -173,6 +177,7 @@ install_mfem() { -DMFEM_USE_SUPERLU=YES \ -DMFEM_USE_NETCDF=YES \ -DMFEM_USE_GSLIB=YES \ + -DMFEM_USE_CONDUIT=YES \ -DGSLIB_DIR="${BUILD_PATH}/gslib/build" \ -DSuperLUDist_DIR="${SLU_DIR}" \ -DSuperLUDist_VERSION_OK=YES From 23df1cb0a4696c070553b230890655034cb62857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CHenrique?= Date: Thu, 31 Oct 2024 15:12:08 +0000 Subject: [PATCH 2/8] Fix MFEM header issue and spack build order --- platypus.mk | 2 +- scripts/build-platypus-csd3-ampere.sh | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/platypus.mk b/platypus.mk index 7244ef55..b09a6f49 100644 --- a/platypus.mk +++ b/platypus.mk @@ -1,7 +1,7 @@ MFEM_DIR :=$(APPLICATION_DIR)/../mfem/build include $(MFEM_DIR)/config/config.mk -MFEM_INCLUDES := -I$(MFEM_INC_DIR)/config -I$(MFEM_DIR)/ -I$(MFEM_DIR)/../miniapps/common +MFEM_INCLUDES := -I$(MFEM_INC_DIR)/config -I$(MFEM_DIR)/ -I$(MFEM_DIR)/../miniapps/common $(MFEM_INCFLAGS) MFEM_LIBS := -L$(MFEM_DIR) -lmfem -lrt -L$(MFEM_DIR)/miniapps/common -lmfem-common $(MFEM_LIB) ADDITIONAL_INCLUDES += $(MFEM_INCLUDES) diff --git a/scripts/build-platypus-csd3-ampere.sh b/scripts/build-platypus-csd3-ampere.sh index 8d36cf17..03a1e4ae 100755 --- a/scripts/build-platypus-csd3-ampere.sh +++ b/scripts/build-platypus-csd3-ampere.sh @@ -90,6 +90,12 @@ install_spack_deps() { spack uninstall -ay arch=${ARCH} spack clean -ab + echo "Installing Conduit..." + spack install conduit +mpi +parmetis +shared \ + ^mpich +cuda +slurm cuda_arch=80 \ + ^hdf5 +cxx +fortran +hl +mpi +shared + spack load conduit arch=${ARCH} + echo "Installing Petsc..." # Spack's petsc doesn't like openmpi, but it works with mpich spack install petsc +cuda cuda_arch=80 +fortran +hdf5 +hypre +metis +mpi \ @@ -103,17 +109,13 @@ install_spack_deps() { spack install slepc +cuda cuda_arch=80 spack load slepc arch=${ARCH} - echo "Installing Conduit..." - spack install conduit +adios +mpi +parmetis +shared - spack load conduit arch=${ARCH} - echo "Installing netcdf..." spack install netcdf-c +parallel-netcdf spack load netcdf-c arch=${ARCH} - echo "Installing ninja..." - spack install ninja - spack load ninja arch=${ARCH} + #echo "Installing ninja..." + #spack install ninja + #spack load ninja arch=${ARCH} echo "Adding python modules..." @@ -153,6 +155,7 @@ install_mfem() { export F77=mpif77 export FC=mpif90 SLU_DIR=$(spack find --format "{prefix}" superlu-dist) + CONDUIT_DIR=$(spack find --format "{prefix}" conduit) export SLU_DIR # Build MFEM @@ -179,6 +182,7 @@ install_mfem() { -DMFEM_USE_GSLIB=YES \ -DMFEM_USE_CONDUIT=YES \ -DGSLIB_DIR="${BUILD_PATH}/gslib/build" \ + -DCONDUIT_DIR="${CONDUIT_DIR}" \ -DSuperLUDist_DIR="${SLU_DIR}" \ -DSuperLUDist_VERSION_OK=YES From 6591e72ee2f1a443146f060ed18fb7d7c89091d0 Mon Sep 17 00:00:00 2001 From: "Henrique B. R." Date: Thu, 31 Oct 2024 16:51:47 +0000 Subject: [PATCH 3/8] Add conduit build to docker file --- docker/platypus-deps/Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docker/platypus-deps/Dockerfile b/docker/platypus-deps/Dockerfile index 19b6391b..559ba9b4 100644 --- a/docker/platypus-deps/Dockerfile +++ b/docker/platypus-deps/Dockerfile @@ -113,6 +113,17 @@ RUN make PETSC_DIR=/$WORKDIR/petsc/petsc-3.19.3 PETSC_ARCH=arch-linux-c-opt inst WORKDIR /$WORKDIR RUN export PETSC_DIR=/$WORKDIR/petsc +# Download and build Conduit +WORKDIR /$WORKDIR +RUN git clone --recursive https://github.com/llnl/conduit.git +WORKDIR /$WORKDIR/conduit +RUN git checkout master && mkdir build +WORKDIR /$WORKDIR/conduit/build +RUN cmake ../src \ + -DCMAKE_BUILD_TYPE="Release" \ + -DENABLE_MPI=YES +RUN make -j$compile_cores + # Build MFEM and common miniapp WORKDIR /$WORKDIR RUN git clone https://github.com/mfem/mfem.git @@ -134,6 +145,8 @@ RUN cmake .. \ -DMFEM_USE_SUPERLU=YES \ -DSuperLUDist_DIR=/$WORKDIR/petsc/ \ -DMFEM_USE_NETCDF=YES \ + -DMFEM_USE_CONDUIT=YES \ + -DCONDUIT_DIR=/$WORKDIR/conduit/build \ -DHDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/mpich/ && \ make -j$compile_cores WORKDIR /$WORKDIR/mfem/build/miniapps/common From a4ba0bc78e093b180a7158507535e4589f67bf34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CHenrique?= Date: Fri, 1 Nov 2024 10:48:16 +0000 Subject: [PATCH 4/8] Add Conduit to data colections test --- test/tests/outputs/datacollections.i | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/tests/outputs/datacollections.i b/test/tests/outputs/datacollections.i index c70b5c73..1a4382ac 100644 --- a/test/tests/outputs/datacollections.i +++ b/test/tests/outputs/datacollections.i @@ -103,5 +103,10 @@ [VisItDataCollection] type = MFEMVisItDataCollection file_base = OutputData/VisItDataCollection + [] + [ConduitDataCollection] + type = MFEMConduitDataCollection + file_base = OutputData/ConduitDataCollection + protocol = conduit_bin [] [] From fa937a4a6c0ad3d18092d03e361fbe91a1770ec3 Mon Sep 17 00:00:00 2001 From: Alexander Blair Date: Mon, 4 Nov 2024 17:08:11 +0000 Subject: [PATCH 5/8] Get Platypus to link to MFEM's external libraries --- platypus.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypus.mk b/platypus.mk index b09a6f49..a20aad62 100644 --- a/platypus.mk +++ b/platypus.mk @@ -5,7 +5,7 @@ MFEM_INCLUDES := -I$(MFEM_INC_DIR)/config -I$(MFEM_DIR)/ -I$(MFEM_DIR)/../mini MFEM_LIBS := -L$(MFEM_DIR) -lmfem -lrt -L$(MFEM_DIR)/miniapps/common -lmfem-common $(MFEM_LIB) ADDITIONAL_INCLUDES += $(MFEM_INCLUDES) -ADDITIONAL_LIBS += -Wl, $(MFEM_LIBS) +ADDITIONAL_LIBS += -Wl, $(MFEM_LIBS) ${MFEM_EXT_LIBS} $(info ADDITIONAL_INCLUDES = $(ADDITIONAL_INCLUDES)); $(info ADDITIONAL_LIBS = $(ADDITIONAL_LIBS)); \ No newline at end of file From a8cde570791e6aefd9cec6d311437eb04e5224dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CHenrique?= Date: Tue, 5 Nov 2024 10:52:33 +0000 Subject: [PATCH 6/8] Fully removed ninja install --- scripts/build-platypus-csd3-ampere.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/build-platypus-csd3-ampere.sh b/scripts/build-platypus-csd3-ampere.sh index 03a1e4ae..ba38173c 100755 --- a/scripts/build-platypus-csd3-ampere.sh +++ b/scripts/build-platypus-csd3-ampere.sh @@ -113,10 +113,6 @@ install_spack_deps() { spack install netcdf-c +parallel-netcdf spack load netcdf-c arch=${ARCH} - #echo "Installing ninja..." - #spack install ninja - #spack load ninja arch=${ARCH} - echo "Adding python modules..." spack install py-pyaml From 1e314b99222465d35201c580d93fdc90769658ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CHenrique?= Date: Mon, 9 Dec 2024 14:38:48 +0000 Subject: [PATCH 7/8] Added MFEMConduitDataCollection documentation --- .../outputs/MFEMConduitDataCollection.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/content/source/outputs/MFEMConduitDataCollection.md diff --git a/doc/content/source/outputs/MFEMConduitDataCollection.md b/doc/content/source/outputs/MFEMConduitDataCollection.md new file mode 100644 index 00000000..5ef23187 --- /dev/null +++ b/doc/content/source/outputs/MFEMConduitDataCollection.md @@ -0,0 +1,22 @@ +# MFEMConduitDataCollection + +## Summary + +!syntax description /Outputs/MFEMConduitDataCollection + +## Overview + +`MFEMDataCollection` controlling output of data to an `mfem::ConduitDataCollection` for visualisation +in VisIt. Conduit output is typically significantly faster than other data collections since VisIt uses the MFEM FE types for visualization, and ParaViewDataCollection oversamples the degrees of freedom. + +The user may choose the output protocol out of the following options: `hdf5`, `json`, `conduit_json`, and `conduit_bin`. + +## Example Input File Syntax + +!listing test/tests/outputs/datacollections.i block=Outputs/ConduitDataCollection + +!syntax parameters /Outputs/MFEMConduitDataCollection + +!syntax inputs /Outputs/MFEMConduitDataCollection + +!syntax children /Outputs/MFEMConduitDataCollection From ea595d6c5bdca2f763a2c35bc1e6a834dd8e756f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CHenrique?= Date: Mon, 9 Dec 2024 15:06:58 +0000 Subject: [PATCH 8/8] Linting --- doc/content/source/outputs/MFEMConduitDataCollection.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/content/source/outputs/MFEMConduitDataCollection.md b/doc/content/source/outputs/MFEMConduitDataCollection.md index 5ef23187..4286b04a 100644 --- a/doc/content/source/outputs/MFEMConduitDataCollection.md +++ b/doc/content/source/outputs/MFEMConduitDataCollection.md @@ -7,7 +7,8 @@ ## Overview `MFEMDataCollection` controlling output of data to an `mfem::ConduitDataCollection` for visualisation -in VisIt. Conduit output is typically significantly faster than other data collections since VisIt uses the MFEM FE types for visualization, and ParaViewDataCollection oversamples the degrees of freedom. +in VisIt. Conduit output is typically significantly faster than other data collections since VisIt uses +the MFEM FE types for visualisation, and ParaViewDataCollection oversamples the degrees of freedom. The user may choose the output protocol out of the following options: `hdf5`, `json`, `conduit_json`, and `conduit_bin`.