Integrating with Variorum
Variorum is a node-level library that can be integrated easily with higher-level system software such as schedulers and runtime systems, to create a portable HPC PowerStack. As part of our efforts to support a hierarchical, dynamic and open-source portable power management stack, we have integrated Variorum with various open-source system software. The JSON API enables Variorum to interface with higher-level system software in an portable and easy manner.
ECP Integrations
Current integration efforts include a Kokkos connector for power monitoring, a Caliper service for method-level power data, a Flux power management module for scheduling, and Sandia’s OVIS Lightweight Distributed Metric Service (LDMS) monitoring plugin. These enable Variorum to be used at scale across multiple layers of the PowerStack, application/user layer, resource management layer, and system-level layer. Upcoming integrations also include developing a Variorum interface for PowerAPI and Intel GEOPM.
Links to Variorum’s integrations with each of these frameworks can be found below. Note that these integrations are in early development stages and are expected to be updated to support more features and tests.
Contributing Integrations with JSON
In order for tools to interact with Variorum, a simple JANSSON based parser is sufficient. Our existing integration implementations, which are linked here, are a good starting point.
The format of the JSON object has been documented in Variorum API and includes total node power, as well as CPU, Memory, and GPU power (current assumption is that of two sockets per node). It also includes the hostname and the timestamp.
We describe a simple example of how the data from the JSON object can be extracted from Variorum in the client tool below, and we point developers to the Kokkos and Flux integration links shown above for more detailed examples. We have used the JANSSON library for our purposes, but the JSON object can also be retrieved in a similar manner by other JSON libraries and supporting tools.
#include <jansson.h>
void parse_variorum_data()
{
// Define a JSON object to retrieve data from Variorum in
json_t *power_obj = json_object();
char *s = NULL;
// Define a local variable for the value of interest. For example, the
// client side tool may only be interested in node power, or it may be
// collecting samples for integration.
double power_node;
// Define a variable to capture appropriate return code from Variorum
int ret;
// Call the Variorum JSON API
ret = variorum_get_node_power_json(&s);
if (ret != 0)
{
printf("Variorum get node power API failed.\n");
free(s);
exit(-1);
}
// Extract the value of interest from the JSON object by using the
// appropriate get function. Documentation of these can be found in the
// JANSSON library documentation.
power_obj = json_loads(s, JSON_DECODE_ANY, NULL);
power_node = json_real_value(json_object_get(power_obj, "power_node_watts"));
printf("Node power is: %lf\n", power_node);
// Decrement references to JSON object, required for JANSSON library.
json_decref(power_obj);
// Deallocate the string
free(s);
}