ECP-WarpX / WarpX

WarpX is an advanced, time-based electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
276 stars 176 forks source link

Assertion `dims == dims_compiled' #4605

Open rl3418 opened 5 months ago

rl3418 commented 5 months ago

I compiled Warpx with cmake -S . -B build -DWarpX_DIMS="1;2;RZ;3" -DWarpX_PSATD=ON -DWarpX_PYTHON=ON cmake --build build -j 4

This is the shell script I used to compile the code compile.txt

and these are the build outputs warpx_build_log2.txt warpx_build_log.txt

I then tried to run a 3D test simulation using mpirun run.txt input.txt

This returned with an error message saying Assertion `dims == dims_compiled' failed. It said the the selected executable was built as '3'-dimensional, and the input file does not declare 'geometry.dims'. I cloned the input file from $WarpX/Examples/Physics_applications/plasma acceleration/inputs_3d_boost, and it does declare that geometry.dims = 3.

This is the log file for the run run_log.txt

rl3418 commented 5 months ago

I tried to test if launching warpx through python works, but warpx was built as a static library. Python import only support dynamic libraries. Is there a flag to compile warpx as a dynamics library?

ax3l commented 5 months ago

Hi @rl3418,

Thanks for the details. I think there is a typo in your job script in the mpirun line. It reads

mpirun -n 4 $BIN_DIR/warpx.3d -w $OUTDIR 3D > output.txt

but the warpx.3d executable has no -w ... argument.

Did you mean to write

mpirun -n 4 -w $OUTDIR $BIN_DIR/warpx.3d 3D > output.txt

?

rl3418 commented 5 months ago

Thanks for the reply, that seems to be working.

As for running WarpX through python, WarpX is built as a static library. Python import searches for .so file. It doesn't recognise the .a files for static libraries. Is there an option to built WarpX as a dynamic library? Or is there an easy way to import static libraries?