Skip to content

Confusion about global versus local arrays #525

Answered by dionhaefner
jklymak asked this question in Q&A
Discussion options

You must be logged in to vote

The easiest way to achieve this within setup files is to pass dist_safe=False to @veros_routineand to work on global arrays instead. Routines marked as non-dist safe will automatically perform gather and scatter operations at their boundaries. The code is executed on the main process which shouldn't be an issue for routines that are only called once (i.e., all except set_forcing and after_timestep).

Otherwise, you can use veros.runtime_state.proc_idx to get the (i, j) index of the current process.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@jklymak
Comment options

@dionhaefner
Comment options

Answer selected by jklymak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants