XcalableMP Programming Model and Language
57
10 iand
ior
ieor
Note In contrast to the reduction clause of the loop construct, which precedes loops, the reduction construct does not accept operators of firstmax,
firstmin, lastmax, and lastmin.
Note Similar to the reduction clause, the reduction construct may generate
slightly different results in a parallel execution from those in a sequential execution,
because the results depend on the order of combining the value.
4.5 bcast Construct
The bcast construct broadcasts the values of the variables on the node specified
by the from clause, that is, the root node, to the node set specified by the on clause.
If there is no from clause, the first node of the executing node set is selected as the
root node. If there is no on clause, the current executing node set of the construct
is selected as the executing node set.
In the example below, the first node of the node set p, that is, p[0] or p(1), is
the root node (Fig. 44).
XcalableMP C
#pragma xmp nodes p[4]
:
num = xmpc_node_num() + 1;
#pragma xmp bcast (num)
XcalableMP Fortran
!$xmp nodes p(4)
:
num = xmp_node_num()
!$xmp bcast (num)
In the example below, the last node, that is, p[3] or p(4), is the root node
(Fig. 45).
XcalableMP C
#pragma xmp nodes p[4]
:
57
10 iand
ior
ieor
Note In contrast to the reduction clause of the loop construct, which precedes loops, the reduction construct does not accept operators of firstmax,
firstmin, lastmax, and lastmin.
Note Similar to the reduction clause, the reduction construct may generate
slightly different results in a parallel execution from those in a sequential execution,
because the results depend on the order of combining the value.
4.5 bcast Construct
The bcast construct broadcasts the values of the variables on the node specified
by the from clause, that is, the root node, to the node set specified by the on clause.
If there is no from clause, the first node of the executing node set is selected as the
root node. If there is no on clause, the current executing node set of the construct
is selected as the executing node set.
In the example below, the first node of the node set p, that is, p[0] or p(1), is
the root node (Fig. 44).
XcalableMP C
#pragma xmp nodes p[4]
:
num = xmpc_node_num() + 1;
#pragma xmp bcast (num)
XcalableMP Fortran
!$xmp nodes p(4)
:
num = xmp_node_num()
!$xmp bcast (num)
In the example below, the last node, that is, p[3] or p(4), is the root node
(Fig. 45).
XcalableMP C
#pragma xmp nodes p[4]
:
