Go to the first, previous, next, last section, table of contents.


A complete GA example

The following is a sample Global Arrays program adapted from the original Global Arrays distribution. After initializing TCGMSG, MA, and Global Arrays, it creates an n-by-n array named `A' and referred to as g_a. It then creates an array named `B' by duplicating g_a into g_b with GA_duplicate(). The bulk of the code consists of a variety of array operations on `A' and `B'---GA_zero(), GA_put(), GA_symmetrize(), GA_transpose(), GA_add(), GA_ddot(), GA_acc(), GA_sync(), and GA_get()---that demonstrate some of Global Arrays' capabilities. At the end of the program, `A' and `B' are deallocated with a call to GA_destroy() and the program shuts down Global Arrays and TCGMSG.


Go to the first, previous, next, last section, table of contents.