Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not raise "Unrecognized option -x" error if GMT is not compiled with OpenMP/GThreads support? #8300

Open
seisman opened this issue Jan 17, 2024 · 1 comment
Labels
feature request Request a new feature

Comments

@seisman
Copy link
Member

seisman commented Jan 17, 2024

The -x common option is only available if GMT is compiled with OpenMP/GThreads support. If not, using -x gives the error: Unrecognized option -x. Users may be surprised why a script works on machine A but gives such an error on machine B. After reading the documentation or the man page, they may realize that GMT on machine B is not compiled with parallel support. Then users have to modify their working script unless they're unable to install another parallel-enabled GMT.

So, instead of giving the "Unrecognized option -x" error, we can make it always available.

  • If GMT is compiled with parallel support, then everything works as before
  • If GMT is NOT compiled with parallel support, then raise a WARNING and fallback to one core

In this way,

  1. the warning message can clearly explain that the GMT is not parallel-enabled
  2. users don't have to modify their working script if they don't care about parallel
  3. the synopsis message can also be simplified (i.e., GMT_x_OPT, GMT_ADD_x_OPT)
@seisman seisman added the feature request Request a new feature label Jan 17, 2024
@PaulWessel
Copy link
Member

This is of course a recent change dealing with docs for -x and difference between OpenMP, Gthreads, and movie/batch. I would not care if we always parsed -x and if not compiled to support it we. Interested in fixing this by adding your warning instead?

PaulWessel added a commit that referenced this issue Jan 20, 2024
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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants