Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is OpenMP "auto" schedule implemented in gcc?

The OpenMP documentation for schedule clause says that, when schedule(auto) is specified, then the decision regarding the scheduling is delegated to compiler or runtime system.

How does the compiler (E.g, gcc) decide the scheduling? Does it choose from one of the static, dynamic, guided or will it have its own algorithm for choosing a schedule?

like image 464
Varun V Avatar asked Nov 08 '25 07:11

Varun V


1 Answers

In libgomp, the default OpenMP runtime library shipped with gcc, auto simply maps to static. There is no magic.

This is commented in the code as:

/* For now map to schedule(static), later on we could play with feedback
 driven choice.  */

That comment has been there for 10 years. You can look for GFS_AUTO in loop.c and loop_ull.c

like image 133
Zulan Avatar answered Nov 11 '25 07:11

Zulan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!