00001 #ifndef FUPERMOD_BENCHMARK_H_
00002 #define FUPERMOD_BENCHMARK_H_
00003 
00004 #include "fupermod_kernel.h"
00005 
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009 
00022   extern int fupermod_verbose;
00023 
00025 #define FUPERMOD_MAX_TIME 1e9
00026 
00042   typedef struct fupermod_precision {
00044     int reps_min;
00046     int reps_max;
00048     double cl;
00050     double eps;
00052     double time_max_rep;
00054     double zero_speed;
00056     double time_max_kill;
00057   } fupermod_precision;
00058 
00060   fupermod_precision fupermod_precision_defaults();
00061 
00072   double fupermod_ci(double cl, int reps, double* t);
00073 
00075   typedef struct fupermod_point {
00077     long long int d;
00079     double t;
00081     int reps;
00086     double ci;
00087   } fupermod_point;
00088 
00090   int fupermod_point_read(FILE* stream, fupermod_point* point);
00091 
00093   int fupermod_point_write(FILE* stream, fupermod_point* point, fupermod_complexity complexity);
00094 
00102   int fupermod_point_node(fupermod_point* point, fupermod_point* point_node, MPI_Comm comm_intra, int root_intra);
00103 
00105   typedef struct fupermod_benchmark {
00107     fupermod_kernel* kernel;
00110     fupermod_process_conf conf;
00120     int (*execute)(struct fupermod_benchmark* benchmark, MPI_Comm comm_sync, long long int d, fupermod_precision precision, fupermod_point* point);
00121   } fupermod_benchmark;
00122 
00124   typedef void (*fupermod_benchmark_free)(fupermod_benchmark* benchmark);
00125 
00132   fupermod_benchmark* fupermod_benchmark_basic_alloc(fupermod_kernel* kernel, fupermod_process_conf conf);
00133 
00134 
00136   void fupermod_benchmark_basic_free(fupermod_benchmark* benchmark);
00137 
00138   struct fupermod_model;
00139 
00141   fupermod_benchmark* fupermod_benchmark_emulate_alloc(fupermod_kernel* kernel, struct fupermod_model* model);
00142 
00144   void fupermod_benchmark_emulate_free(fupermod_benchmark* benchmark);
00145 
00149 #ifdef __cplusplus
00150 }
00151 #endif
00152 
00153 #endif