@@ -2607,8 +2607,8 @@ GMT_LOCAL int gmtinit_parse_U_option (struct GMT_CTRL *GMT, char *item) {
26072607}
26082608
26092609/*! -x[[-]<ncores>] */
2610+ GMT_LOCAL int gmtinit_parse_x_option (struct GMT_CTRL *GMT, char *arg) { /* Only effective if MP is enabled */
26102611#ifdef GMT_MP_ENABLED
2611- GMT_LOCAL int gmtinit_parse_x_option (struct GMT_CTRL *GMT, char *arg) {
26122612 GMT->common.x.active = true;
26132613 if (!arg) return (GMT_PARSE_ERROR); /* -x requires a non-NULL argument */
26142614 if (arg[0] == '\0') /* Use all processors */
@@ -2622,9 +2622,9 @@ GMT_LOCAL int gmtinit_parse_x_option (struct GMT_CTRL *GMT, char *arg) {
26222622 GMT->common.x.n_threads = MAX(gmtlib_get_num_processors() - abs (GMT->common.x.n_threads), 1); /* Max-n but at least one */
26232623 if (GMT->current.setting.max_cores) /* Limit to max core defaults setting */
26242624 GMT->common.x.n_threads = GMT->current.setting.max_cores;
2625+ #endif
26252626 return (GMT_NOERROR);
26262627}
2627- #endif
26282628
26292629/*! . */
26302630GMT_LOCAL int gmtinit_parse_colon_option (struct GMT_CTRL *GMT, char *item) {
@@ -9151,9 +9151,12 @@ int gmt_default_error (struct GMT_CTRL *GMT, char option) {
91519151 case 's': error += GMT->common.s.active == false; break;
91529152 case 't': error += GMT->common.t.active == false; break;
91539153 case 'w': error += GMT->common.w.active == false; break;
9154- #if defined(GMT_MP_ENABLED)
9155- case 'x': error += GMT->common.x.active == false; break;
9154+ case 'x': error += GMT->common.x.active == false;
9155+ #if !defined(GMT_MP_ENABLED)
9156+ error --;
9157+ GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Option -x: GMT is not compiled with parallel support. Only one core is used\n");
91569158#endif
9159+ break;
91579160 case ':': error += GMT->common.colon.active == false; break;
91589161
91599162 default:
@@ -18792,12 +18795,13 @@ int gmt_parse_common_options (struct GMT_CTRL *GMT, char *list, char option, cha
1879218795 error += gmt_M_more_than_once (GMT, GMT->common.w.active) || gmtinit_parse_w_option (GMT, item);
1879318796 break;
1879418797
18795- #ifdef GMT_MP_ENABLED
1879618798 case 'x':
1879718799 error += (gmt_M_more_than_once (GMT, GMT->common.x.active) || gmtinit_parse_x_option (GMT, item));
1879818800 GMT->common.x.active = true;
18799- break;
18801+ #if !defined(GMT_MP_ENABLED)
18802+ GMT_Report (GMT->parent, GMT_MSG_WARNING, "Option -x: GMT is not compiled with parallel support. Only one core is used\n");
1880018803#endif
18804+ break;
1880118805
1880218806 case ':':
1880318807 error += (gmt_M_more_than_once (GMT, GMT->common.colon.active) || gmtinit_parse_colon_option (GMT, item));
0 commit comments