@@ -11,7 +11,6 @@ See https://arxiv.org/abs/1805.11174 for an overview."""
11
11
12
12
import sys
13
13
import argparse , numpy , pycbc , logging , cProfile , h5py , lal , json
14
- from time import time
15
14
import os .path
16
15
import itertools
17
16
import platform
@@ -33,6 +32,7 @@ import pycbc.waveform.bank
33
32
from pycbc .vetoes .sgchisq import SingleDetSGChisq
34
33
from pycbc .waveform .waveform import props
35
34
from pycbc import mchirp_area
35
+
36
36
try :
37
37
from setproctitle import setproctitle
38
38
except ImportError :
@@ -639,7 +639,8 @@ fft.verify_fft_options(args, parser)
639
639
if args .output_background is not None and len (args .output_background ) != 2 :
640
640
parser .error ('--output-background takes two parameters: period and path' )
641
641
642
- log_format = "%(asctime)s {0} %(message)s" .format (platform .node ())
642
+ log_format = '%(asctime)s {} {} %(message)s' .format (platform .node (),
643
+ mpi .COMM_WORLD .Get_rank ())
643
644
pycbc .init_logging (args .verbose , format = log_format )
644
645
645
646
ctx = scheme .from_cli (args )
@@ -725,7 +726,7 @@ with ctx:
725
726
# Synchronize start time if not provided on the command line
726
727
if not args .start_time :
727
728
evnt .barrier ()
728
- tnow = lal . GPSTimeNow ( ) if evnt .rank == 0 else None
729
+ tnow = int ( pycbc . gps_now () ) if evnt .rank == 0 else None
729
730
args .start_time = evnt .comm .bcast (tnow , root = 0 )
730
731
731
732
if args .round_start_time :
@@ -776,7 +777,7 @@ with ctx:
776
777
coinc_pool = BroadcastPool (len (estimators ))
777
778
coinc_pool .allmap (set_coinc_id , range (len (estimators )))
778
779
779
- logging .info ('%s: Starting...' , evnt . rank )
780
+ logging .info ('Starting' )
780
781
781
782
if args .enable_profiling is not None and evnt .rank == args .enable_profiling :
782
783
pr = cProfile .Profile ()
@@ -786,8 +787,8 @@ with ctx:
786
787
data_end = lambda : data_reader [tuple (data_reader .keys ())[0 ]].end_time
787
788
last_bg_dump_time = int (data_end ())
788
789
while data_end () < args .end_time :
789
- t1 = time ()
790
- logging .info ('%s: Analyzing from %s' , evnt . rank , data_end ())
790
+ t1 = pycbc . gps_now ()
791
+ logging .info ('Analyzing from %s' , data_end ())
791
792
792
793
results = {}
793
794
evnt .live_detectors = set ()
@@ -810,7 +811,7 @@ with ctx:
810
811
if status is True :
811
812
evnt .live_detectors .add (ifo )
812
813
if evnt .rank > 0 :
813
- logging .info ('%s: Filtering %s' , evnt . rank , ifo )
814
+ logging .info ('Filtering %s' , ifo )
814
815
results [ifo ] = mf .process_data (data_reader [ifo ])
815
816
else :
816
817
logging .info ('Insufficient data for %s analysis' , ifo )
@@ -901,11 +902,11 @@ with ctx:
901
902
902
903
if args .sync :
903
904
evnt .barrier ()
904
- tdiff = time () - t1
905
- lag = float (lal . GPSTimeNow () - data_end ())
906
- logging .info ('%s: Took %1.2f, duty factor of %.2f, '
905
+ tdiff = pycbc . gps_now () - t1
906
+ lag = float (pycbc . gps_now () - data_end ())
907
+ logging .info ('Took %1.2f, duty factor of %.2f, '
907
908
'lag %.2f s, %d live detectors' ,
908
- evnt . rank , tdiff , tdiff / valid_pad , lag ,
909
+ tdiff , tdiff / valid_pad , lag ,
909
910
len (evnt .live_detectors ))
910
911
911
912
if args .output_status is not None and evnt .rank == 0 :
@@ -925,7 +926,7 @@ with ctx:
925
926
'start_sec' : 240 })
926
927
status = {'author' : 'Tito Dal Canton' ,
927
928
'email' : 'tito.canton@ligo.org' ,
928
- 'created_gps' : int (lal . GPSTimeNow ()),
929
+ 'created_gps' : int (pycbc . gps_now ()),
929
930
'status_intervals' : status_intervals }
930
931
try :
931
932
with open (args .output_status , 'w' ) as status_fp :
0 commit comments