Skip to content

Commit

Permalink
Merge pull request #5862 from raffenet/macos-tls
Browse files Browse the repository at this point in the history
ch4: Workaround Intel compiler TLS bug on macOS

Approved-by: Hui Zhou <[email protected]>
  • Loading branch information
raffenet authored Feb 23, 2022
2 parents 908c021 + 66830ab commit a78f64f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/mpid/ch4/src/ch4_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ MPL_COMPILER_TLS int global_vci_poll_count;
int global_vci_poll_count = 0;
#endif

/* ** HACK **
* Hack to workaround an Intel compiler bug on macOS. Touching
* global_vci_poll_count in this file forces the compiler to allocate
* it as TLS. See https://github.com/pmodels/mpich/issues/3437.
*/
int _dummy_touch_tls(void);
int _dummy_touch_tls(void)
{
return global_vci_poll_count;
}

/* PVAR */
unsigned PVAR_LEVEL_posted_recvq_length ATTRIBUTE((unused));
unsigned PVAR_LEVEL_unexpected_recvq_length ATTRIBUTE((unused));
Expand Down

0 comments on commit a78f64f

Please sign in to comment.