
GA++: C++ Bindings for Global Arrays


Overview:
--------

GA++  provides a C++ interface to global arrays (GA) libraries. This is
the first beta release. Here is the doxygen documentation of GA++:
http://www.emsl.pnl.gov:2080/docs/global/ga++/index.html

The GA C++ bindings are a layer built directly on top of the GA C bindings. GA++ provides new names for the C bindings of GA functions (For example, GA_Add_patch() is renamed as addPatch()).


GA++ classes:
------------

All GA classes (GAServices, GlobalArray) are declared within the scope of GA namespace.

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.

Initialization and Termination:
------------------------------
GA namespace has the following static functions for initialization and termination of Global Arrays.

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();
		}
			 

GAServices:
----------
GAServices class has member functions that does all the global operations (non-array operations) like Process Information (number of processes, process id, ..), Inter-process Synchronization (sync, lock, broadcast, reduce,..), etc,. 

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).

Global Array:
------------
GlobalArray class has member functions that does: 
        Array operations, 
        One-sided(get/put), 
        Collective array operations, 
        Utility operations , etc,. 


Note:
In order to built GA++, environment variable GA_C_CORE should be defined as follows and then 'make':
	setenv GA_C_CORE y
