The da_distribution Callback Procedure
The following procedure returns a list of process and thread identifiers over which this array is distributed. In this simple example, any of these arrays are distributed over all processes.
proc da_distribution {type_id address} {
#
# For the moment we assume this is all items in our
# workers group.
global GROUP WGROUP _da_nprocs
# Choose the first process in the focus set.
set proc [lindex [TV::focus_processes] 0]
# Find the relevant worker group identifier.
set group_id $WGROUP($proc)
# Extract the member identifiers from the worker
# contents.
set res [lrange $GROUP($group_id) 1 end]
# Save the number of processes for later.
set _da_nprocs [llength $res]
return $res
}
The da_distribution procedure defines the set of processes or threads that contribute data to the distributed object. It returns a list containing the names of these objects. The order of the processes and threads in this list is important since the value returned by the address callback (described in the next section) to describe the process or thread is an index into this list.