Usually in OmniRPC, the client program executes a remote executable program via the agent. Here are some advantages.
In this explanation, without the agent, we introduce a method to execute directly the remote executable module and to call RPCs. If there are remote executable programs for which you know the path in a certain remote host, you can omit registering remote executable programs, and so on. The advantages as are listed below.
We assume this environment, as an example.
If you use this function, it executes rex directly without the agent.
Because, we don't use the agent for direct execution, initialization of the library is taken by OmniRpcExecInit() API.
APIs which activate remote executable programs on the remote host, are like APIs which use OmniRpcHandle. OmniRpcExecOnHost() API enables the execution of a remote executable program, which is specified by its path, on the specified remote host, and it returns OmniRpcExecHandle, which presents its connection. By using OmniRpcExecCall it is possible to call a function which is inside a module.
We show this example below.
#include <OmniRpc.h> #include <stdio.h> int main(int argc,char *argv[]){ double r; OmniRpcExecHandle handle; OmniRpcExecInit(&argc,&argv); handle = OmniRpcExecOnHost("dennis.hpcc.jp","/usr/local/tmp/calc_sin.rex"); OmniRpcExecCall(handle,"calc_sin",10,&r); printf("sin(10)=%g\n",r); OmniRpcExecTerminate(handle); OmniRpcExecFinalize(); exit(0); }
OmniRpcExecTerminate API enables the termination of the remote executable program which responds to the handle. Finally, you should use OmniExecFinalize() at the end of the program.
You should specify the path of an executable program to activate the remote executable program. For example, the case of an execution using Globus is as follows.
$% a.out --globus args
In the case of SSH activation, you specify "--ssh."; if don't specify this, rsh is used to activate.
At this time, there are some limitations with this method.
We hope to improve these issues in the future.