MESH energy Functions. More...
#include <mesh.h>#include <mesh_def_energy_resources.h>#include <mesh_def_energy_schedulers.h>#include <mesh_energy_types.h>Go to the source code of this file.
Functions | |
| mesh_energy * | mesh_create_energy (mesh_feature_list *cfl, double power, double comp) |
| Creates and initializes a mesh_energy structure and creates the default energy state using the specified power consumption and fractional computational power value provided. The energy structure by default is not associated with any energy resources. A mesh_energy structure may be assigned to an energy resource (created with mesh_create_energy_resource()) using mesh_set_energy(). | |
| mesh_energy_state * | mesh_add_energy_state (mesh_energy *ce, gchar *name, double power, double comp) |
| Adds a new energy state to an energy structure created using mesh_create_energy(). The name of the energy state must be unique to the specified energy structure. To specify comp values for individual features, use mesh_add_energy_state_feature(). | |
| mesh_energy_state * | mesh_add_energy_state_feature (mesh_energy_state *ces, gint feature, double comp) |
| Adds an energy state feature, which specifies the fraction of computational power available to a specific resource feature while in the specified energy state. | |
| mesh_resource * | mesh_set_energy (mesh_resource *cr, mesh_energy *ce) |
| Assigns the previously created (using mesh_create_energy()) mesh_energy structure ce to the previously created (using mesh_create_energy_resource()) resource cr. | |
| mesh_energy * | mesh_get_energy (mesh_resource *cr) |
| Returns a pointer to the mesh_energy structure associated with the given resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy(). | |
| mesh_energy_state * | mesh_find_energy_state_by_name (mesh_energy *ce, gchar *state) |
| Returns a pointer to the energy state state in the energy structure ce if it exists. | |
| double | mesh_find_energy_state_feature (mesh_energy_state *ces, gint feature) |
| Returns the fraction of available computational power for the specified resource feature in the specified energy state. | |
| gboolean | mesh_check_current_energy_state (mesh_resource *cr, gchar *state) |
| Checks if the current energy state of resource cr is state, TRUE if so and FALSE otherwise. | |
| gboolean | mesh_set_current_energy_state (mesh_resource *cr, gchar *state) |
| If possible, changes the energy state of the specified resource to the energy state named state. Returns TRUE if the operation succeeds (the specified energy state exists) and FALSE otherwise. | |
| mesh_energy_state * | mesh_get_current_energy_state (mesh_resource *cr) |
| Returns the current energy state of the specified resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy(). | |
| gboolean | mesh_check_target_energy_state (mesh_resource *cr, gchar *state) |
| Checks if the target energy state of resource cr is state, TRUE if so and FALSE otherwise. | |
| gboolean | mesh_set_target_energy_state (mesh_resource *cr, gchar *state) |
| If possible, changes the energy state of the specified resource to the energy state named state. Returns TRUE if the operation succeeds (the specified energy state exists) and FALSE otherwise. | |
| mesh_energy_state * | mesh_get_target_energy_state (mesh_resource *cr) |
| Returns the target energy state of the specified resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy(). | |
| mesh_energy_state_list * | mesh_get_energy_state_list (mesh_resource *cr) |
| Returns a pointer to the list of available energy states to the given resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy(). | |
| void | mesh_update_energy_state_utilization (mesh_resource *cr) |
| Updates the record of how much time has been spent and energy has been dissipated in the current energy state by comparing the current simulation time to the time utilization was last updated for this resource. Used to determine the energy consumption of a resource by tracking how much time each resource spends in each energy state. | |
| void | mesh_update_energy_state_utilization_consume (mesh_resource *cr, double length, double rpc) |
| Updates the record of how much time has been spent and energy has been dissipated in the current energy state based on the length of the consume call executed and the relative power complexity of the consume call. Used to determine the energy consumption of a resource by tracking how much time each resource spends in each energy state. | |
| void | mesh_print_energy_statistics (mesh_resource *cr) |
| Prints the energy state usage statistics (time spent in each, energy consumed in each) for the given resource, and provides summary statistics (total energy consumed, total time accounted for by energy states). | |
MESH energy Functions.
| mesh_energy_state* mesh_add_energy_state | ( | mesh_energy * | ce, | |
| gchar * | name, | |||
| double | power, | |||
| double | comp | |||
| ) |
Adds a new energy state to an energy structure created using mesh_create_energy(). The name of the energy state must be unique to the specified energy structure. To specify comp values for individual features, use mesh_add_energy_state_feature().
label mesh_add_energy_state
| ce | Already created energy structure to add an energy state to | |
| name | Name of the energy state to create | |
| power | Energy consumed per unit time in this state | |
| comp | Default fraction of computational power available in this state precond A valid mesh_energy structure must be created through mesh_create_energy() |
| mesh_energy_state* mesh_add_energy_state_feature | ( | mesh_energy_state * | ces, | |
| gint | feature, | |||
| double | comp | |||
| ) |
Adds an energy state feature, which specifies the fraction of computational power available to a specific resource feature while in the specified energy state.
label mesh_add_energy_state_feature
| ces | Already created energy state to add an energy state feature to | |
| feature | Index identifying the feature for which an individual comp value is being added | |
| comp | Fraction of computational power available to the specified feature in the specified state precond A valid mesh_energy_state must be created through mesh_add_energy_state() |
| gboolean mesh_check_current_energy_state | ( | mesh_resource * | cr, | |
| gchar * | state | |||
| ) |
Checks if the current energy state of resource cr is state, TRUE if so and FALSE otherwise.
| cr | Already created energy resource with an associated energy structure | |
| state | Name of the energy state being checked against the current energy state precond A valid mesh_energy_resource created with mesh_create_energy_resource(), and a valid mesh_energy structure created with mesh_create_energy() and set with mesh_set_energy() |
| gboolean mesh_check_target_energy_state | ( | mesh_resource * | cr, | |
| gchar * | state | |||
| ) |
Checks if the target energy state of resource cr is state, TRUE if so and FALSE otherwise.
label mesh_check_target_energy_state
| cr | Already created energy resource with an associated energy structure | |
| state | Name of the energy state being checked against the target energy state precond A valid mesh_energy_resource created with mesh_create_energy_resource(), and a valid mesh_energy structure created with mesh_create_energy() and set with mesh_set_energy() |
| mesh_energy* mesh_create_energy | ( | mesh_feature_list * | cfl, | |
| double | power, | |||
| double | comp | |||
| ) |
Creates and initializes a mesh_energy structure and creates the default energy state using the specified power consumption and fractional computational power value provided. The energy structure by default is not associated with any energy resources. A mesh_energy structure may be assigned to an energy resource (created with mesh_create_energy_resource()) using mesh_set_energy().
label mesh_create_energy
| cfl | Already created and fully specified mesh_feature_list | |
| power | Energy consumed per unit time in the default energy state | |
| comp | Fraction of computational power available in the default energy state precond All features must have been added to cfl using mesh_feature_add() |
| mesh_energy_state* mesh_find_energy_state_by_name | ( | mesh_energy * | ce, | |
| gchar * | state | |||
| ) |
Returns a pointer to the energy state state in the energy structure ce if it exists.
label mesh_find_energy_state_by_name
| ce | Energy structure to search | |
| state | Name of state to find in energy structure ce |
| double mesh_find_energy_state_feature | ( | mesh_energy_state * | ces, | |
| gint | feature | |||
| ) |
Returns the fraction of available computational power for the specified resource feature in the specified energy state.
label mesh_find_energy_state_feature
| ces | Energy state to search | |
| feature | Index of the feature to find in energy state ces |
| mesh_energy_state* mesh_get_current_energy_state | ( | mesh_resource * | cr | ) |
Returns the current energy state of the specified resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy().
label mesh_get_current_energy_state
| cr | Resource created using mesh_create_energy_resource() precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
| mesh_energy* mesh_get_energy | ( | mesh_resource * | cr | ) |
Returns a pointer to the mesh_energy structure associated with the given resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy().
label mesh_get_energy
| cr | Resource created using mesh_create_energy_resource() precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
| mesh_energy_state_list* mesh_get_energy_state_list | ( | mesh_resource * | cr | ) |
Returns a pointer to the list of available energy states to the given resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy().
label mesh_get_energy_state_list
| cr | Resource created using mesh_create_energy_resource() precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
| mesh_energy_state* mesh_get_target_energy_state | ( | mesh_resource * | cr | ) |
Returns the target energy state of the specified resource. The resource must have an associated, valid mesh_energy structure, created with mesh_create_energy() and assigned with mesh_set_energy().
label mesh_get_target_energy_state
| cr | Resource created using mesh_create_energy_resource() precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
| void mesh_print_energy_statistics | ( | mesh_resource * | cr | ) |
Prints the energy state usage statistics (time spent in each, energy consumed in each) for the given resource, and provides summary statistics (total energy consumed, total time accounted for by energy states).
label mesh_print_energy_statistics
| cr | Resource created using mesh_create_energy_resource() precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy(), and either mesh_update_energy_state_utilization() or mesh_update_energy_state_utilization_consume() has been called at least once |
| gboolean mesh_set_current_energy_state | ( | mesh_resource * | cr, | |
| gchar * | state | |||
| ) |
If possible, changes the energy state of the specified resource to the energy state named state. Returns TRUE if the operation succeeds (the specified energy state exists) and FALSE otherwise.
label mesh_set_current_energy_state
| cr | Resource created using mesh_create_energy_resource() | |
| state | Name of the energy state to make the current energy state for the specified resource precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
| mesh_resource* mesh_set_energy | ( | mesh_resource * | cr, | |
| mesh_energy * | ce | |||
| ) |
Assigns the previously created (using mesh_create_energy()) mesh_energy structure ce to the previously created (using mesh_create_energy_resource()) resource cr.
label mesh_set_energy
| cr | Resource created using mesh_create_energy_resource() | |
| ce | mesh_energy structure created with mesh_create_energy() precond cr has been created with mesh_create_energy_resource() and ce has been created with mesh_create_energy() |
| gboolean mesh_set_target_energy_state | ( | mesh_resource * | cr, | |
| gchar * | state | |||
| ) |
If possible, changes the energy state of the specified resource to the energy state named state. Returns TRUE if the operation succeeds (the specified energy state exists) and FALSE otherwise.
label mesh_set_target_energy_state
| cr | Resource created using mesh_create_energy_resource() | |
| state | Name of the energy state to make the target energy state for the specified resource precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
| void mesh_update_energy_state_utilization | ( | mesh_resource * | cr | ) |
Updates the record of how much time has been spent and energy has been dissipated in the current energy state by comparing the current simulation time to the time utilization was last updated for this resource. Used to determine the energy consumption of a resource by tracking how much time each resource spends in each energy state.
label mesh_update_energy_state_utilization
| cr | Resource created using mesh_create_energy_resource() precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
| void mesh_update_energy_state_utilization_consume | ( | mesh_resource * | cr, | |
| double | length, | |||
| double | rpc | |||
| ) |
Updates the record of how much time has been spent and energy has been dissipated in the current energy state based on the length of the consume call executed and the relative power complexity of the consume call. Used to determine the energy consumption of a resource by tracking how much time each resource spends in each energy state.
label mesh_update_energy_state_utilization_consume
| cr | Resource created using mesh_create_energy_resource() | |
| length | Length of the consume call executed on the given resource | |
| rpc | The relative power complexity of the consume call precond Resource has been assigned a valid mesh_energy structure with mesh_set_energy() |
1.7.1