Commit 084c99f8 authored by Sridutt Bhalachandra's avatar Sridutt Bhalachandra

[Feature] Add support for user annotation

Allow users to annotate phases to control transmission of application
context information.

A phase can be skipped now by setting NRM_SKIP to non-zero value.

See Issue #3
parent ece5745b
......@@ -8,6 +8,10 @@
* barrier times) to the Argo Node Resource Manager(NRM). The NRM using this
* contextual information invokes power policies to improve energy efficiency
* of the node.
*
* Note: Users can annotate phases to control transmission of application
* context information. A phase can be skipped by setting NRM_SKIP to non-zero
* value.
*
* Written by Sridutt Bhalachandra, sriduttb@anl.gov
*/
......@@ -64,8 +68,8 @@ extern "C" void MPI_nrm_fini()
***********************/
extern "C" void MPI_nrm_print_stats(void)
{
printf("Stats: CPU %u Damper %lf DamperAggreations %u\n", cpu, _damper,
_damperAggregationCount);
printf("Stats: CPU %u Damper %lf DamperAggreations %u PhaseSkips %u\n", cpu,
_damper,_damperAggregationCount, _phaseSkipCount);
return;
}
......@@ -92,6 +96,18 @@ extern "C" void transmit_to_nrm(int cpu, uint64_t *startCompute, uint64_t
return;
}
// Check if user wants to skip sending context to NRM in the current phase
if(getenv("NRM_SKIP"))
{
// Reset phase start time
*startCompute = return_current_time();
_phaseSkipCount++;
// Reset environment variable
setenv("NRM_SKIP", "0", 1);
return;
}
// Send context to NRM
nrm_send_phase_context(&ctxt, cpu, _aggregation, computeTime, totalPhaseTime);
......
......@@ -26,6 +26,7 @@ static double _damper = 0.01;
// Book-keeping and Statistics
static unsigned int _aggregation = 0;
static unsigned int _damperAggregationCount = 0;
static unsigned int _phaseSkipCount = 0;
unsigned int cpu;
int rank;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment