28 const bool use_guru,
const double threshold) {
53int main(
int argc,
char *argv[]) {
58 if (device_count > 0) {
62 const double threshold = 1e-4;
66 printf(
"Number of MPI ranks: %i\n",
68 int number_of_threads = 1;
69#pragma omp parallel default(none) shared(number_of_threads)
73 number_of_threads = omp_get_num_threads();
76 printf(
"Number of OpenMP threads: %i\n", number_of_threads);
104 printf(
"\nAll tests have passed :-)\n");
106 printf(
"\nFound %i errors :-(\n", errors);
int cp_mpi_comm_size(const cp_mpi_comm_t comm)
Wrapper around MPI_Comm_size.
void cp_mpi_init(int *argc, char ***argv)
Initialize MPI with MPI_THREAD_MULTIPLE or attach to an active MPI.
void cp_mpi_barrier(const cp_mpi_comm_t comm)
Wrapper around MPI_Barrier; a null communicator is a no-op.
cp_mpi_comm_t cp_mpi_get_comm_world(void)
Returns MPI_COMM_WORLD.
void cp_mpi_finalize(void)
Detach from MPI and finalize it only if cp_mpi_init initialized it.
int cp_mpi_comm_rank(const cp_mpi_comm_t comm)
Wrapper around MPI_Comm_rank.
int fft_lib_default_library()
Get the default library (GPU if offloading was enabled, else FFTW3).
void fft_finalize_lib(const char *wisdom_file)
Finalize the FFT library (if not done externally).
bool fft_lib_has_guru_interface()
Whether a compound MPI implementation is available.
int fft_init_lib(const fft_lib lib, const int fftw_planning_flag, const bool use_guru_interface, const char *wisdom_file)
Initialize the FFT library (if not done externally).
int fft_test_local()
Function to test the local FFT backend (1-3D).
void fft_print_timing_report(const double threshold, const cp_mpi_comm_t comm)
Print the FFT timing report to standard output.
void fft_finalize_timer()
Finalizes the internal timer.
int run_unittests(const int backend, const int planning_mode, const bool use_guru, const double threshold)
Run all FFT unit tests for the selected backend.
int main()
Unit test of the C-interface provided via libcp2k.h.
int offload_get_device_count(void)
Returns the number of available devices.
void offload_set_chosen_device(int device_id)
Selects the chosen device to be used.