Skip to content

Source · fairmq/devices/

runBenchmarkSampler.cxxsource

fairmq/devices/runBenchmarkSampler.cxx30 lines · C++GitHub ↗
1/********************************************************************************2 * Copyright (C) 2014-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH  *3 *                                                                              *4 *              This software is distributed under the terms of the             *5 *              GNU Lesser General Public Licence (LGPL) version 3,             *6 *                  copied verbatim in the file "LICENSE"                       *7 ********************************************************************************/8 9#include <fairmq/devices/BenchmarkSampler.h>10#include <fairmq/runDevice.h>11 12namespace bpo = boost::program_options;13 14void addCustomOptions(bpo::options_description& options)15{16    options.add_options()17        ("out-channel", bpo::value<std::string>()->default_value("data"), "Name of the output channel")18        ("multipart", bpo::value<bool>()->default_value(false), "Handle multipart payloads")19        ("memset", bpo::value<bool>()->default_value(false), "Memset allocated buffers to 0")20        ("num-parts", bpo::value<size_t>()->default_value(1), "Number of parts to send. 1 will send single messages, not parts")21        ("msg-size", bpo::value<size_t>()->default_value(1000000), "Message size in bytes")22        ("msg-alignment", bpo::value<size_t>()->default_value(0), "Message alignment")23        ("max-iterations", bpo::value<uint64_t>()->default_value(0), "Number of run iterations (0 - infinite)")24        ("msg-rate", bpo::value<float>()->default_value(0), "Msg rate limit in maximum number of messages per second");25}26 27std::unique_ptr<fair::mq::Device> getDevice(fair::mq::ProgOptions& /* config */)28{29    return std::make_unique<fair::mq::BenchmarkSampler>();30}