API for direct execution of remote program

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.