33 int threads = atoi(opt->
answer);
36 threads = omp_get_max_threads();
39 int num_logic_procs = omp_get_num_procs();
41 threads += num_logic_procs;
42 threads = (threads < 1) ? 1 : threads;
44 omp_set_num_threads(threads);
47 "%d threads are set up for parallel computing.",
51 if (!(threads == 0 || threads == 1)) {
52 G_warning(
_(
"GRASS is not compiled with OpenMP support, parallel "
53 "computation is disabled. Only one thread will be used."));
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
void void G_verbose_message(const char *,...) __attribute__((format(printf
#define n_(strs, strp, num)
int G_set_omp_num_threads(struct Option *opt)
Set the number of threads for OpenMP The intended usage is at the beginning of a C tool when paramete...
Structure that stores option information.