31 void bench_openmp(FILE *infile,
int m,
int psi_flag)
36 int M, d, trafo_adjoint;
40 double tt_total, tt_preonepsi;
42 fscanf(infile, "%d %d", &d, &trafo_adjoint);
44 N = malloc(d*sizeof(
int));
45 n = malloc(d*sizeof(
int));
48 fscanf(infile, "%d", N+t);
51 fscanf(infile, "%d", n+t);
53 fscanf(infile, "%d", &M);
56 FFTW(import_wisdom_from_filename)(
"nfft_benchomp_detail_threads.plan");
58 FFTW(import_wisdom_from_filename)(
"nfft_benchomp_detail_single.plan");
62 NFFT(init_guru)(&p, d, N, M, n, m,
64 FFTW_MEASURE| FFTW_DESTROY_INPUT);
67 FFTW(export_wisdom_to_filename)(
"nfft_benchomp_detail_threads.plan");
69 FFTW(export_wisdom_to_filename)(
"nfft_benchomp_detail_single.plan");
72 for (j=0; j < p.M_total; j++)
74 for (t=0; t < p.d; t++)
75 fscanf(infile,
"%lg", p.x+p.d*j+t);
80 for (j=0; j < p.N_total; j++)
82 fscanf(infile,
"%lg %lg", &re, &im);
83 p.f_hat[j] = re + _Complex_I * im;
88 for (j=0; j < p.M_total; j++)
90 fscanf(infile,
"%lg %lg", &re, &im);
91 p.f[j] = re + _Complex_I * im;
98 NFFT(precompute_one_psi)(&p);
100 tt_preonepsi = NFFT(elapsed_seconds)(t1,t0);
102 if (trafo_adjoint==0)
107 tt_total = NFFT(elapsed_seconds)(t1,t0);
110 p.MEASURE_TIME_t[0] = 0.0;
111 p.MEASURE_TIME_t[2] = 0.0;
114 #ifndef MEASURE_TIME_FFTW
115 p.MEASURE_TIME_t[1] = 0.0;
118 printf(
"%.6e %.6e %6e %.6e %.6e %.6e\n", tt_preonepsi, p.MEASURE_TIME_t[0], p.MEASURE_TIME_t[1], p.MEASURE_TIME_t[2], tt_total-tt_preonepsi-p.MEASURE_TIME_t[0]-p.MEASURE_TIME_t[1]-p.MEASURE_TIME_t[2], tt_total);
128 int main(
int argc,
char **argv)
137 nthreads = atoi(argv[3]);
138 FFTW(init_threads)();
139 omp_set_num_threads(nthreads);
146 psi_flag = atoi(argv[2]);
148 bench_openmp(stdin, m, psi_flag);
Header file for the nfft3 library.