Consider tweaking default optimizer options

Issue #387 new
Dan Bonachea created an issue

We should consider/investigate whether we should be augmenting the default compiler optimization options in production mode to provide default optimization that does a good job for common use on the UPC++ header functions.

For example, it's been observed in pull request #172 that the default -O3 optimization options for Intel C++ might not be sufficient to fully inline things in the UPC++ headers that are intended to inline (and subsequently get optimized away). In that case Intel option -no-inline-factor was sufficient, but of course such options have global effects on the user application code.

An alternate more surgical approach to this particular problem (and the one used by GASNet) is to replace/augment inline in our code with GASNETT_INLINE aka __attribute__((__always_inline__)) when supported, which marks a function to be inlined regardless of optimizer flags. However this would be a rather intrusive change to our headers.

A serious end user of course can/should tweak their own optimization options by passing them to the upcxx compile wrapper, so we are just talking about ensuring our defaults are reasonable.

Comments (8)

  1. Johnny Corbino

    When working on the synchronous version of PR #42 for upcxx-extras, we did notice a significant impact on performance by passing the -no-inline-factor flag (which is specific to Intel's compiler). The execution time of the program got reduced by 50%.

  2. Log in to comment