geopm 3.1.1.dev410+g40bf96ed
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
geopm_ctl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 - 2024 Intel Corporation
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef GEOPM_CTL_H_INCLUDE
7#define GEOPM_CTL_H_INCLUDE
8
9#include <mpi.h>
10#include <stdio.h>
11#include <stdint.h>
12#include <pthread.h>
13#include "geopm_public.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/* Opaque structure which is a handle for a geopm::Controller object. */
20struct geopm_ctl_c;
21
22/************************/
23/* OBJECT INSTANTIATION */
24/************************/
25
36int GEOPM_PUBLIC
37 geopm_ctl_create(MPI_Comm comm,
38 struct geopm_ctl_c **ctl);
39
42int GEOPM_PUBLIC
43 geopm_ctl_destroy(struct geopm_ctl_c *ctl);
44
45/********************/
46/* POWER MANAGEMENT */
47/********************/
48
51int GEOPM_PUBLIC
52 geopm_ctl_run(struct geopm_ctl_c *ctl);
53
65int GEOPM_PUBLIC
66 geopm_ctl_pthread(struct geopm_ctl_c *ctl,
67 const pthread_attr_t *attr,
68 pthread_t *thread);
69#ifdef __cplusplus
70}
71#endif
72#endif
int GEOPM_PUBLIC geopm_ctl_destroy(struct geopm_ctl_c *ctl)
destroys all resources associated with the ctl structure which allocated by a previous call to geopm_...
Definition Controller.cpp:102
int GEOPM_PUBLIC geopm_ctl_create(MPI_Comm comm, struct geopm_ctl_c **ctl)
creates a geopm_ctl_c object, ctl which is an opaque structure that holds the state used to execute t...
Definition MPICommSplit.cpp:23
int GEOPM_PUBLIC geopm_ctl_pthread(struct geopm_ctl_c *ctl, const pthread_attr_t *attr, pthread_t *thread)
creates a POSIX thread running the control algorithm continuously until the application signals shutd...
Definition Controller.cpp:47
int GEOPM_PUBLIC geopm_ctl_run(struct geopm_ctl_c *ctl)
steps the control algorithm continuously until the application signals shutdown.
Definition Controller.cpp:128