#include #include #include #include #include #include #include #include "PAN_FFTW3.h" #include "panphasia_functions.h" extern size_t descriptor_base_size; #ifdef USE_OPENMP #include int threads_ok; int number_omp_threads = 1; #endif int main(int argc, char **argv) { int verbose=0; int error; size_t x0=0, y0=0, z0=0; size_t rel_level; char descriptor[300] = "[Panph6,L20,(424060,82570,148256),S1,KK0,CH-999,Auriga_100_vol2]"; #ifdef USE_OPENMP omp_set_num_threads(number_omp_threads); int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided); threads_ok = provided >= MPI_THREAD_FUNNELED; if (threads_ok) threads_ok = fftw_init_threads(); fftw_mpi_init(); int num_threads = number_omp_threads ; if (threads_ok){ fftw_plan_with_nthreads(num_threads); }else{ printf("Failure to initialise threads ...\n"); MPI_Finalize(); }; printf("OpenMP threads enabled with FFTW. Number of threads %d\n",fftw_planner_nthreads()); #else MPI_Init(&argc, &argv); #endif PANPHASIA_init_descriptor_(descriptor,&verbose); rel_level = 6; //Set size of test dataset if (error=PANPHASIA_init_level_(&rel_level,&x0,&y0,&z0,&verbose)){ printf("Abort: PANPHASIA_init_level_ :error code %d\n",error); abort(); }; //======================= FFTW ============================== fftw_mpi_init(); ptrdiff_t alloc_local, local_n0, local_0_start; ptrdiff_t N0 = descriptor_base_size<