74
M. Nakao and H. Murai
Omni compiler
Fig. 1 Operation flow of Omni compiler (https://omni-compiler.org)
If necessary, a code besides the directives is also modified. Secondly, a native
compiler (e.g., gcc or Intel) compiles the translated code and creates an execution
binary with linking to Omni compiler runtime library. The runtime library uses MPI
in XMP, and CUDA in OpenACC, and both MPI and CUDA in XACC. As for
XMP, Omni compiler may create better runtime libraries by adding a one-sided
communication library to MPI, which is described in Chap. 3.
2.2 Example of Code Translation
This section describes how Omni compiler translates a user code for the global-view
memory model. A code translation for the local-view memory model is described
in Chap. 3.
2.2.1 Distributed Array
Figure 2 shows an XMP example code using an align directive to declare a
distributed array a[][].
double a[10][10];
#pragma xmp align a[i][j] with t[i][j]
void *_XMP_DESC_a;
double *_XMP_ADDR_a;
unsigned long long _XMP_ACC_a_0;
_XMP_init_array_desc(&_XMP_DESC_a, .., sizeof(double), 10, 10);
:
_XMP_alloc_array(&_XMP_ADDR_a, &_XMP_ACC_a_0, ..., _XMP_DESC_a);
Fig. 2 Code translation of align directive
M. Nakao and H. Murai
Omni compiler
Fig. 1 Operation flow of Omni compiler (https://omni-compiler.org)
If necessary, a code besides the directives is also modified. Secondly, a native
compiler (e.g., gcc or Intel) compiles the translated code and creates an execution
binary with linking to Omni compiler runtime library. The runtime library uses MPI
in XMP, and CUDA in OpenACC, and both MPI and CUDA in XACC. As for
XMP, Omni compiler may create better runtime libraries by adding a one-sided
communication library to MPI, which is described in Chap. 3.
2.2 Example of Code Translation
This section describes how Omni compiler translates a user code for the global-view
memory model. A code translation for the local-view memory model is described
in Chap. 3.
2.2.1 Distributed Array
Figure 2 shows an XMP example code using an align directive to declare a
distributed array a[][].
double a[10][10];
#pragma xmp align a[i][j] with t[i][j]
void *_XMP_DESC_a;
double *_XMP_ADDR_a;
unsigned long long _XMP_ACC_a_0;
_XMP_init_array_desc(&_XMP_DESC_a, .., sizeof(double), 10, 10);
:
_XMP_alloc_array(&_XMP_ADDR_a, &_XMP_ACC_a_0, ..., _XMP_DESC_a);
Fig. 2 Code translation of align directive
