OpenMP "auto" 调度是如何在 gcc 中实现的?
How is OpenMP "auto" schedule implemented in gcc?
schedule
子句的 OpenMP 文档说,当指定 schedule(auto)
时,有关调度的决定将委托给编译器或运行时系统。
编译器(例如 gcc)如何决定调度?它是从 static, dynamic, guided
中选择一个,还是会有自己的算法来选择时间表?
在 libgomp 中,gcc 附带的默认 OpenMP 运行时库,auto
简单地映射到 static
。没有魔法。
这在代码中被注释为:
/* For now map to schedule(static), later on we could play with feedback
driven choice. */
该评论已经存在 10 年了。您可以在 loop.c
and loop_ull.c
中查找 GFS_AUTO
schedule
子句的 OpenMP 文档说,当指定 schedule(auto)
时,有关调度的决定将委托给编译器或运行时系统。
编译器(例如 gcc)如何决定调度?它是从 static, dynamic, guided
中选择一个,还是会有自己的算法来选择时间表?
在 libgomp 中,gcc 附带的默认 OpenMP 运行时库,auto
简单地映射到 static
。没有魔法。
这在代码中被注释为:
/* For now map to schedule(static), later on we could play with feedback
driven choice. */
该评论已经存在 10 年了。您可以在 loop.c
and loop_ull.c
GFS_AUTO