Skip to content

Commit

Permalink
r.univar: fix MASK check with nprocs > 1 (OSGeo#4297)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa authored and Mahesh1998 committed Sep 19, 2024
1 parent b466820 commit 94700a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions raster/r.univar/r.univar_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ int main(int argc, char *argv[])
sscanf(param.nprocs->answer, "%d", &nprocs);
if (nprocs < 1)
G_fatal_error(_("<%d> is not valid number of nprocs."), nprocs);
if (nprocs > 1 && G_find_raster("MASK", G_mapset()) != NULL) {
G_warning(_("Parallel processing disabled due to active MASK."));
nprocs = 1;
}
#if defined(_OPENMP)
omp_set_num_threads(nprocs);
#else
Expand All @@ -200,10 +204,6 @@ int main(int argc, char *argv[])
"threads setting."));
nprocs = 1;
#endif
if (nprocs > 1 && G_find_raster("MASK", G_mapset()) != NULL) {
G_warning(_("Parallel processing disabled due to active MASK."));
nprocs = 1;
}
/* table field separator */
zone_info.sep = G_option_to_separator(param.separator);

Expand Down

0 comments on commit 94700a9

Please sign in to comment.