[GRASS-SVN] r70295 - grass/trunk/vector/v.surf.rst

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 7 14:32:23 PST 2017


Author: annakrat
Date: 2017-01-07 14:32:23 -0800 (Sat, 07 Jan 2017)
New Revision: 70295

Modified:
   grass/trunk/vector/v.surf.rst/main.c
Log:
v.surf.rst: keep consistent options (added new nprocs) with and without openmp

Modified: grass/trunk/vector/v.surf.rst/main.c
===================================================================
--- grass/trunk/vector/v.surf.rst/main.c	2017-01-07 21:42:55 UTC (rev 70294)
+++ grass/trunk/vector/v.surf.rst/main.c	2017-01-07 22:32:23 UTC (rev 70295)
@@ -124,9 +124,7 @@
     struct multtree *tree;
     int open_check, with_z;
     char buf[1024];
-#if defined(_OPENMP)
     int threads;
-#endif
 
     struct GModule *module;
     struct
@@ -253,7 +251,6 @@
 	_("Name for output vector map showing overlapping windows");
     parm.overfile->guisection = _("Outputs");
 
-#if defined(_OPENMP)
     parm.threads = G_define_option();
     parm.threads->key = "nprocs";
     parm.threads->type = TYPE_INTEGER;
@@ -262,7 +259,6 @@
     parm.threads->description =
 	_("Number of threads for parallel computing");
     parm.threads->guisection = _("Parameters");
-#endif
 
     parm.maskmap = G_define_standard_option(G_OPT_R_INPUT);
     parm.maskmap->key = "mask";
@@ -401,7 +397,6 @@
     treefile = parm.treefile->answer;
     overfile = parm.overfile->answer;
 
-#if defined(_OPENMP)
     sscanf(parm.threads->answer, "%d", &threads);
     if (threads < 1)
     {
@@ -413,7 +408,11 @@
         G_warning(_("Parallel computation disabled when deviation output is required"));
         threads = 1;
     }
+#if defined(_OPENMP)
     omp_set_num_threads(threads);
+#else
+    if (threads > 1)
+        G_warning(_("GRASS GIS is not compiled with OpenMP support, parallel computation is disabled."));
 #endif
 
     if (devi) {



More information about the grass-commit mailing list