Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 26 additions & 1 deletion .github/workflows/idefix-ci-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
PYTHONPATH: ${{ github.workspace }}
IDEFIX_DIR: ${{ github.workspace }}


jobs:
ShocksHydro:
runs-on: self-hosted
Expand All @@ -35,6 +36,8 @@ jobs:
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/sod-iso -all $TESTME_OPTIONS
- name: Mach reflection test
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD//MachReflection -all $TESTME_OPTIONS
- name: Sedov blast wave
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/SedovBlastWave -all $TESTME_OPTIONS

ParabolicHydro:
runs-on: self-hosted
Expand Down Expand Up @@ -63,8 +66,10 @@ jobs:
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/sod-iso -all $TESTME_OPTIONS
- name: Orszag Tang
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang -all $TESTME_OPTIONS
- name: Orszag Tang 3D+restart tests
- name: Orszag Tang 3D
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang3D -all $TESTME_OPTIONS
- name: Linear wave test
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/LinearWaveTest -all $TESTME_OPTIONS
- name: Axis Flux tube
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/AxisFluxTube -all $TESTME_OPTIONS

Expand Down Expand Up @@ -207,3 +212,23 @@ jobs:
run: scripts/ci/run-tests $IDEFIX_DIR/test/utils/dumpImage -all $TESTME_OPTIONS
- name: Column density
run: scripts/ci/run-tests $IDEFIX_DIR/test/utils/columnDensity -all $TESTME_OPTIONS

IOs:
needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity]
runs-on: self-hosted
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restart dumps
run: scripts/ci/run-tests $IDEFIX_DIR/test/IO/dump -all $TESTME_OPTIONS
- name: Pydefix
run: |
python3 -m venv $IDEFIX_DIR/test/IO/pydefix/env
source $IDEFIX_DIR/test/IO/pydefix/env/bin/activate
python3 -m pip install -r $IDEFIX_DIR/test/IO/pydefix/python_requirements.txt
scripts/ci/run-tests $IDEFIX_DIR/test/IO/pydefix -all $TESTME_OPTIONS

- name: xdmf
run: scripts/ci/run-tests $IDEFIX_DIR/test/IO/xdmf -all $TESTME_OPTIONS
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,30 @@ if(Idefix_HDF5)
)
find_package(HDF5 REQUIRED)
target_link_libraries(idefix "${HDF5_LIBRARIES}")
target_include_directories(idefix "${HDF5_INCLUDE_DIRS}")
message(STATUS "Found HDF5 include directories: ${HDF5_INCLUDE_DIRS}")
target_include_directories(idefix PUBLIC "${HDF5_INCLUDE_DIRS}")
if(Idefix_MPI)
if(NOT HDF5_IS_PARALLEL)
message(FATAL_ERROR "Parallel HDF5 required for Idefix_MPI but the found HDF5 library does not support it")
endif()
endif()
message(STATUS "XDMF (hdf5+xmf) dumps enabled")
else()
set(Idefix_HDF5 OFF)
endif()

if(Idefix_PYTHON)
add_compile_definitions("WITH_PYTHON")
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)

execute_process(
COMMAND "${Python3_EXECUTABLE}" -m pybind11 --cmakedir
OUTPUT_VARIABLE PYBIND11_CMAKE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY
)

list(APPEND CMAKE_PREFIX_PATH "${PYBIND11_CMAKE_DIR}")
if (NOT DEFINED Python_FIND_FRAMEWORK)
set(Python_FIND_FRAMEWORK "LAST") # Use Apple's python only at last resort on Macos
endif ()
Expand Down
14 changes: 7 additions & 7 deletions src/output/xdmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,18 @@ int Xdmf::Write() {
idfx::pushRegion("Xdmf::Write");
fs::path filename;
fs::path filename_xmf;
hid_t err;
[[maybe_unused]] hid_t err;
idfx::cout << "Xdmf: Write file n " << xdmfFileNumber << "..." << std::flush;
timer.reset();

// Create a copy of the dataBlock on Host, and sync it.

#if DIMENSIONS == 1
int tot_dim = 1;
[[maybe_unused]] int tot_dim = 1;
#elif DIMENSIONS == 2
int tot_dim = 2;
#elif DIMENSIONS == 3
int tot_dim = 3;
[[maybe_unused]] int tot_dim = 3;
#endif

std::stringstream ssfileName, ssfileNameXmf, ssxdmfFileNum;
Expand Down Expand Up @@ -344,7 +344,8 @@ int Xdmf::Write() {
#endif

// Layout of the field data in memory
hsize_t field_data_size[3], field_data_start[3], field_data_subsize[3], stride[3];
[[maybe_unused]] hsize_t field_data_size[3], field_data_start[3];
[[maybe_unused]] hsize_t field_data_subsize[3], stride[3];
#ifdef WITH_MPI
for(int dir = 0; dir < 3 ; dir++) {
field_data_size[dir] = static_cast<hsize_t>(this->mpi_data_size[dir]);
Expand Down Expand Up @@ -454,11 +455,10 @@ void Xdmf::WriteHeader(
hid_t tspace, tattr;
hid_t unit_info, unit_attr;
hid_t group;
hid_t file_access = 0;
#ifdef WITH_MPI
hid_t plist_id_mpiio = 0; /* for collective MPI I/O */
#endif
hid_t err;
[[maybe_unused]] hid_t err;

hsize_t dimstr;

Expand Down Expand Up @@ -814,7 +814,7 @@ void Xdmf::WriteScalar(
dataset_name = var_name.c_str();
std::string dataset_label = dataset_name.c_str();
std::transform(dataset_label.begin(), dataset_label.end(), dataset_label.begin(), ::tolower);
hid_t err, dataset;
[[maybe_unused]] hid_t err, dataset;

// We define the dataset that contain the fields.

Expand Down
7 changes: 5 additions & 2 deletions src/pydefix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ py::array_t<real, py::array::c_style> GatherIdefixArray(IdefixHostArray3D<real>
// np_int: size that should be copied into global
// beg: offset in the incoming array where copy should begin
// gbeg: offset in the global array where copy should be begin
std::array<int,3> np_int,np_tot, beg, gbeg;
[[maybe_unused]] std::array<int,3> np_int,np_tot, beg, gbeg;
IdefixHostArray3D<real> buf;

if(rank==0) {
Expand Down Expand Up @@ -127,7 +127,7 @@ py::array_t<real, py::array::c_style> GatherIdefixArray(IdefixHostArray3D<real>
}// End loop on target rank for root process
} else { // MPI prank >0
std::array<int,3> np_int = dataHost.np_int;
std::array<int,3> np_tot = dataHost.np_tot;
[[maybe_unused]] std::array<int,3> np_tot = dataHost.np_tot;
std::array<int,3> gbeg = dataHost.gbeg;
std::array<int,3> beg = dataHost.beg;

Expand Down Expand Up @@ -278,6 +278,9 @@ Pydefix::Pydefix(Input &input) {
idfx::cout << "Pydefix: start Python interpreter." << std::endl;

py::initialize_interpreter();
py::exec("import sys; print(f'Pydefix: Python Version: {sys.version}')");
py::exec("print(f'Pydefix: Executable Path: {sys.executable}')");
py::exec("print(f'Pydefix: Sys Path: {sys.path}')");
}
this->scriptFilename = input.Get<std::string>("Python","script",0);
if(scriptFilename.substr(scriptFilename.length() - 3, 3).compare(".py")==0) {
Expand Down
4 changes: 3 additions & 1 deletion src/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// own implementation of the constructor, initflow and destructor

__attribute__((weak)) Setup::Setup(Input &input, Grid &grid, DataBlock &data, Output &output) {
IDEFIX_WARNING("Caution, this is the default Setup constructor and it does nothing!");
#ifndef WITH_PYTHON
IDEFIX_WARNING("Caution, this is the default Setup constructor and it does nothing!");
#endif
}

__attribute__((weak)) void Setup::InitFlow(DataBlock &data) {
Expand Down
5 changes: 2 additions & 3 deletions test/HD/SedovBlastWave/idefix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ X3-beg periodic
X3-end periodic

[Output]
vtk 0.1
xdmf 0.1
dmp 0.1
vtk 0.1
dmp 0.1
1 change: 1 addition & 0 deletions test/IO/dump/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable_idefix_property(Idefix_MHD)
5 changes: 5 additions & 0 deletions test/IO/dump/definitions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define COMPONENTS 3
#define DIMENSIONS 3
//#define DEBUG

#define GEOMETRY CARTESIAN
File renamed without changes.
Loading
Loading