Chapter 3. Getting Started: Programming with OmniRPC

Table of Contents
Simple example
Execution environment
OmniRPC agent and remote executable programs
Write remote executable program
Registration of remote executable program
Client program
Create hostfile.xml
Execution of Cleint Program
Summary

Simple example

Let's begin programming with OmniRPC using a simple example. In this case, we consider a program to calculate from 1 to 10 using sine function.

#include <stdio.h>
#include <math.h>
     
int main(){
  int i;
  double x, res[10];
  x = 0.0;
  for(i = 0; i < 10; i++){
    res[i] = sin(x);
    x += 1.0;
  }
  for(i = 0; i < 10; i++) 
    printf("sin(%d)=%g\n",i,res[i]);
}
      

On this program, we calculate the sine in a remote node using OmniRPC. We label the computer node on which the program makes the Remote Procedure Call (RPC) as the client host, and the computer node on which procedures are executed by the RPC call as the remote host.