perfstat_cluster_total Subroutine

Purpose

Retrieves cluster statistics

Library

perfstat library (libperfstat.a)

Syntax

#include <libperfstat.h>

int perfstat_cluster_total  ( name, userbuff, sizeof_userbuff, desired_number)

perfstat_id_node_t *name;
perfstat_cluster_total_t *userbuff;
int sizeof_userbuff;int desired_number;

Description

The perfstat_cluster_total subroutine returns the cluster statistics in a perfstat_cluster_total_t structure.

The perfstat_cluster_total subroutine should be called only after enabling cluster statistics collection by using the following perfstat API call: perfstat_config(PERFSTAT_ENABLE | PERFSTAT_CLUSTER_STATS, NULL) system call.

The cluster statistics collection must be disabled after collecting the cluster statistics by using the following perfstat API call: perfstat_config(PERFSTAT_DISABLE | PERFSTAT_CLUSTER_STATS, NULL).

To get the statistics of any particular cluster (in which the current node is a cluster member) the cluster name must be specified in the name parameter. The userbuff parameter must be allocated. The desired_number parameter must be set to one.

Note: The cluster name should be one of the clusters in which the current node (in which the perfstat API call is run) is a cluster member.

Parameters

Item Description
name.nodenamename.spec

Specifies the cluster name.

Specifies the Cluster ID specifier. Should be set to CLUSTERNAME.

userbuff Specifies the memory area that is to be filled with the perfstat_cluster_total_t structure.
sizeof_userbuff Specifies the size of the perfstat_cluster_total_t structure.
desired_number Specifies the number of structures to be returned. The value of this parameter must be set to one.

Return Values

Upon successful completion, the number of structures filled is returned. This will always be 1.

If unsuccessful, a value of -1 is returned, and the errno global variable is set.

Error Codes

The subroutine is unsuccessful if the following is true:

Item Description
EINVAL

One of the parameters is not valid.

ENOENT

Either cluster statistics collection is not enabled using the perfstat_config subroutine or the cluster statistics collection is not supported.

ENOSPC

The ENOSPC error code is set if either of the following cases occur:

  • If the userbuff->node_data is not NULL and initialized with insufficient memory (less than the total number of nodes in the cluster).
  • If userbuff->disk_data is not NULL and initialized with insufficient memory (less than the total number of disks in the cluster).

Upon return, userbuff->num_nodes and userbuff->num_disks are initialized with the total number of nodes and disks respectively so that the user can reallocate sufficient memory and call the interface again.

Files

The libperfstat.h file defines standard macros, data types, and subroutines.