Files
openmp/runtime/tools/make-fat-binaries.pl
T
Jim Cownie f12a6547f0 I apologise in advance for the size of this check-in. At Intel we do
understand that this is not friendly, and are working to change our
internal code-development to make it easier to make development
features available more frequently and in finer (more functional)
chunks. Unfortunately we haven't got that in place yet, and unpicking
this into multiple separate check-ins would be non-trivial, so please
bear with me on this one. We should be better in the future.

Apologies over, what do we have here?

GGC 4.9 compatibility
--------------------
* We have implemented the new entrypoints used by code compiled by GCC
4.9 to implement the same functionality in gcc 4.8. Therefore code
compiled with gcc 4.9 that used to work will continue to do so.
However, there are some other new entrypoints (associated with task
cancellation) which are not implemented. Therefore user code compiled
by gcc 4.9 that uses these new features will not link against the LLVM
runtime. (It remains unclear how to handle those entrypoints, since
the GCC interface has potentially unpleasant performance implications
for join barriers even when cancellation is not used)

--- new parallel entry points ---
new entry points that aren't OpenMP 4.0 related
These are implemented fully :-
      GOMP_parallel_loop_dynamic()
      GOMP_parallel_loop_guided()
      GOMP_parallel_loop_runtime()
      GOMP_parallel_loop_static()
      GOMP_parallel_sections()
      GOMP_parallel()

--- cancellation entry points ---
Currently, these only give a runtime error if OMP_CANCELLATION is true
because our plain barriers don't check for cancellation while waiting
        GOMP_barrier_cancel()
        GOMP_cancel()
        GOMP_cancellation_point()
        GOMP_loop_end_cancel()
        GOMP_sections_end_cancel()

--- taskgroup entry points ---
These are implemented fully.
      GOMP_taskgroup_start()
      GOMP_taskgroup_end()

--- target entry points ---
These are empty (as they are in libgomp)
     GOMP_target()
     GOMP_target_data()
     GOMP_target_end_data()
     GOMP_target_update()
     GOMP_teams()

Improvements in Barriers and Fork/Join
--------------------------------------
* Barrier and fork/join code is now in its own file (which makes it
easier to understand and modify).
* Wait/release code is now templated and in its own file; suspend/resume code is also templated
* There's a new, hierarchical, barrier, which exploits the
cache-hierarchy of the Intel(r) Xeon Phi(tm) coprocessor to improve
fork/join and barrier performance.

***BEWARE*** the new source files have *not* been added to the legacy
Cmake build system. If you want to use that fixes wil be required.

Statistics Collection Code
--------------------------
* New code has been added to collect application statistics (if this
is enabled at library compile time; by default it is not). The
statistics code itself is generally useful, the lightweight timing
code uses the X86 rdtsc instruction, so will require changes for other
architectures.
The intent of this code is not for users to tune their codes but
rather 
1) For timing code-paths inside the runtime
2) For gathering general properties of OpenMP codes to focus attention
on which OpenMP features are most used. 

Nested Hot Teams
----------------
* The runtime now maintains more state to reduce the overhead of
creating and destroying inner parallel teams. This improves the
performance of code that repeatedly uses nested parallelism with the
same resource allocation. Set the new KMP_HOT_TEAMS_MAX_LEVEL
envirable to a depth to enable this (and, of course, OMP_NESTED=true
to enable nested parallelism at all).

Improved Intel(r) VTune(Tm) Amplifier support
---------------------------------------------
* The runtime provides additional information to Vtune via the
itt_notify interface to allow it to display better OpenMP specific
analyses of load-imbalance.

Support for OpenMP Composite Statements
---------------------------------------
* Implement new entrypoints required by some of the OpenMP 4.1
composite statements.

Improved ifdefs
---------------
* More separation of concepts ("Does this platform do X?") from
platforms ("Are we compiling for platform Y?"), which should simplify
future porting.


ScaleMP* contribution
---------------------
Stack padding to improve the performance in their environment where
cross-node coherency is managed at the page level.

Redesign of wait and release code
---------------------------------
The code is simplified and performance improved.

Bug Fixes
---------
    *Fixes for Windows multiple processor groups.
    *Fix Fortran module build on Linux: offload attribute added.
    *Fix entry names for distribute-parallel-loop construct to be consistent with the compiler codegen.
    *Fix an inconsistent error message for KMP_PLACE_THREADS environment variable.



git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@219214 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 16:25:50 +00:00

235 lines
5.1 KiB
Perl
Executable File

#!/usr/bin/env perl
#
#//===----------------------------------------------------------------------===//
#//
#// The LLVM Compiler Infrastructure
#//
#// This file is dual licensed under the MIT and the University of Illinois Open
#// Source Licenses. See LICENSE.txt for details.
#//
#//===----------------------------------------------------------------------===//
#
use strict;
use warnings;
use IO::Dir;
use FindBin;
use lib "$FindBin::Bin/lib";
use tools;
our $VERSION = "0.003";
#
# Subroutines.
#
sub check_dir($$) {
# Make sure a directory is a readable directory.
my ( $dir, $type ) = @_;
-e $dir or runtime_error( "Directory \"$dir\" does not exist" );
-d $dir or runtime_error( "\"$dir\" is not a directory" );
-r $dir or runtime_error( "Directory \"$dir\" is not readable" );
}; # sub check_dir
sub read_dir($) {
# Return list of files (not subdirectories) of specified directory.
my ( $dir ) = @_;
my $handle;
my $entry;
my @files;
$handle = IO::Dir->new( $dir ) or runtime_error( "Cannot open \"$dir\" directory: $!" );
while ( $entry = $handle->read() ) {
my $path = "$dir/$entry";
if ( $entry !~ m{\A\.} and -f $path ) {
push( @files, $entry );
}; # if
}; # while
$handle->close();
@files = sort( @files );
return @files;
}; # sub read_dir
# --------------------------------------------------------------------------------------------------
# Main program.
# --------------------------------------------------------------------------------------------------
#
# Parse command line.
#
my @dirs; # List of input directories.
my @files; # List of files.
my $output; # Output directory.
get_options(
"output=s" => \$output
);
@ARGV == 0 and cmdline_error( "No input directories specified" );
#
# Check input and output directories.
#
# Make shure there is no duplicated directories.
my %dirs;
$dirs{ $output } = "";
foreach my $dir ( @ARGV ) {
if ( exists( $dirs{ $dir } ) ) {
cmdline_error( "Directory \"$dir\" has already been specified" );
}; # if
$dirs{ $dir } = "";
push( @dirs, $dir );
}; # foreach $dir
undef( %dirs );
# Make sure all dirs are exist, dirs, and readable.
check_dir( $output, "output" );
foreach my $dir ( @dirs ) {
check_dir( $dir, "input" );
}; # foreach $dir
# All input dirs should contain exactly the same list of files.
my @errors;
@files = read_dir( $dirs[ 0 ] );
foreach my $dir ( @dirs ) {
my %files = map( ( $_ => 0 ), @files );
foreach my $file ( read_dir( $dir ) ) {
if ( not exists( $files{ $file } ) ) {
push( @errors, "Extra file: `" . cat_file( $dir, $file ) . "'." );
}; # if
$files{ $file } = 1;
}; # foreach $file
foreach my $file ( keys( %files ) ) {
if ( $files{ $file } == 0 ) {
push( @errors, "Missed file: `" . cat_file( $dir, $file ) . "'." );
}; # if
}; # foreach $file
}; # foreach $dir
if ( @errors ) {
runtime_error( @errors );
}; # if
#
# Make fat binaries.
#
foreach my $file ( sort( @files ) ) {
info( "Making \"$file\"..." );
my $output_file = cat_file( $output, $file );
del_file( $output_file );
execute(
[
"lipo",
"-create",
"-output", $output_file,
map( cat_file( $_, $file ), @dirs )
]
);
}; # foreach $entry
exit( 0 );
__END__
=pod
=head1 NAME
B<make-fat-binaries.pl> -- Make set of fat (universal) binaries.
=head1 SYNOPSIS
B<make-fat-binaries.pl> I<OPTION>... I<INPUT_DIR>...
=head1 OPTIONS
=over
=item B<--output=>I<DIR>
Name of output directory to place fat binaries to. Directory must exist and be writable.
=item Standard Options
=over
=item B<--doc>
=item B<--manual>
Print full help message and exit.
=item B<--help>
Print short help message and exit.
=item B<--usage>
Print very short usage message and exit.
=item B<--verbose>
Do print informational messages.
=item B<--version>
Print program version and exit.
=item B<--quiet>
Work quiet, do not print informational messages.
=back
=back
=head1 ARGUMENTS
=over
=item I<INPUT_DIR>
Name of input directory to get thin files from. Directory must exist and be readable. At least one
directory required.
=back
=head1 DESCRIPTION
The script creates set of Mac-O fat (universal, multi-architecture) binaries from set of thin
(single-architecture) files.
The scripts reads files from input directory (or directoriers). It is assumed that one input
directory keeps files for one architecture (e. g. i386), another directory contains files for
another architecture (e. g. x86_64), etc. All input directories must contain the same set of files.
The script issues an error if sets of files in input directories differ.
If the script finishes successfuly, output directory will contain the set universal binaries
built from files with the same name in input directories.
=head1 EXAMPLES
Get thin binaries from C<mac_32.thin/> and C<mac_32e.thin/> directories, and put fat binaries to
C<mac.fat/> directory:
$ make-fat-binaries.pl --output=mac.fat mac_32.thin mac_32e.thin
=cut
# end of file #