PAPI 7.1.0.0
Loading...
Searching...
No Matches
flops.h File Reference
Include dependency graph for flops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void flops_driver (char *papi_event_str, hw_desc_t *hw_desc, char *outdir)
 

Function Documentation

◆ flops_driver()

void flops_driver ( char *  papi_event_str,
hw_desc_t hw_desc,
char *  outdir 
)

Definition at line 841 of file flops.c.

841 {
842 int retval = PAPI_OK;
843 int EventSet = PAPI_NULL;
844 FILE* ofp_papi;
845 const char *sufx = ".flops";
846 char *papiFileName;
847
848 (void)hw_desc;
849
850 int l = strlen(outdir)+strlen(papi_event_name)+strlen(sufx);
851 if (NULL == (papiFileName = (char *)calloc( 1+l, sizeof(char)))) {
852 return;
853 }
854 if (l != (sprintf(papiFileName, "%s%s%s", outdir, papi_event_name, sufx))) {
855 goto error0;
856 }
857 if (NULL == (ofp_papi = fopen(papiFileName,"w"))) {
858 fprintf(stderr, "Failed to open file %s.\n", papiFileName);
859 goto error0;
860 }
861
863 if (retval != PAPI_OK ){
864 goto error1;
865 }
866
867 retval = PAPI_add_named_event( EventSet, papi_event_name );
868 if (retval != PAPI_OK ){
869 goto error1;
870 }
871
872 exec_flops(HALF, EventSet, ofp_papi);
873 exec_flops(SINGLE, EventSet, ofp_papi);
874 exec_flops(DOUBLE, EventSet, ofp_papi);
875
877 if (retval != PAPI_OK ){
878 goto error1;
879 }
881 if (retval != PAPI_OK ){
882 goto error1;
883 }
884
885error1:
886 fclose(ofp_papi);
887error0:
888 free(papiFileName);
889 return;
890}
add PAPI preset or native hardware event by name to an EventSet
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
#define HALF
Definition: flops.c:12
#define DOUBLE
Definition: flops.c:10
#define SINGLE
Definition: flops.c:11
void exec_flops(int precision, int EventSet, FILE *fp)
Definition: flops.c:813
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
static int EventSet
Definition: init_fini.c:8
FILE * stderr
int fclose(FILE *__stream)
int retval
Definition: zero_fork.c:53
Here is the call graph for this function:
Here is the caller graph for this function: