XcalableMP Programming Model and Language
59
Fig. 46 bcast construct (3)
XcalableMP Fortran
!$xmp nodes p(4)
:
sum = xmp_node_num()
!$xmp bcast (num) from p(4) on p(2:4)
4.6 wait_async Construct
Communication directives (i.e. reflect, gmove, reduction, bcast, and
reduce_shadow) can perform asynchronous communication if the async
clause is added. The wait_async construct is used to guarantee the completion
of such an asynchronous communication.
XcalableMP C
#pragma xmp bcast (num) async(1)
:
#pragma xmp wait_async (1)
XcalableMP Fortran
!$xmp bcast (num) async(1)
:
!$xmp wait_async (1)
Since the bcast directive has an async clause, communication may not
be completed immediately after the bcast directive. The completion of that
communication is guaranteed with the wait_async construct having the same
value as that of the async clause. Therefore, between the bcast construct and the
wait_async constructs, you may not reference the target variable of the bcast
directive.
Précédent

- 67/265

Suivant