Next: , Previous: , Up: Language-visible functions   [Contents][Index]


Topology-function descriptions

Topology functions

In the following functions, the ‘dfunc’ versions merely cast their arguments to ncptl_ints and call the corresponding ‘func’ versions.

Function: ncptl_int ncptl_func_tree_parent (ncptl_int task, ncptl_int arity)
Function: double ncptl_dfunc_tree_parent (double task, double arity)

Return task task’s parent in an arity-ary tree.

Function: ncptl_int ncptl_func_tree_child (ncptl_int task, ncptl_int child, ncptl_int arity)
Function: double ncptl_dfunc_tree_child (double task, double child, double arity)

Return child child of task task in an arity-ary tree.

Function: ncptl_int ncptl_func_mesh_coord (ncptl_int vartask, ncptl_int coord, ncptl_int width, ncptl_int height, ncptl_int depth)
Function: double ncptl_dfunc_mesh_coord (double vartask, double coord, double width, double height, double depth)

Return task task’s x coordinate (coord=0), y coordinate (coord=1), or z coordinate (coord=2) on a width*height*depth mesh (or torus).

Function: ncptl_int ncptl_func_mesh_neighbor (ncptl_int width, ncptl_int height, ncptl_int depth, ncptl_int xtorus, ncptl_int ytorus, ncptl_int ztorus, ncptl_int task, ncptl_int xdelta, ncptl_int ydelta, ncptl_int zdelta)
Function: double ncptl_dfunc_mesh_neighbor (double width, double height, double depth, double xtorus, double ytorus, double ztorus, double task, double xdelta, double ydelta, double zdelta)

Return one of task task’s neighbors—not necessarily an immediate neighbor—on a 3-D mesh or torus. For the following explanation, assume that task task lies at coordinates (x, y, z) on a width*height*depth mesh or torus. In the mesh case (xtorus=ytorus=ztorus=0), the value returned is the task ID corresponding to coordinates (x+xdelta, y+ydelta, z+zdelta). In the full-torus case (xtorus=ytorus=ztorus=1), the value returned is the task ID corresponding to coordinates ((x+xdelta) mod width, (y+ydelta) mod height, (z+zdelta) mod depth).

Note that there are no 1-D or 2-D grid functions. Instead, the appropriate 3-D function should be used with depth and—in the 1-D case—height set to ‘1’.

Function: ncptl_int ncptl_func_knomial_parent (ncptl_int task, ncptl_int arity, ncptl_int numtasks)
Function: double ncptl_dfunc_knomial_parent (double task, double arity, double numtasks)

Return task task’s parent in an arity-nomial tree of numtasks tasks.

Function: ncptl_int ncptl_func_knomial_child (ncptl_int task, ncptl_int child, ncptl_int arity, ncptl_int numtasks, ncptl_int count_only)
Function: double ncptl_dfunc_knomial_child (double task, double child, double arity, double numtasks, double count_only)

If count_only is ‘0’, return task task’s childth child in an arity-nomial tree of numtasks tasks. If count_only is ‘1’, return the number of children task task has in an arity-nomial tree of numtasks tasks.


Next: , Previous: , Up: Language-visible functions   [Contents][Index]

Scott Pakin, pakin@lanl.gov