-
Notifications
You must be signed in to change notification settings - Fork 361
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
GMT 5 much slower than GMT 4? #587
Comments
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute! Please make sure you read our Contributing Guide and abide by our Code of Conduct. |
Hi @alomax, you are right that GMT5 is slower than GMT4 for many tasks, especially table i/o. The key reason for this is that the entire i/o machinery was replaced to enable us to extend GMT to other platforms such as MATLAB, Python, Julia and more via the API. As such, the API is a bit immature and has room for optimizing. It would be helpful to see your actual scripts for the jobs that are timing out as we may be able to offer some advice for the short-term, and hopefully we can also determine which are the most critical bottlenecks. For instance, if you have fixed areas and you are running pscoast, consider running that once, store the PostScript overlay, and simply cat it in place as needed instead of re-running the same command, etc. |
But it's nevertheless strange that the script is made up of basically |
Yes, those are both unaffected by the i/o changes so perhaps we need to run a time and eventually profiling of the calls. |
Not really comparable, but maybe a relevant footnote; http://gmt.soest.hawaii.edu/boards/1/topics/7996. |
Thanks for the extensive comments @PaulWessel, and also @joa-quim and @abanbj Here are the scripts, but the ensemble is a monster! https://www.dropbox.com/s/8gsszu86ts4k9m9/EarlyEest_GMT5_scripts.tgz?dl=0 We do have a fixed, world map, but for each earthquake detected there is a regional map with center at the current earthquake epicenter. Is perhaps the main increase in execution time GMT5 vs GMT4 due to the creation and management of a new session Thanks, |
Don't think the
and timings are
So, actually, Ah, and remind that these timings include the Julia parsing too, though they presumably very small. |
@joa-quim I was wondering if the whole session architecture and management overhead is the main difference GMT 5 vs GMT 4 when run as individual commands from the shell. Not just the initial |
Yes, not impossible, but in that case a single, tailored, executable with all the commands for your needs wouldn't be substantially faster since it would use the same architecture anyway. |
But in GMT 5 it looks like each call to While doing all in a single program with the new API would only set up one session. |
Yes, and that is why I tested the timings for creating and deleting new sessions. Aside from the time consumed in in creating/deleting new sessions, both the single exe and the multiple commands solutions should spend the same time in managing the sessions. Off course I may be wrong and nothing like testing. BTW, maintaining a single session is what the Julia wrapper does for the GMT scripts, but one has to pay also the parsing time plus some memory copies that sometimes must be made. |
A bit intriguing.
timings vary a bit but the relation is close to this
|
But in GMT 5 it looks like each call to While doing all in a single program with the new API would only set up one session. |
I would think the i/o is where the slowness is but we will need to have a look. If you scripts do a bunch of GMT calls building a plot then it would be possible to write a C program that just called Create, a bunch of GMT_Call_Module with strings, and GMT_Destroy. So you would save all those Create/Destroy times which certainly takes some time. But I don't want to send you down that path with the promise of speedup without doing some more testing. |
Yes, it may be that a combination of i/o and Create/Destroy in many gmt calls is a major cause of slowness. In our scripts, there is a set of many psxy calls which shows up in timing tests as a relatively large user of time:
It does seem likely that an envelope C program instead of bash script would be (much) more efficient. But I will wait for more testing proof. And we do not currently have €€€€ for such development (€) and testing (€€€) of new envelope C programs... |
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
It seems there is nothing we can do here. Closing? |
No, simply have not had time to investigate - lets keep it alive. |
Equivalent command line scripts take more than twice as long to run in GMT 5 than in GMT 4
We use GMT extensively for maps, earthquake mechanisms and other plots in a time-sensitive, real-time system: http://early-est.alomax.net
The latest versions of our software using GMT 5 are broken because the plotting and reporting module does not complete fast enough. We suspect this may be primarily due to much the longer processing time needed for command line GMT 5 than for GMT 4:
Full scripts that show the difference in run time:
https://www.dropbox.com/s/0asx13o1ahiz1dr/test_GMT4.bash?dl=0
https://www.dropbox.com/s/cz0acpj4cueyatz/test_GMT5.bash?dl=0
System information
Operating system:
System Version: OS X 10.10.5 (14F2511)
Kernel Version: Darwin 14.5.0
Hardware:
Model Name: iMac
Model Identifier: iMac14,2
Processor Name: Intel Core i7
Processor Speed: 3.5 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 16 GB
Version of GMT: 4.5.7 and 5.4.5
The text was updated successfully, but these errors were encountered: