beostat_get_MHz – get the speed of the processor on a node
#include <sys/beostat.h> int beostat_get_MHz (int node, float *MHz);
The node to query
A pointer to a float, which will contain the speed of processor on the node in megahertz upon successful completion.
beostat_get_MHz executes on the master node and returns the speed of
CPU(s) on a given node in units of megahertz. On multi-CPU (SMP)
machines it is assumed that all CPUs are the same speed. This is
currently a hardware requirement on all known SMP machines.
float speed; beostat_get_MHz (3, &speed); printf ("The node 3 has a %f MHz processor\n", speed);
Return 0 on success. If an error occurs, it will return -1.
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.