32 int threads = atoi(opt->
answer);
35 threads = omp_get_max_threads();
38 int num_logic_procs = omp_get_num_procs();
40 threads += num_logic_procs;
41 threads = (threads < 1) ? 1 : threads;
43 omp_set_num_threads(threads);
46 "%d threads are set up for parallel computing.",
50 if (!(threads == 0 || threads == 1)) {
51 G_warning(
_(
"GRASS is not compiled with OpenMP support, parallel "
52 "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.