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

GMT.jl is not thread capable #564

Open
joa-quim opened this issue Apr 2, 2021 · 0 comments
Open

GMT.jl is not thread capable #564

joa-quim opened this issue Apr 2, 2021 · 0 comments

Comments

@joa-quim
Copy link
Member

joa-quim commented Apr 2, 2021

Made this experiment

julia> Threads.nthreads()
6

julia> G = GMT.peaks(N=2000);

julia> @time for k=1:20 grdgradient(G, A=0); end
  9.382858 seconds (160.01 M allocations: 2.683 GiB, 4.60% gc time)

julia> @time Threads.@threads for k=1:20 grdgradient(G, A=0); end
grdgradient [ERROR]: Option -n given more than once
grdgradient [ERROR]: Option -n parsing failure. Correct syntax:
...

The problem is very likely that all threads are using the same API session and mess follows as it has to be.
The solution seems to be to create a mechanism where each new thread launches a new gmt() process with its own API session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant