XcalableMP Programming Model and Language
9
1.5.2 Array Assignment Statement in XcalableMP C
In XcalableMP C, the base language C is also extended so that it supports array
assignment statements just as Fortran does.
With such statement, the value of each element of the result of the right-hand side
expression is assigned to the corresponding element of the array section on the lefthand side. When an operator or an elemental function is applied to array sections in
the right-hand side expression, it is evaluated to an array section that has the same
shape as that of the operands or arguments, and each element of which is the result
of the operator or function applied to the corresponding element of the operands or
arguments. A scalar object is assumed to be an array section that has the same shape
as that of the other array section(s) in the expression or on the left-hand side, and
where each element has its value.
Note that an array assignment is a statement, and therefore cannot appear as an
expression in any other statements.
In the example below, an array assignment statement in the fourth line copies the
five elements from B[0] to B[4] into the elements from A[5] to A[9].
XcalableMP C
int A[10];
int B[5];
...
A[5:5] = B[0:5];
1.6 Interoperability
Most of the existing parallel applications are written with MPI. It is not realistic to
port them over to XMP because each of them consists of millions of lines.
Because XMP is interoperable with MPI, users can develop an XMP application
by modifying a part of an existing one instead of rewriting it totally. Besides, when
developing a parallel application from scratch, it is possible to use XMP to write a
complicated part of, for example, domain decomposition while they use MPI, which
could be faster than XMP, to write a hot-spot part that need to be tuned carefully. In
addition, XMP is interoperable with OpenMP and Python (see Chap. 5).
It might be difficult to develop an application with just one programming
language or framework since it generally has its own strong and weak points. Thus,
an XMP program is interoperable with those in other languages to provide both high
productivity and performance.
9
1.5.2 Array Assignment Statement in XcalableMP C
In XcalableMP C, the base language C is also extended so that it supports array
assignment statements just as Fortran does.
With such statement, the value of each element of the result of the right-hand side
expression is assigned to the corresponding element of the array section on the lefthand side. When an operator or an elemental function is applied to array sections in
the right-hand side expression, it is evaluated to an array section that has the same
shape as that of the operands or arguments, and each element of which is the result
of the operator or function applied to the corresponding element of the operands or
arguments. A scalar object is assumed to be an array section that has the same shape
as that of the other array section(s) in the expression or on the left-hand side, and
where each element has its value.
Note that an array assignment is a statement, and therefore cannot appear as an
expression in any other statements.
In the example below, an array assignment statement in the fourth line copies the
five elements from B[0] to B[4] into the elements from A[5] to A[9].
XcalableMP C
int A[10];
int B[5];
...
A[5:5] = B[0:5];
1.6 Interoperability
Most of the existing parallel applications are written with MPI. It is not realistic to
port them over to XMP because each of them consists of millions of lines.
Because XMP is interoperable with MPI, users can develop an XMP application
by modifying a part of an existing one instead of rewriting it totally. Besides, when
developing a parallel application from scratch, it is possible to use XMP to write a
complicated part of, for example, domain decomposition while they use MPI, which
could be faster than XMP, to write a hot-spot part that need to be tuned carefully. In
addition, XMP is interoperable with OpenMP and Python (see Chap. 5).
It might be difficult to develop an application with just one programming
language or framework since it generally has its own strong and weak points. Thus,
an XMP program is interoperable with those in other languages to provide both high
productivity and performance.
