Skip to content

Commit

Permalink
v.surf.rst: fix cross-validation and prevent running it multi-threaded (
Browse files Browse the repository at this point in the history
OSGeo#2643)

Bug introduced in OSGeo#1271.
  • Loading branch information
petrasovaa authored and marisn committed May 18, 2023
1 parent 173ae70 commit ef15ddc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vector/v.surf.rst/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ int main(int argc, char *argv[])
G_warning(_("Parallel computation disabled when deviation output is required"));
threads = 1;
}
if (parm.cvdev->answer && threads > 1) {
G_warning(_("Parallel computation disabled when cross validation output is required"));
threads = 1;
}
#if defined(_OPENMP)
omp_set_num_threads(threads);
#else
Expand All @@ -427,6 +431,7 @@ int main(int argc, char *argv[])
#endif

if (devi) {
create_devi = true;
if (Vect_legal_filename(devi) == -1)
G_fatal_error(_("Output vector map name <%s> is not valid map name"),
devi);
Expand Down Expand Up @@ -637,8 +642,6 @@ int main(int argc, char *argv[])
}
db_begin_transaction(driver2);
count = 1;
create_devi = true;

}

ertot = 0.;
Expand Down

0 comments on commit ef15ddc

Please sign in to comment.