Remote Procedure Calls (RPC's)

From: Mahendra Vallabh (Mike) <"Mahendra>
Date: Mon, 14 Aug 1995 09:38:04 +1200

Hi there,

Can anyone out there help me with the following code segment?
I have a lecturer who is trying to measure ``load'' on several
various machines. Here's what he is trying to do:

/* rload
 *
 * Gives the load on a remote host.
    cc [ flag ... ] file ... -lrpcsvc
 *
 */
#include "/d/pvm3/include/pvm3.h"
#include <stdio.h>
#include <rpc/rpc.h>
#include <rpcsvc/rstat.h>
 
 
/* Proto - can't find a system one */
enum clnt_stat rstat(char *host, struct statstime *statp);
 
int
main(int ac, char **av) {
    int nhosts;
    enum clnt_stat cstat;
    struct statstime stats;
    float * load;
    nhosts = 1;
    load = (float *)malloc(nhosts*sizeof(float));
 
    cstat = rstat(av[1], &stats);
 
    if (cstat != RPC_SUCCESS) {
        clnt_perrno(cstat);
        exit (cstat);
    }
    load[0]=(float)stats.avenrun[0];
 
    printf ("%f\n", load[0]);
    free(load);
    exit(0);
 }
 
This code compiles fine on a Sun Sparcstation 2 (Solaris 2.4) and our Alpha
Box (OSF/1 v3.0). However the program won't run on the Alpha.

ie,
rload.alpha is the alpha binary
rload.sun is the sun binary

On the Alpha:

  rload.alpha sunhost works
  rload.alpha alphahost results in the following error

  cstat returns 15
  RPC: Program not registered

On the Sun:

  rload.sun sunhost works
  rload.sun alphahost results in the following error

  cstat returns 12
  RPC: Remote system error

So.... are RPC's on an Alpha different from those on a Sun???

Mike
Received on Sun Aug 13 1995 - 23:57:21 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT