Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
36e8c24
ensure that Fargo can't be used with too low DIMENSIONS (#250)
glesur Jul 9, 2024
cb5117c
Doc fix (#251)
glesur Jul 9, 2024
040592b
fix #252 (#253)
glesur Jul 19, 2024
0a6193d
avoid implicit conversion to double in VTK I/O routines (#255)
glesur Jul 26, 2024
1859ad5
set built type as default (allow user override) (#256)
nicolasaunai Aug 7, 2024
e5ca2b5
Make shockFlattening public (#257)
vdbma Sep 9, 2024
a020a3f
Check for successful write in serial (#260)
glesur Sep 13, 2024
3629695
[FIX] xdmf datatype agnostic dump (#261)
dutta-alankar Sep 16, 2024
dcaefdf
Update setup.cpp.rst (#264)
ThomasJannaudCAM Sep 20, 2024
6657a0a
Minor correction to have the filesystem header same as dump and vtk (…
dutta-alankar Sep 27, 2024
427982a
MNT: fix linting with cpplint 2.0.0 (#279)
neutrinoceros Oct 11, 2024
84c1763
STY: locally disable linting around #include <filesystem> (#281)
neutrinoceros Oct 12, 2024
9d92bfe
Simplify input file for DIMENSIONS < 3 setups (#274)
glesur Oct 13, 2024
0b79b28
MNT: auto-upgrade pre-commit hooks (#278)
neutrinoceros Oct 19, 2024
0c3ce8a
Update to numpy 2+
vdbma Oct 18, 2024
6c95183
Included numpy to ruff
vdbma Oct 21, 2024
10725f7
Merge pull request #283 from vdbma/FixIdfxIO
neutrinoceros Oct 21, 2024
45fcfd6
fix arch for nvidia architectures
glesur Oct 22, 2024
d9466ab
add central mass in the restart dump. (#287)
aborderies Oct 22, 2024
ec0594d
Reduce roundoff error on div(B) when using grid coarsening (#284)
glesur Oct 23, 2024
d44c53f
add Changelog (new version)
glesur Oct 23, 2024
8c1bff4
update version number
glesur Oct 23, 2024
153d957
Merge branch 'develop' into v2.1.02
glesur Oct 23, 2024
7972c35
update changelog
glesur Oct 23, 2024
46d1973
update JZ documentation
glesur Oct 24, 2024
a2a0189
-move to Kokkos 4.4 (#289)
glesur Oct 24, 2024
4267c4f
Merge branch 'fixConfigDoc' into develop
glesur Oct 24, 2024
3226d65
Merge branch 'develop' into v2.1.02
glesur Oct 24, 2024
951a0a9
update Changelog
glesur Oct 24, 2024
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
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exclude: "^(src/kokkos)"
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace # auto-fix trailing whitespaces
- id: end-of-file-fixer # add EOF "\n" if missing
Expand All @@ -23,7 +23,7 @@ repos:


- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
rev: v0.6.9
hooks:
- id: ruff
args:
Expand All @@ -33,14 +33,15 @@ repos:
- F # pyflakes
- B # flake8-bugbear
- I # isort
- NPY # numpy-specific rules

- repo: https://github.com/neutrinoceros/inifix
rev: v4.4.0
rev: v5.0.2
hooks:
- id: inifix-format

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
rev: v1.5.5
hooks:
- id: remove-tabs # auto-fix tab/space mixing
- id: insert-license
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.02] 2024-10-24
### Changed

- Fix a bug that could lead to corrupted VTK file when using single precision arithmetic (#255)
- Fix a bug that could lead to incorrect central mass gravitational potential upon restart (#287)
- Changed the way magnetic field is reconstructed when using grid coarsening to reduce roundoff errors on div(B). This can have an impact on the results of models using grid coarsening+MHD (#284)
- Ensure that XDMF outputs are precision agnostic (#261)
- Bump up Kokkos version to 4.4.01 (#289)
- Check that writes are successfull in serial, otherwise throw an error (#260)
- Ensure that shock flattening flags can be modified by user (#260)
- Throw an error when user enables Fargo without enough DIMENSIONS (#250)
- Fix linting errors following upgrade to cpplint 2.0 (#278, #279, #281)
- Update idfx_io to numpy 2.0 (#283)

### Added

- Allow the user to define the grid and boundary conditions only on active dimensions (#274)
- Configuration for Nvidia H100 on Jean Zay in the documentation


## [2.1.01] 2024-06-20
### Changed
- Fix a bug that could result in too restrictive timesteps when resistivity is enabled (#244)
Expand Down
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
cmake_minimum_required(VERSION 3.16)
set(CMAKE_BUILD_TYPE Release)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
set (CMAKE_CXX_STANDARD 17)

set(Idefix_VERSION_MAJOR 2)
set(Idefix_VERSION_MINOR 1)
set(Idefix_VERSION_PATCH 01)
set(Idefix_VERSION_PATCH 02)

project (idefix VERSION 2.1.00)
project (idefix VERSION 2.1.02)
option(Idefix_MHD "enable MHD" OFF)
option(Idefix_MPI "enable Message Passing Interface parallelisation" OFF)
option(Idefix_HIGH_ORDER_FARGO "Force Fargo to use a PPM reconstruction scheme" OFF)
Expand Down Expand Up @@ -43,10 +45,12 @@ include(SetRequiredBuildSettingsForGCC8)
#Idefix requires Cuda Lambdas (experimental)
if(Kokkos_ENABLE_CUDA)
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Idefix requires lambdas on Cuda" FORCE)
set(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC OFF CACHE BOOL "Disable Async malloc to avoid bugs on PSM2" FORCE)
endif()

# Add kokkos CMAKE files (required early since these set compiler options)
add_subdirectory(src/kokkos build/kokkos)
include_directories(${Kokkos_INCLUDE_DIRS_RET})

# Add Idefix CXX Flags
add_compile_options(${Idefix_CXX_FLAGS})
Expand Down
2 changes: 2 additions & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ filter=-whitespace/comma # 6027 errors
filter=-whitespace/comments # 881 errors
filter=-whitespace/operators # 5240 errors
filter=-whitespace/parens # 413 error
filter=-whitespace/newline
filter=-whitespace/indent_namespace
filter=-readability/multiline_string
filter=-build/include_subdir # 296 errors
#filter=-whitespace/end_of_line
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = 'Geoffroy Lesur'

# The full version, including alpha/beta/rc tags
release = '2.1.01'
release = '2.1.02'



Expand Down
6 changes: 3 additions & 3 deletions doc/source/performances.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Performances

We report below the performances obtained on various architectures using Idefix. The reference test
is the 3D MHD Orszag-Tang test problem with 2nd order reconstruction and uct_contact EMFS bundled in
Idefix test suite, computed with a 128\ :sup:`3` resolution per MPI sub-domain on GPUs or 32\ :sup:`3`
per MPI sub-domain on CPUs. All of the performances measures have been obtained enabling MPI on
*one full node*, but we report here the performance *per GPU*
Idefix test suite, disabling passive tracers. The test is computed with a 128\ :sup:`3` resolution per
MPI sub-domain on GPUs or 32\ :sup:`3` per MPI sub-domain on CPUs. All of the performances measures
have been obtained enabling MPI on *one full node*, but we report here the performance *per GPU*
(i.e. with 2 GCDs on AMD Mi250) or *per core* (on CPU), i.e. dividing the node performance by the number of GPU/core
to simplify the comparison with other clusters.

Expand Down
6 changes: 3 additions & 3 deletions doc/source/reference/idefix.ini.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ allows for comments, which should start with ``#``.

``Grid`` section
--------------------
The grid section defines the grid total dimension. It consists of 3 entries ``X1-grid``, ``X2-grid`` and ``X3-grid``. Each entry defines the repartition of the grid points in the corresponding direction (the grid is always rectilinear).
The grid section defines the grid total dimension. It consists of 3 entries ``X1-grid``, ``X2-grid`` (when DIMENSIONS>=2) and ``X3-grid`` (when DIMENSIONS=3). Each entry defines the repartition of the grid points in the corresponding direction (the grid is always rectilinear).
Each entry defines a series of grid blocks which are concatenated along the direction. Each block in a direction can have a different spacing rule (uniform, log or stretched). The definition of the Grid entries is as follows

+----------------------------+-------------------------+------------------------------+
Expand Down Expand Up @@ -332,8 +332,8 @@ this block is simply ignored.
------------------------

This section describes the boundary conditions used by the code. There are 6 entries
which need to be defined: ``X1-beg``, ``X2-beg``, ``X3-beg`` for the left boundaries in the direction X1, X2, X3,
and ``X1-end``, ``X2-end``, ``X3-end`` for the right boundaries. Each boundary can be assigned the following types of conditions
that need to be defined: ``X1-beg``, ``X2-beg``, ``X3-beg`` for the left boundaries in the direction X1, X2, X3,
and ``X1-end``, ``X2-end``, ``X3-end`` for the right boundaries. ``X2`` boundaries are mandatory only when DIMENSIONS>=2 and ``X3`` when DIMENSIONS=3. Each boundary can be assigned the following types of conditions

+----------------+------------------------------------------------------------------------------------------------------------------+
| Boundary type | Comment |
Expand Down
42 changes: 33 additions & 9 deletions doc/source/reference/makefile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,37 +125,61 @@ Finally, *Idefix* can be configured to run on Mi250 by enabling HIP and the desi

.. code-block:: bash

-DKokkos_ENABLE_HIP=ON -DKokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATION=ON -DKokkos_ARCH_VEGA90A=ON
-DKokkos_ENABLE_HIP=ON -DKokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS=ON -DKokkos_ARCH_VEGA90A=ON


MPI (multi-GPU) can be enabled by adding ``-DIdefix_MPI=ON`` as usual.

Jean Zay at IDRIS, Nvidia V100 and A100 GPUs
--------------------------------------------
Jean Zay at IDRIS, Nvidia V100/A100/H100 GPUs
---------------------------------------------

We recommend the following modules and environement variables on Jean Zay:
We recommend the following modules and environement variables on Jean Zay V100/A100:

.. code-block:: bash

module load arch/a100 # ONLY forA100
module load cuda/12.1.0
module load gcc/12.2.0
module load openmpi/4.1.1-cuda
module load cmake/3.18.0
module load cmake/3.25.2

While for H100:

.. code-block:: bash

module load arch/h100
module load cmake/3.30.1
module load cuda/12.1.0
module load openmpi/4.1.5-cuda

*Idefix* can then be configured to run on Nvidia V100 with the following options to ccmake:

.. code-block:: bash

-DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_VOLTA70=ON -DKokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC=OFF
-DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_VOLTA70=ON

While Ampere A100 GPUs are enabled with

.. code-block:: bash

-DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_AMPERE80=ON -DKokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC=OFF
-DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON

And for H100 GPUS:

.. code-block:: bash

-DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_HOPPER90=ON


MPI (multi-GPU) can be enabled by adding ``-DIdefix_MPI=ON`` as usual.


.. warning::

As of *Idefix* 2.1.02, we automatically disable Cuda Malloc async (``-DKokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC=OFF``). However, earlier versions of
*Idefix* requires this flag when calling cmake to prevent a bug when using PSM2 with async Cuda malloc possibly leading to openmpi crash or hangs on Jean Zay.


MPI (multi-GPU) can be enabled by adding ``-DIdefix_MPI=ON`` as usual. The malloc async option is here to prevent a bug when using PSM2 with async
Cuda malloc possibly leading to openmpi crash or hangs on Jean Zay.

.. _setupSpecificOptions:

Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/setup.cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ assuming we want to create a dump from ``mydump.dmp``:
int iglob=i-2*d.beg[IDIR]+d.gbeg[IDIR];
int jglob=j-2*d.beg[JDIR]+d.gbeg[JDIR];
int kglob=k-2*d.beg[KDIR]+d.gbeg[KDIR];
d.Vs(BX1s,k,j,i) = image->arrays["Vs-BX1s"](kglob,jglob,iglob);
d.Vs(BX1s,k,j,i) = image.arrays["Vs-BX1s"](kglob,jglob,iglob);
}}}

// And so on for the other components
Expand Down
2 changes: 1 addition & 1 deletion pytools/idfx_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, fh, byteorder="little"):
dims = []
for dim in range(self.ndims):
dims.append(int.from_bytes(fh.read(INT_SIZE), byteorder))
ntot = int(np.product(dims))
ntot = int(np.prod(dims))
raw = struct.unpack(str(ntot) + "d", fh.read(DOUBLE_SIZE * ntot))
self.array = np.asarray(raw).reshape(dims[::-1])

Expand Down
2 changes: 2 additions & 0 deletions src/dataBlock/dataBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// ***********************************************************************************

#include <algorithm>
#include <memory>
#include <string>
#include "idefix.hpp"
#include "dataBlock.hpp"
#include "fluid.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/dataBlock/dataBlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <string>
#include <map>
#include <memory>
#include <cstdio>

#include "idefix.hpp"
#include "grid.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/dataBlock/dataBlockHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Licensed under CeCILL 2.1 License, see COPYING for more information
// ***********************************************************************************

#include <vector>
#include "idefix.hpp"
#include "dataBlockHost.hpp"
#include "fluid.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/dataBlock/dumpToFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Licensed under CeCILL 2.1 License, see COPYING for more information
// ***********************************************************************************

#include <string>
#include <cstdio>
#include "../idefix.hpp"
#include "dataBlock.hpp"
#include "version.hpp"
Expand Down
6 changes: 6 additions & 0 deletions src/dataBlock/fargo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ Fargo::Fargo(Input &input, int nmax, DataBlock *data) {
}

#if GEOMETRY == CARTESIAN || GEOMETRY == POLAR
#if DIMENSIONS < 2
IDEFIX_ERROR("Fargo should be used with DIMENSIONS >= 2 in Cartesian or Polar geometries");
#endif
// Check if there is a domain decomposition in the intended fargo direction
if(data->mygrid->nproc[JDIR]>1) {
haveDomainDecomposition = true;
Expand All @@ -80,6 +83,9 @@ Fargo::Fargo(Input &input, int nmax, DataBlock *data) {
this->meanVelocity = IdefixArray2D<real>("FargoVelocity",data->np_tot[KDIR],
data->np_tot[IDIR]);
#elif GEOMETRY == SPHERICAL
#if DIMENSIONS < 3
IDEFIX_ERROR("Fargo should be used with DIMENSIONS == 3 in Spherical geometry");
#endif
// Check if there is a domain decomposition in the intended fargo direction
if(data->mygrid->nproc[KDIR]>1) {
haveDomainDecomposition = true;
Expand Down
14 changes: 9 additions & 5 deletions src/dataBlock/planetarySystem/planetarySystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ indirect term, with multiple planets that don't feel each others.");
IDEFIX_ERROR("need to define a planet-to-primary mass ratio via planetToPrimary");
}
#if GEOMETRY == POLAR || GEOMETRY == CARTESIAN
if ((this->data->mygrid->xbeg[KDIR] == 0)
|| (this->data->mygrid->xend[KDIR] == 0)) {
this->halfdisk = true;
} else {
#if DIMENSIONS == 3
if ((this->data->mygrid->xbeg[KDIR] == 0)
|| (this->data->mygrid->xend[KDIR] == 0)) {
this->halfdisk = true;
} else {
this->halfdisk = false;
}
#else // DIMENSIONS == 3
this->halfdisk = false;
}
#endif // DIMENSIONS == 3
#elif GEOMETRY == SPHERICAL
if ( (this->data->mygrid->xbeg[JDIR] == M_PI/2.0)
|| (this->data->mygrid->xend[JDIR] == M_PI/2.0)) {
Expand Down
4 changes: 2 additions & 2 deletions src/fluid/RiemannSolver/riemannSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class RiemannSolver {
template<int dir>
ExtrapolateToFaces<Phys, dir>* GetExtrapolator();

std::unique_ptr<ShockFlattening<Phys>> shockFlattening;

private:
template <typename P, int dir, PLMLimiter L, int O>
friend class ExtrapolateToFaces;
Expand All @@ -75,8 +77,6 @@ class RiemannSolver {

Solver mySolver;

std::unique_ptr<ShockFlattening<Phys>> shockFlattening;

// Because each direction is a different template, we can't use
std::unique_ptr<ExtrapolateToFaces<Phys,IDIR>> slopeLimIDIR;
std::unique_ptr<ExtrapolateToFaces<Phys,JDIR>> slopeLimJDIR;
Expand Down
1 change: 1 addition & 0 deletions src/fluid/boundary/axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Licensed under CeCILL 2.1 License, see COPYING for more information
// ***********************************************************************************

#include <vector>
#include "axis.hpp"
#include "boundary.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/fluid/boundary/boundary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void Boundary<Phys>::EnrollFluxBoundary(UserDefBoundaryFuncOld myFunc) {

IDEFIX_WARNING(msg);
this->fluxBoundaryFuncOld = myFunc;
this->haveUserDefBoundary = true;
this->haveFluxBoundary = true;
}

template<typename Phys>
Expand Down
1 change: 1 addition & 0 deletions src/fluid/checkNan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#ifndef FLUID_CHECKNAN_HPP_
#define FLUID_CHECKNAN_HPP_
#include <iostream>
#include "dataBlock.hpp"
#include "dataBlockHost.hpp"
#include "fluid.hpp"
Expand Down
Loading