Skip to content

Commit

Permalink
Allow pycbc inspiral to run with only numpy fft
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeresh Kumar Perla authored and Neeresh Kumar Perla committed Jul 5, 2023
1 parent 158e038 commit 153f3af
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
31 changes: 17 additions & 14 deletions bin/pycbc_inspiral
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,21 @@ def template_triggers(t_num):
return out_vals_all, tparam

with ctx:
# The following FFTW specific options needed to wait until
# we were inside the scheme context.
if opt.fft_backends == 'fftw':

# Import system wisdom.
if opt.fftw_import_system_wisdom:
fft.fftw.import_sys_wisdom()
# The following FFTW specific options needed to wait until
# we were inside the scheme context.

# Read specified user-provided wisdom files
if opt.fftw_input_float_wisdom_file is not None:
fft.fftw.import_single_wisdom_from_filename(opt.fftw_input_float_wisdom_file)
# Import system wisdom.
if opt.fftw_import_system_wisdom:
fft.fftw.import_sys_wisdom()

if opt.fftw_input_double_wisdom_file is not None:
fft.fftw.import_double_wisdom_from_filename(opt.fftw_input_double_wisdom_file)
# Read specified user-provided wisdom files
if opt.fftw_input_float_wisdom_file is not None:
fft.fftw.import_single_wisdom_from_filename(opt.fftw_input_float_wisdom_file)

if opt.fftw_input_double_wisdom_file is not None:
fft.fftw.import_double_wisdom_from_filename(opt.fftw_input_double_wisdom_file)

flow = opt.low_frequency_cutoff
flen = strain_segments.freq_len
Expand Down Expand Up @@ -499,10 +501,11 @@ event_mgr.save_performance(ncores, len(segments), len(bank), run_time, tsetup)
logging.info("Writing out triggers")
event_mgr.write_events(opt.output)

if opt.fftw_output_float_wisdom_file:
fft.fftw.export_single_wisdom_to_filename(opt.fftw_output_float_wisdom_file)
if opt.fft_backends == 'fftw':
if opt.fftw_output_float_wisdom_file:
fft.fftw.export_single_wisdom_to_filename(opt.fftw_output_float_wisdom_file)

if opt.fftw_output_double_wisdom_file:
fft.fftw.export_double_wisdom_to_filename(opt.fftw_output_double_wisdom_file)
if opt.fftw_output_double_wisdom_file:
fft.fftw.export_double_wisdom_to_filename(opt.fftw_output_double_wisdom_file)

logging.info("Finished")
9 changes: 9 additions & 0 deletions pycbc/fft/npfft.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,12 @@ def __init__(self, invec, outvec, nbatch=1, size=None):

def execute(self):
ifft(self.invec, self.outvec, self.prec, self.itype, self.otype)

def insert_fft_options(optgroup):
"""
Inserts the options that affect the behavior of this backend
This backend has no options
"""
return

0 comments on commit 153f3af

Please sign in to comment.