[Openmp-dev] kmp vs. gomp
Joachim Protze via Openmp-dev
openmp-dev at lists.llvm.org
Fri Jun 22 08:09:59 PDT 2018
Ok, different proposal:
Many computing centers carefully provide separate tool chains for
different compilers used on their clusters based on module system or
I also think, that in the near future several tools will integrate the
LLVM/OpenMP runtime into their build to enable their tool to work with
applications built with older compilers coming without OMPT interface.
Hopefully this will be solved within the next years :) But experience
shows that HPC machines tend to run with quite old software stack, so it
could take another 5-10 years :(
A configure switch might provide the ability to turn off kmp or gomp
interface in these module environments. So, if the sysadmin compiles the
runtime for the gcc toolchain, he would only activate the gomp
interface. Based on this switch a more detailed support level of OMPT
callbacks might be announced to the tool.
Default for this switch would be of cause kmp+gomp.
On 06/20/2018 07:32 PM, Churbanov, Andrey wrote:
> Doesn't sound like a good idea to me.
> The whole point why we have GOMP and KMP interfaces in the library is to allow same binary be used with code compiled by different compilers.
> You may solve one particular problem of running unit tests for an OpenMP implementation (one combination of compiler+runtime). But what if people use several OpenMP implementations to produce single application (e.g. several OpenMP-parallelized third-party libraries)? These cases may stop working or produce unexpected (or unspecified) results.
> I'd rather look for some other solution for the problem. E.g. always return ompt_set_sometimes when registering ompt_callback_work. Or make a tool to cope somehow with the absence of end_single event. Etc.
> -----Original Message-----
> From: Joachim Protze [mailto:protze.joachim at gmail.com]
> Sent: Monday, June 18, 2018 4:17 PM
> To: Churbanov, Andrey <Andrey.Churbanov at intel.com>
> Cc: openmp-dev at lists.llvm.org
> Subject: Re: [Openmp-dev] kmp vs. gomp
> Following Michael Klemms opinion, that an OpenMP implementation consists of a fixed pair of compiler+runtime, I suggest to add a CMake flag, that selects whether the intended use of the runtime is KMP or GOMP.
> Based on this flag, we would provide return codes for OMPT callback registration.
> What do you think about this proposal?
> On 06/13/2018 03:05 PM, Churbanov, Andrey wrote:
>> In general, it is not possible to know which compiler used to compile the code that caused the initialization of the runtime library.
>> It could be possible if kmp or gomp interface caused the initialization, but definitely not possible if it was omp_* call.
>> Note also that we tentatively support case when executable linked from objects compiled by different compilers, so the library can be initialized in code compiled by one compiler and then used in the code compiled by another compiler (we do not cover all the cases of cause, but simple cases should work).
>> -- Andrey
>> -----Original Message-----
>> From: Openmp-dev [mailto:openmp-dev-bounces at lists.llvm.org] On Behalf
>> Of Joachim Protze via Openmp-dev
>> Sent: Wednesday, June 13, 2018 12:35 AM
>> To: openmp-dev at lists.llvm.org
>> Subject: [Openmp-dev] kmp vs. gomp
>> Hi all,
>> is there a way in the runtime to tell whether the runtime was initialized through a call to the kmp or gomp interface? As I understand the initialization, this is currently not possible.
>> A way to implement this would be to pass a flag through __kmp_get_global_thread_id_reg to __kmp_do_serial_initialize. Would this be acceptable?
>> The background for this question is the different behavior regarding OMPT callbacks. Specifically, gomp has currently no way to provide a callback for the single-end event.
>> Following the specification, the runtime should return ompt_set_sometimes instead of ompt_set_always when registering ompt_callback_work knowing that the application uses the gomp interface.
>> Openmp-dev mailing list
>> Openmp-dev at lists.llvm.org
>> Joint Stock Company Intel A/O
>> Registered legal address: Krylatsky Hills Business Park,
>> 17 Krylatskaya Str., Bldg 4, Moscow 121614, Russian Federation
>> This e-mail and any attachments may contain confidential material for
>> the sole use of the intended recipient(s). Any review or distribution
>> by others is strictly prohibited. If you are not the intended
>> recipient, please contact the sender and delete all copies.
> Joint Stock Company Intel A/O
> Registered legal address: Krylatsky Hills Business Park,
> 17 Krylatskaya Str., Bldg 4, Moscow 121614,
> Russian Federation
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
More information about the Openmp-dev