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])

   1 print 'Creating a new partition:',part,'with lbuf=',lbuf
   2 os.system('smcreate '+part+' -lbuf '+str(lbuf))
   3 os.system('smlist')

   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)

> 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

> 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

> kagra-cal/Observation/Phase1/tutorials/flink --mode push --host HOSTNAME --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

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

> 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.
...

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}
...

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)