No more threadid indexing? [thread-local storage]

In other words, you’d be replacing the line

GP = buffers.thread_buffers[tid]

with something like

GP = get!(task_local_storage(), :FLORIDyn_buffer) do
   # create new buffer if it doesn't exist yet for this task
end::WindFarm

Since this is only executed once per iteration, and the rest of the iteration (the rest of your for loop body) seems to do a lot of other work, why would the cost of a dictionary lookup matter?

6 Likes