src/AriesCounters.c
/* End recording counters for current region. Adds the counters to the list of
 * counters to be printed at the end.
 */
End recording counters for current region. Adds the counters to the list of
counters to be printed at the end.
End recording counters for current region . Adds the counters to the list of counters to be printed at the end .
void EndRecordAriesCounters(int my_rank, int reporting_rank_mod, int* AC_event_set, char*** AC_events, long long** AC_values, int* AC_event_count)
{
    if (my_rank % reporting_rank_mod != 0) { return; }
    unsigned long long elapsed_time = EndSysTimer();
    PAPI_stop(*AC_event_set, *AC_values);
    PAPI_reset(*AC_event_set);
    struct timestep_counters *new_counters = (struct timestep_counters *)malloc(sizeof(struct timestep_counters));
    int num_bytes = sizeof(long long) * (*AC_event_count);
    new_counters->counters = (long long *)malloc(num_bytes);
    memcpy(new_counters->counters, *AC_values, num_bytes);
    new_counters->timestep = region;
    new_counters->elapsed_time = elapsed_time;
    new_counters->next = counters_list;
    counters_list = new_counters;
    region++;
}
void EndRecordAriesCounters ( int my_rank , int reporting_rank_mod , int * AC_event_set , char * * * AC_events , long long * * AC_values , int * AC_event_count ) { if ( my_rank % reporting_rank_mod != 0 ) { return ; } unsigned long long elapsed_time = EndSysTimer ( ) ; PAPI_stop ( * AC_event_set , * AC_values ) ; PAPI_reset ( * AC_event_set ) ; struct timestep_counters * new_counters = ( struct timestep_counters * ) malloc ( sizeof ( struct timestep_counters ) ) ; int num_bytes = sizeof ( long long ) * ( * AC_event_count ) ; new_counters -> counters = ( long long * ) malloc ( num_bytes ) ; memcpy ( new_counters -> counters , * AC_values , num_bytes ) ; new_counters -> timestep = region ; new_counters -> elapsed_time = elapsed_time ; new_counters -> next = counters_list ; counters_list = new_counters ; region ++ ; }
End recording counters for current region.
End recording counters for current region .
// Stop timer for elapsed time // Store the counters in linked list in memory. // Copy the counters. // Store the region number. // Store the elapsed time for this rank. // Insert at the head of the list for convenience.