Comments (16)
Thank you for suggesting this. I actually had the same comment a few days ago from a colleague.
from smilei.
ok, sent again, hopefully right person this time :)
from smilei.
Admittedly the 'flush_every' function helps reduce the chance of the HDF5 file being corrupted during a write while it's running, so part of what I said is not quite right, but the problem still exists that some bits of data at the end of the HDF5 files is miswritten sometimes during a crash.
from smilei.
Sorry, bad code in previous thing, this recreates the probes hdf5 file (at least I think it does) and seems to work all of the time as far as I have tested:
`
import h5py
f_dest = h5py.File("Probes0_fixed.h5", "w")
f_src = h5py.File("Probes0.h5", "r")
for key in f_src:
try:
f_dest.create_dataset_like(str(key), f_src[key])
f_dest[key][()] = f_src[key][()]
for attrib in f_src[key].attrs.keys():
f_dest[key].attrs.create(attrib, f_src[key].attrs[attrib])
except KeyError:
print("faulty key = " + str(key))
for attrib in f_src.attrs.keys():
f_dest.attrs.create(attrib, f_src.attrs[attrib])
`
from smilei.
Just to note when I use the above script it doesn't always work. The individual attributes must also be tested before the key is written to the new H5 file as sometimes a key can be correctly created but not filled with attributes correctly.
from smilei.
Do you have an idea of to reproduce this? I cannot get a corrupted file
from smilei.
from smilei.
It does not happen on my system for some reason. Would you be able to produce a small example and send it with dropbox or equivalent?
from smilei.
from smilei.
It does not happen on my system for some reason. Would you be able to produce a small example and send it with dropbox or equivalent?
I've sent you a link in element chat
from smilei.
I have not received it. My name on element is fredpz
from smilei.
from smilei.
from smilei.
I made a change for happi in the develop branch. Could you test it?
from smilei.
Yes, that seems to allow me to access files which I couldn't before, thanks! That's eliminated a step which was quite annoying and will save me some time too, really appreciated!
from smilei.
Just to be clear, with the old version I tried to access a broken probes0.h5 file and got this error:
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/media/david_blackman/left_external/broadband/simulation_results/bandwidth/redone_diags/fixed_ions/narrow/../../../../py1D/make_signal_files.py", line 193, in start
signal = Ez_probe.getData()
File "/home/david_blackman/codes/smilei_new/Smilei/happi/_Diagnostics/Diagnostic.py", line 163, ingetData
data.append( self._dataAtTime(t) )
File "/home/david_blackman/codes/smilei_new/Smilei/happi/_Diagnostics/Diagnostic.py", line 862, in_dataLinAtTime
A = self._getDataAtTime(t)
File "/home/david_blackman/codes/smilei_new/Smilei/happi/_Diagnostics/Probe.py", line 372, in _getDataAtTime
data = self._dataForTime[t][n,first:last]
TypeError: 'NoneType' object is not subscriptable
Now I get no error and successfully build up my probe signals so I can process them properly.!
from smilei.
Related Issues (20)
- Operations between quantities in Scalar Diagnostic HOT 1
- Tasks Parallelisation HOT 2
- Initial phase for LaserGaussian3D HOT 2
- Explanation/example for ParticleBinning units HOT 2
- EM_boundary_conditions set as "PML" in 3Dcartesian is ok? HOT 5
- The Screen diagnostic Data at instantaneous time step. HOT 1
- Clarification on the Screen diagnostic HOT 1
- Shortcut to profiles in the documentation HOT 7
- Segmentation faults HOT 30
- Segmentation fault HOT 16
- Unit conversion in PostProcess HOT 1
- Adjusting gridGlobalOffset and temporal offset HOT 7
- Keeping track of number of MPI processes and OpenMP threads HOT 3
- Beam current distribution in LWFA through AM HOT 1
- Error with "Collisions" block HOT 2
- Enabling Prescribed Field for AM Geometry
- Magnetic field in TrackParticle and ParticleBinning diagnostics HOT 21
- Force final step to be restartable option HOT 2
- 'cannot convert float NaN to integer' error when opening Track Particles Diagnostic HOT 13
- Thermal boundary condition HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smilei.