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
2 changes: 2 additions & 0 deletions .github/workflows/dependencies/gcc-openmpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ python3 -m pip install -U pip setuptools wheel
python3 -m pip install -U cmake pytest
python3 -m pip install -r requirements_mpi.txt
python3 -m pip install -r examples/requirements.txt

python3 -m pip install -U openPMD-validator
2 changes: 2 additions & 0 deletions .github/workflows/dependencies/gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ sudo apt-get install -y \
python3 -m pip install -U pip setuptools wheel
python3 -m pip install -U cmake pytest
python3 -m pip install -r examples/requirements.txt

python3 -m pip install -U openPMD-validator
4 changes: 4 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
python3 -m pip install --upgrade pytest
python3 -m pip install -r requirements_mpi.txt
python3 -m pip install -r examples/requirements.txt
python3 -m pip install --upgrade openPMD-validator
set -e
- name: CCache Cache
uses: actions/cache@v3
Expand Down Expand Up @@ -93,3 +94,6 @@ jobs:
{ cat Backtrace.0.0; exit 1; }
impactx.MPI.OMP.DP.OPMD examples/fodo/input_fodo.in algo.particle_shape = 3 || \
{ cat Backtrace.0.0; exit 1; }
- name: validate created openPMD files
run: find build -name *.h5 | xargs -n1 -I{} openPMD_check_h5 -i {}
6 changes: 6 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
python3 examples/fodo/run_fodo.py
- name: validate created openPMD files
run: find build -name *.h5 | xargs -n1 -I{} openPMD_check_h5 -i {}

build_gcc_python:
name: GCC w/o MPI w/ Python
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -125,3 +128,6 @@ jobs:
cmake --build build --target pip_install
python3 examples/fodo/run_fodo.py
- name: validate created openPMD files
run: find build -name *.h5 | xargs -n1 -I{} openPMD_check_h5 -i {}
7 changes: 7 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
python3 -m pip install -U pip setuptools wheel pytest
python3 -m pip install -r requirements.txt
python3 -m pip install -r examples/requirements.txt
python3 -m pip install -U openPMD-validator
- name: Build
run: |
$env:HDF5_DIR = "C:/Program Files/HDF_Group/HDF5/1.12.2/cmake/"
Expand All @@ -81,6 +82,8 @@ jobs:
if(!$?) { Exit $LASTEXITCODE }
cmake --build build --config RelWithDebInfo --target pip_install
if(!$?) { Exit $LASTEXITCODE }
- name: validate created openPMD files
run: Get-ChildItem -Path build -Recurse -Filter *.h5 | %{openPMD_check_h5 -i $_}

build_win_clang:
name: Clang w/ OMP w/o MPI
Expand Down Expand Up @@ -137,6 +140,7 @@ jobs:
python3 -m pip install -U pip setuptools wheel pytest
python3 -m pip install -r requirements.txt
python3 -m pip install -r examples/requirements.txt
python3 -m pip install -U openPMD-validator
- name: Build
shell: cmd
run: |
Expand Down Expand Up @@ -175,3 +179,6 @@ jobs:
# if errorlevel 1 exit 1
# cmake --build build --target pip_install
# if errorlevel 1 exit 1

- name: validate created openPMD files
run: Get-ChildItem -Path build -Recurse -Filter *.h5 | %{openPMD_check_h5 -i $_}
4 changes: 3 additions & 1 deletion src/particles/elements/diagnostics/openPMD.H
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ namespace detail

/** Prepare entering the element before starting push logic.
*
* @param[in] pc particle container.
* @param[in] pc particle container
* @param[in] ref_part reference particle
* @param[in] step global step for diagnostics
*/
void prepare (
PinnedContainer & pc,
RefPart const & ref_part,
int step
);

Expand Down
16 changes: 15 additions & 1 deletion src/particles/elements/diagnostics/openPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ namespace detail

void BeamMonitor::prepare (
PinnedContainer & pc,
RefPart const & ref_part,
int step
) {
#ifdef ImpactX_USE_OPENPMD
Expand Down Expand Up @@ -253,6 +254,17 @@ namespace detail
getComponentRecord(component_name).resetDataset(d_fl);
}
}

// openPMD coarse position
{
beam["positionOffset"]["x"].resetDataset(d_fl);
beam["positionOffset"]["x"].makeConstant(ref_part.x);
beam["positionOffset"]["y"].resetDataset(d_fl);
beam["positionOffset"]["y"].makeConstant(ref_part.y);
beam["positionOffset"]["ct"].resetDataset(d_fl);
beam["positionOffset"]["ct"].makeConstant(ref_part.t);
Comment on lines +264 to +265
Copy link
Member Author

@ax3l ax3l Apr 24, 2023

Choose a reason for hiding this comment

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

@cemitch99 here for positionOffset and in position, do we want to output s+delta s instead of ct + c*dt?

Copy link
Member

Choose a reason for hiding this comment

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

Not sure I follow what the intended output is here. I understand that by "ct" you mean "ref_part.t", but what is meant by "dt"? Does this represent one or more particle values of the "t" coordinate?

In general, I would say that "s" is qualitatively different from the other variables like ct. It is an independent variable, it is associated only with the reference particle, and the other (beam particle) values are given as functions of "s".

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, ah yes I was confused for a second... So per particle, splitting the longitudinal position (for a fixed s) into ref_part.t (should we call this ref_part.ct?) and position.ct makes sense...

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's true.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, will do in #350

}

// AoS: Int
beam["id"][scalar].resetDataset(d_ui);

Expand Down Expand Up @@ -298,7 +310,7 @@ namespace detail
*/

// prepare element access
this->prepare(pinned_pc, step);
this->prepare(pinned_pc, ref_part, step);

// loop over refinement levels
int const nLevel = pinned_pc.finestLevel();
Expand All @@ -320,6 +332,8 @@ namespace detail
auto series = std::any_cast<io::Series>(m_series);
io::WriteIterations iterations = series.writeIterations();
io::Iteration iteration = iterations[m_step];

// close iteration
iteration.close();
}

Expand Down