[Openmp-dev] OMPT on Windows

Peyton, Jonathan L jonathan.l.peyton at intel.com
Wed Jun 17 08:55:03 PDT 2015


I tested this on Windows, Mac, and Linux and it works as expected on all three (error on Windows, fine on the others).

Committed r239912.

-- Johnny

-----Original Message-----
From: openmp-dev-bounces at cs.uiuc.edu [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Hahnfeld, Jonas
Sent: Wednesday, June 17, 2015 2:57 AM
To: John Mellor-Crummey; Cramer, Tim
Cc: openmp-dev at dcs-maillist2.engr.illinois.edu
Subject: Re: [Openmp-dev] OMPT on Windows

Hi all,

as we are currently not planning to support OMPT on Windows, find attached a patch to let CMake fail if someone tries to enable it.
Could you please test before committing? We don't have a Windows machine with the required build infrastructure, but tried to be consistent with the other checks already implemented...

If someone (from Intel) wants to implement support for Windows, this can be easily reverted.

Greetings,
Jonas

From: John Mellor-Crummey [mailto:johnmc at rice.edu]
Sent: Monday, June 08, 2015 6:28 PM
To: Cramer, Tim
Cc: Malysheva, Olga; Hahnfeld, Jonas; openmp-dev at dcs-maillist2.engr.illinois.edu
Subject: Re: OMPT on Windows 

Olga,

I don’t work with Windows, so I would appreciate suggestions from those at Intel who do about how to have the OpenMP runtime interact with the tool in a dynamically linked scenario on Windows. Is the text that Tim included below from the OMPT draft specification enough for you to craft a solution for Windows? If not, how should the OpenMP runtime identify that a tool is present and call a function to set up the tool?

We wanted to avoid creating a security flaw by having the OMP runtime read the name of a dynamically linked library for the tool shared library an environment variable and then load that. This strategy would certainly work, though I would expect to hear that this would create security problems.
--
John Mellor-Crummey         Professor
Dept of Computer Science    Rice University
email: johnmc at rice.edu      phone: 713-348-5179

On Jun 8, 2015, at 11:05 AM, Cramer, Tim <Cramer at itc.rwth-aachen.de> wrote:

Hi Olga,
 
To be honest: I am not really aware of Windows. As far as I know weak symbols are not supported on Windows, so that we need a different strategy. The OMPT specification [1] says
 
“Compiler and linker don't support weak symbols. On systems that don't support weak symbols, different implementation strategies are needed for static and dynamic linking. For a static library implementation of an OpenMP runtime library, the library can provide a stub version of ompt_initialize in a separate object file. In this case, the linker will include the OpenMP library's stub implementation of ompt_initialize only if no tool supplied version is already present when the OpenMP runtime library is used to resolve undefined symbols. An OpenMP implementation used as a dynamic library can define ompt_initialize as a global symbol. The version in the OpenMP library would be invoked only if no tool-supplied implementation of ompt_initialize is statically linked in the executable or a tool library that appears before the OpenMP runtime library in the dynamic library search path during execution.”
 
I will discuss with Jonas how / if we can fix this. At least we should ensure that compiling is possible on Windows, at least with deactivating OMPT.
 
Regards,
 
Tim
 
[1] http://openmp.org/mp-documents/ompt-tr2.pdf
 
 
From: Malysheva, Olga [mailto:Olga.Malysheva at intel.com]
Sent: Thursday, June 04, 2015 2:42 PM
To: Hahnfeld, Jonas
Cc: John Mellor-Crummey (johnmc at rice.edu); Cramer, Tim; 'openmp-dev at dcs-maillist2.engr.illinois.edu'
Subject: OMPT on Windows 
 
Hi Jonas, 
 
How do you intend to support OMPT on Windows? 
The code currently committed to the project can be compiled only on unix-like systems due to the attribute ‘weak’ specified for the initialization function (in ompt-general.c):
 
_OMP_EXTERN __attribute__ (( weak ))
int ompt_initialize(ompt_function_lookup_t ompt_fn_lookup, const char *version,
                    unsigned int ompt_version) {
    return no_tool_present;
}
 
Thank you.
 
Regards,
Olga
 
-----Original Message-----
From: openmp-dev-bounces at cs.uiuc.edu [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Hahnfeld, Jonas
Sent: Thursday, April 9, 2015 4:25 PM
To: 'openmp-dev at dcs-maillist2.engr.illinois.edu'
Cc: John Mellor-Crummey (johnmc at rice.edu); Cramer, Tim
Subject: [Openmp-dev] Patches to support OMPT
 
Hi all!
 
After some months of work, we would like to share our patches to add support for OMPT[1] to this version of the Intel runtime.
Implementation was mainly done by John Mellor-Crummey from Rice University in a repository at Google Code[2].
 
Support for OMPT is disabled by default and therefore has to be enabled
explicitly:
With CMake, define "ompt-support": $ cmake -Dompt-support=true ..
build.pl works nearly the same: $ make build_args="--ompt-support=on"
With this switch, ompt-blame and ompt-trace will be enabled as well which can be disabled separately.
 
We've uploaded the patches to LLVM's Phabricator. Some short explanation:
0001-kmp_lock-Change-return-type-of-release-functions-fro.patch[3]
This is a preparation patch to get information about the actual release status from nested locks.
 
0002-Add-new-files-for-OMPT.patch[4]
This patch contains the new files for OMPT and the needed changes to the build infrastructure.
 
0003-Modify-runtime-to-call-correct-functions-for-OMPT.patch[5]
These are the actual changes in the runtime to issue OMPT-related functions.
All of them are surrounded by #if OMPT_SUPPORT and can be disabled (which is the default).
 
The implementation is tested with the OMPT-TestSuite[6] and conforms with the OpenMP's 2nd Technical Report[1].
Additionally we ran the OpenMP Validation Suite contained in this repository to make sure that nothing broke.
 
Please review and commit if found suitable.
We know that these are rather big patches (for a big feature), but we couldn't come up with a better splitting.
 
>From Aachen,
Tim Cramer and Jonas Hahnfeld
 
[1]: http://openmp.org/mp-documents/ompt-tr2.pdf
[2]: https://code.google.com/p/ompt-intel-openmp/
[3]: http://reviews.llvm.org/D8916
[4]: http://reviews.llvm.org/D8917
[5]: http://reviews.llvm.org/D8918
[6]: https://code.google.com/p/ompt-test-suite/
 
 
--
Jonas Hahnfeld, MATSE-Auszubildender
 
IT Center
Group: High Performance Computing
Division: Computational Science and Engineering RWTH Aachen University Seffenter Weg 23 D 52074  Aachen (Germany) Hahnfeld at itc.rwth-aachen.dewww.itc.rwth-aachen.de
 
 
 

--------------------------------------------------------------------
Closed 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.
!DSPAM:8504,5575bd4387891074019211!





More information about the Openmp-dev mailing list