The Type Transformation for mandel.c
The commands that install a type transformation for the distributed array within mandel.c are:
set proto_id [TV::prototype create Array]
TV::prototype set $proto_id \
name {^struct cyclic_array$} \
language c \
validate_callback da_validate \
typedef_callback da_typedef \
type_callback da_type \
rank_callback da_rank \
bounds_callback da_bounds \
address_callback da_address \
distribution_callback da_distribution
apply_prototype_to_focus $proto_id
This chapter will only present validate_callback, address_callback, and the distribution_callback procedures. The other callbacks and the related utility functions are either identical or similar to those that have already been discussed. (A complete listing of these callbacks is located in The cyclic_array.tcl Type Mapping File.) The most important differences between this distributed example and the other array example are:
- The prototype also has a distribution_callback property. This callback provides TotalView with the set of processes over which the array is distributed.
- If an array prototype has a distribution callback, you must:
- Add a replication argument to the addressing callback.
- Provide an index into the distribution.
- Create an addressing operation that indicates the process or thread from which TotalView will fetch the data and its address.