Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw06/tbb #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

hw06/tbb #2

wants to merge 2 commits into from

Conversation

Tigerrr07
Copy link


函数 串行 (s) 并行 (s) 提升倍数
fill 0.951 0.258 3.69
saxpy 0.042 0.021 2
sqrdot 0.0916 0.0214 3.88
minvalue 0.092 0.023 4
magicfilter 0.41 0.05 8
scanner 0.09 0.047 1.91
  • 为了方便比较提升倍数,所有的for循环使用任务域指定使用的线程数为4

  • 每个函数只有一个for循环,故使用默认的auto_partitioner自动进行任务分配

  • saxpyscanner函数,其余都能达到接近4倍的性能提升,magicfilter甚至达到了8倍

  • 观察到saxpyscanner涉及到同时对数组进行读和写的操作,在scanner中每个线程算出对应的local_ret才会进行下一步的累加操作,这也会造成线程之间的等待时间,这一部分应该还有优化的地方

  • sqrdot的串行结果为5165.4,会出现浮点误差,并行则可以避免浮点误差,结果为5792.62

  • 关于内卷:tbb已经够强大了,不卷了不卷了,还要补前面的课😂

Copy link
Contributor

@archibate archibate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢你认真的作业!一下就看出老师在repo里塞了个pod.h的用意 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants