Skip to content

Commit

Permalink
Update pycbc_live
Browse files Browse the repository at this point in the history
  • Loading branch information
spxiwh authored and yi-fan-wang committed Jun 1, 2023
1 parent e615f2b commit 5ff31ae
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions bin/pycbc_live
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,21 @@ class LiveEventManager(object):
if self.run_snr_optimization:
# preestimate the number of CPU cores that we can afford giving
# to followup processes without slowing down the main search
# if the machine isn't a mac
bg_cores = len(tuple(itertools.combinations(ifos, 2)))
analysis_cores = 1 + bg_cores
if platform.system() != 'Darwin':
available_cores = len(os.sched_getaffinity(0))
self.fu_cores = available_cores - analysis_cores
if self.fu_cores <= 0:
logging.warning(
'Insufficient number of CPU cores (%d) to '
'run search and trigger followups. Uploaded '
'triggers will momentarily increase the lag',
available_cores
)
self.fu_cores = 1
else:
available_cores = multiprocessing.cpu_count()
bg_cores = len(tuple(itertools.combinations(ifos, 2)))
analysis_cores = 1 + bg_cores
self.fu_cores = available_cores - analysis_cores
if self.fu_cores <= 0:
logging.warning('Insufficient number of CPU cores (%d) to '
'run search and trigger followups. Uploaded '
'triggers will momentarily increase the lag',
available_cores)
# To enable mac testing, this is just set to 1
self.fu_cores = 1

if args.enable_embright_has_massgap:
Expand Down

0 comments on commit 5ff31ae

Please sign in to comment.