From c91c8fba7738f3f6820a47e6b06d9b09110eec6d Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Tue, 9 Jul 2024 16:02:08 +0200 Subject: [PATCH 1/6] Create cmake-multi-platform.yml initial commit of workflow --- .github/workflows/cmake-multi-platform.yml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml new file mode 100644 index 0000000..9db5c8d --- /dev/null +++ b/.github/workflows/cmake-multi-platform.yml @@ -0,0 +1,78 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CMake on multiple platforms + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + + # Set up a matrix to run the following 3 configurations: + # 1. + # 2. + # 3. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest] + build_type: [Release] + c_compiler: [gcc] + include: + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + + steps: + - uses: actions/checkout@v4 + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Install prerequisite libraries + # Install 3rd party libraries + run: | + sudo apt-get update -qq + sudo apt-get install gcc g++ gfortran -qq -y + gcc --version + # Install a CMake 3.0.2 version. + sudo apt-get install git cmake pkg-config cmake-data -y --force-yes + # Print the CMake version. + cmake --version + # Install the necessary libraries + sudo apt-get install libfftw3-dev -y + sudo apt-get install libgsl-dev -y + sudo apt-get install libhdf5-serial-dev -y + sudo apt-get install openmpi-bin libopenmpi-dev -y + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} From d399be804ac45be15e6903aabbe2669fcf52067c Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Tue, 9 Jul 2024 16:05:13 +0200 Subject: [PATCH 2/6] Update cmake-multi-platform.yml forgot to use the mpi fftw version --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9db5c8d..92c748e 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -52,7 +52,7 @@ jobs: # Print the CMake version. cmake --version # Install the necessary libraries - sudo apt-get install libfftw3-dev -y + sudo apt-get install libfftw3-mpi-dev libfftw3-dev -y sudo apt-get install libgsl-dev -y sudo apt-get install libhdf5-serial-dev -y sudo apt-get install openmpi-bin libopenmpi-dev -y From 0eedc765d085f359abb55cbc16afcf884c3e0c00 Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Tue, 9 Jul 2024 16:09:47 +0200 Subject: [PATCH 3/6] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b2eafdd..fcb85c3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # MUSIC2 - monofonIC Modular high-precision IC generator for cosmological simulations. MUSIC2-monofonIC is for non-zoom full box ICs (use [MUSIC](https://bitbucket.org/ohahn/music) for zooms, MUSIC2 for zooms is in the works). +[![CMake on multiple platforms](https://github.com/cosmo-sims/monofonIC/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/cosmo-sims/monofonIC/actions/workflows/cmake-multi-platform.yml) + Note that this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. BEWARE: This software package is currently in a beta testing phase! Proceed with caution before using it for large-scale simulations. @@ -107,4 +109,4 @@ specifying the desired number of threads per task in the config file, and the nu mpirun -np 16 ./monofonIC ``` -It will then run with 16 tasks times the number of threads per task specified in the config file. \ No newline at end of file +It will then run with 16 tasks times the number of threads per task specified in the config file. From 91b0dd0fcdf72c2787f33bdc2a3e243b7c3cda25 Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Tue, 9 Jul 2024 16:10:10 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcb85c3..84e1b84 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ +[![CMake on multiple platforms](https://github.com/cosmo-sims/monofonIC/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/cosmo-sims/monofonIC/actions/workflows/cmake-multi-platform.yml) + # MUSIC2 - monofonIC Modular high-precision IC generator for cosmological simulations. MUSIC2-monofonIC is for non-zoom full box ICs (use [MUSIC](https://bitbucket.org/ohahn/music) for zooms, MUSIC2 for zooms is in the works). -[![CMake on multiple platforms](https://github.com/cosmo-sims/monofonIC/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/cosmo-sims/monofonIC/actions/workflows/cmake-multi-platform.yml) - Note that this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. BEWARE: This software package is currently in a beta testing phase! Proceed with caution before using it for large-scale simulations. From 02a74498e5180cf115867046798afcb603f5cff7 Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Tue, 9 Jul 2024 21:41:11 +0200 Subject: [PATCH 5/6] Create CITATION.bib --- CITATION.bib | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 CITATION.bib diff --git a/CITATION.bib b/CITATION.bib new file mode 100644 index 0000000..09c17df --- /dev/null +++ b/CITATION.bib @@ -0,0 +1,27 @@ +@article{MONOFONIC:3LPT, + author = {Michaux, Micha\"el and Hahn, Oliver and Rampf, Cornelius and Angulo, Raul E.}, + title = "{Accurate initial conditions for cosmological N-body simulations: Minimizing truncation and discreteness errors}", + eprint = "2008.09588", + archivePrefix = "arXiv", + primaryClass = "astro-ph.CO", + doi = "10.1093/mnras/staa3149", + journal = "Mon. Not. Roy. Astron. Soc.", + volume = "500", + number = "1", + pages = "663--683", + year = "2020" +} + +@article{MONOFONIC:BARYONS, + author = "Hahn, Oliver and Rampf, Cornelius and Uhlemann, Cora", + title = "{Higher order initial conditions for mixed baryon\textendash{}CDM simulations}", + eprint = "2008.09124", + archivePrefix = "arXiv", + primaryClass = "astro-ph.CO", + doi = "10.1093/mnras/staa3773", + journal = "Mon. Not. Roy. Astron. Soc.", + volume = "503", + number = "1", + pages = "426--445", + year = "2021" +} From a19b967f3b3f43141eb9acd982a6b15d1e1e4a39 Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Tue, 9 Jul 2024 21:42:46 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 84e1b84..5469177 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ If you use MUSIC2-monofonIC in your scientific work, you are required to acknowl - For baryon+CDM sims, or PPT numerics related aspects: Hahn et al. 2020 [arXiv:2008.09124](https://arxiv.org/abs/2008.09124) +You can find the respective BibTeX entries in the enclosed CITATION.bib file. ## Acknowledgments