From 0c663b72529dc2b9e766ae90200e2dbc9cc1fdae Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Sat, 20 Jan 2024 13:05:39 +0100 Subject: [PATCH 1/3] Reduce lack of -x to just an information messag See #8300. Just say if no parallel support then only once care will be used. However @seisman, my effort at printing that out fails (but the error is gone). Can you check why #if !defined(GMT_MP_ENABLED) seems to fail for me? --- src/gmt_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gmt_init.c b/src/gmt_init.c index 62e7f43bcc8..00ff55d2144 100644 --- a/src/gmt_init.c +++ b/src/gmt_init.c @@ -9164,9 +9164,12 @@ int gmt_default_error (struct GMT_CTRL *GMT, char option) { case 's': error += GMT->common.s.active == false; break; case 't': error += GMT->common.t.active == false; break; case 'w': error += GMT->common.w.active == false; break; -#ifdef GMT_MP_ENABLED - case 'x': error += GMT->common.x.active == false; break; + case 'x': error += GMT->common.x.active == false; + error--; +#if !defined(GMT_MP_ENABLED) + GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Option -x: GMT is not compiled with parallel support. Only one core is used\n"); #endif + break; case ':': error += GMT->common.colon.active == false; break; default: @@ -18770,10 +18773,11 @@ int gmt_parse_common_options (struct GMT_CTRL *GMT, char *list, char option, cha error += gmt_M_more_than_once (GMT, GMT->common.w.active) || gmtinit_parse_w_option (GMT, item); break; -#ifdef GMT_MP_ENABLED case 'x': error += (gmt_M_more_than_once (GMT, GMT->common.x.active) || gmtinit_parse_x_option (GMT, item)); GMT->common.x.active = true; +#!define(GMT_MP_ENABLED) + GMT_Report (GMT->parent, GMT_MSG_WARNING, "Option -x: GMT is not compiled with parallel support. Only one core is used\n"); break; #endif From 2f9467cda07327a224fdc6ac027d1c6b328c38a9 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Sat, 20 Jan 2024 15:32:28 +0100 Subject: [PATCH 2/3] Update src/gmt_init.c Co-authored-by: Dongdong Tian --- src/gmt_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmt_init.c b/src/gmt_init.c index 00ff55d2144..15b34cc9340 100644 --- a/src/gmt_init.c +++ b/src/gmt_init.c @@ -18776,7 +18776,7 @@ int gmt_parse_common_options (struct GMT_CTRL *GMT, char *list, char option, cha case 'x': error += (gmt_M_more_than_once (GMT, GMT->common.x.active) || gmtinit_parse_x_option (GMT, item)); GMT->common.x.active = true; -#!define(GMT_MP_ENABLED) +#if !define(GMT_MP_ENABLED) GMT_Report (GMT->parent, GMT_MSG_WARNING, "Option -x: GMT is not compiled with parallel support. Only one core is used\n"); break; #endif From 06b7dc91e13b2247426f0ea1b0553444ae60de49 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 26 Jan 2024 22:57:40 +0800 Subject: [PATCH 3/3] Update src/gmt_init.c --- src/gmt_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmt_init.c b/src/gmt_init.c index 15b34cc9340..66a95fb2a88 100644 --- a/src/gmt_init.c +++ b/src/gmt_init.c @@ -18776,7 +18776,7 @@ int gmt_parse_common_options (struct GMT_CTRL *GMT, char *list, char option, cha case 'x': error += (gmt_M_more_than_once (GMT, GMT->common.x.active) || gmtinit_parse_x_option (GMT, item)); GMT->common.x.active = true; -#if !define(GMT_MP_ENABLED) +#if !defined(GMT_MP_ENABLED) GMT_Report (GMT->parent, GMT_MSG_WARNING, "Option -x: GMT is not compiled with parallel support. Only one core is used\n"); break; #endif