GenericMappingTools / GenericMappingTools/gmt

Let only modules using OpenMP list it on the synopsis line if enabled

Open
#7,173 0 comments 0 reactions 1 assignee Claimed by @PaulWessel View on GitHub
feature request
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

**Description of the desired feature**

Currently, if you build GMT with OpenMP support (which we do for the distributed installers), then all module synopsis lines look like this (e.g, **psxy**):

`gmt psxy [core] 6.5.0 [MP] - Plot lines, polygons, and symbols in 2-D`

i.e., the **[MP]** flag is always there. Of course, there is nothing in **psxy** that actually uses OpenMP so it would obviously be better if the **[MP]** string only was presented if the module actually takes advantage of OpenMP. This feature request asks for that to be done.

Currently, we use the static string created by the _GMT_version_() macro to print the version stuff which includes **[MP]** as another static string named **GMT_MP** - hence it is the same fixed constant string for all modules. I think the only way to make it more flexible would be to

1. Remove the inclusion of **[MP]** from the _GMT_version_ macro in gmt_version.h.in.
2. Set new macro **THIS_MODULE_MP** to **Y** or **N** at the top of each module using OpenMP.
3. In _gmt_show_name_and_purpose_, expect a new final argument _use_MP_ and then use that to decide to print **[MP]** or not (if the _OPENMP compiler flag is active - else not).
4. Pass **THIS_MODULE_MP** as new last argument to all the _gmt_show_name_and_purpose_ calls (1 per module).

There is a bit of work involved here to see if this recipe would do the right thing or not. Does @GenericMappingTools/core think this is a useful improvement? I am leaning that way due to the false advertisement we otherwise have. Note: It is a bit more involved than just grepping for _OPENMP in each module since modules like **grdmath** calls library functions elsewhere that has _OPENMP, so a bit of manual thinking will be required.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.