Skip to content

Commit

Permalink
Use API->n_cores instead of gmtlib_get_num_processors() to see if it …
Browse files Browse the repository at this point in the history
…pleases Mac
  • Loading branch information
joa-quim committed Jun 18, 2024
1 parent e7c3397 commit 9173ce2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/grdfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,13 +896,13 @@ 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 (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" );
//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());
GMT->common.x.n_threads = API->n_cores;
GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Enable all available threads (up to %d)\n", API->n_cores);
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/potential/gmtgravmag3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static int parse(struct GMT_CTRL *GMT, struct GMTGRAVMAG3D_CTRL *Ctrl, struct GM

#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 (!GMT->common.x.active) GMT->common.x.n_threads = API->n_cores;
#endif

n_errors += gmt_M_check_condition(GMT, Ctrl->S.active && (Ctrl->S.radius <= 0.0 || gmt_M_is_dnan (Ctrl->S.radius)),
Expand Down
2 changes: 1 addition & 1 deletion src/potential/grdgravmag3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static int parse(struct GMT_CTRL *GMT, struct GRDGRAVMAG3D_CTRL *Ctrl, struct GM

#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 (!GMT->common.x.active) GMT->common.x.n_threads = API->n_cores;
#endif

n_errors += gmt_M_check_condition(GMT, !Ctrl->In.file[0], "Must specify input file\n");
Expand Down

0 comments on commit 9173ce2

Please sign in to comment.