hightower8083 / synchrad

Synchrotron Radiation calculator via openCL
GNU General Public License v3.0
18 stars 11 forks source link

PIC example broken? #13

Closed berceanu closed 4 years ago

berceanu commented 4 years ago
Running on 1 devices
  Starting without device: 
Platform: None
Compiler: None
Traceback (most recent call last):
  File "compute_spectrum.py", line 18, in <module>
    file_spectrum="spectrum.h5",)
  File "/home/berceanu/Development/synchrad/synchrad/calc.py", line 44, in calculate_spectrum
    self._init_raditaion(comp, nSnaps)
  File "/home/berceanu/Development/synchrad/synchrad/calc.py", line 293, in _init_raditaion
    arrcl.zeros(self.queue, radiation_shape, dtype=self.dtype)
AttributeError: 'SynchRad' object has no attribute 'queue'

Steps to reproduce:

$ git checkout dev
$ cd example/PIC
$ python fbpic_lwfa_script.py # produces diags/ and diags_track/
$ python extract_tracks.py # produces tracks.h5
$ python compute_spectrum.py # produces above error, instead of spectrum.h5
hightower8083 commented 4 years ago

Hi Andrei

Yes, I forgot to inform -- I have done some major modifs and had to re-adapt tests. As you may see now track and spectra files are more self-consistent and user friendly. This error is however note related to the changes but is just that when checking the tests, I've set ctx to [0,0] for my machine (i've nvidia and pocl platforms) and have forgotten to comment it.. I've updated the example -- now it will ask you to choose the context, so it should be fine.