CODA: Difference between revisions

From CLONWiki
Jump to navigation Jump to search
Boiarino (talk | contribs)
Boiarino (talk | contribs)
 
(5 intermediate revisions by the same user not shown)
Line 6: Line 6:


Executed in the order opposite to 'Go' transition: TS ROC first, then all remaining ROCs, then EB.
Executed in the order opposite to 'Go' transition: TS ROC first, then all remaining ROCs, then EB.
First ROC receives 'End' command:


1. 'coda_roc::codaEnd()' called, it does following:
1. 'coda_roc::codaEnd()' called, it does following:
Line 18: Line 20:
* call informEB(EV_END) to send 'End' event to EB
* call informEB(EV_END) to send 'End' event to EB
* call codaUpdateStatus("downloaded"), set tcpState = rocp->state = DA_DOWNLOADED
* call codaUpdateStatus("downloaded"), set tcpState = rocp->state = DA_DOWNLOADED
3. In network thread, 'roc_network::net_thread()' loop send 'end' event to EB, see 'ifend' flag in it, break loop, sleep(1), cleanup big buffers, call 'roc_network::LINK_close' which calls  'shutdown(socket, 2)' and 'close(socket)' closing connection to EB
After coda_roc is finished, 'End' command issued to EB, it executes 'coda_eb::codaEnd()', doing following:
1. Checks EB state in database, it should be 'active' (if 'downloaded', do nothing)
2. Building thread(s) see End event, call 'CODA_decode_spec(&temp,desc1)' ...
3. 'coda_eb::polling_routine()' (started as thread by constructor) see 'ebp->ended == 1', canceling building thread(s) and calls 'LINK_support::debCloseLink()' for every connected ROC telling input thread(s) to exit ('''what if they already exited ?''')
4. Wait for building thread(s) to finish and cleanup building threads, then exit 'coda_eb::codaEnd()' (TEMPORARY using 'force_end=1', see code)




3. In network thread, 'roc_network::net_thread()' loop sees 'end' event, breaks loop and call 'roc_network::LINK_close' whichcalls  'shutdown(socket, 2)' and 'close(socket)', closing connection to EB
5. In a meanwhile, 'LINK_support::debCloseLink()' executed exiting EB input threads (one per ROC)


== VME Controllers: Intel-based FANUC under RHEL OS ==
== VME Controllers: Intel-based FANUC under RHEL OS ==

Latest revision as of 18:05, 8 May 2019

CODA is DAQ software designed and supported by JLAB CODA group. This section contains some information related to the use of CODA in Hall B.


End transition

Executed in the order opposite to 'Go' transition: TS ROC first, then all remaining ROCs, then EB.

First ROC receives 'End' command:

1. 'coda_roc::codaEnd()' called, it does following:

  • call 'ROL1::__end()' routine; it disables triggers and calls 'blocksLeft = tiBReady()' until nothing left, or until timeout
  • call 'codaUpdateStatus("ending")', sets 'tcpState = rocp->state = DA_ENDING' and 'rocp->active = 2'

2. inside 'coda_roc::output_proc_network' loop: after exiting current loop iteration execute 'case DA_ENDING':

  • make sure the output buffer gets sent if there is any data in it
  • make sure we have the last event in the output buffer
  • call informEB(EV_END) to send 'End' event to EB
  • call codaUpdateStatus("downloaded"), set tcpState = rocp->state = DA_DOWNLOADED

3. In network thread, 'roc_network::net_thread()' loop send 'end' event to EB, see 'ifend' flag in it, break loop, sleep(1), cleanup big buffers, call 'roc_network::LINK_close' which calls 'shutdown(socket, 2)' and 'close(socket)' closing connection to EB


After coda_roc is finished, 'End' command issued to EB, it executes 'coda_eb::codaEnd()', doing following:

1. Checks EB state in database, it should be 'active' (if 'downloaded', do nothing)

2. Building thread(s) see End event, call 'CODA_decode_spec(&temp,desc1)' ...

3. 'coda_eb::polling_routine()' (started as thread by constructor) see 'ebp->ended == 1', canceling building thread(s) and calls 'LINK_support::debCloseLink()' for every connected ROC telling input thread(s) to exit (what if they already exited ?)

4. Wait for building thread(s) to finish and cleanup building threads, then exit 'coda_eb::codaEnd()' (TEMPORARY using 'force_end=1', see code)


5. In a meanwhile, 'LINK_support::debCloseLink()' executed exiting EB input threads (one per ROC)

VME Controllers: Intel-based FANUC under RHEL OS

CODA group install RHEL OS into flash memory, so it boot after power recycle. Auto mount and some other stuff must be adjusted for clon cluster: