Open mrakitin opened 7 years ago
I tested by setting the number of macro electrons down to 2, sorry.
That's fine. I'll check what's going wrong there.
I'm not seeing this error:
Calculation will be sequential (non-parallel), because "mpi4py" module can not be loaded
i= 0 Electron Coord.: x= -2.74452048352e-05 x'= -5.30201947148e-06 y= 3.33399322641e-06 y'= 8.88316322966e-07 E= 3.00238284361
i= 1 Electron Coord.: x= 2.94014986023e-05 x'= -3.43237532114e-06 y= -1.01652414766e-06 y'= -5.38704099806e-06 E= 3.00112419227
i= 2 Electron Coord.: x= 2.30356693789e-05 x'= 1.81178681222e-06 y= 2.70769424073e-06 y'= 1.69800387734e-06 E= 3.00249151578
i= 3 Electron Coord.: x= -4.12356508492e-05 x'= -2.36273974903e-05 y= 2.75360743031e-06 y'= 4.41985214074e-06 E= 2.99916732752
i= 4 Electron Coord.: x= 6.21094516163e-05 x'= -1.07174990888e-05 y= -1.19992938014e-06 y'= -3.97142680411e-06 E= 3.0004317949
i= 5 Electron Coord.: x= 7.3260748751e-05 x'= 7.79653887459e-06 y= 2.44371077004e-06 y'= -1.38341144966e-06 E= 2.99982473891
i= 6 Electron Coord.: x= 4.1509977579e-05 x'= -1.04050744888e-05 y= 5.52057700099e-06 y'= 1.56349806772e-06 E= 2.99922713544
i= 7 Electron Coord.: x= 9.59965901195e-06 x'= -1.88606855745e-05 y= 1.24538799667e-06 y'= -2.67208857646e-06 E= 3.00118094599
i= 8 Electron Coord.: x= 2.53495969248e-05 x'= 7.48612653311e-06 y= 5.81342573793e-07 y'= -4.05367374664e-06 E= 3.00299184895
i= 9 Electron Coord.: x= -4.13070513812e-05 x'= 4.35930554132e-06 y= -1.01591946856e-07 y'= 2.91897196637e-06 E= 3.00038364949
I'm running Sierra (10.12.3).
Do you see __srwl_logs__
dir? Did it exist before? I would remove it and try to run this calculation again, since it fails create this directory due to the rank=1 instead of 0 in https://github.com/mrakitin/SRW/blob/53ee934e95c81055d268535cf9994750ea82d538/env/work/srw_python/srwlib.py#L3870.
No, there is no __srwl_logs__
directory. I ran the example again. Then I ran it after creating __srwl_logs__
. It ran fine, but didn't write any output there, but it did write to data_example_10/.
That's strange - it's an old behavior and it should not happen in the most recent version. Do you have the latest changes from https://github.com/mrakitin/SRW/tree/master?
Just did a clean build of master and still no errors and an empty __srwl_logs__
directory.
ah, logs just showed up. :)
i= 3 Electron Coord.: x= -4.12356508492e-05 x'= -2.36273974903e-05 y= 2.75360743031e-06 y'= 4.41985214074e-06 E= 2.99916732752
i= 4 Electron Coord.: x= 6.21094516163e-05 x'= -1.07174990888e-05 y= -1.19992938014e-06 y'= -3.97142680411e-06 E= 3.0004317949
i= 5 Electron Coord.: x= 7.3260748751e-05 x'= 7.79653887459e-06 y= 2.44371077004e-06 y'= -1.38341144966e-06 E= 2.99982473891
i= 6 Electron Coord.: x= 4.1509977579e-05 x'= -1.04050744888e-05 y= 5.52057700099e-06 y'= 1.56349806772e-06 E= 2.99922713544
i= 7 Electron Coord.: x= 9.59965901195e-06 x'= -1.88606855745e-05 y= 1.24538799667e-06 y'= -2.67208857646e-06 E= 3.00118094599
C-c C-cTraceback (most recent call last):
File "/Users/nagler/src/mrakitin/SRW/env/work/srw_python/srwlib.py", line 4455, in srwl_wfr_emit_prop_multi_e
srwl.CalcElecFieldSR(wfr, 0, _mag, arPrecParSR) #calculate Electric Field emitted by current electron
KeyboardInterrupt
i= 8 Electron Coord.: x= 2.53495969248e-05 x'= 7.48612653311e-06 y= 5.81342573793e-07 y'= -4.05367374664e-06 E= 3.00299184895
C-c C-cTraceback (most recent call last):
File "/Users/nagler/src/mrakitin/SRW/env/work/srw_python/srwlib.py", line 4471, in srwl_wfr_emit_prop_multi_e
srwl.PropagElecField(wfr, _opt_bl) #propagate Electric Field emitted by the electron
RuntimeError: External (callback) function falied to modify (/ reallocate memory for) wavefront data.
i= 9 Electron Coord.: x= -4.13070513812e-05 x'= 4.35930554132e-06 y= -1.01591946856e-07 y'= 2.91897196637e-06 E= 3.00038364949
C-c C-cTraceback (most recent call last):
File "/Users/nagler/src/mrakitin/SRW/env/work/srw_python/srwlib.py", line 4471, in srwl_wfr_emit_prop_multi_e
srwl.PropagElecField(wfr, _opt_bl) #propagate Electric Field emitted by the electron
RuntimeError: External (callback) function falied to modify (/ reallocate memory for) wavefront data.
C-c C-cTraceback (most recent call last):
File "SRWLIB_Example10.py", line 217, in <module>
os.path.join(os.getcwd(), strExDataFolderName, strIntPropME_OutFileName), sampFactNxNyForProp, optBL)
File "/Users/nagler/src/mrakitin/SRW/env/work/srw_python/srwlib.py", line 4509, in srwl_wfr_emit_prop_multi_e
wfr.calc_stokes(workStokes) #calculate Stokes parameters from Electric Field
File "/Users/nagler/src/mrakitin/SRW/env/work/srw_python/srwlib.py", line 1610, in calc_stokes
_stokes.arS[i + nTot3] = 2*(-reEx*reEy + imEx*imEy) #check sign
KeyboardInterrupt
[2.7.9;@ski srw_python]$ ls -al __srwl_logs__/
total 16
drwxr-x--- 4 nagler staff 136 Feb 2 07:55 .
drwxr-x--- 67 nagler staff 2278 Feb 2 07:53 ..
-rw------- 1 nagler staff 152 Feb 2 07:55 srwl_stat_wfr_emit_prop_multi_e_2017-02-02_07-54-25.json
-rw-r----- 1 nagler staff 70 Feb 2 07:55 srwl_stat_wfr_emit_prop_multi_e_2017-02-02_07-54-25.log
OK, I see. Thanks Rob. Do you use Python 2 or 3?
I've been testing with 2.7.9. In general, we use py2.
OK, I've reproduced the problem. It's not related to Mac, but rather to the mpi4py
library. If it's not installed, the rank is 1, which does not trigger the directory creation. I'll change the name of the ticket and will fix the issue.
Too many 1st priorities, reduce priority to 2nd. Will take care of it after other 1st priority issues are solved.
Example 10 fails on Mac after the 4th step with the error: