#include <OmniRpc.h> void OmniRpcInit(int *argc, char **argv[])
Initializes OmniRPC System. Sets argc by the argc pointer of the main function, sets argv by the argv pointer of it. This should be called before processing the argument information. In initialization, it uses the hostfile which is specified in the command line "--hostfile" or the hostfile on "$HOME/.omrpc-registry/hosts.xml" if not specified. It reads the hostfile and executes omrpc-agent on the host which are used. And, it reads registry information about the remote executable programs which are registered on the each host.
#include <OmniRpc.h> void OmniRpcFinalize(void);
Finalize OmniRPC system. Terminate all remote executable programs and agents.
#include <OmniRpc.h> int OmniRpcCall(char *entry_name,...);
Calls a remote function which is specified by entry_name. It blocks the caller thread until the end of the function call.
It searches for the function name from modules which are registered on the one of remote hosts which are described in the hostfile, and calls the function on the appropriate remote host. If the function name is not found, it returns OMRPC_ERROR. If it ends normally, it returns OMRPC_OK.
#include <OmniRpc.h> OmniRpcRequest OmniRpcCallAsync(char *entry_name,...);
Requests to call a remote function which is specified by entry_name, and returns the data structure (OmniRpcRequest) for the request. It blocks the caller thread.
It search for a function name from the modules which are registered on the remote hosts, which are described in the hostfile, and calls the function on the appropriate remote host. If the function name is not found, it returns NULL.
#include <OmniRpc.h> void OmniRpcWait(OmniRpcRequest req);
It blocks the caller thread until the end of an asynchronous call for the call request of req.
#include <OmniRpc.h> int OmniRpcProbe(OmniRpcRequest req);
Probes whether or not an asynchronous function call which associated to the call request of req finishes. If it does not finish, it returns 0. If it finishes, it returns 1.
#include <OmniRpc.h> void OmniRpcWaitAll(int n, OmniRpcRequest reqs[]);
It blocks caller threads until the end of all asynchronous function calls which correspond to n call requests of req. The call requests are stored in an array of OmniRpcRequest.
#include <OmniRpc.h> int OmniRpcWaitAny(int n, OmniRpcRequest reqs[]);
It blocks caller threads until the end of one asynchronous function call which corresponds to n call requests of req, which are stored in an array of OmniRpcRequest. It returns the positions of finished call requests in the array. The finished call request elements on the array are set with NULL.
#include <OmniRpc.h> OmniRpcHandle OmniRpcCreateHandle(char *host_name, char *module_name);
Executes the remote executable program of the module which is specified by module_name, and that is on the remote host which is specified by host_name. It returns handle corresponding to it. By using this, it calls functions on running remote executable programs with OmniRpcCallByHandle. If host_name is NULL, it selects the appropriate host in registered modules, and execute remote executable program of module. If host name or module are incorrect, it return NULL.
#include <OmniRpc.h> int OmniRpcCallByHandle(OmniRpcHandle handle,char *entry_name,...);
Calls function on running remote executable program corresponding to the handle by OmniRpcCreateHandle. It blocks the caller thread until the end of the function call. If the function does not exist, it returns NULL.
#include <OmniRpc.h> OmniRpcRequest OmniRpcCallAsyncByHandle(OmniRpcHandle handle,char *entry_name,...);
Calls function on running executable program corresponding to the handle created by OmniRpcCreateHandle. It calls a function and returns the OmniRpcRequest which is associated with it. It probes the end of the function and blocks control by OmniRpcWait, OmniRpcProbe, OmniRpcWaitAll and OmniRpcWaitAny APIs.
#include <OmniRpc.h> void OmniRpcDestroyHandle(OmniRpcHandle handle);
Terminates running remote executable program corresponding to the handle which is created by OmniRpcCreateHandle.
#include <OmniRpc.h> int OmniRpcModuleInit(char *module_name,...);
Sets arguments for initialization of the module named module_name. The "Initialize" function is required in the modules of remote executable programs. When the remote executable programs of modules are executed, it calls the "Initialize" function with sets the arguments. This API only sets the arguments; the actual initialization occurs when the remote executable program is executed.
#include <OmniRpc.h> void OmniRpcExecInit(int *argc, char **argv[]);
Initializes OmniRPC system for direct invocation of a remote executable program. You should set argc by the argc pointer of the main function, and sets argv by the argv pointer of it. You call this API in the main function of program before processing argument information. As in OmniRpcInit, the agent is not executed.
In the command option, if you specify "--globus", it uses GRAM, or, if you specify "--ssh", it uses ssh to invoke the remote executable program directly. It uses rsh by default.
#include <OmniRpc.h> void OmniRpcExecFinalize(void);
Finalizes of OmniRPC system. Terminates all remote executable programs.
#include <OmniRpc.h> OmniRpcExecHandle OmniRpcExecOnHost(char *host_name,char *prog_name);
Invokes remote executable program prog_name on the remote host which iss specified host_name, and returns the corresponding handle. Specify prog_name with path on remote host. Using this with OmniRpcExecCall, it is possible to call functions on running remote executable programs. You should initialize with OmniRpcExecInit API if you use this function. If the host name or module name is incorrect, it returns NULL.
#include <OmniRpc.h> int OmniRpcExecCall(OmniRpcExecHandle handle, char *func_name, ...);
Calls a function of the running remote executable program corresponding to the handle created by OmniRpcExecOnHost. It blocks the called thread until the end of the function. If the remote executable program does not have a function, it returns NULL.
#include <OmniRpc.h> void OmniRpcExecTerminate(OmniRpcExecHandle handle);
Terminates the running remote executable program corresponding to the handle created by OmniRpcExecOnHost.