NeoPZ
|
Measure the amount of GFlops/s the system can sustain. More...
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
#include "arglib.h"
#include "run_stats_table.h"
Go to the source code of this file.
Classes | |
struct | thread_arg_t |
struct | thread_map1_arg< T > |
Macros | |
#define | MIN_T(a, b) |
#define | GIGA |
#define | VERBOSE(level, ...) |
#define | MEGABYTE |
Functions | |
void | help (const char *prg) |
void | clean_mem (unsigned sz) |
void | process_arr (double *ara, double *arb, double *arc, unsigned sz, unsigned nthreads, void *(*fun)(void *)) |
template<class T > | |
void * | thread_map1_worker (void *arg) |
template<class T > | |
void | thread_map1 (T *array, T(*map1)(T), unsigned sz, unsigned nthreads) |
void | mul_arr_rev (double *ara, double *arb, double *arc, unsigned sz, unsigned threads) |
double | sqrt_dbl (double v) |
void * | mul_arr (void *a) |
void * | imul_arr (void *a) |
void * | add_arr (void *a) |
void * | acc_arr (void *a) |
void * | mulred_arr (void *a) |
void * | mulsingle_arr (void *a) |
void | profile (double *ara, double *arb, double *arc, unsigned sz, unsigned num_threads, void *(*fun)(void *), ElapsedTimeRunStat &et, RunStatsTable &rst) |
double | gflops (ElapsedTimeRunStat &et, unsigned sz) |
int | main (int argc, char *argv[]) |
Variables | |
clarg::argInt | asz ("-asz", "array size", 10000000) |
clarg::argInt | moda ("-moda", "modulo a", 0) |
clarg::argInt | modb ("-modb", "modulo b", 0) |
clarg::argInt | modc ("-modc", "modulo c", 0) |
clarg::argInt | nt ("-nt", "number of threads", 0) |
clarg::argInt | verb_level ("-v", "verbosity level", 0) |
clarg::argBool | h ("-h", "help message", false) |
clarg::argInt | cm ("-cm", "clean memory before execution", 512) |
RunStatsTable | mul_rst ("-mul_rdt", "Array multiply statistics raw data table") |
RunStatsTable | imul_rst ("-imul_rdt", "Array immeditate multiply statistics raw data table") |
RunStatsTable | mulred_rst ("-mulred_rdt", "Array multiply and reduce statistics raw data table") |
RunStatsTable | add_rst ("-add_rdt", "Array add statistics raw data table") |
RunStatsTable | acc_rst ("-acc_rdt", "Array accumulate statistics raw data table") |
RunStatsTable | mulsingle_rst ("-mulsingle_rdt", "Fake array-multiply statistics raw data table") |
double | global_res |
#define GIGA |
Referenced by gflops().
#define MEGABYTE |
Referenced by main().
#define MIN_T | ( | a, | |
b | |||
) |
Referenced by process_arr(), and thread_map1().
#define VERBOSE | ( | level, | |
... | |||
) |
void* acc_arr | ( | void * | a | ) |
Definition at line 196 of file gflopstest.cpp.
References thread_arg_t::ara, thread_arg_t::arb, and thread_arg_t::sz.
Referenced by main().
void* add_arr | ( | void * | a | ) |
Definition at line 183 of file gflopstest.cpp.
References thread_arg_t::ara, thread_arg_t::arb, thread_arg_t::arc, and thread_arg_t::sz.
Referenced by main().
void clean_mem | ( | unsigned | sz | ) |
Definition at line 44 of file gflopstest.cpp.
References acc_rst, add_rst, imul_rst, mul_rst, mulred_rst, and mulsingle_rst.
Referenced by main().
double gflops | ( | ElapsedTimeRunStat & | et, |
unsigned | sz | ||
) |
Definition at line 248 of file gflopstest.cpp.
References ElapsedTimeRunStat::getElapsedMS(), and GIGA.
Referenced by main().
void help | ( | const char * | prg | ) |
Definition at line 23 of file gflopstest.cpp.
References clarg::arguments_descriptions(), asz, cm, h, moda, modb, modc, nt, and verb_level.
Referenced by main().
void* imul_arr | ( | void * | a | ) |
Definition at line 171 of file gflopstest.cpp.
References thread_arg_t::ara, and thread_arg_t::sz.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 257 of file gflopstest.cpp.
References acc_arr(), acc_rst, add_arr(), add_rst, clean_mem(), clarg::argT< T >::get_value(), gflops(), help(), imul_arr(), imul_rst, MEGABYTE, mul_arr(), mul_rst, mulred_arr(), mulred_rst, mulsingle_arr(), mulsingle_rst, clarg::parse_arguments(), profile(), clarg::values(), verbose, and clarg::arg_base::was_set().
void* mul_arr | ( | void * | a | ) |
Definition at line 158 of file gflopstest.cpp.
References thread_arg_t::ara, thread_arg_t::arb, thread_arg_t::arc, and thread_arg_t::sz.
Referenced by main().
void mul_arr_rev | ( | double * | ara, |
double * | arb, | ||
double * | arc, | ||
unsigned | sz, | ||
unsigned | threads | ||
) |
Definition at line 149 of file gflopstest.cpp.
void* mulred_arr | ( | void * | a | ) |
Definition at line 209 of file gflopstest.cpp.
References thread_arg_t::arb, thread_arg_t::arc, test::res, and thread_arg_t::sz.
Referenced by main().
void* mulsingle_arr | ( | void * | a | ) |
Definition at line 223 of file gflopstest.cpp.
References thread_arg_t::arb, thread_arg_t::arc, test::res, and thread_arg_t::sz.
Referenced by main().
void process_arr | ( | double * | ara, |
double * | arb, | ||
double * | arc, | ||
unsigned | sz, | ||
unsigned | nthreads, | ||
void *(*)(void *) | fun | ||
) |
Definition at line 68 of file gflopstest.cpp.
References thread_arg_t::ara, thread_arg_t::arb, thread_arg_t::arc, MIN_T, nthreads, and thread_arg_t::sz.
Referenced by profile().
void profile | ( | double * | ara, |
double * | arb, | ||
double * | arc, | ||
unsigned | sz, | ||
unsigned | num_threads, | ||
void *(*)(void *) | fun, | ||
ElapsedTimeRunStat & | et, | ||
RunStatsTable & | rst | ||
) |
Definition at line 237 of file gflopstest.cpp.
References process_arr(), RunStatsTable::start(), ElapsedTimeRunStat::start(), RunStatsTable::stop(), and ElapsedTimeRunStat::stop().
Referenced by main().
double sqrt_dbl | ( | double | v | ) |
Definition at line 156 of file gflopstest.cpp.
void thread_map1 | ( | T * | array, |
T(*)(T) | map1, | ||
unsigned | sz, | ||
unsigned | nthreads | ||
) |
Definition at line 120 of file gflopstest.cpp.
References thread_map1_arg< T >::array, thread_map1_arg< T >::map_func, MIN_T, nthreads, and thread_map1_arg< T >::sub_sz.
void* thread_map1_worker | ( | void * | arg | ) |
Definition at line 108 of file gflopstest.cpp.
References thread_map1_arg< T >::array, thread_map1_arg< T >::map_func, and thread_map1_arg< T >::sub_sz.
RunStatsTable acc_rst("-acc_rdt", "Array accumulate statistics raw data table") |
Referenced by clean_mem(), and main().
RunStatsTable add_rst("-add_rdt", "Array add statistics raw data table") |
Referenced by clean_mem(), and main().
clarg::argInt asz("-asz", "array size", 10000000) |
Referenced by help().
clarg::argInt cm("-cm", "clean memory before execution", 512) |
Referenced by help().
double global_res |
Definition at line 208 of file gflopstest.cpp.
clarg::argBool h("-h", "help message", false) |
Referenced by help().
RunStatsTable imul_rst("-imul_rdt", "Array immeditate multiply statistics raw data table") |
Referenced by clean_mem(), and main().
clarg::argInt moda("-moda", "modulo a", 0) |
Referenced by help().
clarg::argInt modb("-modb", "modulo b", 0) |
Referenced by help().
clarg::argInt modc("-modc", "modulo c", 0) |
Referenced by help().
RunStatsTable mul_rst("-mul_rdt", "Array multiply statistics raw data table") |
Referenced by clean_mem(), and main().
RunStatsTable mulred_rst("-mulred_rdt", "Array multiply and reduce statistics raw data table") |
Referenced by clean_mem(), and main().
RunStatsTable mulsingle_rst("-mulsingle_rdt", "Fake array-multiply statistics raw data table") |
Referenced by clean_mem(), and main().
clarg::argInt nt("-nt", "number of threads", 0) |
Referenced by help().
clarg::argInt verb_level("-v", "verbosity level", 0) |
Referenced by help().