![]() |
(git:db0abe2)
|
#include "grid_library.h"#include "grid_common.h"#include "grid_constants.h"#include "../../mpiwrap/cp_mpi.h"#include "../../offload/offload_runtime.h"#include <assert.h>#include <omp.h>#include <stddef.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | grid_library_globals |
Macros | |
| #define | GRID_LIBRARY_PRINT(FN, MSG, OUTPUT_UNIT) |
| #define | GRID_NBACKENDS 5 |
| #define | GRID_NKERNELS 4 |
| #define | GRID_MAX_LP 20 |
Functions | |
| void | grid_library_init (void) |
| Initializes the grid library. | |
| void | grid_library_finalize (void) |
| Finalizes the grid library. | |
| grid_sphere_cache * | grid_library_get_sphere_cache (void) |
| Returns a pointer to the thread local sphere cache. | |
| void * | grid_library_get_scratch (const size_t bytes) |
| Returns a pointer to a thread local scratch buffer with at least the given size. The buffer grows on demand and is reused across calls. | |
| void | grid_library_set_config (const enum grid_backend backend, const bool validate, const bool apply_cutoff) |
| Configures the grid library. | |
| grid_library_config | grid_library_get_config (void) |
| Returns the library config. | |
| void | grid_library_counter_add (const int lp, const enum grid_backend backend, const enum grid_library_kernel kernel, const int increment) |
| Adds given increment to counter specified by lp, backend, and kernel. | |
| static int | compare_counters (const void *a, const void *b) |
| Comperator passed to qsort to compare two counters. | |
| void | grid_library_print_stats (const int fortran_comm, void(*print_func)(const char *, int, int), const int output_unit) |
| Prints statistics gathered by the grid library. | |
Variables | |
| static grid_library_globals ** | per_thread_globals = NULL |
| static bool | library_initialized = false |
| static int | max_threads = 0 |
| static grid_library_config | config |
| #define GRID_LIBRARY_PRINT | ( | FN, | |
| MSG, | |||
| OUTPUT_UNIT ) |
Definition at line 21 of file grid_library.c.
| #define GRID_NBACKENDS 5 |
Definition at line 25 of file grid_library.c.
| #define GRID_NKERNELS 4 |
Definition at line 26 of file grid_library.c.
| #define GRID_MAX_LP 20 |
Definition at line 27 of file grid_library.c.
| void grid_library_init | ( | void | ) |
Initializes the grid library.
Definition at line 55 of file grid_library.c.
| void grid_library_finalize | ( | void | ) |
Finalizes the grid library.
Definition at line 91 of file grid_library.c.
| grid_sphere_cache * grid_library_get_sphere_cache | ( | void | ) |
Returns a pointer to the thread local sphere cache.
Definition at line 111 of file grid_library.c.
| void * grid_library_get_scratch | ( | const size_t | bytes | ) |
Returns a pointer to a thread local scratch buffer with at least the given size. The buffer grows on demand and is reused across calls.
Returns a pointer to a thread local scratch buffer with at least the given size. The buffer grows on demand and is reused across calls. It stays valid until the next call on the same thread.
Definition at line 121 of file grid_library.c.
| void grid_library_set_config | ( | const enum grid_backend | backend, |
| const bool | validate, | ||
| const bool | apply_cutoff ) |
Configures the grid library.
Definition at line 138 of file grid_library.c.
| grid_library_config grid_library_get_config | ( | void | ) |
Returns the library config.
Definition at line 149 of file grid_library.c.
| void grid_library_counter_add | ( | const int | lp, |
| const enum grid_backend | backend, | ||
| const enum grid_library_kernel | kernel, | ||
| const int | increment ) |
Adds given increment to counter specified by lp, backend, and kernel.
Definition at line 155 of file grid_library.c.
|
static |
Comperator passed to qsort to compare two counters.
Definition at line 173 of file grid_library.c.
| void grid_library_print_stats | ( | const int | fortran_comm, |
| void(* | print_func )(const char *, int, int), | ||
| const int | output_unit ) |
Prints statistics gathered by the grid library.
Definition at line 181 of file grid_library.c.
|
static |
Definition at line 36 of file grid_library.c.
|
static |
Definition at line 37 of file grid_library.c.
|
static |
Definition at line 38 of file grid_library.c.
|
static |
Definition at line 39 of file grid_library.c.