26
H. Murai et al.
Fig. 19 Example of task construct (1)
XcalableMP C
#pragma xmp task on p[1:3]
{
#pragma xmp bcast (num)
}
XcalableMP Fortran
!$xmp task on p(2:4)
!$xmp bcast (num)
!$xmp end task
This bcast construct is executed by the node set specified by the on clause of
the task construct. Thus, the node p[1] broadcasts the value of num to p[2]
and p[3] in XMP/C, and p(2) to p(3) and p(4) in XMP/Fortran.
The bcast construct in the above code is equivalent to that in the following
code, where it is executed by a new node set q that is explicitly declared.
XcalableMP C
#pragma xmp nodes q[3] = p[1:3]
#pragma xmp bcast (num) on q
XcalableMP Fortran
!$xmp nodes q(3) = p(2:4)
!$xmp bcast (num) on q
Précédent

- 34/265

Suivant