{"id":21044350,"url":"https://github.com/trixi-framework/poster-2024-pasc-libtrixi","last_synced_at":"2026-01-01T22:33:02.855Z","repository":{"id":241536899,"uuid":"793488503","full_name":"trixi-framework/poster-2024-pasc-libtrixi","owner":"trixi-framework","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-28T12:59:23.000Z","size":13566,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-20T17:28:48.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trixi-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-29T10:11:54.000Z","updated_at":"2024-05-28T12:59:27.000Z","dependencies_parsed_at":"2024-05-29T00:48:47.619Z","dependency_job_id":null,"html_url":"https://github.com/trixi-framework/poster-2024-pasc-libtrixi","commit_stats":null,"previous_names":["trixi-framework/poster-2024-pasc-libtrixi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trixi-framework%2Fposter-2024-pasc-libtrixi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trixi-framework%2Fposter-2024-pasc-libtrixi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trixi-framework%2Fposter-2024-pasc-libtrixi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trixi-framework%2Fposter-2024-pasc-libtrixi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trixi-framework","download_url":"https://codeload.github.com/trixi-framework/poster-2024-pasc-libtrixi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243489898,"owners_count":20299001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T14:16:29.737Z","updated_at":"2026-01-01T22:32:57.829Z","avatar_url":"https://github.com/trixi-framework.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# PASC24: Controlling Parallel CFD Simulations in Julia from C/Fortran with libtrixi\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](https://opensource.org/licenses/MIT)\n\nThis is the companion repository for the poster\n\n**Controlling Parallel CFD Simulations in Julia from C/Fortran with libtrixi**  \n[*Gregor Gassner*](https://www.mi.uni-koeln.de/NumSim/gregor-gassner/),\n[*Benedict Geihe*](https://www.mi.uni-koeln.de/NumSim/dr-benedict-geihe/),\n[*Michael Schlottke-Lakemper*](https://lakemper.eu)\n\n[PASC24](https://pasc24.pasc-conference.org/), ETH Zurich, June 3 to 5, 2024\n\n\n## Abstract\nWith [libtrixi](https://github.com/trixi-framework/libtrixi) we present a software library to control complex\nJulia code from a main program written in a different language. Specifically, libtrixi provides an API to\n[Trixi.jl](https://github.com/trixi-framework/Trixi.jl), a Julia package for adaptive numerical simulations of\nconservation laws, used to accurately predict naturally occurring processes in various areas of physics. Here a\nbroad range of spatial and temporal length scales render finely resolved computational grids indispensable and\ncall for high-performance computing techniques. Consequently, many simulation tools are written in traditional\nHPC languages such as C, C++, or Fortran, which offer high computational performance, but are often complex to\nlearn and maintain. The Julia programming language aims to combine convenience with performance by providing an\naccessible, high-level syntax together with fast, just-in-time-compiled execution. With libtrixi we present a blue\nprint for connecting established research codes to modern software packages written in Julia. We will give details\non the implementation of the interface library and show numerical applications in earth system modeling. These are\ncontrolled by a Fortran code and employ Trixi.jl’s distributed CPU compute capabilities.\n\n## Poster\nThe poster can be downloaded [here](poster.pdf).\n\n## Reproducibility\n\nThe instructions are written based on the supercomputer\n[JUWELS](https://www.fz-juelich.de/en/ias/jsc/systems/supercomputers/juwels), operated at\nJülich Supercomputing Centre, on which the results presented on the poster were obtained.\n\n### Getting started\n\nThe following standard software packages need to be made available locally before installing\n[libtrixi](https://github.com/trixi-framework/libtrixi):\n* C compiler with support for C11 or later (e.g., [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/))\n  (we used GCC v12.3.0)\n* Fortran compiler with support for Fortran 2018 or later (e.g., [Gfortran](https://gcc.gnu.org/fortran/))\n  (we used Gfortran v12.3.0)\n* [CMake](https://cmake.org/)\n  (we used cmake v3.26.3)\n* MPI (e.g., [Open MPI](https://www.open-mpi.org/) or [MPICH](https://www.mpich.org/))\n  (we used Open MPI v4.1.5)\n* [HDF5](https://www.hdfgroup.org/solutions/hdf5/)\n  (we used parallel HDF5 v1.14.2)\n* [Julia](https://julialang.org/downloads/platform/)\n  (it is advised to use tarballs from the official website or the `juliaup` manager, we used v1.10.3)\n* [Paraview](https://paraview.org) for visualization\n  (we used v5.12.0)\n\nThe following software packages require manual compilation and installation. To simplify\nthe installation instructions, we assume that the environment variable `WORKDIR` was set to the\ndirectory, where all the code is downloaded to and compiled, and `PREFIX` was set to an installation\nprefix. For example,\n```shell\nexport WORKDIR=$HOME/repro-poster-2024-pasc-libtrixi\nexport PREFIX=$WORKDIR/install\n```\n\n\n#### t8code\n\nt8code is a meshing library which is used in `Trixi.jl`. The source code can be obtained from the official\n[website](https://github.com/DLR-AMR/t8code). Here is an example for compiling and installing it (we used v2.0.0):\n\n```shell\ncd $WORKDIR\ngit clone --branch 'v2.0.0' --depth 1 https://github.com/DLR-AMR/t8code.git\ncd t8code\ngit submodule init\ngit submodule update\n./bootstrap\n./configure --prefix=\"${PREFIX}/t8code\" \\\n            CFLAGS=\"-Wall -O2\" \\\n            CXXFLAGS=\"-Wall -O2\" \\\n            --enable-mpi \\\n            CXX=mpicxx \\\n            CC=mpicc \\\n            --enable-static \\\n            --without-blas \\\n            --without-lapack\nmake\nmake install\n```\n\n\n#### libtrixi\n\nHere is an example for compiling and installing `libtrixi` (we used v0.1.5):\n\n```shell\ncd $WORKDIR\ngit clone --branch 'v0.1.5' --depth 1 https://github.com/trixi-framework/libtrixi.git\ncd libtrixi\nmkdir build\ncd build\ncmake -DCMAKE_BUILD_TYPE=Release \\\n      -DCMAKE_INSTALL_PREFIX=${PREFIX}/libtrixi ..\nmake\nmake install\n```\n\nA separate Julia project for use with libtrixi has to be set up:\n\n```shell\nmkdir ${PREFIX}/libtrixi-julia\ncd ${PREFIX}/libtrixi-julia\n${PREFIX}/libtrixi/bin/libtrixi-init-julia \\\n  --t8code-library ${PREFIX}/t8code/lib/libt8.so \\\n  ${PREFIX}/libtrixi\n```\n\nTo exactly reproduce the results presented on the poster, the provided [Manifest.toml](Manifest.toml)\ncan be used to install the same package versions for all Julia dependencies:\n\n```shell\ncp Manifest.toml ${PREFIX}/libtrixi-julia/\ncd ${PREFIX}/libtrixi-julia\nJULIA_DEPOT_PATH=./julia-depot \\\n  julia --project=. -e 'import Pkg; Pkg.instantiate()'\n```\n\nAlternatively all packages can be updated to the most recent version on demand:\n\n```shell\ncd ${PREFIX}/libtrixi-julia\nJULIA_DEPOT_PATH=./julia-depot \\\n  julia --project=. -e 'import Pkg; Pkg.update()'\n```\n\n\n#### Trixi2Vtk\n\n[Trixi2Vtk](https://github.com/trixi-framework/Trixi2Vtk.jl)\nneeds to be installed for later post processing (we used v0.3.15):\n\n```shell\ncd ${PREFIX}/libtrixi-julia\nJULIA_DEPOT_PATH=./julia-depot \\\n  julia --project=. -e 'import Pkg; Pkg.add(name=\"Trixi2Vtk\", version=\"0.3.15\")'\n```\n\n\n### Running the baroclinic instability simulation\n\nThe julia scripts for setting up simulations (*libelixirs*) can be found in the examples folder:\n```shell\nexport EXAMPLES=$PREFIX/libtrixi/share/libtrixi/LibTrixi.jl/examples\n```\n\nFor the results on the poster the resolution of the computational mesh was increased. For \nthis, modify line 128 of\n`${EXAMPLES}/libelixir_p4est3d_euler_baroclinic_instability.jl`\nsuch that `initial_refinement_level = 1`.\n\nWe used the following SLURM script to launch the simulation on JUWELS:\n```shell\n#!/bin/bash -x\n#SBATCH --nodes=128\n#SBATCH --ntasks-per-node=48\n\nmodule purge\nmodule load GCC\nmodule load OpenMPI\nmodule load HDF5/1.14.2\n\nsrun -n \"${SLURM_NTASKS}\" \\\n  ${PREFIX}/libtrixi/bin/trixi_controller_simple_f \\\n  ${PREFIX}/libtrixi-julia \\\n  ${EXAMPLES}/libelixir_p4est3d_euler_baroclinic_instability.jl\n```\n\nOutput files will be written to `./out_baroclinic` and need to be post processed:\n\n```shell\ncd ${PREFIX}/libtrixi/out_bubble\nJULIA_DEPOT_PATH=${PREFIX}/libtrixi-julia/julia-depot \\\n   julia --project=${PREFIX}/libtrixi-julia -e 'using Trixi2Vtk; trixi2vtk(\"solution*.h5\")'\n```\n\nThe results can now be viewed using, e.g., paraview.\nWe used [slice_surface.pvsm](slice_surface.pvsm) to generate our results.\n\n\n## Authors\nThis repository was initiated by\n[Benedict Geihe](https://www.mi.uni-koeln.de/NumSim/dr-benedict-geihe/)\nand [Michael Schlottke-Lakemper](https://lakemper.eu).\n\n\n## License\nThe contents of this repository are licensed under the MIT license (see [LICENSE.md](LICENSE.md)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrixi-framework%2Fposter-2024-pasc-libtrixi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrixi-framework%2Fposter-2024-pasc-libtrixi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrixi-framework%2Fposter-2024-pasc-libtrixi/lists"}