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 http://www.globus.org/gram). 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.
Functionality
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.
instantiateComponent() is invoked. The GramServer uses the arguments of this method call to serve the request. It's a four step process:
hpcxx_connectContext(gatekeeperMachine);
This makes sure that the user running the GramServer has the required credentials to request the GramServer to instantiate components.
HPCxx_ContextID *remoteCID = hpcxx_createContext(machineToRunOn, path)
This creates a context on the target machine, and return its HPCxx_ContextID.
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);
bread> GramServer
or bread> GramServer machine-name
or bread> GramServer machine-name port
or bread> GramServer machine-name port name-to-bind-as