Open iplasma opened 1 year ago
Time freezing can be tricky to use. If particles should have been moving, the plasma response would be wrong, and letting them move suddenly could make discontinuities. I am not sure how stable the code would be in that case
In my case, time_frozen is used to save some simulation time before a laser propagates to the plasma. For this test input file, the plasma should be neutral and the field should be small, so I don't understand why time_frozen would matter. I just tried reducing the plasma density by 100x, the simulation crashes with the same error.
Would it be possible to have the first ionization process occuring on a frozen species at time t=7. ?
It should be related to the ionization process. The simulation with ionize_model="none" seems to run fine with time_frozen. BTW, smilei_test also crashes with this test input file.
Then unfreezing a frozen particle which has been ionized is probably the cause of the problem. You probably need to unfreeze the species before the first ionization occurs. Or keep it frozen the whole time.
smilei_test
runs fine on my system with your input file. Which error do you get ?
I may misunderstand the meaning of time_frozen here. Is it only applied to the pusher? I was thinking it should be applied to the ionization processes too, which would be convenient to skip those along with particle pushes until a specific time. If the ionization/collisions calculations are active since the beginning of the simulation, unfreezing those species perhaps would be problematic. So is there another way to control when to turn on the ionization/collision?
The smilei_test problem is probably specific to the aocc compiler, with gnu compiler it works fine. Below is the error message with aocc compiler.
----- TEST MODE WITH INTENDED PARTITION 1x1-----
_ _
___ _ | | _ \ \ Version : 4.7-1037-g81d858dd9-HEAD
/ __| _ __ (_) | | ___ (_) | |
\__ \ | ' \ _ | | / -_) _ | |
|___/ |_|_|_| |_| |_| \___| |_| | |
/_/
Reading the simulation parameters
--------------------------------------------------------------------------------
HDF5 version 1.12.2
Python version 3.9.16
Parsing pyinit.py
Parsing 4.7-1037-g81d858dd9-HEAD
Parsing pyprofiles.py
Parsing inp.master.py
Parsing pycontrol.py
Check for function preprocess()
python preprocess function does not exist
Calling python _smilei_check
Calling python _keep_python_running() :
CAREFUL: Patches distribution: hilbertian
[WARNING](0) src/Params/Params.cpp:1123 (compute) simulation_time has been redefined from 20000.000000 to 19999.996800 to match timestep.
Geometry: 1Dcartesian
--------------------------------------------------------------------------------
Interpolation order : 2
Maxwell solver : Yee
simulation duration = 19999.996800, total number of iterations = 4081632
timestep = 0.004900 = 0.980000 x CFL, time resolution = 204.081633
Grid length: 808.96
Cell length: 0.005, 0, 0
Number of cells: 161792
Spatial resolution: 200
Electromagnetic boundary conditions
--------------------------------------------------------------------------------
xmin silver-muller, absorbing vector [1]
xmax silver-muller, absorbing vector [-1]
Vectorization:
--------------------------------------------------------------------------------
Mode: off
Initializing MPI
--------------------------------------------------------------------------------
MPI_THREAD_MULTIPLE enabled
Number of MPI processes: 1
Number of threads per MPI process : 1
OpenMP task parallelization not activated
Number of patches: 2048
Number of cells in one patch: 79
Dynamic load balancing: never
Initializing the restart environment
--------------------------------------------------------------------------------
Initializing species
--------------------------------------------------------------------------------
Creating Species #0: carbon
> Pusher: boris
CAREFUL: For species 'carbon' possible conflict between time-frozen & not cold initialization
> Species frozen until time: 18.000000
> Boundary conditions: remove remove
> Density profile: 1D built-in profile `constant` (value: 0.010000)
Creating Species #1: hydrogen
> Pusher: boris
CAREFUL: For species 'hydrogen' possible conflict between time-frozen & not cold initialization
> Species frozen until time: 18.000000
> Boundary conditions: remove remove
> Density profile: 1D built-in profile `constant` (value: 0.010000)
Creating Species #2: elec
> Pusher: boris
CAREFUL: For species 'elec' possible conflict between time-frozen & not cold initialization
> Species frozen until time: 18.000000
> Boundary conditions: remove remove
> Density profile: 1D built-in profile `constant` (value: 0.030000)
Initializing Patches
--------------------------------------------------------------------------------
First patch created
All patches created
Stack trace (most recent call last):
#7 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#6 Object "/global/Work/smilei_github/Smilei/smilei_test", at 0x40c959, in _start
#5 Object "/lib64/libc.so.6", at 0x7fcca65e424c, in __libc_start_main
#4 Object "/global/Work/smilei_github/Smilei/smilei_test", at 0x8e1585, in main
#3 Object "/global/Work/smilei_github/Smilei/smilei_test", at 0x8e56fd, in executeTestMode(VectorPatch&, Region&, SmileiMPI*, SimWindow*, Params&, Checkpoint&, OpenPMDparams&, RadiationTables*)
#2 Object "/global/Work/smilei_github/Smilei/smilei_test", at 0x8e6e3b, in PatchesFactory::createVector(VectorPatch&, Params&, SmileiMPI*, OpenPMDparams&, RadiationTables*, unsigned int, unsigned int)
#1 Object "/global/Work/smilei_github/Smilei/smilei_test", at 0x7e6829, in VectorPatch::updateFieldList(SmileiMPI*)
#0 Object "/global/Work/smilei_github/Smilei/smilei_test", at 0x91022b, in AsyncMPIbuffers::defineTags(Patch*, SmileiMPI*, int)
Segmentation fault (Address not mapped to object [0x168])
For a reason I cannot remember, the ionization process is not frozen. @beck-llr is there a good reason, for example in the case of LWFA?
Yes there are simulations where you want a frozen ion background that can still be ionized and generate (non frozen) electrons.
As I see it frozen species skip pusher and projector because the don't move therefore do not deposit current. Interpolation is still done if ionization is turned on otherwise it is skipped too.
Something to try: turn off the ionization and dump a checkpoint at the time you want to start ionization. Do a restart with ionization turned on ? that might work ...
Sounds like a good idea. I will try and report back.
Yes, turning on ionization in a restart run from a previous frozen run without ionization works fine. Thanks for this idea. Still, it requires manual changes and would be nice to have a variable to turn on/off the ionization just like time_frozen. .
@beck-llr I am not sure I understand why your solution works. What is the problem about unfreezing ionized atoms?
Hi,
With the attached test input file and latest master branch of Smilei, the simulation will crash with message as follows. This appears to be related to the time_frozen variable, for example, if it is set to a value between 0 and 6, the code seems to run fine, but it crashes for time_frozen = 7.0, which is very strange. Any idea of what could be wrong?
Parameters
Smilei version: 4.7-1037-g81d858dd9-HEAD
C++ compiler : both AOCC and gnu
Input file