beostat_get_MHz

Name

beostat_get_MHz -- get the speed of the processor on a node

Synopsis

#include <sys/beostat.h>

int beostat_get_MHz (int node, float *MHz);

Arguments

node

The node to query

MHz

A pointer to a float, which will contain the speed of processor on the node in megahertz upon successful completion.

Description

beostat_get_MHz will get the speed of CPU on a given node in units of megahertz. On multi-CPU (SMP) machines it is assumed that all the CPU are the same speed. This is currently a hardware requirement on all known SMP machines.

Examples

 float speed;
 beostat_get_MHz (3, &speed);
 printf ("The node 3 has a %f MHz processor\n", speed);

Return Value

Return 0 on success. If an error occurs, it will return -1.

Errors

This function relies on the Beostat subsystem, which consists of the proc filesystem on the remote node, the sendstats daemon on the remote node, the recvstats daemon on the master node, and two shared memory files in the directory /var/shm. If any part of the system breaks down, this function could fail.