hibtc / madgui

GUI for accelerator simulations using MAD-X
https://hibtc.github.io/madgui
Other
3 stars 2 forks source link

Reading in lattice #22

Closed rainswor closed 7 years ago

rainswor commented 7 years ago

I'm having a issue get a Recycler lattice to run on madqt

I'm using the following bmad file as the input (from the bmad install)

$DIST_BASE_DIR/tao/examples/custom_tao_with_measured_data/RRNOVAMU2E11172016.bmad

I'm using python27 and qt5. Running

python -m madqt

and then opening the bmad file above i get the following error

 python -m madqt
Traceback (most recent call last):
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/core/menu.py", line 32, in <lambda>
    self.callback = lambda: callback()
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/core/mainwindow.py", line 187, in fileOpen
    self.loadFile(filename)
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/core/mainwindow.py", line 305, in loadFile
    self.setWorkspace(Workspace(filename, self.config))
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/engine/tao.py", line 68, in __init__
    super(Workspace, self).__init__(filename, app_config)
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/engine/common.py", line 72, in __init__
    self.load(filename)
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/engine/common.py", line 79, in load
    self.load_dispatch(name, ext)
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/engine/tao.py", line 77, in load_dispatch
    self.load_lattice_file(name)
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/engine/tao.py", line 94, in load_lattice_file
    self.init('-lat', filename, '-noinit', **kw)
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/engine/tao.py", line 107, in init
    self.segment = Segment(self, self.data.get('sequence'))
  File "build/bdist.macosx-10.12-x86_64/egg/madqt/engine/tao.py", line 150, in __init__
    el_names = self.tao.get_list('lat_ele_list', self.unibra)
  File "build/bdist.macosx-10.12-x86_64/egg/pytao/tao.py", line 165, in get_list
    return _parse_list(self.python(*qualname))
  File "build/bdist.macosx-10.12-x86_64/egg/pytao/tao.py", line 97, in python
    self.command('python', '-noprint', *command)
  File "build/bdist.macosx-10.12-x86_64/egg/pytao/tao.py", line 87, in command
    self.pipe.command(join_args(command))
  File "build/bdist.macosx-10.12-x86_64/egg/minrpc/client.py", line 139, in DeferredMethod
    funcname, args, kwargs)
  File "build/bdist.macosx-10.12-x86_64/egg/minrpc/client.py", line 92, in _request
    raise RemoteProcessCrashed()

I get no error using pytao inside the python interpreter and running tao = Tao('-lat', 'RRNOVAMU2E11172016.bmad', '-noplot', '-gui_mode')

DavidSagan commented 7 years ago

I can reproduce this. The full listing of the crash I get is:

XXX:erpsim1:~/dcs16/TaoGui/test> madqt fermi.bmad
*** Error in `/home/dcs16/dcs16/usr_local/bin/python': malloc(): smallbin double linked list corrupted: 0x00000000028674b0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7ada4)[0x7ffb136ddda4]
/lib64/libc.so.6(+0x7ddc7)[0x7ffb136e0dc7]
/lib64/libc.so.6(__libc_malloc+0x4c)[0x7ffb136e2fbc]
/home/dcs16/dcs16/usr_local/lib/python3.5/lib-dynload/_pickle.cpython-35m-x86_64-linux-gnu.so(+0x65ca)[0x7ffb1244c5ca]
/home/dcs16/dcs16/usr_local/lib/python3.5/lib-dynload/_pickle.cpython-35m-x86_64-linux-gnu.so(+0x12511)[0x7ffb12458511]
/home/dcs16/dcs16/usr_local/bin/python(PyCFunction_Call+0xd9)[0x5a3f59]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x8cd2)[0x4fde72]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x87e5)[0x4fd985]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x87e5)[0x4fd985]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x87e5)[0x4fd985]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x87e5)[0x4fd985]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x87e5)[0x4fd985]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x87e5)[0x4fd985]
/home/dcs16/dcs16/usr_local/bin/python[0x4fec80]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalCode+0x1f)[0x4fed6f]
/home/dcs16/dcs16/usr_local/bin/python[0x4f2e6e]
/home/dcs16/dcs16/usr_local/bin/python(PyCFunction_Call+0xb9)[0x5a3f39]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x8cd2)[0x4fde72]
/home/dcs16/dcs16/usr_local/bin/python[0x4fec80]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalFrameEx+0x5b96)[0x4fad36]
/home/dcs16/dcs16/usr_local/bin/python[0x4fec80]
/home/dcs16/dcs16/usr_local/bin/python(PyEval_EvalCodeEx+0x23)[0x4fed43]
/home/dcs16/dcs16/usr_local/bin/python[0x59eb36]
/home/dcs16/dcs16/usr_local/bin/python(PyObject_Call+0x5e)[0x437a0e]
/home/dcs16/dcs16/usr_local/bin/python[0x41faab]
/home/dcs16/dcs16/usr_local/bin/python(Py_Main+0x651)[0x420421]
/home/dcs16/dcs16/usr_local/bin/python(main+0x157)[0x41c3f7]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7ffb13684b35]
/home/dcs16/dcs16/usr_local/bin/python[0x41c499]
======= Memory map: ========
00400000-00655000 r-xp 00000000 00:34 64771308                           /nfs/acc/user/dcs16/usr_local/bin/python3.5
00854000-008bd000 rw-p 00254000 00:34 64771308                           /nfs/acc/user/dcs16/usr_local/bin/python3.5
008bd000-008ee000 rw-p 00000000 00:00 0 
01e28000-07543000 rw-p 00000000 00:00 0                                  [heap]
7ffaec000000-7ffaec021000 rw-p 00000000 00:00 0 
7ffaec021000-7ffaf0000000 ---p 00000000 00:00 0 
7ffaf3ac1000-7ffb0581d000 rw-p 00000000 00:00 0 
7ffb09d5f000-7ffb0e4b6000 rw-p 00000000 00:00 0 
7ffb0e4b6000-7ffb0e4cb000 r-xp 00000000 fd:00 50608                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ffb0e4cb000-7ffb0e6ca000 ---p 00015000 fd:00 50608                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ffb0e6ca000-7ffb0e6cb000 r--p 00014000 fd:00 50608                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ffb0e6cb000-7ffb0e6cc000 rw-p 00015000 fd:00 50608                      /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ffb0e6cc000-7ffb0e707000 r-xp 00000000 fd:00 415386                     /usr/lib64/libquadmath.so.0.0.0
7ffb0e707000-7ffb0e906000 ---p 0003b000 fd:00 415386                     /usr/lib64/libquadmath.so.0.0.0
7ffb0e906000-7ffb0e907000 r--p 0003a000 fd:00 415386                     /usr/lib64/libquadmath.so.0.0.0
7ffb0e907000-7ffb0e908000 rw-p 0003b000 fd:00 415386                     /usr/lib64/libquadmath.so.0.0.0
7ffb0e908000-7ffb0e92d000 r-xp 00000000 fd:00 50549                      /usr/lib64/libtinfo.so.5.9
7ffb0e92d000-7ffb0eb2d000 ---p 00025000 fd:00 50549                      /usr/lib64/libtinfo.so.5.9
7ffb0eb2d000-7ffb0eb31000 r--p 00025000 fd:00 50549                      /usr/lib64/libtinfo.so.5.9
7ffb0eb31000-7ffb0eb32000 rw-p 00029000 fd:00 50549                      /usr/lib64/libtinfo.so.5.9
7ffb0eb32000-7ffb0ec51000 r-xp 00000000 fd:00 1326144                    /usr/lib64/libgfortran.so.3.0.0
7ffb0ec51000-7ffb0ee51000 ---p 0011f000 fd:00 1326144                    /usr/lib64/libgfortran.so.3.0.0
7ffb0ee51000-7ffb0ee53000 r--p 0011f000 fd:00 1326144                    /usr/lib64/libgfortran.so.3.0.0
7ffb0ee53000-7ffb0ee55000 rw-p 00121000 fd:00 1326144                    /usr/lib64/libgfortran.so.3.0.0
7ffb0ee55000-7ffb0ee91000 r-xp 00000000 fd:00 202376                     /usr/lib64/libreadline.so.6.2
7ffb0ee91000-7ffb0f091000 ---p 0003c000 fd:00 202376                     /usr/lib64/libreadline.so.6.2
7ffb0f091000-7ffb0f093000 r--p 0003c000 fd:00 202376                     /usr/lib64/libreadline.so.6.2
7ffb0f093000-7ffb0f099000 rw-p 0003e000 fd:00 202376                     /usr/lib64/libreadline.so.6.2
7ffb0f099000-7ffb0f09b000 rw-p 00000000 00:00 0 
7ffb0f09b000-7ffb0fcb3000 r-xp 00000000 00:34 65150115                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao_pipe.cpython-35m-x86_64-linux-gnu.so
7ffb0fcb3000-7ffb0feb2000 ---p 00c18000 00:34 65150115                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao_pipe.cpython-35m-x86_64-linux-gnu.so
7ffb0feb2000-7ffb0fed2000 r--p 00c17000 00:34 65150115                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao_pipe.cpython-35m-x86_64-linux-gnu.so
7ffb0fed2000-7ffb11bbf000 rw-p 00c37000 00:34 65150115                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao_pipe.cpython-35m-x86_64-linux-gnu.so
7ffb11bbf000-7ffb12243000 rw-p 00000000 00:00 0 
7ffb12243000-7ffb12245000 r-xp 00000000 00:34 65150057                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
7ffb12245000-7ffb12445000 ---p 00002000 00:34 65150057                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
7ffb12445000-7ffb12446000 rw-p 00002000 00:34 65150057                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
7ffb12446000-7ffb1245d000 r-xp 00000000 00:34 65150101                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_pickle.cpython-35m-x86_64-linux-gnu.so
7ffb1245d000-7ffb1265d000 ---p 00017000 00:34 65150101                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_pickle.cpython-35m-x86_64-linux-gnu.so
7ffb1265d000-7ffb12661000 rw-p 00017000 00:34 65150101                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_pickle.cpython-35m-x86_64-linux-gnu.so
7ffb12661000-7ffb126a1000 rw-p 00000000 00:00 0 
7ffb126a1000-7ffb126a9000 r-xp 00000000 00:34 65150086                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_struct.cpython-35m-x86_64-linux-gnu.so
7ffb126a9000-7ffb128a9000 ---p 00008000 00:34 65150086                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_struct.cpython-35m-x86_64-linux-gnu.so
7ffb128a9000-7ffb128ac000 rw-p 00008000 00:34 65150086                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_struct.cpython-35m-x86_64-linux-gnu.so
7ffb128ac000-7ffb128b7000 r-xp 00000000 00:34 65150092                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
7ffb128b7000-7ffb12ab7000 ---p 0000b000 00:34 65150092                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
7ffb12ab7000-7ffb12ab9000 rw-p 0000b000 00:34 65150092                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
7ffb12ab9000-7ffb12abe000 r-xp 00000000 00:34 65150078                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
7ffb12abe000-7ffb12cbd000 ---p 00005000 00:34 65150078                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
7ffb12cbd000-7ffb12cbf000 rw-p 00004000 00:34 65150078                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
7ffb12cbf000-7ffb12cc2000 r-xp 00000000 00:34 65150071                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
7ffb12cc2000-7ffb12ec1000 ---p 00003000 00:34 65150071                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
7ffb12ec1000-7ffb12ec2000 rw-p 00002000 00:34 65150071                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
7ffb12ec2000-7ffb12f82000 rw-p 00000000 00:00 0 
7ffb12f82000-7ffb12f97000 r-xp 00000000 fd:00 50622                      /usr/lib64/libz.so.1.2.7
7ffb12f97000-7ffb13196000 ---p 00015000 fd:00 50622                      /usr/lib64/libz.so.1.2.7
7ffb13196000-7ffb13197000 r--p 00014000 fd:00 50622                      /usr/lib64/libz.so.1.2.7
7ffb13197000-7ffb13198000 rw-p 00015000 fd:00 50622                      /usr/lib64/libz.so.1.2.7
7ffb13198000-7ffb1319e000 r-xp 00000000 00:34 65150100                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/zlib.cpython-35m-x86_64-linux-gnu.so
7ffb1319e000-7ffb1339d000 ---p 00006000 00:34 65150100                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/zlib.cpython-35m-x86_64-linux-gnu.so
7ffb1339d000-7ffb1339f000 rw-p 00005000 00:34 65150100                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/zlib.cpython-35m-x86_64-linux-gnu.so
7ffb1339f000-7ffb1341f000 rw-p 00000000 00:00 0 
7ffb1341f000-7ffb13421000 r-xp 00000000 00:34 65150104                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
7ffb13421000-7ffb13620000 ---p 00002000 00:34 65150104                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
7ffb13620000-7ffb13623000 rw-p 00001000 00:34 65150104                   /nfs/acc/user/dcs16/usr_local/lib/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
7ffb13623000-7ffb13663000 rw-p 00000000 00:00 0 
7ffb13663000-7ffb13819000 r-xp 00000000 fd:00 37112                      /usr/lib64/libc-2.17.so
7ffb13819000-7ffb13a19000 ---p 001b6000 fd:00 37112                      /usr/lib64/libc-2.17.so
7ffb13a19000-7ffb13a1d000 r--p 001b6000 fd:00 37112                      /usr/lib64/libc-2.17.so
7ffb13a1d000-7ffb13a1f000 rw-p 001ba000 fd:00 37112                      /usr/lib64/libc-2.17.so
7ffb13a1f000-7ffb13a24000 rw-p 00000000 00:00 0 
7ffb13a24000-7ffb13b24000 r-xp 00000000 fd:00 1913437                    /usr/lib64/libm-2.17.so
7ffb13b24000-7ffb13d24000 ---p 00100000 fd:00 1913437                    /usr/lib64/libm-2.17.so
7ffb13d24000-7ffb13d25000 r--p 00100000 fd:00 1913437                    /usr/lib64/libm-2.17.so
7ffb13d25000-7ffb13d26000 rw-p 00101000 fd:00 1913437                    /usr/lib64/libm-2.17.so
7ffb13d26000-7ffb13d2d000 r-xp 00000000 fd:00 1913443                    /usr/lib64/librt-2.17.so
7ffb13d2d000-7ffb13f2c000 ---p 00007000 fd:00 1913443                    /usr/lib64/librt-2.17.so
7ffb13f2c000-7ffb13f2d000 r--p 00006000 fd:00 1913443                    /usr/lib64/librt-2.17.so
7ffb13f2d000-7ffb13f2e000 rw-p 00007000 fd:00 1913443                    /usr/lib64/librt-2.17.so
7ffb13f2e000-7ffb13f30000 r-xp 00000000 fd:00 37146                      /usr/lib64/libutil-2.17.so
7ffb13f30000-7ffb1412f000 ---p 00002000 fd:00 37146                      /usr/lib64/libutil-2.17.so
7ffb1412f000-7ffb14130000 r--p 00001000 fd:00 37146                      /usr/lib64/libutil-2.17.so
7ffb14130000-7ffb14131000 rw-p 00002000 fd:00 37146                      /usr/lib64/libutil-2.17.so
7ffb14131000-7ffb14133000 r-xp 00000000 fd:00 1888715                    /usr/lib64/libdl-2.17.so
7ffb14133000-7ffb14333000 ---p 00002000 fd:00 1888715                    /usr/lib64/libdl-2.17.so
7ffb14333000-7ffb14334000 r--p 00002000 fd:00 1888715                    /usr/lib64/libdl-2.17.so
7ffb14334000-7ffb14335000 rw-p 00003000 fd:00 1888715                    /usr/lib64/libdl-2.17.so
7ffb14335000-7ffb1434c000 r-xp 00000000 fd:00 37138                      /usr/lib64/libpthread-2.17.so
7ffb1434c000-7ffb1454b000 ---p 00017000 fd:00 37138                      /usr/lib64/libpthread-2.17.so
7ffb1454b000-7ffb1454c000 r--p 00016000 fd:00 37138                      /usr/lib64/libpthread-2.17.so
7ffb1454c000-7ffb1454d000 rw-p 00017000 fd:00 37138                      /usr/lib64/libpthread-2.17.so
7ffb1454d000-7ffb14551000 rw-p 00000000 00:00 0 
7ffb14551000-7ffb14571000 r-xp 00000000 fd:00 37104                      /usr/lib64/ld-2.17.so
7ffb14598000-7ffb145d8000 rw-p 00000000 00:00 0 
7ffb14609000-7ffb1474e000 rw-p 00000000 00:00 0 
7ffb1476e000-7ffb14770000 rw-p 00000000 00:00 0 
7ffb14770000-7ffb14771000 r--p 0001f000 fd:00 37104                      /usr/lib64/ld-2.17.so
7ffb14771000-7ffb14772000 rw-p 00020000 fd:00 37104                      /usr/lib64/ld-2.17.so
7ffb14772000-7ffb14773000 rw-p 00000000 00:00 0 
7ffe2b30e000-7ffe2b32e000 rwxp 00000000 00:00 0                          [stack]
7ffe2b32e000-7ffe2b32f000 rw-p 00000000 00:00 0 
7ffe2b347000-7ffe2b349000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Traceback (most recent call last):
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/minrpc-0.0.3-py3.5.egg/minrpc/client.py", line 90, in _request
    response = self._conn.recv()
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/minrpc-0.0.3-py3.5.egg/minrpc/connection.py", line 47, in recv
    return pickle.load(self._recv)
EOFError: Ran out of input

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/core/mainwindow.py", line 119, in loadDefault
    self.loadFile(self.searchFile(filename))
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/core/mainwindow.py", line 344, in loadFile
    self.setWorkspace(Workspace(filename, self.config))
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/tao.py", line 70, in __init__
    super(Workspace, self).__init__(filename, app_config)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/common.py", line 72, in __init__
    self.load(filename)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/common.py", line 79, in load
    self.load_dispatch(name, ext)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/tao.py", line 79, in load_dispatch
    self.load_lattice_file(name)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/tao.py", line 96, in load_lattice_file
    self.init('-lat', filename, '-noinit', **kw)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/tao.py", line 112, in init
    self.segment = Segment(self, self.data.get('sequence'))
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/tao.py", line 160, in __init__
    self.elements = ElementList(el_names, self.get_element_data)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/common.py", line 323, in __init__
    self.update()
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/common.py", line 327, in update
    beg, end = self[0], self[-1]
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/common.py", line 353, in __getitem__
    return self._get_by_index(index)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/common.py", line 414, in _get_by_index
    el = self._cached[index] = self._get_data(index)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/common.py", line 187, in get_element_data
    return self.utool.dict_add_unit(self.get_element_data_raw(index, which))
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/MadQt-0.0.0-py3.5.egg/madqt/engine/tao.py", line 166, in get_element_data_raw
    data = merged(self.tao.get_element_data(index, who='general'),
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao.py", line 310, in get_element_data
    universe, branch, ix_ele, which, who
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao.py", line 213, in properties
    return self._parse_dict(self.python(*qualname))
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao.py", line 170, in python
    self.command('python', '-noprint', *command)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/pytao-0.0.0-py3.5-linux-x86_64.egg/pytao/tao.py", line 138, in command
    self.pipe.command(join_args(command))
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/minrpc-0.0.3-py3.5.egg/minrpc/client.py", line 139, in DeferredMethod
    funcname, args, kwargs)
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/minrpc-0.0.3-py3.5.egg/minrpc/client.py", line 92, in _request
    raise RemoteProcessCrashed()
minrpc.client.RemoteProcessCrashed
^CException ignored in: <bound method Client.__del__ of <minrpc.client.Client object at 0x7f27c426bf98>>
Traceback (most recent call last):
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/minrpc-0.0.3-py3.5.egg/minrpc/client.py", line 48, in __del__
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/minrpc-0.0.3-py3.5.egg/minrpc/client.py", line 69, in close
  File "/home/dcs16/dcs16/usr_local/lib/python3.5/site-packages/minrpc-0.0.3-py3.5.egg/minrpc/connection.py", line 53, in send
BrokenPipeError: [Errno 32] Broken pipe
DavidSagan commented 7 years ago

Basic problem is that madqt fails when there are too many lattice elements. A simple lattice that demonstrates this is:

parameter[geometry] = open

beginning[e_tot]    = 400e+9

beginning[beta_a]   = 44
beginning[beta_b]   = 44
beginning[alpha_a]  = -7
beginning[alpha_b]  = -1

bb: quadrupole, l = 0.1

seq: line = (200*bb)

use, seq
coldfix commented 7 years ago

I logged the commands that madqt is using and tried to execute them with tao directly, I get a segmentation fault as follows:

% tao -lat RRNOVAMU2E11172016.bmad -noinit -noplot -gui_mode < /home/thomas/hit/dev/madqt/RRNOVAMU2E11172016kv_mwH.commands.tao.2 
[INFO] tao_init:
    Note: global%rf_on = False  -->  RFCavities will be turned off in lattices
Using startup file: tao.startup

Tao: ! pingread is a custom command

Tao: pingread b data/VerKick_VerticalBPMs_refVP605.txt
[ERROR | 2017-JUN-12 20:08:26] tao_command:
    UNRECOGNIZED COMMAND: pingread b data/VerKick_VerticalBPMs_refVP605.txt
[WARNING] tao_abort_command_file:
    ABORTING COMMAND FILE: tao.startup

Tao> set global lattice_calc_on = F

Tao> place * none

Tao> place * none

Tao> python -noprint lat_general 1

Tao> python -noprint lat_ele_list 1@0

(...)

Tao> python -noprint lat_ele1 1@0>>27|model multipole

Tao> python -noprint lat_ele1 1@0>>28|model general

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f26ef1ed6ef in ???
#1  0x7f26ef235c5d in ???
#2  0x7f26ef236fb7 in ???
#3  0x7f26efe5d307 in data_transfer_init
    at /build/gcc-multilib/src/gcc/libgfortran/io/transfer.c:2791
#4  0x53a28b in ???
#5  0x46d670 in ???
#6  0x465125 in ???
#7  0x464f04 in ???
#8  0x7f26ef1da439 in ???
#9  0x464f39 in ???
#10  0xffffffffffffffff in ???
[1]    29613 segmentation fault (core dumped)  tao -lat RRNOVAMU2E11172016.bmad -noinit -noplot -gui_mode < 

The first few lines of the commands file are as follows:

set global lattice_calc_on = F
place * none
place * none
python -noprint lat_general 1
python -noprint lat_ele_list 1@0
python -noprint lat_ele1 1@0>>0|model general
python -noprint enum mat6_calc_method
python -noprint enum tracking_method
python -noprint enum spin_tracking_method
python -noprint enum ptc_integration_type
python -noprint enum field_calc
python -noprint enum aperture_at
python -noprint enum aperture_type
python -noprint lat_ele1 1@0>>0|model parameters
python -noprint lat_ele1 1@0>>0|model multipole
python -noprint lat_ele1 1@0>>12402|model general
python -noprint lat_ele1 1@0>>12402|model parameters
python -noprint lat_ele1 1@0>>12402|model multipole
python -noprint lat_ele1 1@0>>1|model general
python -noprint lat_ele1 1@0>>1|model parameters
python -noprint lat_ele1 1@0>>1|model multipole
python -noprint lat_ele1 1@0>>2|model general
python -noprint lat_ele1 1@0>>2|model parameters
python -noprint lat_ele1 1@0>>2|model multipole
python -noprint lat_ele1 1@0>>3|model general
python -noprint lat_ele1 1@0>>3|model parameters
python -noprint enum FRINGE_TYPE
python -noprint enum FRINGE_AT
python -noprint lat_ele1 1@0>>3|model multipole
python -noprint lat_ele1 1@0>>4|model general
python -noprint lat_ele1 1@0>>4|model parameters
python -noprint lat_ele1 1@0>>4|model multipole
python -noprint lat_ele1 1@0>>5|model general
python -noprint lat_ele1 1@0>>5|model parameters
python -noprint lat_ele1 1@0>>5|model multipole
python -noprint lat_ele1 1@0>>6|model general
python -noprint lat_ele1 1@0>>6|model parameters
python -noprint lat_ele1 1@0>>6|model multipole
python -noprint lat_ele1 1@0>>7|model general
python -noprint lat_ele1 1@0>>7|model parameters
python -noprint lat_ele1 1@0>>7|model multipole
python -noprint lat_ele1 1@0>>8|model general
python -noprint lat_ele1 1@0>>8|model parameters
python -noprint lat_ele1 1@0>>8|model multipole
python -noprint lat_ele1 1@0>>9|model general
python -noprint lat_ele1 1@0>>9|model parameters
python -noprint lat_ele1 1@0>>9|model multipole
python -noprint lat_ele1 1@0>>10|model general
python -noprint lat_ele1 1@0>>10|model parameters
python -noprint lat_ele1 1@0>>10|model multipole
python -noprint lat_ele1 1@0>>11|model general
python -noprint lat_ele1 1@0>>11|model parameters
python -noprint lat_ele1 1@0>>11|model multipole
python -noprint lat_ele1 1@0>>12|model general
python -noprint lat_ele1 1@0>>12|model parameters
python -noprint lat_ele1 1@0>>12|model multipole
python -noprint lat_ele1 1@0>>13|model general
python -noprint lat_ele1 1@0>>13|model parameters
python -noprint lat_ele1 1@0>>13|model multipole
python -noprint lat_ele1 1@0>>14|model general
python -noprint lat_ele1 1@0>>14|model parameters
python -noprint lat_ele1 1@0>>14|model multipole
python -noprint lat_ele1 1@0>>15|model general
python -noprint lat_ele1 1@0>>15|model parameters
python -noprint lat_ele1 1@0>>15|model multipole
python -noprint lat_ele1 1@0>>16|model general
python -noprint lat_ele1 1@0>>16|model parameters
python -noprint lat_ele1 1@0>>16|model multipole
python -noprint lat_ele1 1@0>>17|model general
python -noprint lat_ele1 1@0>>17|model parameters
python -noprint lat_ele1 1@0>>17|model multipole
python -noprint lat_ele1 1@0>>18|model general
python -noprint lat_ele1 1@0>>18|model parameters
python -noprint lat_ele1 1@0>>18|model multipole
python -noprint lat_ele1 1@0>>19|model general
python -noprint lat_ele1 1@0>>19|model parameters
python -noprint lat_ele1 1@0>>19|model multipole
python -noprint lat_ele1 1@0>>20|model general
python -noprint lat_ele1 1@0>>20|model parameters
python -noprint lat_ele1 1@0>>20|model multipole
python -noprint lat_ele1 1@0>>21|model general
python -noprint lat_ele1 1@0>>21|model parameters
python -noprint lat_ele1 1@0>>21|model multipole
python -noprint lat_ele1 1@0>>22|model general
python -noprint lat_ele1 1@0>>22|model parameters
python -noprint lat_ele1 1@0>>22|model multipole
python -noprint lat_ele1 1@0>>23|model general
python -noprint lat_ele1 1@0>>23|model parameters
python -noprint lat_ele1 1@0>>23|model multipole
python -noprint lat_ele1 1@0>>24|model general
python -noprint lat_ele1 1@0>>24|model parameters
python -noprint lat_ele1 1@0>>24|model multipole
python -noprint lat_ele1 1@0>>25|model general
python -noprint lat_ele1 1@0>>25|model parameters
python -noprint lat_ele1 1@0>>25|model multipole
python -noprint lat_ele1 1@0>>26|model general
python -noprint lat_ele1 1@0>>26|model parameters
python -noprint lat_ele1 1@0>>26|model multipole
python -noprint lat_ele1 1@0>>27|model general
python -noprint lat_ele1 1@0>>27|model parameters
python -noprint lat_ele1 1@0>>27|model multipole
python -noprint lat_ele1 1@0>>28|model general
python -noprint lat_ele1 1@0>>28|model parameters
python -noprint lat_ele1 1@0>>28|model multipole
python -noprint lat_ele1 1@0>>29|model general
python -noprint lat_ele1 1@0>>29|model parameters
python -noprint lat_ele1 1@0>>29|model multipole
python -noprint lat_ele1 1@0>>30|model general
python -noprint lat_ele1 1@0>>30|model parameters
python -noprint lat_ele1 1@0>>30|model multipole
python -noprint lat_ele1 1@0>>31|model general
python -noprint lat_ele1 1@0>>31|model parameters
python -noprint lat_ele1 1@0>>31|model multipole
python -noprint lat_ele1 1@0>>32|model general
python -noprint lat_ele1 1@0>>32|model parameters
python -noprint lat_ele1 1@0>>32|model multipole
python -noprint lat_ele1 1@0>>33|model general
python -noprint lat_ele1 1@0>>33|model parameters
python -noprint lat_ele1 1@0>>33|model multipole
python -noprint lat_ele1 1@0>>34|model general
python -noprint lat_ele1 1@0>>34|model parameters
python -noprint lat_ele1 1@0>>34|model multipole
python -noprint lat_ele1 1@0>>35|model general
python -noprint lat_ele1 1@0>>35|model parameters
python -noprint lat_ele1 1@0>>35|model multipole
python -noprint lat_ele1 1@0>>36|model general

Can you reproduce @DavidSagan? If so, is there something illegitimate with the sequence of commands?

DavidSagan commented 7 years ago

Thomas: The fermilab lattice has ~14K elements so madqt will need to handle this number of lattice elements.

DavidSagan commented 7 years ago

Thomas: What you are seeing is due to running in the tao/examples/custom_tao_with_measured_data directory where there is a tao.startup file which Tao will automatically read in. This particular tao.startup is meant to be used with a custom version of Tao. Bottom line: Just run madqt in a different directory to avoid this tao.startup.

DavidSagan commented 7 years ago

Thinking about it I'm guessing that the problem is with the Tao python command. Thomas: Can you identify which particular command is problematic? This should be an easy fix.

coldfix commented 7 years ago

It doesn't look to be problem of specific command: when I delete commands from the front, the error occurs later in the file. So it looks like this is related to the length of the input file. I haven't built the debug mode so far, but can give you a traceback once that finishes (if it's reproducible).

coldfix commented 7 years ago

On debug build, tao crashes even sooner:

% tao -lat custom_tao_with_measured_data/RRNOVAMU2E11172016.bmad -noinit -noplot -gui_mode < /home/thomas/hit/dev/madqt/RRNOVAMU2E11172016kv_mwH.commands.tao.2
[INFO] tao_init:
    Note: global%rf_on = False  -->  RFCavities will be turned off in lattices

Tao> set global lattice_calc_on = F

Tao> place * none

Tao> place * none

Tao> python -noprint lat_general 1

Tao> python -noprint lat_ele_list 1@0
At line 674 of file /home/thomas/hit/dev/bmad_dist_2017_0215/tao/code/tao_python_cmd.f90
Fortran runtime error: Index '201' of dimension 1 of array 'li' above upper bound of 200

Error termination. Backtrace:
#0  0x70de02 in tao_python_cmd_
    at /home/thomas/hit/dev/bmad_dist_2017_0215/tao/code/tao_python_cmd.f90:674
#1  0x412c9c in tao_command_
    at /home/thomas/hit/dev/bmad_dist_2017_0215/tao/code/tao_command.f90:355
#2  0x403d2a in tao_top_level_
    at /home/thomas/hit/dev/bmad_dist_2017_0215/tao/code/tao_top_level.f90:97
#3  0x403a0e in tao_program
    at /home/thomas/hit/dev/bmad_dist_2017_0215/tao/program/tao_program.f90:15
#4  0x403a47 in main
    at /home/thomas/hit/dev/bmad_dist_2017_0215/tao/program/tao_program.f90:9
DavidSagan commented 7 years ago

Found it! There is a missing allocation. I put in a fix. But madqt still crashes. It looks like a missing allocation someplace else. I am looking around for it but if you can get a crash listing with debug that would help (and I am looking into generating this on my side...).

coldfix commented 7 years ago

I get another error:

% madqt custom_tao_with_measured_data/RRNOVAMU2E11172016.bmad
[INFO] tao_init:
    Note: global%rf_on = False  -->  RFCavities will be turned off in lattices
At line 588 of file /home/thomas/hit/dev/bmad_dist_2017_0215/sim_utils/misc/fortran_cpp_utils.f90
Fortran runtime error: Dimension 1 of array 'c_string' has extent 27 instead of 1001

Commands executed:

set global lattice_calc_on = F
place * none
place * none
python -noprint lat_general 1
DavidSagan commented 7 years ago

I cannot reproduce this but I just made a change that might have affected this so try updating Tao and try again.

coldfix commented 7 years ago

Getting build error now:

[ 71%] Building Fortran object CMakeFiles/bmad.dir/custom/track1_beam_hook.f90.o
/home/thomas/hit/dev/bmad_dist_2017_0215/bmad/custom/track1_beam_hook.f90:26:4:

 use bmad
    1
Error: ‘track1_beam_hook’ of module ‘bmad’, imported at (1), is also the name of the current program unit
gmake[2]: *** [CMakeFiles/bmad.dir/build.make:2751: CMakeFiles/bmad.dir/custom/track1_beam_hook.f90.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:69: CMakeFiles/bmad.dir/all] Error 2
gmake: *** [Makefile:84: all] Error 2
DavidSagan commented 7 years ago

Fixed

DavidSagan commented 7 years ago

That is, Fixed the Distribution problem. In terms of the problem running madqt with the above lattice, I'm stuck trying to diagnose where the problem is. Let me know if you have any progress...

coldfix commented 7 years ago

Sorry, I'm currently on something else. I can investigate more tonight or tomorrow.

DavidSagan commented 7 years ago

No problem. I am also getting pulled in multiple directions...

coldfix commented 7 years ago

The reported crash seems to be fixed by the patches to tao. However big lattice is still a problem, taking up enormous startup time. The issue is superseeded by #24.