
Namespace issue: Although namespace
is part of ANSI C++ standard, not all C++ compilers support namespaces
(A non-instantiable GA class is provided for implementations using compilers
without namespace).
Note: define the variable _GA_USENAMESPACE_ as 0 in ga++.h if your
compiler doesnot support namespaces.
namespace
GA {
class GAServices;
class GlobalArray;
};
Current implementation has no derived classes (no (virtual) inheritance), templates or exception handling. Eventually, more object oriented functionalities will be added, and standard library facilities will be used without affecting the performance.
GA::Initialize():
Initialize Global Arrays, allocates and initializes internal data structures
in Global Arrays. This is a collective operation.
GA::Terminate():
Delete all active arrays and destroy internal data structures. This
is a collective operation.
namespace GA {
_GA_STATIC_ void Initialize(int argc, char *argv[], size_t limit = 0);
_GA_STATIC_ void Initialize(int argc, char *argv[], unsigned long heapSize,
unsigned long stackSize, int type, size_t limit = 0);
_GA_STATIC_ void Terminate();
};
Example:
#include <iostream.h>
#include "ga++.h"
int
main(int argc, char **argv) {
GA::Initialize(argc, argv, 0);
cout << "Hello World\n";
GA::Terminate();
}
SERVICES Object:
GA namespace has a global "SERVICES" object (of
type "GAServices"), which can be used to invoke the non-array operations.
To call the functions (for example, sync()), we invoke them on this SERVICES
object (for example, GA::SERVICES.sync()). As this object is in the global
address space, the functions can be invoked from anywhere inside the program
(provided the ga++.h is included in that file/program).