Differences between revisions 1 and 2
Revision 1 as of 2018-08-21 17:39:15
Size: 6562
Comment:
Revision 2 as of 2018-08-21 17:40:10
Size: 6567
Comment:
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
}}}

  • To read and write channel data from and to the shared memory, please refer step10 and step11

  • Here we try to link the channel data in shared memory at CAL low-latency machine to the DMG machine
  • We can use "framelink" program in GDS (gds-2.18.7/Utilities/FrUtils/framelink.cc)
  • Check the existing shared memory partition with "smlist" and kill it with "smkill" if it already exists

   1 part = options.partition
   2 lbuf = options.lbuf
   3 port = ':'+options.port
   4 
   5 sl = commands.getoutput('smlist')
   6 ss = sl.split('\n')
   7 
   8 if len(ss) > 1:
   9     for s in ss[1:]:
  10         cc = s.split()
  11         if cc[1] == part:
  12             print 'Killing the current partition:',cc[1]
  13             os.system('smkill '+cc[1])
  • Create a shared memory with specified buffer length, which should be large enough compared with the frame file data size

   1 print 'Creating a new partition:',part,'with lbuf=',lbuf
   2 os.system('smcreate '+part+' -lbuf '+str(lbuf))
   3 os.system('smlist')
  • Run "framelink" with either receive or push mode

   1 opt = ''
   2 if options.debug:
   3     opt = ' --verbose /dev/stdout --debug 1000'
   4 
   5 print 'Starting framelink...'
   6 
   7 if options.mode == 'receive':
   8     os.system('framelink'+opt+' receive 0.0.0.0'+port+' '+part)
   9 
  10 else:
  11     os.system('framelink'+opt+' push '+part+' '+options.host+port)
  • The python scripts are available at git repository

> kagra-cal/Observation/Phase1/tutorials/flink --help
Usage: flink [options]

Options:
  -h, --help        show this help message and exit
  --mode=mode       Set the operation mode, either from "receive" or "push".
  --partition=name  Set the name of the shared memory partition to write to.
  --host=host       Set the host name
  --port=port       Set the port number (default= 23232)
  --lbuf=size       Set the shared memory buffer size (default= 200000)
  --debug           Show debug messages
  • Here is an example to send the shared memory from the CAL machine to DMG machine
  • At the DMG machine, start the receiver server

> kagra-cal/Observation/Phase1/tutorials/flink --mode=receive --debug
Killing the current partition: KGR_hoft
Creating a new partition: KGR_hoft with lbuf= 200000
  id      name        nBuf   lBuf     nTotal
  32  KGR_hoft          4    200000         0

Starting framelink...
2018.08.21-08:27:39 Look up peer: 0.0.0.0:PORT
2018.08.21-08:27:39 Starting framelink: $Id: framelink.cc 7922 2017-08-03 00:14:52Z john.zweizig@LIGO.ORG $
2018.08.21-08:27:39 arguments are: --verbose /dev/stdout --debug 1000 receive 0.0.0.0:PORT KGR_hoft
2018.08.21-08:27:39 Verbose logging enabled to: /dev/stdout
2018.08.21-08:27:39 Binding socket to server address: 0.0.0.0
2018.08.21-08:27:39 Listening to server socket
2018.08.21-08:27:39 Waiting for client connection
  • At the CAL machine, start the pusher client

> kagra-cal/Observation/Phase1/tutorials/flink --mode push --host HOSTNAME --debug
bin/flink --mode push --host pleiades-02 --debug
Creating a new partition: KGR_hoft with lbuf= 200000
  id      name        nBuf   lBuf     nTotal
  32  KGR_hoft          4    200000         0

Starting framelink...
2018.08.21-08:33:43 Look up peer: HOSTNAME:PORT
2018.08.21-08:33:43 Starting framelink: $Id: framelink.cc 7922 2017-08-03 00:14:52Z john.zweizig@LIGO.ORG $
2018.08.21-08:33:43 arguments are: --verbose /dev/stdout --debug 1000 push KGR_hoft HOSTNAME:PORT
2018.08.21-08:33:43 Verbose logging enabled to: /dev/stdout
2018.08.21-08:33:43 Connecting to server: HOSTNAME
# Connected to: HOSTNAME
2018.08.21-08:33:43 framelink: Attaching consumer to partition KGR_hoft
  • At the DMG machine, it shows that the connection is established

2018.08.21-08:28:53 Client connected
2018.08.21-08:28:53 Keep-alive set
2018.08.21-08:28:53 framelink: Attaching producer to partition KGR_hoft
2018.08.21-08:29:53 framelink: Waiting for frame from 0.0.0.0
  • At the CAL machine, run "dpush" as in step 10 you can put a channel data into the shared memory

> kagra-cal/Observation/Phase1/tutorials/dpush --debug --shared-memory-partition=KGR_hoft
Opening partition KGR_hoft for output.
Opened frame file: 1sec/K-K1_TEST-1209288320-1.gwf
Read frame: file-length/rc 68771 / 68771
Opened frame file: 1sec/K-K1_TEST-1209288321-1.gwf
Waiting 999874usec.
Read frame: file-length/rc 65135 / 65135
Opened frame file: 1sec/K-K1_TEST-1209288322-1.gwf
Waiting 999564usec.
Read frame: file-length/rc 66984 / 66984
Opened frame file: 1sec/K-K1_TEST-1209288323-1.gwf
Waiting 999553usec.
...
  • At the CAL machine, you can check that the frame data is sent to the DMG machine

1218875715 get 1209288320 68771 OK.
2018.08.21-08:34:57 sent header block, len, gps, time = {0, 68771, 1209288320, 1}
1218875715 put 1209288320 68771 OK.
1218875716 get 1209288321 65135 OK.
2018.08.21-08:34:58 sent header block, len, gps, time = {1, 65135, 1209288321, 1}
1218875716 put 1209288321 65135 OK.
1218875717 get 1209288322 66984 OK.
2018.08.21-08:34:59 sent header block, len, gps, time = {2, 66984, 1209288322, 1}
1218875717 put 1209288322 66984 OK.
1218875718 get 1209288323 63983 OK.
2018.08.21-08:35:00 sent header block, len, gps, time = {3, 63983, 1209288323, 1}
...
  • At the DMG machine, you can check that the frame data is received from the CAL machine

2018.08.21-08:34:57 received header block, len, gps, time = {0, 68771, 1209288320, 1}
2018.08.21-08:34:57 Data length inferred from first block. dt = 1
1218875715 get 1209288320 68771 OK.
1218875715 put 1209288320 68771 OK.
2018.08.21-08:34:58 received header block, len, gps, time = {1, 65135, 1209288321, 1}
1218875716 get 1209288321 65135 OK.
1218875716 put 1209288321 65135 OK.
2018.08.21-08:34:59 received header block, len, gps, time = {2, 66984, 1209288322, 1}
1218875717 get 1209288322 66984 OK.
1218875717 put 1209288322 66984 OK.
2018.08.21-08:35:00 received header block, len, gps, time = {3, 63983, 1209288323, 1}
1218875718 get 1209288323 63983 OK.
1218875718 put 1209288323 63983 OK.
2018.08.21-08:35:01 received header block, len, gps, time = {4, 65568, 1209288324, 1}
...

KAGRA/Subgroups/CAL/GstLAL/tutorials/step12 (last edited 2018-08-21 20:34:39 by SadakazuHaino)