[Openmp-dev] kmp vs. gomp
John Mellor-Crummey via Openmp-dev
openmp-dev at lists.llvm.org
Wed Jun 20 13:14:58 PDT 2018
I agree with Andrey.
(sent from my phone)
> On Jun 20, 2018, at 8:32 PM, Churbanov, Andrey via Openmp-dev <openmp-dev at lists.llvm.org> 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.
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
More information about the Openmp-dev