ALP User Documentation 0.7.alpha
Algebraic Programming User Documentation
|
A class that follows the API of the grb::Launcher, but instead of launching the given ALP program once, it launches it multiple times while benchmarking its execution times. More...
#include <benchmark.hpp>
Public Member Functions | |
Benchmarker (const size_t process_id=0, size_t nprocs=1, std::string hostname="localhost", std::string port="0") | |
Constructs an instance of the benchmarker class. | |
template<typename T , typename U > | |
RC | exec (void(*alp_program)(const T &, U &), const T &data_in, U &data_out, const size_t inner, const size_t outer, const bool broadcast=false) const |
Benchmarks a given ALP program. | |
template<typename U > | |
RC | exec (void(*alp_program)(const void *, const size_t, U &), const void *data_in, const size_t in_size, U &data_out, const size_t inner, const size_t outer, const bool broadcast=false) const |
Benchmarks a given ALP program. | |
Static Public Member Functions | |
static RC | finalize () |
Releases all ALP resources. | |
A class that follows the API of the grb::Launcher, but instead of launching the given ALP program once, it launches it multiple times while benchmarking its execution times.
|
inline |
Constructs an instance of the benchmarker class.
[in] | process_id | A unique ID for the calling user process. |
[in] | nprocs | The total number of user processes participating in the benchmark. The given process_id must be strictly smaller than this given value. |
[in] | hostname | The hostname where one of the user processes participating in the benchmark resides. |
[in] | port | A free TCP/IP port at the host corresponding to the given hostname. |
The hostname and port arguments are unused if nprocs equals one.
All arguments are optional– their defaults are:
This constructor may throw the same errors as grb::Launcher.
|
inline |
Benchmarks a given ALP program.
This variant applies to input data as a user-defined POD struct and output data as a user-defined POD struct.
T | Input type of the given user program. |
U | Output type of the given user program. |
[in] | alp_program | The ALP program to be benchmarked |
[in] | data_in | Input data as a raw data blob |
[out] | data_out | Output data |
[in] | inner | The number of inner repetitions of the benchmark |
[in] | outer | The number of outer repetitions of the benchmark |
[in] | broadcast | An optional argument that dictates whether the data_in argument should be broadcast across all user processes participating in the benchmark, prior to each invocation of alp_program. |
The default value of broadcast is false
.
|
inline |
Benchmarks a given ALP program.
This variant applies to input data as a byte blob and output data as a user-defined POD struct.
U | Output type of the given user program. |
[in] | alp_program | The use rogram to be benchmarked |
[in] | data_in | Input data as a raw data blob |
[in] | in_size | The size, in bytes, of the input data |
[out] | data_out | Output data |
[in] | inner | The number of inner repetitions of the benchmark |
[in] | outer | The number of outer repetitions of the benchmark |
[in] | broadcast | An optional argument that dictates whether the data_in argument should be broadcast across all user processes participating in the benchmark, prior to each invocation of alp_program. |
The default value of broadcast is false
.
nullptr
.
|
inlinestatic |
Releases all ALP resources.
Calling this function is equivalent to calling grb::Launcher::finalize.
After a call to this function, no further ALP programs may be benchmarked nor launched– i.e., both the grb::Launcher and grb::Benchmarker functionalities many no longer be used.
A well-behaving program calls this function, or grb::Launcher::finalize, exactly once and just before exiting (or just before the guaranteed last invocation of an ALP program).