kmp_version.c

Go to the documentation of this file.
00001 /*
00002  * kmp_version.c
00003  * $Revision: 42181 $
00004  * $Date: 2013-03-26 15:04:45 -0500 (Tue, 26 Mar 2013) $
00005  */
00006 
00007 /* <copyright>
00008     Copyright (c) 1997-2013 Intel Corporation.  All Rights Reserved.
00009 
00010     Redistribution and use in source and binary forms, with or without
00011     modification, are permitted provided that the following conditions
00012     are met:
00013 
00014       * Redistributions of source code must retain the above copyright
00015         notice, this list of conditions and the following disclaimer.
00016       * Redistributions in binary form must reproduce the above copyright
00017         notice, this list of conditions and the following disclaimer in the
00018         documentation and/or other materials provided with the distribution.
00019       * Neither the name of Intel Corporation nor the names of its
00020         contributors may be used to endorse or promote products derived
00021         from this software without specific prior written permission.
00022 
00023     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00026     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00027     HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00028     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00029     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00030     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00031     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00032     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034 
00035 
00036 ------------------------------------------------------------------------
00037 
00038     Portions of this software are protected under the following patents:
00039         U.S. Patent 5,812,852
00040         U.S. Patent 6,792,599
00041         U.S. Patent 7,069,556
00042         U.S. Patent 7,328,433
00043         U.S. Patent 7,500,242
00044 
00045 </copyright> */
00046 
00047 #include "kmp.h"
00048 #include "kmp_io.h"
00049 #include "kmp_version.h"
00050 
00051 // Replace with snapshot date YYYYMMDD for promotion build.
00052 #define KMP_VERSION_BUILD    00000000
00053 
00054 // Helper macros to convert value of macro to string literal.
00055 #define _stringer( x ) #x
00056 #define stringer( x )  _stringer( x )
00057 
00058 // Detect compiler.
00059 #ifdef __INTEL_COMPILER
00060     #if   __INTEL_COMPILER == 1010
00061         #define KMP_COMPILER "Intel C++ Compiler 10.1"
00062     #elif __INTEL_COMPILER == 1100
00063         #define KMP_COMPILER "Intel C++ Compiler 11.0"
00064     #elif __INTEL_COMPILER == 1110
00065         #define KMP_COMPILER "Intel C++ Compiler 11.1"
00066     #elif __INTEL_COMPILER == 1200
00067         #define KMP_COMPILER "Intel C++ Compiler 12.0"
00068     #elif __INTEL_COMPILER == 1210
00069         #define KMP_COMPILER "Intel C++ Compiler 12.1"
00070     #elif __INTEL_COMPILER == 1300
00071         #define KMP_COMPILER "Intel C++ Compiler 13.0"
00072     #elif __INTEL_COMPILER == 1310
00073         #define KMP_COMPILER "Intel C++ Compiler 13.1"
00074     #elif __INTEL_COMPILER == 9999
00075         #define KMP_COMPILER "Intel C++ Compiler mainline"
00076     #endif
00077 #elif defined( __GNUC__ )
00078     #define KMP_COMPILER "GCC " stringer( __GNUC__ ) "." stringer( __GNUC_MINOR__ )
00079 #endif
00080 #ifndef KMP_COMPILER
00081     #warning "Unknown compiler"
00082     #define KMP_COMPILER "unknown compiler"
00083 #endif
00084 
00085 // Detect librray type (perf, stub).
00086 #ifdef KMP_STUB
00087     #define KMP_LIB_TYPE "stub"
00088 #else
00089     #define KMP_LIB_TYPE "performance"
00090 #endif // KMP_LIB_TYPE
00091 
00092 // Detect link type (static, dynamic).
00093 #ifdef GUIDEDLL_EXPORTS
00094     #define KMP_LINK_TYPE "dynamic"
00095 #else
00096     #define KMP_LINK_TYPE "static"
00097 #endif // KMP_LINK_TYPE
00098 
00099 // Finally, define strings.
00100 #define KMP_LIBRARY   KMP_LIB_TYPE " library (" KMP_LINK_TYPE ")"
00101 #define KMP_COPYRIGHT "Copyright (C) 1997-2013, Intel Corporation. All Rights Reserved."
00102 
00103 int const __kmp_version_major = KMP_VERSION_MAJOR;
00104 int const __kmp_version_minor = KMP_VERSION_MINOR;
00105 int const __kmp_version_build = KMP_VERSION_BUILD;
00106 int const __kmp_openmp_version =
00107     #if OMP_30_ENABLED
00108         201107;
00109     #else
00110         200505;
00111     #endif
00112 
00113 /* Do NOT change the format of this string!  Intel(R) Thread Profiler checks for a
00114    specific format some changes in the recognition routine there need to
00115    be made before this is changed.
00116 */
00117 char const __kmp_copyright[] =
00118     KMP_VERSION_PREFIX KMP_LIBRARY
00119     " ver. " stringer( KMP_VERSION_MAJOR ) "." stringer( KMP_VERSION_MINOR )
00120     "." stringer( KMP_VERSION_BUILD ) " "
00121     KMP_COPYRIGHT;
00122 
00123 char const __kmp_version_copyright[]      = KMP_VERSION_PREFIX KMP_COPYRIGHT;
00124 char const __kmp_version_lib_ver[]        = KMP_VERSION_PREFIX "version: " stringer( KMP_VERSION_MAJOR ) "." stringer( KMP_VERSION_MINOR ) "." stringer( KMP_VERSION_BUILD );
00125 char const __kmp_version_lib_type[]       = KMP_VERSION_PREFIX "library type: " KMP_LIB_TYPE;
00126 char const __kmp_version_link_type[]      = KMP_VERSION_PREFIX "link type: " KMP_LINK_TYPE;
00127 char const __kmp_version_build_time[]     = KMP_VERSION_PREFIX "build time: " _KMP_BUILD_TIME;
00128 #if __MIC__
00129     char const __kmp_version_target_env[] = KMP_VERSION_PREFIX "target environment: MIC_";
00130 #elif __MIC2__
00131     char const __kmp_version_target_env[] = KMP_VERSION_PREFIX "target environment: MIC__";
00132 #endif
00133 char const __kmp_version_build_compiler[] = KMP_VERSION_PREFIX "build compiler: " KMP_COMPILER;
00134 
00135 //
00136 // Called at serial initialization time.
00137 //
00138 static int __kmp_version_1_printed = FALSE;
00139 
00140 void
00141 __kmp_print_version_1( void )
00142 {
00143     if ( __kmp_version_1_printed ) {
00144         return;
00145     }; // if
00146     __kmp_version_1_printed = TRUE;
00147 
00148     #ifndef KMP_STUB
00149         kmp_str_buf_t buffer;
00150         __kmp_str_buf_init( & buffer );
00151         // Print version strings skipping initial magic.
00152         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_copyright[ KMP_VERSION_MAGIC_LEN ] );
00153         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_lib_ver[ KMP_VERSION_MAGIC_LEN ] );
00154         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_lib_type[ KMP_VERSION_MAGIC_LEN ] );
00155         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_link_type[ KMP_VERSION_MAGIC_LEN ] );
00156         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_build_time[ KMP_VERSION_MAGIC_LEN ] );
00157       #if KMP_MIC
00158         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_target_env[ KMP_VERSION_MAGIC_LEN ] );
00159       #endif
00160         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_build_compiler[ KMP_VERSION_MAGIC_LEN ] );
00161         #if defined(KMP_GOMP_COMPAT)
00162             __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_alt_comp[ KMP_VERSION_MAGIC_LEN ] );
00163         #endif /* defined(KMP_GOMP_COMPAT) */
00164         __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_omp_api[ KMP_VERSION_MAGIC_LEN ] );
00165         __kmp_str_buf_print( & buffer, "%sdynamic error checking: %s\n", KMP_VERSION_PREF_STR, ( __kmp_env_consistency_check ? "yes" : "no" )  );
00166         #ifdef KMP_DEBUG
00167             for ( int i = bs_plain_barrier; i < bs_last_barrier; ++ i ) {
00168                 __kmp_str_buf_print(
00169                     & buffer,
00170                     "%s%s barrier branch bits: gather=%u, release=%u\n",
00171                     KMP_VERSION_PREF_STR,
00172                     __kmp_barrier_type_name[ i ],
00173                     __kmp_barrier_gather_branch_bits[ i ],
00174                     __kmp_barrier_release_branch_bits[ i ]
00175                 ); // __kmp_str_buf_print
00176             }; // for i
00177             for ( int i = bs_plain_barrier; i < bs_last_barrier; ++ i ) {
00178                 __kmp_str_buf_print(
00179                     & buffer,
00180                     "%s%s barrier pattern: gather=%s, release=%s\n",
00181                     KMP_VERSION_PREF_STR,
00182                     __kmp_barrier_type_name[ i ],
00183                     __kmp_barrier_pattern_name[ __kmp_barrier_gather_pattern[ i ] ],
00184                     __kmp_barrier_pattern_name[ __kmp_barrier_release_pattern[ i ] ]
00185                 ); // __kmp_str_buf_print
00186             }; // for i
00187             __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_lock[ KMP_VERSION_MAGIC_LEN ] );
00188             __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_perf_v19[ KMP_VERSION_MAGIC_LEN ] );
00189             __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_perf_v106[ KMP_VERSION_MAGIC_LEN ] );
00190         #endif
00191         __kmp_str_buf_print(
00192             & buffer,
00193             "%sthread affinity support: %s\n",
00194             KMP_VERSION_PREF_STR,
00195             #if KMP_OS_WINDOWS || KMP_OS_LINUX
00196                 (
00197                     KMP_AFFINITY_CAPABLE()
00198                     ?
00199                     (
00200                         __kmp_affinity_type == affinity_none
00201                         ?
00202                         "not used"
00203                         :
00204                         "yes"
00205                     )
00206                     :
00207                     "no"
00208                 )
00209             #else
00210                 "no"
00211             #endif
00212         );
00213         __kmp_printf( "%s", buffer.str );
00214         __kmp_str_buf_free( & buffer );
00215         K_DIAG( 1, ( "KMP_VERSION is true\n" ) );
00216     #endif // KMP_STUB
00217 } // __kmp_print_version_1
00218 
00219 //
00220 // Called at parallel initialization time.
00221 //
00222 static int __kmp_version_2_printed = FALSE;
00223 
00224 void
00225 __kmp_print_version_2( void ) {
00226     if ( __kmp_version_2_printed ) {
00227         return;
00228     }; // if
00229     __kmp_version_2_printed = TRUE;
00230 
00231     #ifndef KMP_STUB
00232     #endif // KMP_STUB
00233 } // __kmp_print_version_2
00234 
00235 // end of file //

Generated on 25 Aug 2013 for libomp_oss by  doxygen 1.6.1