dmorse / pscfpp

Polymer Self-Consistent Field Theory (C++/CUDA version)
https://pscf-home.cems.umn.edu
GNU General Public License v3.0
25 stars 20 forks source link

Enable open-mp threaded version of fftw #143

Open dmorse opened 9 months ago

dmorse commented 9 months ago

See FFTW manual: https://www.fftw.org/fftw3_doc/Usage-of-Multi_002dthreaded-FFTW.html

Proposal:

 - Create a makefile variable PSCF_OPENMP in set opts, option t

 - Create a C preprocessor macro PSCF_OPENMP using -DPSCF_OPENMP

 - Create a command line option -t to select the actual number of threads, nthreads.
    Make this a required option ifdef PSCF_OPENMP

 - In Pscf::Pspc::System<D>::setOptions, conditionally compile
           fftw_init_threads()
           fftw_plan_with_nthreads(nthreads)
 -