libsc  1.6.0
src/sc_flops.h
00001 /*
00002   This file is part of the SC Library.
00003   The SC Library provides support for parallel scientific applications.
00004 
00005   Copyright (C) 2010 The University of Texas System
00006 
00007   The SC Library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Lesser General Public
00009   License as published by the Free Software Foundation; either
00010   version 2.1 of the License, or (at your option) any later version.
00011 
00012   The SC Library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   Lesser General Public License for more details.
00016 
00017   You should have received a copy of the GNU Lesser General Public
00018   License along with the SC Library; if not, write to the Free Software
00019   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020   02110-1301, USA.
00021 */
00022 
00023 #ifndef SC_FLOPS_H
00024 #define SC_FLOPS_H
00025 
00026 #include <sc.h>
00027 
00028 SC_EXTERN_C_BEGIN;
00029 
00030 typedef struct sc_flopinfo
00031 {
00032   double              seconds;  /* current time from sc_MPI_Wtime */
00033 
00034   /* these variables measure onward from from sc_flops_start */
00035   double              cwtime;   /* cumulative wall time */
00036   float               crtime;   /* cumulative real time */
00037   float               cptime;   /* cumulative process time */
00038   long long           cflpops;  /* cumulative floating point operations */
00039 
00040   /* measure since sc_flops_start or the previous sc_flops_count */
00041   double              iwtime;   /* interval wall time */
00042   float               irtime;   /* interval real time */
00043   float               iptime;   /* interval process time */
00044   long long           iflpops;  /* interval floating point operations */
00045   float               mflops;   /* MFlop/s rate in this interval */
00046 
00047   /* without SC_PAPI only seconds, ?wtime and ?rtime are meaningful */
00048 }
00049 sc_flopinfo_t;
00050 
00057 void                sc_flops_papi (float *rtime, float *ptime,
00058                                    long long *flpops, float *mflops);
00059 
00067 void                sc_flops_start (sc_flopinfo_t * fi);
00068 
00077 void                sc_flops_count (sc_flopinfo_t * fi);
00078 
00085 void                sc_flops_snap (sc_flopinfo_t * fi,
00086                                    sc_flopinfo_t * snapshot);
00087 
00097 void                sc_flops_shot (sc_flopinfo_t * fi,
00098                                    sc_flopinfo_t * snapshot);
00099 
00104 void                sc_flops_shotv (sc_flopinfo_t * fi, ...);
00105 
00106 SC_EXTERN_C_END;
00107 
00108 #endif /* !SC_FLOPS_H */
 All Data Structures Files Functions Variables Typedefs Defines