开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 37

uxsys/cpp-taskflow

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (3)
标签 (15)
master
dev
cpp14
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.7.0
v2.6.0
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
master
分支 (3)
标签 (15)
master
dev
cpp14
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.7.0
v2.6.0
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (3)
标签 (15)
master
dev
cpp14
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.7.0
v2.6.0
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
cpp-taskflow
/
docs
/
xml
/
BenchmarkTaskflow.xml
cpp-taskflow
/
docs
/
xml
/
BenchmarkTaskflow.xml
BenchmarkTaskflow.xml 11.24 KB
一键复制 编辑 原始数据 按行查看 历史
twhuang 提交于 2022年08月16日 02:24 +08:00 . revised doc
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.14">
<compounddef id="BenchmarkTaskflow" kind="page">
<compoundname>BenchmarkTaskflow</compoundname>
<title>Benchmark Taskflow</title>
<tableofcontents/>
<briefdescription>
</briefdescription>
<detaileddescription>
<sect1 id="BenchmarkTaskflow_1CompileAndRunBenchmarks">
<title>Compile and Run Benchmarks</title>
<para>To build the benchmark code, enable the CMake option <computeroutput>TF_BUILD_BENCHMARKS</computeroutput> to <computeroutput>ON</computeroutput> as follows:</para><para><programlisting filename=".shell-session"><codeline><highlight class="normal">#<sp/>under<sp/>/taskflow/build</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>cmake<sp/>../<sp/>-DTF_BUILD_BENCHMARKS=ON</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>make</highlight></codeline>
</programlisting></para><para>After you successfully build the benchmark code, you can find all benchmark instances in the <computeroutput>benchmarks/</computeroutput> folder. You can run the executable of each instance in the corresponding folder.</para><para><programlisting filename=".shell-session"><codeline><highlight class="normal">~$<sp/>cd<sp/>benchmarks<sp/>&amp;<sp/>ls</highlight></codeline>
<codeline><highlight class="normal">black_scholes<sp/>binary_tree<sp/>graph_traversal<sp/>...</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>cd<sp/>graph_traversal<sp/>&amp;<sp/>./graph_traversal</highlight></codeline>
<codeline><highlight class="normal">|V|+|E|<sp/><sp/><sp/><sp/><sp/>Runtime</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>2<sp/><sp/><sp/><sp/><sp/><sp/><sp/>0.197</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>842<sp/><sp/><sp/><sp/><sp/><sp/><sp/>0.198</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/>3284<sp/><sp/><sp/><sp/><sp/><sp/><sp/>0.488</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/>7288<sp/><sp/><sp/><sp/><sp/><sp/><sp/>0.774</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>...<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>...</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>...<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>...</highlight></codeline>
<codeline><highlight class="normal"><sp/>619802<sp/><sp/><sp/><sp/><sp/><sp/>75.135</highlight></codeline>
<codeline><highlight class="normal"><sp/>664771<sp/><sp/><sp/><sp/><sp/><sp/>77.436</highlight></codeline>
<codeline><highlight class="normal"><sp/>711200<sp/><sp/><sp/><sp/><sp/><sp/>83.957</highlight></codeline>
</programlisting></para><para>You can display the help message by giving the option <computeroutput><ndash/>help</computeroutput>.</para><para><programlisting filename=".shell-session"><codeline><highlight class="normal">~$<sp/>./graph_traversal<sp/>--help</highlight></codeline>
<codeline><highlight class="normal">Graph<sp/>Traversal</highlight></codeline>
<codeline><highlight class="normal">Usage:<sp/>./graph_traversal<sp/>[OPTIONS]</highlight></codeline>
<codeline></codeline>
<codeline><highlight class="normal">Options:</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>-h,--help<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Print<sp/>this<sp/>help<sp/>message<sp/>and<sp/>exit</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>-t,--num_threads<sp/>UINT<sp/><sp/><sp/><sp/><sp/><sp/><sp/>number<sp/>of<sp/>threads<sp/>(default=1)</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>-r,--num_rounds<sp/>UINT<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>number<sp/>of<sp/>rounds<sp/>(default=1)</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>-m,--model<sp/>TEXT<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>model<sp/>name<sp/>tbb|omp|tf<sp/>(default=tf)</highlight></codeline>
</programlisting></para><para>We currently implement the following instances that are commonly used by the parallel computing community to evaluate the system performance.</para><para><table rows="13" cols="2"><row>
<entry thead="yes"><para>Instance </para></entry><entry thead="yes"><para>Description </para></entry></row>
<row>
<entry thead="no"><para>binary_tree </para></entry><entry thead="no"><para>traverses a complete binary tree </para></entry></row>
<row>
<entry thead="no"><para>black_scholes </para></entry><entry thead="no"><para>computes option pricing with Black-Shcoles Models </para></entry></row>
<row>
<entry thead="no"><para>graph_traversal </para></entry><entry thead="no"><para>traverses a randomly generated direct acyclic graph </para></entry></row>
<row>
<entry thead="no"><para>linear_chain </para></entry><entry thead="no"><para>traverses a linear chain of tasks </para></entry></row>
<row>
<entry thead="no"><para>mandelbrot </para></entry><entry thead="no"><para>exploits imbalanced workloads in a Mandelbrot set </para></entry></row>
<row>
<entry thead="no"><para>matrix_multiplication </para></entry><entry thead="no"><para>multiplies two 2D matrices </para></entry></row>
<row>
<entry thead="no"><para>mnist </para></entry><entry thead="no"><para>trains a neural network-based image classifier on the MNIST dataset </para></entry></row>
<row>
<entry thead="no"><para>parallel_sort </para></entry><entry thead="no"><para>sorts a range of items </para></entry></row>
<row>
<entry thead="no"><para>reduce_sum </para></entry><entry thead="no"><para>sums a range of items using reduction </para></entry></row>
<row>
<entry thead="no"><para>wavefront </para></entry><entry thead="no"><para>propagates computations in a 2D grid </para></entry></row>
<row>
<entry thead="no"><para>linear_pipeline </para></entry><entry thead="no"><para>pipeline scheduling on a linear chain of pipes </para></entry></row>
<row>
<entry thead="no"><para>graph_pipeline </para></entry><entry thead="no"><para>pipeline scheduling on a graph of pipes </para></entry></row>
</table>
</para></sect1>
<sect1 id="BenchmarkTaskflow_1ConfigureRunOptions">
<title>Configure Run Options</title>
<para>We implement consistent options for each benchmark instance. Common options are:</para><para><table rows="5" cols="3"><row>
<entry thead="yes"><para>option </para></entry><entry thead="yes"><para>value </para></entry><entry thead="yes"><para>function </para></entry></row>
<row>
<entry thead="no"><para><computeroutput>-h</computeroutput> </para></entry><entry thead="no"><para>none </para></entry><entry thead="no"><para>display the help message </para></entry></row>
<row>
<entry thead="no"><para><computeroutput>-t</computeroutput> </para></entry><entry thead="no"><para>integer </para></entry><entry thead="no"><para>configure the number of threads to run </para></entry></row>
<row>
<entry thead="no"><para><computeroutput>-r</computeroutput> </para></entry><entry thead="no"><para>integer </para></entry><entry thead="no"><para>configure the number of rounds to run </para></entry></row>
<row>
<entry thead="no"><para><computeroutput>-m</computeroutput> </para></entry><entry thead="no"><para>string </para></entry><entry thead="no"><para>configure the baseline models to run, tbb, omp, or tf </para></entry></row>
</table>
</para><para>You can configure the benchmarking environment by giving different options.</para><sect2 id="BenchmarkTaskflow_1SpecifyTheRunModel">
<title>Specify the Run Model</title>
<para>In addition to a Taskflow-based implementation for each benchmark instance, we have implemented two baseline models using the state-of-the-art parallel programming libraries, <ulink url="https://www.openmp.org/">OpenMP</ulink> and <ulink url="https://github.com/oneapi-src/oneTBB">Intel TBB</ulink>, to measure and evaluate the performance of Taskflow. You can select different implementations by passing the option <computeroutput>-m</computeroutput>.</para><para><programlisting filename=".shell-session"><codeline><highlight class="normal">~$<sp/>./graph_traversal<sp/>-m<sp/>tf<sp/><sp/><sp/>#<sp/>run<sp/>the<sp/>Taskflow<sp/>implementation<sp/>(default)</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>./graph_traversal<sp/>-m<sp/>tbb<sp/><sp/>#<sp/>run<sp/>the<sp/>TBB<sp/>implementation</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>./graph_traversal<sp/>-m<sp/>omp<sp/><sp/>#<sp/>run<sp/>the<sp/>OpenMP<sp/>implementation</highlight></codeline>
</programlisting></para></sect2>
<sect2 id="BenchmarkTaskflow_1SpecifyTheNumberOfThreads">
<title>Specify the Number of Threads</title>
<para>You can configure the number of threads to run a benchmark instance by passing the option <computeroutput>-t</computeroutput>. The default value is one.</para><para><programlisting filename=".shell-session"><codeline><highlight class="normal">#<sp/>run<sp/>the<sp/>Taskflow<sp/>implementation<sp/>using<sp/>4<sp/>threads</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>./graph_traversal<sp/>-m<sp/>tf<sp/>-t<sp/>4</highlight></codeline>
</programlisting></para><para>Depending on your environment, you may need to use <computeroutput>taskset</computeroutput> to set the CPU affinity of the running process. This allows the OS scheduler to keep process on the same CPU(s) as long as practical for performance reason.</para><para><programlisting filename=".shell-session"><codeline><highlight class="normal">#<sp/>affine<sp/>the<sp/>process<sp/>to<sp/>4<sp/>CPUs,<sp/>CPU<sp/>0,<sp/>CPU<sp/>1,<sp/>CPU<sp/>2,<sp/>and<sp/>CPU<sp/>3</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>taskset<sp/>-c<sp/>0-3<sp/>graph_traversal<sp/>-t<sp/>4<sp/><sp/></highlight></codeline>
</programlisting></para></sect2>
<sect2 id="BenchmarkTaskflow_1SpecifyTheNumberOfRounds">
<title>Specify the Number of Rounds</title>
<para>Each benchmark instance evaluates the runtime of the implementation at different problem sizes. Each problem size corresponds to one iteration. You can configure the number of rounds per iteration to average the runtime.</para><para><programlisting filename=".shell-session"><codeline><highlight class="normal">#<sp/>measure<sp/>the<sp/>runtime<sp/>in<sp/>an<sp/>average<sp/>of<sp/>10<sp/>runs</highlight></codeline>
<codeline><highlight class="normal">~$<sp/>./graph_traversal<sp/>-r<sp/>10</highlight></codeline>
<codeline><highlight class="normal">|V|+|E|<sp/><sp/><sp/><sp/><sp/>Runtime</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>2<sp/><sp/><sp/><sp/><sp/><sp/><sp/>0.109<sp/><sp/><sp/>#<sp/>the<sp/>runtime<sp/>value<sp/>0.109<sp/>is<sp/>an<sp/>average<sp/>of<sp/>10<sp/>runs</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>842<sp/><sp/><sp/><sp/><sp/><sp/><sp/>0.298</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>...<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>...</highlight></codeline>
<codeline><highlight class="normal"><sp/>619802<sp/><sp/><sp/><sp/><sp/><sp/>73.135</highlight></codeline>
<codeline><highlight class="normal"><sp/>664771<sp/><sp/><sp/><sp/><sp/><sp/>74.436</highlight></codeline>
</programlisting> </para></sect2>
</sect1>
</detaileddescription>
</compounddef>
</doxygen>
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

cpp-taskflow 是一个开源的 C++ 并行任务编程库,cpp-tastflow 非常快,只包含头文件,可以帮你快速编写包含复杂任务依赖的并行程序
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/uxsys/cpp-taskflow.git
git@gitee.com:uxsys/cpp-taskflow.git
uxsys
cpp-taskflow
cpp-taskflow
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /