geopm
3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
|
#include <stddef.h>
#include "geopm_public.h"
Go to the source code of this file.
Functions | |
int GEOPM_PUBLIC | geopm_endpoint_create (const char *endpoint_name, struct geopm_endpoint_c **endpoint) |
Create an endpoint object for other API functions. More... | |
int GEOPM_PUBLIC | geopm_endpoint_destroy (struct geopm_endpoint_c *endpoint) |
Release resources associated with endpoint. More... | |
int GEOPM_PUBLIC | geopm_endpoint_open (struct geopm_endpoint_c *endpoint) |
Create shmem regions within the endpoint for policy/sample handling. More... | |
int GEOPM_PUBLIC | geopm_endpoint_close (struct geopm_endpoint_c *endpoint) |
Destroy shmem regions within the endpoint. More... | |
int GEOPM_PUBLIC | geopm_endpoint_agent (struct geopm_endpoint_c *endpoint, size_t agent_name_max, char *agent_name) |
Check if an agent has attached. More... | |
int GEOPM_PUBLIC | geopm_endpoint_wait_for_agent_attach (struct geopm_endpoint_c *endpoint, double timeout) |
Blocks until an agent has attached or the timeout is reached. More... | |
int GEOPM_PUBLIC | geopm_endpoint_stop_wait_loop (struct geopm_endpoint_c *endpoint) |
Stops any current wait loops the endpoint is running. More... | |
int GEOPM_PUBLIC | geopm_endpoint_reset_wait_loop (struct geopm_endpoint_c *endpoint) |
Resets the endpoint to prepare for a subsequent call to geopm_endpoint_wait_for_agent_attach(). More... | |
int GEOPM_PUBLIC | geopm_endpoint_profile_name (struct geopm_endpoint_c *endpoint, size_t profile_name_max, char *profile_name) |
Check profile name for an attached job. More... | |
int GEOPM_PUBLIC | geopm_endpoint_num_node (struct geopm_endpoint_c *endpoint, int *num_node) |
Get the number of nodes managed by the agent. More... | |
int GEOPM_PUBLIC | geopm_endpoint_node_name (struct geopm_endpoint_c *endpoint, int node_idx, size_t node_name_max, char *node_name) |
Get the hostname of the indexed compute node. More... | |
int GEOPM_PUBLIC | geopm_endpoint_write_policy (struct geopm_endpoint_c *endpoint, size_t num_policy, const double *policy_array) |
Set the policy values for the agent to follow. More... | |
int GEOPM_PUBLIC | geopm_endpoint_read_sample (struct geopm_endpoint_c *endpoint, size_t num_sample, double *sample_array, double *sample_age_sec) |
Get a sample from the agent and amount of time that has passed since the agent last provided an update. More... | |
int GEOPM_PUBLIC geopm_endpoint_agent | ( | struct geopm_endpoint_c * | endpoint, |
size_t | agent_name_max, | ||
char * | agent_name | ||
) |
Check if an agent has attached.
[in] | endpoint | Object created by call to geopm_endpoint_create(). |
[in] | agent_name_max | Number of bytes allocated for the agent_name string. |
[out] | agent_name | Name of agent if one has attached to the endpoint. If no agent has attached string is unaltered. |
int GEOPM_PUBLIC geopm_endpoint_close | ( | struct geopm_endpoint_c * | endpoint | ) |
Destroy shmem regions within the endpoint.
[in] | endpoint | Object created by call to geopm_endpoint_create(). |
int GEOPM_PUBLIC geopm_endpoint_create | ( | const char * | endpoint_name, |
struct geopm_endpoint_c ** | endpoint | ||
) |
Create an endpoint object for other API functions.
[in] | endpoint_name | Shared memory key substring used to create an endpoint that an agent can attach to. |
[out] | endpoint | Opaque pointer to geopm_endpoint_c object, or NULL upon failure. |
int GEOPM_PUBLIC geopm_endpoint_destroy | ( | struct geopm_endpoint_c * | endpoint | ) |
Release resources associated with endpoint.
Additionally will send a signal to the agent that the manager is detaching from the policy and will no longer send updates.
[in] | endpoint | Object to be destroyed which was previously created by call to geopm_endpoint_create(). |
int GEOPM_PUBLIC geopm_endpoint_node_name | ( | struct geopm_endpoint_c * | endpoint, |
int | node_idx, | ||
size_t | node_name_max, | ||
char * | node_name | ||
) |
Get the hostname of the indexed compute node.
[in] | endpoint | Object created by call to geopm_endpoint_create() that has reported an attached agent. |
[in] | node_idx | the index from zero to the value returned by geopm_agent_num_node() - 1. |
[in] | node_name_max | Number of bytes allocated for the node_name string. |
[out] | node_name | The compute node hostname. |
int GEOPM_PUBLIC geopm_endpoint_num_node | ( | struct geopm_endpoint_c * | endpoint, |
int * | num_node | ||
) |
Get the number of nodes managed by the agent.
[in] | endpoint | Object created by call to geopm_endpoint_create() that has reported an attached agent. |
[out] | num_node | Number of compute nodes controlled by attached agent. |
int GEOPM_PUBLIC geopm_endpoint_open | ( | struct geopm_endpoint_c * | endpoint | ) |
Create shmem regions within the endpoint for policy/sample handling.
[in] | endpoint | Object created by call to geopm_endpoint_create(). |
int GEOPM_PUBLIC geopm_endpoint_profile_name | ( | struct geopm_endpoint_c * | endpoint, |
size_t | profile_name_max, | ||
char * | profile_name | ||
) |
Check profile name for an attached job.
[in] | endpoint | Object created by call to geopm_endpoint_create(). |
[in] | profile_name_max | Number of bytes allocated for the profile_name string. |
[out] | profile_name | Profile name of the job if one has attached to the endpoint. If no agent has attached string is unaltered. |
int GEOPM_PUBLIC geopm_endpoint_read_sample | ( | struct geopm_endpoint_c * | endpoint, |
size_t | num_sample, | ||
double * | sample_array, | ||
double * | sample_age_sec | ||
) |
Get a sample from the agent and amount of time that has passed since the agent last provided an update.
[in] | endpoint | Object created by call to geopm_endpoint_create() that has reported an attached agent that provides samples (i.e. value given by geopm_agent_num_sample() is greater than zero). |
[out] | sample_array | Array of sampled values provide by the agent. |
[out] | timestamp | The timestamp of the agent's last update to the sample. |
int GEOPM_PUBLIC geopm_endpoint_reset_wait_loop | ( | struct geopm_endpoint_c * | endpoint | ) |
Resets the endpoint to prepare for a subsequent call to geopm_endpoint_wait_for_agent_attach().
[in] | endpoint | Object created by call to geopm_endpoint_create(). |
int GEOPM_PUBLIC geopm_endpoint_stop_wait_loop | ( | struct geopm_endpoint_c * | endpoint | ) |
Stops any current wait loops the endpoint is running.
[in] | endpoint | Object created by call to geopm_endpoint_create(). |
int GEOPM_PUBLIC geopm_endpoint_wait_for_agent_attach | ( | struct geopm_endpoint_c * | endpoint, |
double | timeout | ||
) |
Blocks until an agent has attached or the timeout is reached.
[in] | endpoint | Object created by call to geopm_endpoint_create(). |
[in] | timeout | Timeout in seconds. |
int GEOPM_PUBLIC geopm_endpoint_write_policy | ( | struct geopm_endpoint_c * | endpoint, |
size_t | num_policy, | ||
const double * | policy_array | ||
) |
Set the policy values for the agent to follow.
[in] | endpoint | Object created by call to geopm_endpoint_create() that has reported an attached agent. |
[in] | policy_array | Array of length returned by geopm_agent_num_policy() specifying the value of each policy parameter. |