by aflorenzon » Sun Sep 15, 2013 10:48 am
And the following behavior occurs when you run an application to find the total number of instructions:
Execution 1:
./my_program
out: PAPI_TOT_INS = 23339111815
Execution 2:
./my_program
out: PAPI_TOT_INS = 1831345992
Why?
-------------------------------------------------------------------------------------------------------------------
The code:
int main(int argc, char **argv){
int EventSet = PAPI_NULL;
unsigned long long valor = 0;
PAPI_library_init(PAPI_VER_CURRENT);
PAPI_create_eventset(&EventSet);
PAPI_add_event(EventSet, PAPI_TOT_INS);
PAPI_start(EventSet);
PAPI_reset(EventSet);
int *vetor;
vetor = (int*) malloc(sizeof(int)*N);
leEntrada(vetor);
par_impar(vetor);
PAPI_read(EventSet, &valor);
printf("PAPI_TOT_INS = %llu\n", valor);
PAPI_stop(EventSet, NULL);
return 0;
}
Can anyone help?
Thanks.