-
Notifications
You must be signed in to change notification settings - Fork 363
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
grdimage [ERROR]: Option -x given more than once #8256
Comments
Hm, I can reproduce the same. Very odd since 1.. If I build with Xcode there is no OPENMP available yet I still get that message. Traced to
GMT_MP_ENABLED means a guru wishes to build with OPenMP if possible but that does not happen in Xcode, yet GMT_MP_ENABLED is true. _OPENMP is not set. If I wrap the parsing under #ifdef _OPENMP then it more correctly gives the error
since it is not available without OpenMP. However, when I build with gcc and enable openMP the same command yields what you got:
I cannot debug the MP version but even the non-MP debug in Xcode does show me that "-x2" is passed twice, but the linked options produced by Create_Options only has it once. So somewhere in GMT_Parse_Common it is passed two times to Ideally if not MP I would prefer a message like
but it comes from a common macro. |
Yikes, more problems that that. I think this started to happen when we decided that if gthreads is used then we do this: #if defined(HAVE_GLIB_GTHREAD) || defined(_OPENMP) so I was wrong in previous post. Bt, the wast amount of modules that can use openMP, not gthreads (e.g., grdfilter and a few tools in supplements potential, so turning -x on in the pure OpenMP modules is what gives these errors. I think the solution is to have two GMT_x_OPT_MP, GMT_ADD_x_OPT_MP and the same for GTHREAD. Then, the modules needing -x should use the MP option except for a few that needs to GTHREAD option. Does that make sense @joa-quim and @weiji14 ? Means we need to finish this work before we release 6.5. |
Oh, and then on system with both MP and GTHREAD, what do we do? Always select MP if both are present, i.e., if _HAVE_MP set those args else if GHTRED set the other constants, and if neither set them to blank? |
That was the only plotting module that still had the old lower case xy in the MODULE OPTIONS list. We then added x for multicore, hence got 2 -x options to check and that yielded the trouble in #8256. This lead to more relevant fixes in grdfilter test scripts.
Final findings: None of the above was really relevant. The problem was strictly a grdimage bug. As you know, all modules have a THIS_MODULE_OPTIONS string which is used by Minor code changes:
PR coming once I've run tests. |
…xes (#8257) * Remove deprecated xy from grdimage's THIS_MODULE_OPTIONS That was the only plotting module that still had the old lower case xy in the MODULE OPTIONS list. We then added x for multicore, hence got 2 -x options to check and that yielded the trouble in #8256. This lead to more relevant fixes in grdfilter test scripts. * Handle -x in usage and synopsis * Update explain_core_full.rst_ * Restor GLIB check for windows
Thanks @PaulWessel, appreciate the fix. But... PyGMT's dev builds from about 6 hours ago now errors at https://github.com/GenericMappingTools/pygmt/actions/runs/7416568349/job/20181749581#step:15:908 (build from GMT master) with |
Actually no. On Linux and macOS, we're using this script https://github.com/GenericMappingTools/gmt/blob/master/ci/build-gmt.sh to build GMT source codes. |
Oh nice, false alarm then (should have looked at the Windows build for once). We should improve that bash script after the 6.5.0 release. |
Yes, I just build both Xcode version (no OMP but Gthreads) and OPenMP + Gthreads version and if you run a a grd* module that has OpenMP but not actually linked that way you cannot use -x since it is not a vaiid option. We have one issue that Joaquim and I decided to punt on until 6.5 is out and that is the different behavior of -x for his Gthreads modules and all the OpenMP modules: For the OpenMP modules, if compiled to use OpenMP, the default behavior is to actually use all the available core. If you dont want that then you use -x to specify how many. For the 4 Gthreads modules the default is do not use Threads unless -z+a is used. We wish all parallel executables to behave the same way (Default is using all cpus and the +a modifier will be history). |
Description of the problem
Running
grdimage
with the-x
(cores) option fails on GMT 6.4.0 and GMT 6.5.0.dev9+0776994. It seems to think the-x
option is being passed in more than once? Noticed at GenericMappingTools/pygmt#2945 (comment)Full script that generated the error
Full error message
Actual outcome
grdimage
errorsExpected outcome
A map like this should be produced:
System information
gmt --version
): 6.4.0The text was updated successfully, but these errors were encountered: