Skip to content

Commit

Permalink
Do not use multi-threads with -Ff (custom filter). It's broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed Jun 18, 2024
1 parent 94ce412 commit e7c3397
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/grdfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,15 @@ static int parse (struct GMT_CTRL *GMT, struct GRDFILTER_CTRL *Ctrl, struct GMT_

#ifdef HAVE_GLIB_GTHREAD
/* Make the default equal to the OMP case where we use all threads if not stated otherwise. */
if (!GMT->common.x.active) GMT->common.x.n_threads = gmtlib_get_num_processors();
if (Ctrl->F.custom && GMT->common.x.n_threads > 1) {
GMT->common.x.n_threads = 1;
GMT->common.x.active = false;
GMT_Report (GMT->parent, GMT_MSG_WARNING, "Sorry, custom filtering does not support multiple threads. Reset to 1.\n" );
}
if (!GMT->common.x.active) {
GMT->common.x.n_threads = gmtlib_get_num_processors();
GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Enable all available threads (up to %d)\n", gmtlib_get_num_processors());
}
#endif

n_errors += gmt_M_check_condition (GMT, !Ctrl->G.active, "Option -G: Must specify output file\n");
Expand Down

0 comments on commit e7c3397

Please sign in to comment.