Skip to content

[ENH] Customization feature to choose a directory for dumping of log files during runtime#270

Open
dutta-alankar wants to merge 11 commits into
idefix-code:developfrom
dutta-alankar:custom-log-dir
Open

[ENH] Customization feature to choose a directory for dumping of log files during runtime#270
dutta-alankar wants to merge 11 commits into
idefix-code:developfrom
dutta-alankar:custom-log-dir

Conversation

@dutta-alankar

Copy link
Copy Markdown
Contributor

Customization feature to choose a directory for dumping of log files

Often having a custom directory for dumping of log files is very useful to have the code files and executable separated from the location of data dumps. In this PR, this can be achieved by specifying log_dir in the Output block of idefix.ini. I remember that PLUTO already has such an option and it was quite helpful to me, personally as it prevented me to from accidentally overwriting the log files. I hope the developers find this a useful feature to have.

I tested with the KHI HD problem. Also sharing the relevant .ini file and the cmake command used is:
cmake $IDEFIX_DIR/ -DIdefix_MPI=ON -DIdefix_HDF5=ON -DCMAKE_CXX_FLAGS="-DXDMF_DOUBLE"

Contents of idefix.ini

[Grid]
X1-grid    1  0.0  1024  u  4.0
X2-grid    1  0.0  256   u  1.0
X3-grid    1  0.0  1     u  1.0

[TimeIntegrator]
CFL         0.2
tstop       5.0
first_dt    1.e-5
nstages     2

[Hydro]
solver    hllc
csiso     constant  10.0

[Boundary]
X1-beg    periodic
X1-end    periodic
X2-beg    outflow
X2-end    outflow
X3-beg    outflow
X3-end    outflow

[Output]
vtk    0.01
xdmf   0.01
vtk_dir     ./output
xdmf_dir    ./output
log_dir     ./output/Log_Files

@dutta-alankar

Copy link
Copy Markdown
Contributor Author

This has small changes in global.cpp and global.hpp. Let me know if that is acceptable. Otherwise, I'll think of a smarter way that would only change input.cpp and input.hpp.

@glesur glesur self-assigned this Sep 27, 2024
@glesur glesur added the enhancement New feature or request label Sep 27, 2024
glesur and others added 8 commits January 15, 2025 13:49
## [2.2.01] 2025-04-16
### Changed

- Fix a bug that led to instabilities in the RKL scheme with very small grid spacings (idefix-code#323)
- Fix a bug that prevented Idefix from running with Sycl backend (required on Intel GPUs) (idefix-code#331)
- Fix an error that led to incorrect electrical current regularisation around the polar axis in non-Ideal MHD  (idefix-code#333)
- Improve div(B) checks with a dimensionless implementation, avoiding too large divB errors in grids with large stretch factors (idefix-code#334)

### Added

- Time-Implicit drag for multiple dust species, preventing small time steps for strongly coupled dust grains (idefix-code#321)
- Collisionless heat flux added to the Braginskii module (idefix-code#317)
- New global `idfx::DumpArray` debugging function to dump any Idefix array into a numpy array that can read from python (idefix-code#318)
- Automatic benchmark plots in the documentation (idefix-code#319)
- More CI tests of grid coarsening (idefix-code#329)
- Dump outputs based on wallclock time (idefix-code#335)
---------

Co-authored-by: Victor Réville <victorreville@gmail.com>
Co-authored-by: Hal Bal <vreville@irap.omp.eu>
Co-authored-by: Jean Kempf <jean.kempf@irap.omp.eu>
Co-authored-by: Victor Réville <47865059+vreville@users.noreply.github.com>
Co-authored-by: Marc Coiffier <marc.coiffier@univ-grenoble-alpes.fr>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
## [2.2.02] 2025-10-18
### Changed

- Added a module to add explicit units (idefix-code#338)
- fixed a bug that could lead to incorrect profiling information on non-blocking cuda loops (idefix-code#341)
- fixed a bug that could lead to incorrect energy budget when shearing box and fargo were both enabled (idefix-code#346)
- fixed a bug that led to incorrect BX2 reconstruction when axis is not used on both sides of the domain (idefix-code#345)
- fixed a bug that led to incorrect reflective boundary conditions on B when DIMENSIONS < 3 (idefix-code#345)
- fixed a bug that led to incorrect dust stopping time when the adiabatic equation of state is used with "size" drag law (idefix-code#353)

### Added

- documentation for the continuous integration (idefix-code#354)
---------

Co-authored-by: Victor Réville <victorreville@gmail.com>
Co-authored-by: Hal Bal <vreville@irap.omp.eu>
Co-authored-by: Jean Kempf <jean.kempf@irap.omp.eu>
Co-authored-by: Victor Réville <47865059+vreville@users.noreply.github.com>
… with zizmor + pre-commit (idefix-code#373)

* SEC: switch GHA refs to immutable hashes with pinact

* SEC: disable default gha permissions

* SEC: avoid leaking credentials

* SEC: enable security audits with zizmor + pre-commit
### Changed

- fixed a bug that could lead to diverging results around the spherical axis in non-ideal MHD in 2.5D and 3D (idefix-code#356)
- refactor of the MPI exchange routines and boundary routines to avoid buildup of roundoff errors at domain faces/edges that could lead to the sudden burst of div(B) or incoherences between MPI sub-domains (idefix-code#357)
- fixed a bug that could lead to compilations error when targetting AMD APUs (idefix-code#359)
- fixed a bug that led to the generation of incorrect subviews in 2.5D with vector_potential enabled (idefix-code#362)
- fixed a bug that could lead to memory corruption when using the UCT_HLLD emf reconstruction scheme and DIMENSIONS < COMPONENTS  (idefix-code#363)
- reorganise the test to separate specific IO tests from physics tests (idefix-code#367)

### Added
- magnetic vector potential is now accessible from pydefix when enabled (idefix-code#361)
- use ccache in the test suite to reduce the runtime of continuous integration (idefix-code#364)
- automatically detects pybind11 path with cmake when using pydefix (idefix-code#367)
- skeleton to run the test suite with pytest (idefix-code#366)
---------------------------------------------------------------------------
Co-authored-by: Clément Robert <cr52@protonmail.com>
Co-authored-by: Sébastien Valat <sebastien.valat.dev@orange.fr>

@glesur glesur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this contribution, and apologies for the delay in getting back to you.

Comment thread src/global.cpp
std::stringstream sslogFileName;
sslogFileName << "idefix." << idfx::prank << ".log";

sslogFileName << idfx::logFileDir << "/./" << "idefix." << idfx::prank << ".log";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sslogFileName << idfx::logFileDir << "/./" << "idefix." << idfx::prank << ".log";
sslogFileName << idfx::logFileDir << "/" << "idefix." << idfx::prank << ".log";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants