The GramServer is an HPC++ server that acts as a proxy between the CAT GUI and a Globus gatekeeper daemon. The gatekeeper handles the platform-specific details involved in process creation via the GRAM protocol (see The gatekeeper process running on the target machine is used as the process creation daemon. It makes sure that the user requesting the service has the required credentials for the purpose.

Once a component is successfully instantiated using the GlobusHPC++ call hpcxx_createContext(), a contextID to the remote component process is received as return value. The GramServer uses this contextID to invoke a global function on the component to obtain a contextID to the remote component object. This remote object contextID is packed as a NexusRMI remote reference and sent to the CAT. The CAT can now directly communicate with the remote component.

The GramServer binds to a registry on startup, but the CAT can invoke a method on it, asking it to bind itself to another registry. Essentially, we need just one GramServer to run to instantiate components on different architectures. The CAT however provides an option to the user to start more than one registry if she desires.

Why is it needed ?

The GramServer is the only way for the CAT to instantiate components on remote hetrogeneous environments using GRAM. The CAT's database has information as to where the executables for the compnents reside. However the CAT needs the GramServer to verify the credentials of the CAT user and return a handle to the components once they are instantiated. The CAT and the GramServer agree on a NexusRMI registry, where the GramServer will bind itself on startup. As a result the CAT can now communicate with the GramServer and send it requests.


GramServer Startup

We need to have a NexusRMI registry running before we can startup the GramServer. The GramServer parses its command line arguments to get the NexusRMIRegistry host, NexusRMIRegistry PORT and the HPCxx_String name to be used for binding itself in the registry. By default it looks for a registry on the host machine on port 1989.

Receive a request

Once the GramServer has been bound to the NexusRMIRegistry, the CAT can do a lookup on the registry and obtain a remote reference to the GramServer. The CAT gui provides an option for the user to specify the registry host and port. The CAT then invokes the following method on the GramServer:
MyHPCxx_GlobalPtr<'Component'>  GramServer :: instantiateComponent(HPCxx_String gatekeeperMachine, HPCxx_String machineToRunOn, HPCxx_String path,  HPCxx_String FQN) 

gatekeeperMachine:: The machine whose gatekeeper needs to be contacted.
path:: The executable path of the component.
machineToRunOn: The machine to run the component on.
FQN: The fully qualified object name of the component in the CAT.

Serve the request

The GramServer receives a request when it's method instantiateComponent() is invoked. The GramServer uses the arguments of this method call to serve the request. It's a four step process:

Invoking a remote method using HPC++

We use hpcxx_invoke() while making a remote invocation using a HPCxx_ContextID and hpcxx_minvoke() when we have an HPCxx_GlobalPtr to the remote object.
  HPCxx_ContextID remoteContextID;
  HPCxx_GlobalPtr<'Server'> serverGlobalPointer;
  HPCxx_String returnString;

  hpcxx_invoke(&remoteConextID, serverGlobalPointer, RETURN_SERVER_GP_ID);
  hpcxx_minvoke(&serverGlobalPointer, returnString, SAY_HELLO_ID, argumentString);

Kill the GramServer

The GramServer runs for ever and as such needs to be killed from the command line.

Compile and Run

The GramServer needs to know the paths to HPCxx and Globus libraries. In the Makefile provided with the GramServer, fill in the values for the paths for HPCXX, GLOBUS and SSL. These variables are to be defined in Makefile.base. Now to run the GramServer on a machine with prompt" bread>"
    bread> GramServer
or  bread> GramServer machine-name 
or  bread> GramServer machine-name port  
or  bread> GramServer machine-name port  name-to-bind-as

Browse the GramServerInterface

Download the GramServer code

Here is a gzipped tar file.
Madhusudhan Govindaraju
Last modified: Thu Feb 11 18:32:14 EST 1999