@@ -2607,8 +2607,8 @@ GMT_LOCAL int gmtinit_parse_U_option (struct GMT_CTRL *GMT, char *item) {
2607
2607
}
2608
2608
2609
2609
/*! -x[[-]<ncores>] */
2610
+ GMT_LOCAL int gmtinit_parse_x_option (struct GMT_CTRL *GMT, char *arg) { /* Only effective if MP is enabled */
2610
2611
#ifdef GMT_MP_ENABLED
2611
- GMT_LOCAL int gmtinit_parse_x_option (struct GMT_CTRL *GMT, char *arg) {
2612
2612
GMT->common.x.active = true;
2613
2613
if (!arg) return (GMT_PARSE_ERROR); /* -x requires a non-NULL argument */
2614
2614
if (arg[0] == '\0') /* Use all processors */
@@ -2622,9 +2622,9 @@ GMT_LOCAL int gmtinit_parse_x_option (struct GMT_CTRL *GMT, char *arg) {
2622
2622
GMT->common.x.n_threads = MAX(gmtlib_get_num_processors() - abs (GMT->common.x.n_threads), 1); /* Max-n but at least one */
2623
2623
if (GMT->current.setting.max_cores) /* Limit to max core defaults setting */
2624
2624
GMT->common.x.n_threads = GMT->current.setting.max_cores;
2625
+ #endif
2625
2626
return (GMT_NOERROR);
2626
2627
}
2627
- #endif
2628
2628
2629
2629
/*! . */
2630
2630
GMT_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) {
9151
9151
case 's': error += GMT->common.s.active == false; break;
9152
9152
case 't': error += GMT->common.t.active == false; break;
9153
9153
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");
9156
9158
#endif
9159
+ break;
9157
9160
case ':': error += GMT->common.colon.active == false; break;
9158
9161
9159
9162
default:
@@ -18792,12 +18795,13 @@ int gmt_parse_common_options (struct GMT_CTRL *GMT, char *list, char option, cha
18792
18795
error += gmt_M_more_than_once (GMT, GMT->common.w.active) || gmtinit_parse_w_option (GMT, item);
18793
18796
break;
18794
18797
18795
- #ifdef GMT_MP_ENABLED
18796
18798
case 'x':
18797
18799
error += (gmt_M_more_than_once (GMT, GMT->common.x.active) || gmtinit_parse_x_option (GMT, item));
18798
18800
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");
18800
18803
#endif
18804
+ break;
18801
18805
18802
18806
case ':':
18803
18807
error += (gmt_M_more_than_once (GMT, GMT->common.colon.active) || gmtinit_parse_colon_option (GMT, item));
0 commit comments