Remove all remaining vestiges of the Windows integration
This commit was SVN r28137.
Этот коммит содержится в:
родитель
e71b40fdcb
Коммит
a4b6fb241f
2
README
2
README
@ -115,8 +115,6 @@ General notes
|
||||
- ARMv4, ARMv5, ARMv6, ARMv7 (when using non-inline assembly; only
|
||||
ARMv7 is fully supported when -DOMPI_DISABLE_INLINE_ASM is used).
|
||||
- Other 64 bit platforms (e.g., Linux on PPC64)
|
||||
- Microsoft Windows CCP (Microsoft Windows server 2003 and 2008);
|
||||
see the README.WINDOWS file.
|
||||
|
||||
Compiler Notes
|
||||
--------------
|
||||
|
@ -1,179 +0,0 @@
|
||||
10 July 2009
|
||||
---------------
|
||||
|
||||
This version of Open MPI compiles and runs under Microsoft Windows
|
||||
platforms, including Windows XP, Windows HPC Server 2003/2008 and also
|
||||
Windows 7 RC. It provides two remote process launch components, one is
|
||||
using WMI, and the other is using Windows CCP API for Windows HPC
|
||||
Servers. But it has received limited testing compared to other POSIX-like
|
||||
environments, so feedbacks are important and helpful for us.
|
||||
|
||||
You can download an Open MPI tarball from the main web site
|
||||
(http://www.open-mpi.org) or check out a developer copy via Subversion
|
||||
(more information about SVN checkout available on the Open MPI web
|
||||
site).
|
||||
|
||||
The rest of the document is divided on 3 sections. The first and
|
||||
second sections are for "easy" setup, based on some files that are
|
||||
distributed in Open MPI (32 and 64 bits versions). The third section
|
||||
is only for advanced users or developers who want to deeply dig into
|
||||
the software.
|
||||
|
||||
============================================================================
|
||||
|
||||
First approach: Using CMake
|
||||
|
||||
NOTE: CMake support is available in the Open MPI development
|
||||
trunk and 1.3.3 release.
|
||||
|
||||
|
||||
I. Build Open MPI
|
||||
|
||||
1. Download the latest version of CMake (at least v2.4).
|
||||
|
||||
2. In the CMake GUI, add the source path and build path of Open MPI
|
||||
(out of source build is recommended).
|
||||
|
||||
3. Then configure, and after the first time configuration, all
|
||||
available options will show up in the CMake GUI. Select the
|
||||
options that you require.
|
||||
|
||||
4. Run configure again to generate all Windows solution files; they
|
||||
will be generated in build path.
|
||||
|
||||
5. Go to the build directory, open the generated Windows solution
|
||||
file, and compile.
|
||||
|
||||
6. Build the 'INSTALL' project to install files into the path that
|
||||
has been set with CMAKE_INSTALL_PREFIX variable in CMake GUI.
|
||||
|
||||
7. (optional) To generate a installer, you should install NSIS, and build the
|
||||
'PACKAGE' project in the Open MPI sulotion.
|
||||
|
||||
|
||||
II. Build MPI applications with Open MPI
|
||||
|
||||
After successfully built and installed Open MPI, there are two ways
|
||||
to compile and link your applications against the generated libraries:
|
||||
|
||||
Using Visual Studio IDE
|
||||
|
||||
1. In your application's Visual Studio solution, on the target project
|
||||
that needs to link with MPI, add the installed Open MPI library path
|
||||
(for example C:\Program Files\OpenMPI_v1.4\lib) into "Project Property Pages" ->
|
||||
"Configuration Properties" -> Linker -> General -> "Additional Library Directories"
|
||||
|
||||
2. Also put the library names, for example libopen-mpi.lib, into
|
||||
"Project Property Pages" -> "Configuration Properties" -> Linker ->
|
||||
Input -> "Additional Dependencies". Please note that, if you built
|
||||
debug version of Open MPI, the generated library names will have
|
||||
suffix 'd', for example, libopen-mpid.lib.
|
||||
|
||||
Using Open MPI compiler wrappers in VS Command Prompt
|
||||
|
||||
1. Open up a Visual Studio Command Prompt, so that the Visual Studio
|
||||
environment is set, and the VS compiler command cl.exe is available.
|
||||
|
||||
2. Set up Open MPI path environment variable, for example,
|
||||
"set PATH=c:\Program Files\OpenMPI_v1.4\bin;%PATH%", or set it up in
|
||||
the system settings. Please note, using an Open MPI installer, there
|
||||
will be an option to set the system variables automatically.
|
||||
|
||||
3. Simply use one of the Open MPI compiler wrapper to compile and
|
||||
link your application with one single command, for example:
|
||||
c:\> mpicc app.c
|
||||
|
||||
|
||||
III. Run MPI applications
|
||||
|
||||
To launch the application, use the mpirun command, for example:
|
||||
c:\> mpirun -np 2 app.exe
|
||||
or
|
||||
c:\> mpirun -np 2 -host host1 host2 app.exe
|
||||
|
||||
Please note, in order to launch remote MPI processes using WMI, a few Windows
|
||||
settings has to be configured on all nodes, please refer to the following links:
|
||||
http://msdn.microsoft.com/en-us/library/aa393266(VS.85).aspx
|
||||
http://community.spiceworks.com/topic/578
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Second approach: Simple and straightforward
|
||||
|
||||
Step 1: Untar the contrib/platform/win32/ompi-static.tgz tarball in
|
||||
the root directory of the Open MPI distribution.
|
||||
|
||||
Step 2: Go in the ompi/datatype subdirectory in the Open MPI
|
||||
distribution and copy the following:
|
||||
|
||||
datatype_pack.c to datatype_pack_checksum.c
|
||||
datatype_unpack.c to datatype_unpack_checksum.c
|
||||
|
||||
Step 3: Add the following to ompi/tools/ompi_info/ompi_info.h and
|
||||
change the relevant information inside (i.e., replace
|
||||
everything between @'s).
|
||||
|
||||
#define OPAL_CONFIGURE_USER "@USER_NAME@"
|
||||
#define OPAL_CONFIGURE_HOST "@HOST_NAME@"
|
||||
#define OPAL_CONFIGURE_DATE "@TODAY_DATE@"
|
||||
#define OMPI_BUILD_USER OPAL_CONFIGURE_USER
|
||||
#define OMPI_BUILD_HOST OPAL_CONFIGURE_HOST
|
||||
#define OMPI_BUILD_DATE OPAL_CONFIGURE_DATE
|
||||
#define OMPI_BUILD_CFLAGS "/Od /Gm /EHsc /RTC1 /MDd"
|
||||
#define OMPI_BUILD_CPPFLAGS "-I${HOME}/ompi-trunk -I${HOME}/opal/include -I${HOME}/ompi-trunk/orte/include -I${HOME}/ompi-trunk/ompi/include"
|
||||
#define OMPI_BUILD_CXXFLAGS "/Od /Gm /EHsc /RTC1 /MDd"
|
||||
#define OMPI_BUILD_CXXCPPFLAGS "-I${HOME}/ompi-trunk -I../../.. -I$(HOME}/ompi-trunk/opal/include -I${HOME}/ompi-trunk/orte/include -I${HOME}/ompi-trunk/ompi/include"
|
||||
#define OMPI_BUILD_FFLAGS ""
|
||||
#define OMPI_BUILD_FCFLAGS ""
|
||||
#define OMPI_BUILD_LDFLAGS " "
|
||||
#define OMPI_BUILD_LIBS " "
|
||||
#define OPAL_CC_ABSOLUTE "cl"
|
||||
#define OMPI_CXX_ABSOLUTE "cl"
|
||||
#define OMPI_F77_ABSOLUTE "none"
|
||||
#define OMPI_F90_ABSOLUTE "none"
|
||||
#define OMPI_F90_BUILD_SIZE "small"
|
||||
|
||||
Step 4: Open the Open MPI project (.sln file) from the root directory
|
||||
of the distribution.
|
||||
|
||||
Step 5: Choose which version you want to build (from the project
|
||||
manager).
|
||||
|
||||
Step 6: Add the build directory to your PATH.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Third approach: Advanced users
|
||||
|
||||
The rest of this document is only for advanced users / developers;
|
||||
i.e., those who has spare time or an urgent necessity to compile their
|
||||
own Windows version of Open MPI.
|
||||
|
||||
Compiling Open MPI natively on Windows requires several tools. Of
|
||||
course, one need the Microsoft Visual Studio for their C/C++ compiler
|
||||
as well as for the ml (assembler compiler) and the link utilities.
|
||||
But the current version require some GNU tools as well. Here is the
|
||||
list of such tools:
|
||||
|
||||
1. Download any Unix for Windows environment. Tested environments include
|
||||
- cygwin http://www.cygwin.com/
|
||||
- minGW http://www.mingw.org/
|
||||
- Windows Services for Unix (SFU)
|
||||
http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx
|
||||
|
||||
2. Make the default shell ash.exe (install it if it's not installed by
|
||||
default) as it will highly decrease the configuration and
|
||||
compilation time.
|
||||
|
||||
3. Download a very recent Gnu Libtool (e.g., Libtool 2.2.6).
|
||||
|
||||
Now you should be set. The most difficult part is done. Just use your
|
||||
favorite shell to get a window, go in the Open MPi directory and do
|
||||
like in any UNIX environments: configure, make, and make install.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
If you have any problems, find any bugs please feel free to report
|
||||
them to Open MPI user's mailing list (see
|
||||
http://www.open-mpi.org/community/lists/ompi.php).
|
8
VERSION
8
VERSION
@ -21,12 +21,12 @@ release=0
|
||||
# only requirement is that it must be entirely printable ASCII
|
||||
# characters and have no white space.
|
||||
|
||||
greek=a1
|
||||
greek=
|
||||
|
||||
# If want_repo_rev=1, then the repo revision number will be included
|
||||
# in the overall Open MPI version number in some form.
|
||||
|
||||
want_repo_rev=1
|
||||
want_repo_rev=0
|
||||
|
||||
# If repo_rev=-1, then the repository version number will be obtained
|
||||
# dynamically at run time, either:
|
||||
@ -46,11 +46,11 @@ want_repo_rev=1
|
||||
# from an SVN checkout, if repo_rev=-1, then its value is replaced
|
||||
# with the output of "svnversion".
|
||||
|
||||
repo_rev=-1
|
||||
repo_rev=r28134M
|
||||
|
||||
# The date when this release was created
|
||||
|
||||
date="Unreleased developer copy"
|
||||
date="Feb 28, 2013"
|
||||
|
||||
# The shared library version of each of Open MPI's public libraries.
|
||||
# These versions are maintained in accordance with the "Library
|
||||
|
@ -761,9 +761,7 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
|
||||
[AC_HELP_STRING([--enable-builtin-atomics],
|
||||
[Enable use of __sync builtin atomics (default: disabled)])])
|
||||
|
||||
if test "$ompi_cv_c_compiler_vendor" = "microsoft" ; then
|
||||
ompi_cv_asm_arch="WINDOWS"
|
||||
elif test "$enable_builtin_atomics" = "yes" ; then
|
||||
if test "$enable_builtin_atomics" = "yes" ; then
|
||||
OPAL_CHECK_SYNC_BUILTINS([ompi_cv_asm_arch="SYNC_BUILTIN"],
|
||||
[AC_MSG_ERROR([__sync builtin atomics requested but not found.])])
|
||||
AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1],
|
||||
|
@ -119,11 +119,7 @@ struct mca_btl_tcp2_module_t {
|
||||
typedef struct mca_btl_tcp2_module_t mca_btl_tcp2_module_t;
|
||||
extern mca_btl_tcp2_module_t mca_btl_tcp2_module;
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
#define CLOSE_THE_SOCKET(socket) closesocket(socket)
|
||||
#else
|
||||
#define CLOSE_THE_SOCKET(socket) close(socket)
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/**
|
||||
* Register TCP component parameters with the MCA framework
|
||||
|
@ -172,13 +172,6 @@ static void mca_btl_tcp2_component_accept_handler(int, short, void*);
|
||||
int mca_btl_tcp2_component_open(void)
|
||||
{
|
||||
char* message;
|
||||
#ifdef __WINDOWS__
|
||||
WSADATA win_sock_data;
|
||||
if( WSAStartup(MAKEWORD(2,2), &win_sock_data) != 0 ) {
|
||||
BTL_ERROR(("failed to initialise windows sockets:%d", WSAGetLastError()));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* initialize state */
|
||||
mca_btl_tcp2_component.tcp_listen_sd = -1;
|
||||
@ -340,10 +333,6 @@ int mca_btl_tcp2_component_close(void)
|
||||
OBJ_DESTRUCT(&mca_btl_tcp2_component.tcp_frag_user);
|
||||
OBJ_DESTRUCT(&mca_btl_tcp2_component.tcp_lock);
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1,181 +0,0 @@
|
||||
# Copyright (c) 2007-2011 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2008 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
|
||||
|
||||
# The source code is compiled as C++ for dynamic build
|
||||
# and compiled as C for static build
|
||||
|
||||
PROJECT (OMPI)
|
||||
|
||||
# Recuresive search sub directories excluding mca, mpi and tools.
|
||||
# Add sources in different source groups.
|
||||
INCLUDE(list_subdirs)
|
||||
CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" OMPI_SUBDIRS)
|
||||
|
||||
SET(OMPI_EXCLUDE_SUBDIRS contrib debuggers mca mpi mpiext tools)
|
||||
|
||||
FOREACH(OMPI_SUBDIR ${OMPI_SUBDIRS})
|
||||
|
||||
LIST(FIND OMPI_EXCLUDE_SUBDIRS ${OMPI_SUBDIR} OMPI_EXCLUDE_SUBDIR)
|
||||
|
||||
IF(${OMPI_EXCLUDE_SUBDIR} EQUAL -1)
|
||||
|
||||
FILE(GLOB_RECURSE OMPI_${OMPI_SUBDIR}_FILES
|
||||
"${OMPI_SUBDIR}/*.h" "${OMPI_SUBDIR}/*.c" "${OMPI_SUBDIR}/*.cc" "${OMPI_SUBDIR}/*.cpp")
|
||||
|
||||
SET (OMPI_SOURCE_FILES
|
||||
${OMPI_SOURCE_FILES}
|
||||
${OMPI_${OMPI_SUBDIR}_FILES}
|
||||
)
|
||||
|
||||
SOURCE_GROUP("${OMPI_SUBDIR}" FILES ${OMPI_${OMPI_SUBDIR}_FILES})
|
||||
|
||||
ENDIF(${OMPI_EXCLUDE_SUBDIR} EQUAL -1)
|
||||
|
||||
ENDFOREACH(OMPI_SUBDIR ${OMPI_SUBDIRS})
|
||||
|
||||
|
||||
# Add MPI C files
|
||||
FILE(GLOB OMPI_MPI_C_FILES "mpi/c/*.h" "mpi/c/*.c")
|
||||
|
||||
# Remove all MPI_File related files if the option is not selected
|
||||
IF (NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)
|
||||
MESSAGE( STATUS "Skipping the MPI I/O interface")
|
||||
SET( TMP_SRC "" )
|
||||
FOREACH ( FILENAME ${OMPI_MPI_C_FILES})
|
||||
GET_FILENAME_COMPONENT(relname ${FILENAME} NAME)
|
||||
IF (NOT ${relname} MATCHES "file.*[ch]$")
|
||||
IF (NOT ${relname} STREQUAL "register_datarep.c")
|
||||
LIST(APPEND TMP_SRC ${FILENAME})
|
||||
ENDIF (NOT ${relname} STREQUAL "register_datarep.c")
|
||||
ENDIF(NOT ${relname} MATCHES "file.*[ch]$")
|
||||
ENDFOREACH(FILENAME)
|
||||
SET( OMPI_MPI_C_FILES ${TMP_SRC})
|
||||
ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)
|
||||
|
||||
SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_MPI_C_FILES})
|
||||
SOURCE_GROUP(mpi "")
|
||||
SOURCE_GROUP(mpi\\c FILES ${OMPI_MPI_C_FILES})
|
||||
|
||||
IF(OMPI_ENABLE_MPI_PROFILING)
|
||||
# As weak symbols are not supported by MS compiler,
|
||||
# we have to compile the C source files again for profiler,
|
||||
# i.e. add the pre-processor "OMPI_PROFILING_DEFINES" explicitly.
|
||||
|
||||
# first get the file names.
|
||||
# FILE(GLOB OMPI_PROFILE_NAMES "mpi/c/*.c" )
|
||||
# then copy them to the build directory with a prefix.
|
||||
FOREACH(FILE_NAME ${OMPI_MPI_C_FILES})
|
||||
GET_FILENAME_COMPONENT(relname ${FILE_NAME} NAME)
|
||||
IF(NOT ${relname} STREQUAL "attr_fn.c")
|
||||
CONFIGURE_FILE(${FILE_NAME}
|
||||
${PROJECT_BINARY_DIR}/mpi/c/profile/p${relname} [COPYONLY])
|
||||
SET(OMPI_C_PROFILE_FILES ${OMPI_C_PROFILE_FILES} ${PROJECT_BINARY_DIR}/mpi/c/profile/p${relname})
|
||||
ENDIF(NOT ${relname} STREQUAL "attr_fn.c")
|
||||
ENDFOREACH(FILE_NAME ${OMPI_MPI_C_FILES})
|
||||
|
||||
# FILE(GLOB_RECURSE OMPI_C_PROFILE_FILES "${PROJECT_BINARY_DIR}/mpi/c/profile/*.c" )
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${OMPI_C_PROFILE_FILES}
|
||||
PROPERTIES COMPILE_DEFINITIONS OMPI_PROFILING_DEFINES)
|
||||
SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_C_PROFILE_FILES})
|
||||
SOURCE_GROUP(mpi\\c\\profile FILES ${OMPI_C_PROFILE_FILES})
|
||||
ELSE(OMPI_ENABLE_MPI_PROFILING)
|
||||
MESSAGE( STATUS "Skipping the MPI profiling interface")
|
||||
ENDIF(OMPI_ENABLE_MPI_PROFILING)
|
||||
|
||||
|
||||
IF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
# A handful of files in mpi/fortran/base must be included in libmpi, in order to build the
|
||||
# Fortran 77 glue into libmpi
|
||||
FILE(GLOB OMPI_FORTRAN_BASE_FILES "mpi/fortran/base/*.c")
|
||||
SET_SOURCE_FILES_PROPERTIES(${OMPI_FORTRAN_BASE_FILES}
|
||||
PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_COMPILING_FORTRAN_WRAPPERS=1 ${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=0")
|
||||
SET(OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_FORTRAN_BASE_FILES})
|
||||
SOURCE_GROUP(mpi\\fortran\\base FILES ${OMPI_FORTRAN_BASE_FILES})
|
||||
ENDIF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
|
||||
#configure ompi extension components
|
||||
INCLUDE (ompi_ext_config)
|
||||
SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${OMPI_EXT_FILES})
|
||||
|
||||
INCLUDE (check_mca_subdirs)
|
||||
SET (OMPI_SOURCE_FILES ${OMPI_SOURCE_FILES} ${MCA_FILES})
|
||||
|
||||
ADD_LIBRARY (libmpi ${OMPI_SOURCE_FILES})
|
||||
ADD_DEPENDENCIES(libmpi libopen-rte libopen-pal)
|
||||
|
||||
SET_TARGET_PROPERTIES(libmpi PROPERTIES
|
||||
COMPILE_DEFINITIONS "OMPI_MPIHANDLES_DLL_PREFIX=libompi_dbg_mpihandles;OMPI_MSGQ_DLL_PREFIX=libompi_dbg_msgq;OMPI_BUILDING;OMPI_BUILDING_CXX_BINDINGS_LIBRARY")
|
||||
|
||||
# Set compile flags for this target
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(libmpi PROPERTIES
|
||||
COMPILE_DEFINITIONS "_USRDLL;HAVE_CONFIG_H;OMPI_EXPORTS;OPAL_IMPORTS;ORTE_IMPORTS"
|
||||
COMPILE_FLAGS "${OMPI_CXX_LAN_FLAG}" PREFIX "" IMPORT_PREFIX "")
|
||||
|
||||
IF(WINDOWS_MINGW)
|
||||
TARGET_LINK_LIBRARIES (libmpi ${OpenMPI_BINARY_DIR}/event${CMAKE_DEBUG_POSTFIX}.lib
|
||||
${OpenMPI_BINARY_DIR}/hwloc${CMAKE_DEBUG_POSTFIX}.lib
|
||||
libopen-rte Ws2_32.lib shlwapi.lib ${EXTRA_LINK_LIBRARIES})
|
||||
ELSEIF(WINDOWS_VS)
|
||||
TARGET_LINK_LIBRARIES (libmpi ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib
|
||||
${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/hwloc${CMAKE_DEBUG_POSTFIX}.lib
|
||||
libopen-rte Ws2_32.lib shlwapi.lib ${EXTRA_LINK_LIBRARIES})
|
||||
ENDIF(WINDOWS_MINGW)
|
||||
|
||||
ELSE (BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(libmpi PROPERTIES COMPILE_DEFINITIONS "${OMPI_C_DEF_PRE}_LIB")
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
# generate ompi_config.h
|
||||
CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/ompi_config.h.in ${OpenMPI_BINARY_DIR}/ompi/include/ompi_config.h)
|
||||
|
||||
# generate version.h
|
||||
CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/ompi/version.h.in ${OpenMPI_BINARY_DIR}/ompi/include/ompi/version.h)
|
||||
|
||||
|
||||
ADD_SUBDIRECTORY(mpi)
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
|
||||
|
||||
# Install libraries headers, and shared files
|
||||
INSTALL(TARGETS libmpi
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
INSTALL(FILES ${PROJECT_BINARY_DIR}/include/user/mpi.h ${PROJECT_SOURCE_DIR}/include/mpi_portable_platform.h
|
||||
DESTINATION include)
|
||||
|
||||
INSTALL(FILES errhandler/help-mpi-errors.txt
|
||||
DESTINATION share/openmpi)
|
||||
|
||||
IF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
||||
INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi${CMAKE_DEBUG_POSTFIX}.pdb
|
||||
DESTINATION bin)
|
||||
ENDIF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
||||
|
||||
IF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
INSTALL(FILES ${PROJECT_BINARY_DIR}/include/mpif.h
|
||||
${PROJECT_BINARY_DIR}/include/mpif-config.h
|
||||
${PROJECT_BINARY_DIR}/include/mpif-common.h
|
||||
${PROJECT_SOURCE_DIR}/include/mpif-all-common.h
|
||||
${PROJECT_SOURCE_DIR}/include/mpif-mpi-io.h
|
||||
DESTINATION include)
|
||||
ENDIF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
|
||||
INSTALL(FILES ${PROJECT_SOURCE_DIR}/runtime/help-mpi-runtime.txt ${PROJECT_SOURCE_DIR}/mpi/help-mpi-api.txt
|
||||
DESTINATION share/openmpi)
|
||||
INSTALL(DIRECTORY mpi/cxx/ DESTINATION include/openmpi/ompi/mpi/cxx
|
||||
FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE)
|
||||
|
@ -19,8 +19,6 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
|
||||
# We always have C bindings, but do we have profiling?
|
||||
|
||||
if BUILD_MPI_BINDINGS_LAYER
|
||||
|
@ -79,35 +79,6 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
|
||||
# if defined(_USRDLL) /* building shared libraries (.DLL) */
|
||||
# if defined(OMPI_EXPORTS)
|
||||
# define OMPI_DECLSPEC __declspec(dllexport)
|
||||
# define OMPI_MODULE_DECLSPEC
|
||||
# else
|
||||
# if defined(OMPI_IMPORTS)
|
||||
# define OMPI_DECLSPEC __declspec(dllimport)
|
||||
# else
|
||||
# define OMPI_DECLSPEC
|
||||
# endif /*defined(OMPI_IMPORTS)*/
|
||||
# if defined(OMPI_MODULE_EXPORTS)
|
||||
# define OMPI_MODULE_DECLSPEC __declspec(dllexport)
|
||||
# else
|
||||
# define OMPI_MODULE_DECLSPEC __declspec(dllimport)
|
||||
# endif /* defined(OMPI_MODULE_EXPORTS) */
|
||||
# endif /* defined(OMPI_EXPORTS) */
|
||||
# else /* building static library */
|
||||
# if defined(OMPI_IMPORTS)
|
||||
# define OMPI_DECLSPEC __declspec(dllimport)
|
||||
# else
|
||||
# define OMPI_DECLSPEC
|
||||
# endif /* defined(OMPI_IMPORTS) */
|
||||
# define OMPI_MODULE_DECLSPEC
|
||||
# endif /* defined(_USRDLL) */
|
||||
|
||||
#else
|
||||
|
||||
# if OPAL_C_HAVE_VISIBILITY
|
||||
# ifndef OMPI_DECLSPEC
|
||||
# define OMPI_DECLSPEC __opal_attribute_visibility__("default")
|
||||
@ -123,7 +94,6 @@ typedef struct {
|
||||
# define OMPI_MODULE_DECLSPEC
|
||||
# endif
|
||||
# endif
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/* Convenience */
|
||||
#if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS || OMPI_BUILD_FORTRAN_USEMPI_BINDINGS || OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
|
||||
|
@ -52,10 +52,6 @@ typedef struct bcol_basesmuma_smcm_mmap_t {
|
||||
size_t map_size;
|
||||
/* Filename */
|
||||
char map_path[OPAL_PATH_MAX];
|
||||
#if defined(__WINDOWS__)
|
||||
/* Handle to the object */
|
||||
HANDLE hMappedObject;
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
} bcol_basesmuma_smcm_mmap_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(bcol_basesmuma_smcm_mmap_t);
|
||||
|
@ -27,8 +27,6 @@ BEGIN_C_DECLS
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
# include <sched.h>
|
||||
# define SPIN sched_yield()
|
||||
#elif defined(__WINDOWS__)
|
||||
# define SPIN SwitchToThread()
|
||||
#else /* no switch available */
|
||||
# define SPIN
|
||||
#endif
|
||||
|
@ -12,7 +12,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2006-2012 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2006-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2006-2007 Voltaire All rights reserved.
|
||||
* Copyright (c) 2008-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
@ -134,9 +134,7 @@ void mca_btl_openib_show_init_error(const char *file, int line,
|
||||
{
|
||||
if (ENOMEM == errno) {
|
||||
int ret;
|
||||
#ifndef __WINDOWS__
|
||||
struct rlimit limit;
|
||||
#endif
|
||||
char *str_limit = NULL;
|
||||
|
||||
#if HAVE_DECL_RLIMIT_MEMLOCK
|
||||
@ -144,7 +142,6 @@ void mca_btl_openib_show_init_error(const char *file, int line,
|
||||
#else
|
||||
ret = -1;
|
||||
#endif
|
||||
#ifndef __WINDOWS__
|
||||
if (0 != ret) {
|
||||
asprintf(&str_limit, "Unknown");
|
||||
} else if (limit.rlim_cur == RLIM_INFINITY) {
|
||||
@ -152,7 +149,6 @@ void mca_btl_openib_show_init_error(const char *file, int line,
|
||||
} else {
|
||||
asprintf(&str_limit, "%ld", (long)limit.rlim_cur);
|
||||
}
|
||||
#endif
|
||||
|
||||
opal_show_help("help-mpi-btl-openib.txt", "init-fail-no-mem",
|
||||
true, ompi_process_info.nodename,
|
||||
|
@ -12,7 +12,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2006-2012 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2006-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2006-2007 Voltaire All rights reserved.
|
||||
* Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
@ -252,9 +252,7 @@ static int btl_openib_component_close(void)
|
||||
#endif
|
||||
|
||||
ompi_btl_openib_connect_base_finalize();
|
||||
#ifndef __WINDOWS__
|
||||
ompi_btl_openib_fd_finalize();
|
||||
#endif
|
||||
ompi_btl_openib_ini_finalize();
|
||||
if (NULL != mca_btl_openib_component.receive_queues) {
|
||||
free(mca_btl_openib_component.receive_queues);
|
||||
@ -2478,24 +2476,20 @@ btl_openib_component_init(int *num_btl_modules,
|
||||
goto no_btls;
|
||||
}
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
seedv[0] = OMPI_PROC_MY_NAME->vpid;
|
||||
seedv[1] = opal_timer_base_get_cycles();
|
||||
seedv[2] = opal_timer_base_get_cycles();
|
||||
seed48(seedv);
|
||||
#endif
|
||||
|
||||
/* Read in INI files with device-specific parameters */
|
||||
if (OMPI_SUCCESS != (ret = ompi_btl_openib_ini_init())) {
|
||||
goto no_btls;
|
||||
}
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/* Initialize FD listening */
|
||||
if (OMPI_SUCCESS != ompi_btl_openib_fd_init()) {
|
||||
goto no_btls;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Init CPC components */
|
||||
if (OMPI_SUCCESS != (ret = ompi_btl_openib_connect_base_init())) {
|
||||
@ -2916,10 +2910,8 @@ btl_openib_component_init(int *num_btl_modules,
|
||||
/* If we fail early enough in the setup, we just modex around that
|
||||
there are no openib BTL's in this process and return NULL. */
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/* Be sure to shut down the fd listener */
|
||||
ompi_btl_openib_fd_finalize();
|
||||
#endif
|
||||
|
||||
mca_btl_openib_component.ib_num_btls = 0;
|
||||
btl_openib_modex_send();
|
||||
|
@ -11,7 +11,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2008 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -107,14 +107,7 @@ int ompi_btl_openib_ini_init(void)
|
||||
{
|
||||
int ret = OMPI_ERR_NOT_FOUND;
|
||||
char *colon;
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
char separator = ':';
|
||||
#else
|
||||
/* ':' is part of the path on Windows,
|
||||
so use ';' instead. */
|
||||
char separator = ';';
|
||||
#endif
|
||||
|
||||
OBJ_CONSTRUCT(&devices, opal_list_t);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2008 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2009 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
@ -1051,10 +1051,8 @@ static int rdmacm_endpoint_finalize(struct mca_btl_base_endpoint_t *endpoint)
|
||||
OPAL_OUTPUT((-1, "MAIN Main thread calling disconnect on ID %p",
|
||||
(void*) ((id_context_t*) item2)->id));
|
||||
++num_to_wait_for;
|
||||
#ifndef __WINDOWS__
|
||||
ompi_btl_openib_fd_run_in_service(call_disconnect_callback,
|
||||
item2);
|
||||
#endif
|
||||
}
|
||||
/* remove_item returns the item before the item removed,
|
||||
meaning that the for list is still safe */
|
||||
@ -1070,10 +1068,8 @@ static int rdmacm_endpoint_finalize(struct mca_btl_base_endpoint_t *endpoint)
|
||||
|
||||
/* Now wait for all the disconnect callbacks to occur */
|
||||
while (num_to_wait_for != disconnect_callbacks) {
|
||||
#ifndef __WINDOWS__
|
||||
ompi_btl_openib_fd_main_thread_drain();
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
OPAL_OUTPUT((-1, "MAIN Endpoint finished finalizing"));
|
||||
@ -1968,10 +1964,8 @@ static int rdmacm_component_finalize(void)
|
||||
}
|
||||
|
||||
if (NULL != event_channel) {
|
||||
#ifndef __WINDOWS__
|
||||
rc = ompi_btl_openib_fd_unmonitor(event_channel->fd,
|
||||
rdmacm_unmonitor, (void*) &barrier);
|
||||
#endif
|
||||
if (OMPI_SUCCESS != rc) {
|
||||
BTL_ERROR(("Error disabling fd monitor"));
|
||||
}
|
||||
@ -1979,9 +1973,7 @@ static int rdmacm_component_finalize(void)
|
||||
/* Wait for the service thread to stop monitoring the fd */
|
||||
OPAL_OUTPUT((-1, "MAIN rdmacm_component_finalize: waiting for thread to finish"));
|
||||
while (0 == barrier) {
|
||||
#ifndef __WINDOWS__
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
OPAL_OUTPUT((-1, "MAIN rdmacm_component_finalize: thread finished"));
|
||||
}
|
||||
@ -2041,11 +2033,9 @@ static int rdmacm_component_init(void)
|
||||
return OMPI_ERR_UNREACH;
|
||||
}
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/* Start monitoring the fd associated with the cm_device */
|
||||
ompi_btl_openib_fd_monitor(event_channel->fd, OPAL_EV_READ,
|
||||
rdmacm_event_dispatch, NULL);
|
||||
#endif
|
||||
|
||||
rdmacm_component_initialized = true;
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2008-2009 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2011 Los Alamos National Security, LLC. All
|
||||
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All
|
||||
* rights reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
@ -706,9 +706,7 @@ static int udcm_module_finalize(mca_btl_openib_module_t *btl,
|
||||
ompi_btl_openib_fd_unmonitor(m->cm_channel->fd, udcm_unmonitor, (void *)&barrier);
|
||||
|
||||
while (0 == barrier) {
|
||||
#ifndef __WINDOWS__
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* destroy the listen queue pair. this will cause ibv_get_cq_event to
|
||||
|
@ -115,11 +115,7 @@ struct mca_btl_sctp_module_t {
|
||||
typedef struct mca_btl_sctp_module_t mca_btl_sctp_module_t;
|
||||
extern mca_btl_sctp_module_t mca_btl_sctp_module;
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
#define CLOSE_THE_SOCKET(socket) closesocket(socket)
|
||||
#else
|
||||
#define CLOSE_THE_SOCKET(socket) close(socket)
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/**
|
||||
* SCTP component initialization.
|
||||
|
@ -17,10 +17,6 @@
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* In windows, many of the socket functions return an EWOULDBLOCK
|
||||
* instead of \ things like EAGAIN, EINPROGRESS, etc. It has been
|
||||
* verified that this will \ not conflict with other error codes that
|
||||
* are returned by these functions \ under UNIX/Linux environments
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
@ -232,14 +228,6 @@ static int mca_btl_sctp_component_register(void)
|
||||
|
||||
static int mca_btl_sctp_component_open(void)
|
||||
{
|
||||
#ifdef __WINDOWS__
|
||||
WSADATA win_sock_data;
|
||||
if (WSAStartup(MAKEWORD(2,2), &win_sock_data) != 0) {
|
||||
BTL_ERROR(("failed to initialise windows sockets:%d", WSAGetLastError()));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* initialize state */
|
||||
mca_btl_sctp_component.sctp_listen_sd = -1;
|
||||
/* TODO different sd for ipv6 */
|
||||
@ -347,10 +335,6 @@ int mca_btl_sctp_component_close(void)
|
||||
OBJ_DESTRUCT(&mca_btl_sctp_component.sctp_frag_user);
|
||||
OBJ_DESTRUCT(&mca_btl_sctp_component.sctp_lock);
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -122,11 +122,7 @@ struct mca_btl_tcp_module_t {
|
||||
typedef struct mca_btl_tcp_module_t mca_btl_tcp_module_t;
|
||||
extern mca_btl_tcp_module_t mca_btl_tcp_module;
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
#define CLOSE_THE_SOCKET(socket) closesocket(socket)
|
||||
#else
|
||||
#define CLOSE_THE_SOCKET(socket) close(socket)
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/**
|
||||
* TCP component initialization.
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Oak Ridge National Laboratory
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -189,11 +189,7 @@ static int mca_btl_tcp_component_register(void)
|
||||
mca_btl_tcp_param_register_string("if_include", "Comma-delimited list of devices and/or CIDR notation of networks to use for MPI communication (e.g., \"eth0,192.168.0.0/16\"). Mutually exclusive with btl_tcp_if_exclude.", "");
|
||||
mca_btl_tcp_component.tcp_if_exclude =
|
||||
mca_btl_tcp_param_register_string("if_exclude", "Comma-delimited list of devices and/or CIDR notation of networks to NOT use for MPI communication -- all devices not matching these specifications will be used (e.g., \"eth0,192.168.0.0/16\"). If set to a non-default value, it is mutually exclusive with btl_tcp_if_include.",
|
||||
#ifndef __WINDOWS__
|
||||
"127.0.0.1/8,sppp"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
);
|
||||
|
||||
mca_btl_tcp_component.tcp_free_list_num =
|
||||
@ -329,14 +325,6 @@ static int mca_btl_tcp_component_register(void)
|
||||
|
||||
static int mca_btl_tcp_component_open(void)
|
||||
{
|
||||
#ifdef __WINDOWS__
|
||||
WSADATA win_sock_data;
|
||||
if( WSAStartup(MAKEWORD(2,2), &win_sock_data) != 0 ) {
|
||||
BTL_ERROR(("failed to initialise windows sockets:%d", WSAGetLastError()));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* initialize state */
|
||||
mca_btl_tcp_component.tcp_listen_sd = -1;
|
||||
#if OPAL_WANT_IPV6
|
||||
@ -430,10 +418,6 @@ static int mca_btl_tcp_component_close(void)
|
||||
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_frag_user);
|
||||
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_lock);
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -52,12 +52,10 @@ static int reduce_no_order(void *sbuf, void* rbuf, int count,
|
||||
/*
|
||||
* Useful utility routine
|
||||
*/
|
||||
#if !defined(__WINDOWS__)
|
||||
static inline int min(int a, int b)
|
||||
{
|
||||
return (a < b) ? a : b;
|
||||
}
|
||||
#endif /* !defined(__WINDOWS__) */
|
||||
|
||||
/**
|
||||
* Shared memory reduction.
|
||||
|
@ -34,11 +34,7 @@
|
||||
* statements and the definition of an array of pointers to each
|
||||
* component's public mca_base_component_t struct.
|
||||
*/
|
||||
#ifdef __WINDOWS__
|
||||
const mca_base_component_t *mca_fbtl_base_static_components[] = {NULL};
|
||||
#else
|
||||
#include "ompi/mca/fbtl/base/static-components.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global variables; most of which are loaded by back-ends of MCA
|
||||
|
@ -34,11 +34,7 @@
|
||||
* statements and the definition of an array of pointers to each
|
||||
* component's public mca_base_component_t struct.
|
||||
*/
|
||||
#ifdef __WINDOWS__
|
||||
const mca_base_component_t *mca_fcoll_base_static_components[] = {NULL};
|
||||
#else
|
||||
#include "ompi/mca/fcoll/base/static-components.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global variables; most of which are loaded by back-ends of MCA
|
||||
|
@ -49,14 +49,8 @@ void mca_fs_base_get_parent_dir ( char *filename, char **dirnamep)
|
||||
char *dir = NULL, *slash;
|
||||
struct stat statbuf;
|
||||
|
||||
|
||||
|
||||
err = lstat(filename, &statbuf);
|
||||
|
||||
/* no symlink on Windows */
|
||||
#ifdef __WINDOWS__
|
||||
dir = strdup(filename);
|
||||
#else
|
||||
if (err || (!S_ISLNK(statbuf.st_mode))) {
|
||||
/* no such file, or file is not a link; these are the "normal"
|
||||
* cases where we can just return the parent directory.
|
||||
@ -88,7 +82,6 @@ void mca_fs_base_get_parent_dir ( char *filename, char **dirnamep)
|
||||
free(linkbuf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
slash = strrchr(dir, '/');
|
||||
if (!slash) strncpy(dir, ".", 2);
|
||||
|
@ -35,11 +35,7 @@
|
||||
* statements and the definition of an array of pointers to each
|
||||
* component's public mca_base_component_t struct.
|
||||
*/
|
||||
#ifdef __WINDOWS__
|
||||
const mca_base_component_t *mca_fs_base_static_components[] = {NULL};
|
||||
#else
|
||||
#include "ompi/mca/fs/base/static-components.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global variables; most of which are loaded by back-ends of MCA
|
||||
|
@ -108,9 +108,7 @@ void ompi_rte_wait_for_debugger(void)
|
||||
if (orte_standalone_operation) {
|
||||
/* spin until debugger attaches and releases us */
|
||||
while (MPIR_debug_gate == 0) {
|
||||
#if defined(__WINDOWS__)
|
||||
Sleep(100); /* milliseconds */
|
||||
#elif defined(HAVE_USLEEP)
|
||||
#if defined(HAVE_USLEEP)
|
||||
usleep(100000); /* microseconds */
|
||||
#else
|
||||
sleep(1); /* seconds */
|
||||
|
@ -25,8 +25,6 @@ BEGIN_C_DECLS
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
# include <sched.h>
|
||||
# define SPIN sched_yield()
|
||||
#elif defined(__WINDOWS__)
|
||||
# define SPIN SwitchToThread()
|
||||
#else /* no switch available */
|
||||
# define SPIN
|
||||
#endif
|
||||
|
@ -26,8 +26,6 @@ BEGIN_C_DECLS
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
# include <sched.h>
|
||||
# define SPIN sched_yield()
|
||||
#elif defined(__WINDOWS__)
|
||||
# define SPIN SwitchToThread()
|
||||
#else /* no switch available */
|
||||
# define SPIN
|
||||
#endif
|
||||
|
@ -28,8 +28,6 @@ BEGIN_C_DECLS
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
# include <sched.h>
|
||||
# define SPIN sched_yield()
|
||||
#elif defined(__WINDOWS__)
|
||||
# define SPIN SwitchToThread()
|
||||
#else /* no switch available */
|
||||
# define SPIN
|
||||
#endif
|
||||
|
@ -26,8 +26,6 @@ BEGIN_C_DECLS
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
# include <sched.h>
|
||||
# define SPIN sched_yield()
|
||||
#elif defined(__WINDOWS__)
|
||||
# define SPIN SwitchToThread()
|
||||
#else /* no switch available */
|
||||
# define SPIN
|
||||
#endif
|
||||
|
@ -35,11 +35,7 @@
|
||||
* statements and the definition of an array of pointers to each
|
||||
* component's public mca_base_component_t struct.
|
||||
*/
|
||||
#ifdef __WINDOWS__
|
||||
const mca_base_component_t *mca_sharedfp_base_static_components[] = {NULL};
|
||||
#else
|
||||
#include "ompi/mca/sharedfp/base/static-components.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global variables; most of which are loaded by back-ends of MCA
|
||||
|
@ -26,17 +26,6 @@
|
||||
|
||||
static int sb_mmap_file_open(const char *path)
|
||||
{
|
||||
#if defined(__WINDOWS__)
|
||||
sb.sb_fd = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if(INVALID_HANDLE_VALUE == sb.sb_fd)
|
||||
{
|
||||
V_OUTPUT_ERR("pml_v: vprotocol_pessimist: sender_based_init: open (%s): %s",
|
||||
path, GetLastError());
|
||||
return OPAL_ERR_FILE_OPEN_FAILURE;
|
||||
}
|
||||
return OPAL_SUCCESS;
|
||||
#else
|
||||
sb.sb_fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0600);
|
||||
if(-1 == sb.sb_fd)
|
||||
{
|
||||
@ -45,44 +34,18 @@ static int sb_mmap_file_open(const char *path)
|
||||
return OPAL_ERR_FILE_OPEN_FAILURE;
|
||||
}
|
||||
return OPAL_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sb_mmap_file_close(void)
|
||||
{
|
||||
#if defined(__WINDOWS__)
|
||||
CloseHandle(sb.sb_fd);
|
||||
#else
|
||||
int ret = close(sb.sb_fd);
|
||||
if(-1 == ret)
|
||||
V_OUTPUT_ERR("pml_v: protocol_pessimist: sender_based_finalize: close (%d): %s",
|
||||
sb.sb_fd, strerror(errno));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sb_mmap_alloc(void)
|
||||
{
|
||||
#if defined(__WINDOWS__)
|
||||
sb.sb_map = CreateFileMapping(sb.sb_fd, NULL, PAGE_READWRITE, 0,
|
||||
(DWORD)sb.sb_offset + sb.sb_length, NULL);
|
||||
if(NULL == sb.sb_map)
|
||||
{
|
||||
V_OUTPUT_ERR("pml_v: vprotocol_pessimist: sender_based_alloc: CreateFileMapping : %s",
|
||||
GetLastError());
|
||||
ompi_mpi_abort(MPI_COMM_NULL, MPI_ERR_NO_SPACE, false);
|
||||
}
|
||||
|
||||
sb.sb_addr = (uintptr_t) MapViewOfFile(sb.sb_map, FILE_MAP_ALL_ACCESS, 0,
|
||||
sb.sb_offset, sb.sb_length);
|
||||
if(NULL == (void*)sb.sb_addr)
|
||||
{
|
||||
V_OUTPUT_ERR("pml_v: vprotocol_pessimist: sender_based_alloc: mmap: %s",
|
||||
GetLastError());
|
||||
CloseHandle(sb.sb_map);
|
||||
CloseHandle(sb.sb_fd);
|
||||
ompi_mpi_abort(MPI_COMM_NULL, MPI_ERR_NO_SPACE, false);
|
||||
}
|
||||
#else
|
||||
#ifndef MAP_NOCACHE
|
||||
# define MAP_NOCACHE 0
|
||||
#endif
|
||||
@ -104,20 +67,14 @@ static void sb_mmap_alloc(void)
|
||||
close(sb.sb_fd);
|
||||
ompi_mpi_abort(MPI_COMM_NULL, MPI_ERR_NO_SPACE, false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sb_mmap_free(void)
|
||||
{
|
||||
#if defined(__WINDOWS__)
|
||||
UnmapViewOfFile( (LPCVOID)sb.sb_addr);
|
||||
CloseHandle(sb.sb_map);
|
||||
#else
|
||||
int ret = munmap((void *) sb.sb_addr, sb.sb_length);
|
||||
if(-1 == ret)
|
||||
V_OUTPUT_ERR("pml_v: protocol_pessimsit: sender_based_finalize: munmap (%p): %s",
|
||||
(void *) sb.sb_addr, strerror(errno));
|
||||
#endif
|
||||
}
|
||||
|
||||
int vprotocol_pessimist_sender_based_init(const char *mmapfile, size_t size)
|
||||
|
@ -29,14 +29,7 @@ typedef struct vprotocol_pessimist_sender_based_t
|
||||
#ifdef SB_USE_CONVERTOR_METHOD
|
||||
uintptr_t sb_conv_to_pessimist_offset; /* end of request from req_conv */
|
||||
#endif
|
||||
|
||||
#if defined __WINDOWS__
|
||||
HANDLE sb_fd; /* file handle of mapped file */
|
||||
HANDLE sb_map; /* view handle of mapped file */
|
||||
#else
|
||||
int sb_fd; /* file descriptor of mapped file */
|
||||
#endif
|
||||
|
||||
off_t sb_offset; /* offset in mmaped file */
|
||||
uintptr_t sb_addr; /* base address of mmaped segment */
|
||||
size_t sb_length; /* length of mmaped segment */
|
||||
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2007-2012 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
IF(OMPI_BUILD_CXX_BINDINGS)
|
||||
ADD_SUBDIRECTORY(cxx)
|
||||
ELSE(OMPI_BUILD_CXX_BINDINGS)
|
||||
MESSAGE(STATUS "Skipping MPI C++ interface")
|
||||
ENDIF(OMPI_BUILD_CXX_BINDINGS)
|
||||
|
||||
IF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
ADD_SUBDIRECTORY(fortran/mpif-h)
|
||||
ELSE(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
MESSAGE(STATUS "Skipping MPI FORTRAN interface")
|
||||
ENDIF(OMPI_WANT_FORTRAN_BINDINGS)
|
@ -17,8 +17,7 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
EXTRA_DIST += \
|
||||
mpi/CMakeLists.txt \
|
||||
EXTRA_DIST = \
|
||||
mpi/fortran/configure-fortran-output-bottom.h
|
||||
|
||||
dist_pkgdata_DATA += mpi/help-mpi-api.txt
|
||||
|
@ -43,14 +43,7 @@ double MPI_Wtick(void)
|
||||
OPAL_CR_NOOP_PROGRESS();
|
||||
|
||||
#if OPAL_TIMER_USEC_NATIVE
|
||||
/* We may or may not have native usec precision on Windows, so put
|
||||
this #if before the #ifdef checking for Windows. */
|
||||
return 0.000001;
|
||||
#elif defined(__WINDOWS__)
|
||||
if( (opal_timer_t)0 == opal_timer_base_get_freq() ) {
|
||||
opal_output( 0, "No timer frequency\n" );
|
||||
}
|
||||
return (double)opal_timer_base_get_freq();
|
||||
#else
|
||||
/* Otherwise, we already return usec precision. */
|
||||
return 0.000001;
|
||||
|
@ -43,12 +43,7 @@ double MPI_Wtime(void)
|
||||
double wtime;
|
||||
|
||||
#if OPAL_TIMER_USEC_NATIVE
|
||||
/* We may or may not have native usec precision on Windows, so put
|
||||
this #if before the #ifdef checking for Windows. */
|
||||
wtime = ((double) opal_timer_base_get_usec()) / 1000000.0;
|
||||
#elif defined(__WINDOWS__)
|
||||
wtime = ((double) opal_timer_base_get_cycles()) /
|
||||
((double) opal_timer_base_get_freq());
|
||||
#else
|
||||
/* Fall back to gettimeofday() if we have nothing else */
|
||||
struct timeval tv;
|
||||
|
@ -1,55 +0,0 @@
|
||||
# Copyright (c) 2007-2011 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
FILE(GLOB CXX_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp")
|
||||
|
||||
# skip the file interface sources if not wanted
|
||||
IF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)
|
||||
SET( TMP_SRC "" )
|
||||
FOREACH ( FILENAME ${CXX_SOURCE_FILES})
|
||||
GET_FILENAME_COMPONENT(relname ${FILENAME} NAME)
|
||||
IF (NOT ${relname} MATCHES "file.*[ch]$")
|
||||
LIST(APPEND TMP_SRC ${FILENAME})
|
||||
ENDIF (NOT ${relname} MATCHES "file.*[ch]$")
|
||||
ENDFOREACH(FILENAME)
|
||||
SET( CXX_SOURCE_FILES ${TMP_SRC})
|
||||
ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)
|
||||
|
||||
ADD_LIBRARY (libmpi_cxx ${CXX_SOURCE_FILES})
|
||||
|
||||
SET_TARGET_PROPERTIES (libmpi_cxx PROPERTIES LINKER_LANGUAGE CXX PREFIX "" IMPORT_PREFIX "")
|
||||
|
||||
# Set compile flags for this target
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
|
||||
TARGET_LINK_LIBRARIES(libmpi_cxx libmpi libopen-pal)
|
||||
# Need OMPI_BUILDING_CXX_BINDINGS_LIBRARY so that we can get the path
|
||||
# names correct inside the MPI C++ library. OMPI_SKIP_MPICXX is necessary
|
||||
# so that mpi.h doesn't include mpicxx.h through the incorrect pathname
|
||||
# in any of the C++ bindings .c files. Just use the define for this purpose
|
||||
# from user code.
|
||||
ADD_DEFINITIONS (-D_USRDLL -DOMPI_BUILDING
|
||||
-DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1 -DOMPI_SKIP_MPICXX=1
|
||||
-DOMPI_IMPORTS -DOPAL_IMPORTS)
|
||||
|
||||
ELSE (BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS (-D_LIB -DOMPI_BUILDING
|
||||
-DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1 -DOMPI_SKIP_MPICXX=1)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
INSTALL(TARGETS libmpi_cxx
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
||||
IF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
||||
INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_cxx${CMAKE_DEBUG_POSTFIX}.pdb
|
||||
DESTINATION bin)
|
||||
ENDIF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
||||
|
@ -18,8 +18,6 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
|
||||
# Need the first so that we can get the path names correct inside the
|
||||
# MPI C++ library. The second is necessary so that mpi.h doesn't
|
||||
# include mpicxx.h through the incorrect pathname in any of the C++
|
||||
|
@ -1,75 +0,0 @@
|
||||
# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
FILE(GLOB OMPI_FORTRAN_FILES "*.c")
|
||||
FILE(GLOB OMPI_FORTRAN_HEADER_FILES "*.h")
|
||||
|
||||
# Remove all MPI_File related files if the option is not selected
|
||||
IF (NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)
|
||||
MESSAGE( STATUS "Skipping the MPI I/O interface")
|
||||
SET( TMP_SRC "" )
|
||||
FOREACH ( FILENAME ${OMPI_FORTRAN_FILES})
|
||||
GET_FILENAME_COMPONENT(relname ${FILENAME} NAME)
|
||||
IF (NOT ${relname} MATCHES "file.*[ch]$")
|
||||
IF (NOT ${relname} STREQUAL "register_datarep.c")
|
||||
LIST(APPEND TMP_SRC ${FILENAME})
|
||||
ENDIF (NOT ${relname} STREQUAL "register_datarep.c")
|
||||
ENDIF(NOT ${relname} MATCHES "file.*[ch]$")
|
||||
ENDFOREACH(FILENAME ${OMPI_FORTRAN_FILES})
|
||||
SET( OMPI_FORTRAN_FILES ${TMP_SRC})
|
||||
ENDIF(NOT OMPI_PROVIDE_MPI_FILE_INTERFACE)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${OMPI_FORTRAN_FILES} PROPERTIES
|
||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=0 ${OMPI_C_DEF_PRE}OMPI_COMPILING_FORTRAN_WRAPPERS=1")
|
||||
|
||||
IF(OMPI_ENABLE_MPI_PROFILING)
|
||||
# As weak symbols are not supported by MS compiler,
|
||||
# we have to compile the C source files again for profiler,
|
||||
# i.e. add the pre-processor "OMPI_PROFILING_DEFINES" explicitly.
|
||||
|
||||
# copy the files to the build directory with a prefix.
|
||||
FOREACH(FILE_NAME ${OMPI_FORTRAN_FILES})
|
||||
GET_FILENAME_COMPONENT(relname ${FILE_NAME} NAME)
|
||||
CONFIGURE_FILE(${FILE_NAME}
|
||||
${PROJECT_BINARY_DIR}/profile/p${relname} [COPYONLY])
|
||||
ENDFOREACH(FILE_NAME ${OMPI_FORTRAN_FILES})
|
||||
|
||||
FILE(GLOB OMPI_FORTRAN_PROFILE_FILES "${PROJECT_BINARY_DIR}/profile/*.c" )
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${OMPI_FORTRAN_PROFILE_FILES} PROPERTIES
|
||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_PROFILE_LAYER=1 ${OMPI_C_DEF_PRE}OMPI_COMPILING_FORTRAN_WRAPPERS=1")
|
||||
|
||||
SET(OMPI_FORTRAN_FILES ${OMPI_FORTRAN_FILES} ${OMPI_FORTRAN_PROFILE_FILES})
|
||||
SOURCE_GROUP(profile FILES ${OMPI_FORTRAN_PROFILE_FILES})
|
||||
|
||||
ELSE(OMPI_ENABLE_MPI_PROFILING)
|
||||
MESSAGE( STATUS "Skipping the MPI profiling interface")
|
||||
ENDIF(OMPI_ENABLE_MPI_PROFILING)
|
||||
|
||||
|
||||
ADD_LIBRARY(libmpi_fortran ${OMPI_FORTRAN_FILES} ${OMPI_FORTRAN_HEADER_FILES})
|
||||
TARGET_LINK_LIBRARIES(libmpi_fortran libmpi)
|
||||
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS
|
||||
${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_CXX_LAN_FLAG})
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(${OMPI_C_DEF_PRE}_LIB)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
INSTALL(TARGETS libmpi_fortran
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
||||
IF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
||||
INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libmpi_fortran${CMAKE_DEBUG_POSTFIX}.pdb
|
||||
DESTINATION bin)
|
||||
ENDIF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
@ -18,8 +18,6 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
|
||||
SUBDIRS = profile
|
||||
|
||||
#
|
||||
|
@ -41,15 +41,11 @@
|
||||
#endif
|
||||
|
||||
#if OPAL_WANT_LIBLTDL
|
||||
#ifndef __WINDOWS__
|
||||
#if OPAL_LIBLTDL_INTERNAL
|
||||
#include "opal/libltdl/ltdl.h"
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "opal/util/output.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -215,14 +215,14 @@ int ompi_mpi_register_params(void)
|
||||
/* If we do not have stack trace
|
||||
capability, make this a read-only
|
||||
MCA param */
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) && defined(HAVE_BACKTRACE)
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE && defined(HAVE_BACKTRACE)
|
||||
false,
|
||||
#else
|
||||
true,
|
||||
#endif
|
||||
(int) ompi_mpi_abort_print_stack,
|
||||
&value);
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) && defined(HAVE_BACKTRACE)
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE && defined(HAVE_BACKTRACE)
|
||||
/* Only take the value if we have stack trace capability */
|
||||
ompi_mpi_abort_print_stack = OPAL_INT_TO_BOOL(value);
|
||||
#else
|
||||
|
@ -1,144 +0,0 @@
|
||||
# Copyright (c) 2007-2011 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2008 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
ADD_SUBDIRECTORY(ompi_info)
|
||||
|
||||
|
||||
MACRO(CONFIGURE_WRAPPER_DATA_FILE APP_NAME)
|
||||
|
||||
# mpic++ and mpicxx share the same input file
|
||||
IF(${APP_NAME} STREQUAL "mpicxx")
|
||||
SET(INPUT_PREFIX "mpic++")
|
||||
ELSE(${APP_NAME} STREQUAL "mpicxx")
|
||||
SET(INPUT_PREFIX ${APP_NAME})
|
||||
ENDIF(${APP_NAME} STREQUAL "mpicxx")
|
||||
|
||||
FILE(READ ${OpenMPI_SOURCE_DIR}/ompi/tools/wrappers/${INPUT_PREFIX}-wrapper-data.txt.in DATA_FILE)
|
||||
STRING(REGEX REPLACE "-l[-a-zA-Z0-9_]+ " "" DATA_FILE ${DATA_FILE})
|
||||
|
||||
# create a temporary input file, for "write file" command only
|
||||
# replace the variables in the first level. :(
|
||||
FILE(WRITE ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in "${DATA_FILE}")
|
||||
|
||||
CONFIGURE_FILE(${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in
|
||||
${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}-wrapper-data.txt @ONLY)
|
||||
INSTALL(FILES ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}-wrapper-data.txt
|
||||
DESTINATION share/openmpi)
|
||||
CONFIGURE_FILE(${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}-wrapper-data.txt.in
|
||||
${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}.exe-wrapper-data.txt @ONLY)
|
||||
INSTALL(FILES ${OMPI_BINARY_DIR}/tools/wrappers/${APP_NAME}${OMPI_EXE_DEBUG_POSTFIX}.exe-wrapper-data.txt
|
||||
DESTINATION share/openmpi)
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
# select debug or release libraries at configure time
|
||||
IF(WINDOWS_VS)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_BASE_LIBS
|
||||
"libmpid.lib libopen-pald.lib libopen-rted.lib advapi32.lib Ws2_32.lib shlwapi.lib")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_BASE_LIBS
|
||||
"libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ELSEIF(WINDOWS_MINGW)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_BASE_LIBS "-lmpid")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_BASE_LIBS "-lmpi")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ENDIF(WINDOWS_VS)
|
||||
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET(OMPI_WRAPPER_EXTRA_CFLAGS
|
||||
"${OMPI_C_LAN_FLAG}")
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_CFLAGS "${OMPI_C_LAN_FLAG} ${OMPI_C_MD_DEBUG}")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_CFLAGS "${OMPI_C_LAN_FLAG} ${OMPI_C_MD}")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
SET(OMPI_WRAPPER_EXTRA_LIBS ${OMPI_WRAPPER_BASE_LIBS})
|
||||
CONFIGURE_WRAPPER_DATA_FILE(mpicc)
|
||||
UNSET(OMPI_WRAPPER_EXTRA_LIBS)
|
||||
|
||||
IF(OMPI_BUILD_CXX_BINDINGS)
|
||||
|
||||
# select debug or release libraries at configure time
|
||||
IF(WINDOWS_VS)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxxd.lib ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_CXX_LIB "libmpi_cxx.lib ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ELSEIF(WINDOWS_MINGW)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_CXX_LIB "-lmpi_cxxd ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_CXX_LIB "-lmpi_cxx ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ENDIF(WINDOWS_VS)
|
||||
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET(OMPI_WRAPPER_EXTRA_CXXFLAGS
|
||||
"${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION}")
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_MD_DEBUG}")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_CXXFLAGS "${OMPI_CXX_LAN_FLAG} ${OMPI_CXX_EXCEPTION} ${OMPI_C_MD}")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
CONFIGURE_WRAPPER_DATA_FILE(mpic++)
|
||||
CONFIGURE_WRAPPER_DATA_FILE(mpicxx)
|
||||
ENDIF(OMPI_BUILD_CXX_BINDINGS)
|
||||
|
||||
IF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
# select debug or release libraries at configure time
|
||||
IF(WINDOWS_VS)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_fortrand.lib ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_LIBS "libmpi_fortran.lib ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ELSEIF(WINDOWS_MINGW)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_LIBS "-lmpi_fortrand ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_LIBS "-lmpi_fortran ${OMPI_WRAPPER_BASE_LIBS}")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ENDIF(WINDOWS_VS)
|
||||
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET(OMPI_WRAPPER_EXTRA_FFLAGS
|
||||
"")
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
IF(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_FFLAGS "${FORTRAN_DYNAMIC_FLAG_DEBUG}")
|
||||
ELSE(OMPI_DEBUG_BUILD)
|
||||
SET(OMPI_WRAPPER_EXTRA_FFLAGS "${FORTRAN_DYNAMIC_FLAG}")
|
||||
ENDIF(OMPI_DEBUG_BUILD)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
CONFIGURE_WRAPPER_DATA_FILE(mpifort)
|
||||
UNSET(OMPI_WRAPPER_EXTRA_LIBS)
|
||||
ENDIF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
|
||||
#IF(OMPI_WANT_F90_BINDINGS)
|
||||
# CONFIGURE_WRAPPER_DATA_FILE(mpif90)
|
||||
#ENDIF(OMPI_WANT_F90_BINDINGS)
|
||||
|
||||
IF(WANT_INSTALL_HEADERS)
|
||||
CONFIGURE_WRAPPER_DATA_FILE(opal-wrapper)
|
||||
ENDIF(WANT_INSTALL_HEADERS)
|
@ -19,8 +19,6 @@
|
||||
|
||||
# This makefile.am does not stand on its own - it is included from ompi/Makefile.am
|
||||
|
||||
EXTRA_DIST += tools/win_makefile tools/CMakeLists.txt
|
||||
|
||||
SUBDIRS += \
|
||||
tools/ompi_info \
|
||||
tools/wrappers
|
||||
|
@ -1,26 +0,0 @@
|
||||
# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
FILE(GLOB_RECURSE OMPI_INFO_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp")
|
||||
ADD_EXECUTABLE (ompi_info ${OMPI_INFO_SOURCE_FILES})
|
||||
|
||||
ADD_DEPENDENCIES(ompi_info libmpi)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(ompi_info PROPERTIES
|
||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS")
|
||||
SET_SOURCE_FILES_PROPERTIES(${PROJECT_SOURCE_DIR}/tools/ompi_info/components.c PROPERTIES COMPILE_FLAGS "${OMPI_CXX_LAN_FLAG}")
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
SET_TARGET_PROPERTIES(ompi_info PROPERTIES
|
||||
DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}")
|
||||
|
||||
TARGET_LINK_LIBRARIES (ompi_info libmpi libopen-rte libopen-pal Ws2_32.lib shlwapi.lib)
|
||||
|
||||
INSTALL(TARGETS ompi_info
|
||||
DESTINATION bin)
|
@ -41,7 +41,7 @@ AM_CFLAGS = \
|
||||
include $(top_srcdir)/Makefile.man-page-rules
|
||||
|
||||
man_pages = ompi_info.1
|
||||
EXTRA_DIST = $(man_pages:.1=.1in) CMakeLists.txt
|
||||
EXTRA_DIST = $(man_pages:.1=.1in)
|
||||
|
||||
if OMPI_INSTALL_BINARIES
|
||||
|
||||
|
@ -1,172 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
# This is a simple makefile for windows which makes all the components
|
||||
# which are required for super computing. Too lazy to open up visual
|
||||
# studio each and every time to compile a component, so just adding
|
||||
# this to the svn repository
|
||||
#
|
||||
|
||||
topdir := $(shell cygpath -m $(CURDIR))/../..
|
||||
installdir = ${topdir}/src/Debug
|
||||
libdir = ${installdir}/lib
|
||||
bindir = ${installdir}/bin
|
||||
incdir = ${installdir}/include
|
||||
|
||||
# list of components to build with the c compiler
|
||||
C_SUBDIRS = \
|
||||
orted
|
||||
|
||||
# list of components to build with the cpp compiler
|
||||
# (because of the problem with OBJ_CLASS_INSTANCE)
|
||||
CPP_SUBDIRS = \
|
||||
ompi_info
|
||||
|
||||
CC = cl
|
||||
|
||||
INCL = \
|
||||
/I"${topdir}/src/win32/generated_include" \
|
||||
/I"${topdir}/src/win32" \
|
||||
/I"${topdir}/include" \
|
||||
/I"${topdir}/src" \
|
||||
/I"${topdir}/src/event/compat/" \
|
||||
/I"${topdir}/src/event" \
|
||||
/I"${topdir}/src/event/WIN32-Code/"
|
||||
|
||||
CFLAGS = \
|
||||
/DWIN32 \
|
||||
/DHAVE_CONFIG_H \
|
||||
/DOMPI_SYSCONFDIR="\"${installdir}/share\"" \
|
||||
/DOMPI_BUILDING_WIN_DSO=1 \
|
||||
/EHsc \
|
||||
/ML \
|
||||
/W0 \
|
||||
/Wp64 \
|
||||
/TC \
|
||||
/D_MBCS \
|
||||
/LD\
|
||||
/nologo \
|
||||
/c
|
||||
|
||||
CPPFLAGS = \
|
||||
/DWIN32 \
|
||||
/TP \
|
||||
/DHAVE_CONFIG_H \
|
||||
/DOMPI_SYSCONFDIR="\"${installdir}/share\"" \
|
||||
/DOMPI_BUILDING_WIN_DSO=1 \
|
||||
/EHsc \
|
||||
/ML \
|
||||
/W0 \
|
||||
/Wp64 \
|
||||
/D_MBCS \
|
||||
/LD \
|
||||
/nologo \
|
||||
/c
|
||||
|
||||
ADD_INCL = \
|
||||
/DOMPI_BUILD_USER="\"not implemented\"" \
|
||||
/DOMPI_BUILD_DATE="\"not implemented\"" \
|
||||
/DOMPI_BUILD_HOST="\"not implemented\"" \
|
||||
/DOMPI_WANT_SVN="\"not implemented\"" \
|
||||
/DOMPI_SVN_R="\"not implemented\"" \
|
||||
/DOPAL_CONFIGURE_USER="\"not implemented\"" \
|
||||
/DOPAL_CONFIGURE_DATE="\"not implemented\"" \
|
||||
/DOPAL_CONFIGURE_HOST="\"not implemented\"" \
|
||||
/DOMPI_BUILD_CFLAGS="\"not implemented\"" \
|
||||
/DOMPI_BUILD_CXXFLAGS="\"not implemented\"" \
|
||||
/DOMPI_BUILD_FFLAGS="\"not implemented\"" \
|
||||
/DOMPI_BUILD_FCFLAGS="\"not implemented\"" \
|
||||
/DOMPI_BUILD_LDFLAGS="\"not implemented\"" \
|
||||
/DOMPI_BUILD_LIBS="\"not implemented\"" \
|
||||
/DOMPI_MAJOR_VERSION=1 \
|
||||
/DOMPI_MINOR_VERSION=0 \
|
||||
/DOMPI_RELEASE_VERSION=0 \
|
||||
/DOMPI_ALPHA_VERSION=0 \
|
||||
/DOMPI_BETA_VERSION=0 \
|
||||
/DOMPI_SVN_VERSION=0 \
|
||||
/DOMPI_PREFIX="\"${prefix}\"" \
|
||||
/DOMPI_BINDIR="\"${bindir}\"" \
|
||||
/DOMPI_LIBDIR="\"${libdir}\"" \
|
||||
/DOMPI_INCDIR="\"${incdir}\"" \
|
||||
/DOMPI_PKGLIBDIR="\"${libdir}\""
|
||||
|
||||
|
||||
# link with ompi.lib to resolve external symbols
|
||||
OMPILIB = \
|
||||
"${topdir}/src/libmpi.lib"
|
||||
|
||||
LINK = link
|
||||
|
||||
LINKFLAGS = \
|
||||
/OPT:NOICF \
|
||||
/OPT:NOREF \
|
||||
/DEFAULTLIB:${OMPILIB} \
|
||||
/nologo
|
||||
|
||||
ADDLIBS = \
|
||||
ws2_32.lib \
|
||||
kernel32.lib \
|
||||
user32.lib \
|
||||
gdi32.lib \
|
||||
winspool.lib \
|
||||
comdlg32.lib \
|
||||
advapi32.lib \
|
||||
shell32.lib \
|
||||
ole32.lib \
|
||||
oleaut32.lib \
|
||||
uuid.lib \
|
||||
odbc32.lib \
|
||||
odbccp32.lib
|
||||
|
||||
all: \
|
||||
cexes \
|
||||
cppexecs
|
||||
|
||||
cexes: ${C_SUBDIRS}
|
||||
@for dirs in ${C_SUBDIRS}; do \
|
||||
(echo "Entering $$dirs"; cd $$dirs; \
|
||||
${CC} ${CFLAGS} ${INCL} *.c; ${LINK} ${LINKFLAGS} ${ADDLIBS} *.obj;); \
|
||||
done
|
||||
|
||||
cppexecs: ${CPP_SUBDIRS}
|
||||
@for dirs in ${CPP_SUBDIRS}; do \
|
||||
(echo "Entering $$dirs"; cd $$dirs; \
|
||||
${CC} ${CPPFLAGS} ${INCL} ${ADD_INCL} *.cc; ${LINK} ${LINKFLAGS} ${ADDLIBS} *.obj;); \
|
||||
done
|
||||
|
||||
install: win_makefile
|
||||
@echo -n "Installing components ......................."
|
||||
@for dirs in ${C_SUBDIRS}; do \
|
||||
install -d ${CURDIR}/$${dirs}/ ${bindir}; \
|
||||
install -p ${CURDIR}/$${dirs}/$${dirs}.exe ${installdir}/$${dirs}.exe; \
|
||||
done
|
||||
@for dirs in ${CPP_SUBDIRS}; do \
|
||||
install -d ${CURDIR}/$${dirs}/ ${bindir}; \
|
||||
install -p ${CURDIR}/$${dirs}/$${dirs}.exe ${installdir}/$${dirs}.exe; \
|
||||
done
|
||||
@echo "done"
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
@for dirs in ${C_SUBDIRS}; do \
|
||||
(echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \
|
||||
done
|
||||
@for dirs in ${CPP_SUBDIRS}; do \
|
||||
(echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \
|
||||
done
|
@ -1,176 +0,0 @@
|
||||
# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
|
||||
PROJECT (OPAL)
|
||||
|
||||
|
||||
|
||||
# Add include sub directory to gernerate opal_config.h
|
||||
ADD_SUBDIRECTORY (include)
|
||||
|
||||
# These two files need to be compiled twice, one time with preprocessor CHECKSUM.
|
||||
# Make one copy of them with another file name and add them into the project.
|
||||
CONFIGURE_FILE(datatype/opal_datatype_pack.c ${PROJECT_BINARY_DIR}/datatype/opal_datatype_pack_checksum.c [COPYONLY])
|
||||
CONFIGURE_FILE(datatype/opal_datatype_unpack.c ${PROJECT_BINARY_DIR}/datatype/opal_datatype_unpack_checksum.c [COPYONLY])
|
||||
|
||||
SET(DATATYPE_CHECKSUM_FILES ${PROJECT_BINARY_DIR}/datatype/opal_datatype_pack_checksum.c
|
||||
${PROJECT_BINARY_DIR}/datatype/opal_datatype_unpack_checksum.c )
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${DATATYPE_CHECKSUM_FILES}
|
||||
PROPERTIES COMPILE_DEFINITIONS CHECKSUM)
|
||||
SET(OPAL_SOURCE_FILES ${OPAL_SOURCE_FILES} ${DATATYPE_CHECKSUM_FILES})
|
||||
SOURCE_GROUP(datatype FILES ${DATATYPE_CHECKSUM_FILES})
|
||||
|
||||
IF(OPAL_WANT_LIBLTDL)
|
||||
INCLUDE(find_libltdl)
|
||||
ENDIF(OPAL_WANT_LIBLTDL)
|
||||
|
||||
|
||||
# Include headers.
|
||||
FILE(GLOB OPAL_INCLUDE_FILES "include/*.h" "include/opal/*.h" "include/opal/sys/win32/*.h")
|
||||
SOURCE_GROUP(include FILES ${OPAL_INCLUDE_FILES})
|
||||
|
||||
SET (OPAL_SOURCE_FILES
|
||||
${OPAL_SOURCE_FILES}
|
||||
${OPAL_EVENT_FILES}
|
||||
${OPAL_INCLUDE_FILES}
|
||||
)
|
||||
|
||||
# Recuresive search sub directories excluding mca, event, include and tools.
|
||||
# Add sources in different source groups.
|
||||
INCLUDE(list_subdirs)
|
||||
CHECK_SUBDIRS("${PROJECT_SOURCE_DIR}" OPAL_SUBDIRS)
|
||||
|
||||
SET(OPAL_EXCLUDE_SUBDIRS event include libltdl mca tools)
|
||||
|
||||
FOREACH(OPAL_SUBDIR ${OPAL_SUBDIRS})
|
||||
|
||||
LIST(FIND OPAL_EXCLUDE_SUBDIRS ${OPAL_SUBDIR} OPAL_EXCLUDE_SUBDIR)
|
||||
|
||||
IF(${OPAL_EXCLUDE_SUBDIR} EQUAL -1)
|
||||
|
||||
FILE(GLOB_RECURSE OPAL_${OPAL_SUBDIR}_FILES
|
||||
"${OPAL_SUBDIR}/*.h" "${OPAL_SUBDIR}/*.c" "${OPAL_SUBDIR}/*.cc" "${OPAL_SUBDIR}/*.cpp")
|
||||
|
||||
SET (OPAL_SOURCE_FILES
|
||||
${OPAL_SOURCE_FILES}
|
||||
${OPAL_${OPAL_SUBDIR}_FILES}
|
||||
)
|
||||
|
||||
SOURCE_GROUP("${OPAL_SUBDIR}" FILES ${OPAL_${OPAL_SUBDIR}_FILES})
|
||||
|
||||
ENDIF(${OPAL_EXCLUDE_SUBDIR} EQUAL -1)
|
||||
|
||||
ENDFOREACH(OPAL_SUBDIR ${OPAL_SUBDIRS})
|
||||
|
||||
# remove non-mca files that shouldn't be compiled under windows
|
||||
LIST(REMOVE_ITEM OPAL_SOURCE_FILES "${PROJECT_SOURCE_DIR}/datatype/opal_datatype_cuda.c"
|
||||
"${PROJECT_SOURCE_DIR}/datatype/opal_datatype_cuda.h")
|
||||
|
||||
#only generate if it's not a tarball
|
||||
IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/keyval_lex.c)
|
||||
ADD_FLEX_FILE(OPAL_SOURCE_FILES ./util/keyval/keyval_lex.l
|
||||
opal_util_keyval_yy "${PROJECT_BINARY_DIR}/util/keyval/")
|
||||
ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/keyval/keyval_lex.c)
|
||||
|
||||
IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/show_help_lex.c)
|
||||
ADD_FLEX_FILE(OPAL_SOURCE_FILES ./util/show_help_lex.l
|
||||
opal_show_help_yy "${PROJECT_BINARY_DIR}/util/")
|
||||
ENDIF(NOT EXISTS ${PROJECT_SOURCE_DIR}/util/show_help_lex.c)
|
||||
|
||||
|
||||
# Add source files from mca subdirectories.
|
||||
INCLUDE (check_mca_subdirs)
|
||||
SET (OPAL_SOURCE_FILES ${OPAL_SOURCE_FILES} ${MCA_FILES})
|
||||
|
||||
|
||||
ADD_LIBRARY (libopen-pal ${OPAL_SOURCE_FILES})
|
||||
|
||||
|
||||
IF(WINDOWS_MINGW)
|
||||
SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIRARIES} -lpthread")
|
||||
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIRARIES} -lpthread")
|
||||
ENDIF(WINDOWS_MINGW)
|
||||
|
||||
# Set compile flags for this target
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
IF(WINDOWS_MINGW)
|
||||
ADD_CUSTOM_COMMAND(TARGET libopen-pal POST_BUILD
|
||||
COMMAND ar -rcs ${OpenMPI_BINARY_DIR}/event${CMAKE_DEBUG_POSTFIX}.lib ${EVENT_OBJ_FILES}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMENT "Generating static event library."
|
||||
)
|
||||
ADD_CUSTOM_COMMAND(TARGET libopen-pal POST_BUILD
|
||||
COMMAND ar -rcs ${OpenMPI_BINARY_DIR}/hwloc${CMAKE_DEBUG_POSTFIX}.lib ${HWLOC_OBJ_FILES}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMENT "Generating static hwloc library."
|
||||
)
|
||||
ELSEIF(WINDOWS_VS)
|
||||
ADD_CUSTOM_COMMAND(TARGET libopen-pal POST_BUILD
|
||||
COMMAND ${OMPI_LIB_CMD} ${OMPI_LIB_CMD_OUTPUT}${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib ${EVENT_OBJ_FILES}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMENT "Generating static event library."
|
||||
)
|
||||
ADD_CUSTOM_COMMAND(TARGET libopen-pal POST_BUILD
|
||||
COMMAND ${OMPI_LIB_CMD} ${OMPI_LIB_CMD_OUTPUT}${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/hwloc${CMAKE_DEBUG_POSTFIX}.lib ${HWLOC_OBJ_FILES}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMENT "Generating static hwloc library."
|
||||
)
|
||||
ENDIF(WINDOWS_MINGW)
|
||||
|
||||
SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_DEFINITIONS "_USRDLL;OPAL_EXPORTS"
|
||||
PREFIX "" IMPORT_PREFIX "")
|
||||
IF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND)
|
||||
INCLUDE_DIRECTORIES(${LIBLTDL_INCLUDE_PATH})
|
||||
TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib ${LIBLTDL_LIB})
|
||||
ELSE(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND)
|
||||
TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib)
|
||||
ENDIF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND)
|
||||
ELSE (BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_DEFINITIONS _LIB)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
# Generate install_dirs.h
|
||||
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
SET(bindir ${prefix}/bin)
|
||||
SET(sbindir ${prefix}/sbin)
|
||||
SET(libexecdir ${prefix}/libexec)
|
||||
SET(datarootdir ${prefix}/share)
|
||||
SET(datadir ${prefix}/share)
|
||||
SET(PACKAGE "openmpi")
|
||||
SET(sysconfdir ${prefix}/etc)
|
||||
SET(sharedstatedir ${prefix}/com)
|
||||
SET(localstatedir ${prefix}/var)
|
||||
SET(libdir ${prefix}/lib)
|
||||
SET(includedir ${prefix}/include)
|
||||
SET(infodir ${datarootdir}/info)
|
||||
SET(mandir ${datarootdir}/man)
|
||||
CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/opal/mca/installdirs/config/install_dirs.h.in
|
||||
${OpenMPI_BINARY_DIR}/opal/mca/installdirs/config/install_dirs.h)
|
||||
|
||||
# generate version.h
|
||||
CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/opal/include/opal/version.h.in ${OpenMPI_BINARY_DIR}/opal/include/opal/version.h)
|
||||
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
|
||||
# Install libraries, shared files.
|
||||
INSTALL(TARGETS libopen-pal
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
INSTALL(FILES runtime/help-opal-runtime.txt
|
||||
mca/base/help-mca-base.txt
|
||||
mca/base/help-mca-param.txt
|
||||
DESTINATION share/openmpi)
|
||||
|
||||
IF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
||||
INSTALL(FILES ${OpenMPI_BINARY_DIR}/Debug/libopen-pal${CMAKE_DEBUG_POSTFIX}.pdb
|
||||
DESTINATION bin)
|
||||
ENDIF (OMPI_DEBUG_BUILD AND WINDOWS_VS)
|
@ -17,8 +17,6 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
|
||||
SUBDIRS = \
|
||||
include \
|
||||
$(LIBLTDL_SUBDIR) \
|
||||
@ -83,6 +81,5 @@ include memoryhooks/Makefile.am
|
||||
include runtime/Makefile.am
|
||||
include threads/Makefile.am
|
||||
include mca/Makefile.am
|
||||
include win32/Makefile.am
|
||||
include tools/Makefile.am
|
||||
include dss/Makefile.am
|
||||
|
@ -1,45 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2007-2012 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2008 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# make a temporary copy of the input file
|
||||
FILE(READ ${OpenMPI_SOURCE_DIR}/ompi/include/mpi.h.in MPI_H_IN)
|
||||
|
||||
# change the syntax of the copy into CMake understandable
|
||||
STRING(REGEX REPLACE "#undef ([-_a-zA-Z0-9]+)[ ]*\n" "#cmakedefine \\1 \${\\1}\n" MPI_H_OUT "${MPI_H_IN}")
|
||||
STRING(REPLACE "#cmakedefine OMPI_HAVE_FORTRAN_" "#define OMPI_HAVE_FORTRAN_" MPI_H_OUT "${MPI_H_OUT}")
|
||||
STRING(REPLACE "{OMPI_PROVIDE_MPI_FILE_INTERFACE}"
|
||||
"{OMPI_PROVIDE_MPI_FILE_INTERFACE}" MPI_H_OUT "${MPI_H_OUT}")
|
||||
STRING(REPLACE "\${OMPI_BUILD_CXX_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}")
|
||||
STRING(REPLACE "\${OMPI_WANT_FORTRAN_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}")
|
||||
STRING(REPLACE "\${OMPI_WANT_F90_BINDINGS}" "1" MPI_H_OUT "${MPI_H_OUT}")
|
||||
STRING(REPLACE "\${OMPI_WANT_MPI_CXX_SEEK}" "1" MPI_H_OUT "${MPI_H_OUT}")
|
||||
STRING(REPLACE "\${OMPI_WANT_MPI_INTERFACE_WARNING}" "1" MPI_H_OUT "${MPI_H_OUT}")
|
||||
|
||||
FILE(WRITE ${OpenMPI_BINARY_DIR}/ompi/include/mpi.h.in "${MPI_H_OUT}")
|
||||
|
||||
# generate mpi.h
|
||||
CONFIGURE_FILE(${OpenMPI_BINARY_DIR}/ompi/include/mpi.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpi.h)
|
||||
|
||||
|
||||
#define OMPI/ORTE/OPAL_IMPORTS in mpi.h, then we dont't need to define it in the command line or solution config.
|
||||
#this mpi.h is used only for user programs
|
||||
STRING(REPLACE "define OMPI_MPI_H"
|
||||
"define OMPI_MPI_H\n\n#define OMPI_IMPORTS\n#define OPAL_IMPORTS\n#define ORTE_IMPORTS" MPI_H_OUT "${MPI_H_OUT}")
|
||||
FILE(WRITE ${OpenMPI_BINARY_DIR}/ompi/include/user/mpi.h.in "${MPI_H_OUT}")
|
||||
CONFIGURE_FILE(${OpenMPI_BINARY_DIR}/ompi/include/user/mpi.h.in ${OpenMPI_BINARY_DIR}/ompi/include/user/mpi.h)
|
||||
|
||||
IF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/mpif.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpif.h)
|
||||
CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/mpif-common.h.fin ${OpenMPI_BINARY_DIR}/ompi/include/mpif-common.h)
|
||||
CONFIGURE_FILE(${OpenMPI_SOURCE_DIR}/ompi/include/mpif-config.h.in ${OpenMPI_BINARY_DIR}/ompi/include/mpif-config.h)
|
||||
ENDIF(OMPI_WANT_FORTRAN_BINDINGS)
|
@ -27,7 +27,7 @@ nodist_headers = opal_config.h
|
||||
|
||||
include opal/Makefile.am
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt $(headers)
|
||||
EXTRA_DIST = $(headers)
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
opaldir = $(includedir)/openmpi
|
||||
|
@ -18,121 +18,9 @@
|
||||
#ifndef OPAL_GET_SOCKET_ERROR_H
|
||||
#define OPAL_GET_SOCKET_ERROR_H
|
||||
|
||||
/* In windows, sockets return differnt error codes than the linux counter parts. Although,
|
||||
one can find there are some similarities in the naming, there are definite differences.
|
||||
opal_socket_errno is defined to be errno under linux and opal_get_socket_errno under
|
||||
windows to ensure that the code which uses errno does not have to be changed. In windows,
|
||||
the mapping is taken care of by opal_get_socket_errno().
|
||||
|
||||
ANYONE USING SOCKET FUNCTIONS' RETURN VALUE PLEASE USE opal_socket_errno INSTEAD
|
||||
OF errno FOR COMPATIBILITY */
|
||||
|
||||
#include <errno.h>
|
||||
#include "opal/constants.h"
|
||||
#ifdef __WINDOWS__
|
||||
#define opal_socket_errno opal_get_socket_errno()
|
||||
|
||||
/* some of these have been defined in newer version of errno.h*/
|
||||
#if (defined(__WINDOWS__) && !defined(_MSC_VER)) || _MSC_VER < 1600
|
||||
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define EALREADY WSAEALREADY
|
||||
#define ENOTSOCK WSAENOTSOCK
|
||||
#define EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#define EMSGSIZE WSAEMSGSIZE
|
||||
#define EPROTOTYPE WSAEPROTOTYPE
|
||||
#define ENOPROTOOPT WSAENOPROTOOPT
|
||||
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#define EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#define EADDRINUSE WSAEADDRINUSE
|
||||
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#define ENETDOWN WSAENETDOWN
|
||||
#define ENETUNREACH WSAENETUNREACH
|
||||
#define ENETRESET WSAENETRESET
|
||||
#define ECONNABORTED WSAECONNABORTED
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#define ENOBUFS WSAENOBUFS
|
||||
#define EISCONN WSAEISCONN
|
||||
#define ENOTCONN WSAENOTCONN
|
||||
#define ETIMEDOUT WSAETIMEDOUT
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#define ELOOP WSAELOOP
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
|
||||
#endif /*defined(_MSC_VER) && _MSC_VER < 1600*/
|
||||
|
||||
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#define EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#define ESHUTDOWN WSAESHUTDOWN
|
||||
#define ETOOMANYREFS WSAETOOMANYREFS
|
||||
#define EHOSTDOWN WSAEHOSTDOWN
|
||||
#define EPROCLIM WSAEPROCLIM
|
||||
#define EUSERS WSAEUSERS
|
||||
#define EDQUOT WSAEDQUOT
|
||||
#define ESTALE WSAESTALE
|
||||
#define EREMOTE WSAEREMOTE
|
||||
|
||||
/*
|
||||
* pound define opal_get_error() to be opal_errno. so, in windows land
|
||||
* this simply defaults to being errno
|
||||
*/
|
||||
|
||||
/* return directly from the case statments */
|
||||
|
||||
static __inline int opal_get_socket_errno(void) {
|
||||
int ret = WSAGetLastError();
|
||||
switch (ret) {
|
||||
case WSAEINTR: return EINTR;
|
||||
case WSAEBADF: return EBADF;
|
||||
case WSAEACCES: return EACCES;
|
||||
case WSAEFAULT: return EFAULT;
|
||||
case WSAEINVAL: return EINVAL;
|
||||
case WSAEMFILE: return EMFILE;
|
||||
case WSAEWOULDBLOCK: return EWOULDBLOCK;
|
||||
case WSAEINPROGRESS: return EINPROGRESS;
|
||||
case WSAEALREADY: return EALREADY;
|
||||
case WSAENOTSOCK: return ENOTSOCK;
|
||||
case WSAEDESTADDRREQ: return EDESTADDRREQ;
|
||||
case WSAEMSGSIZE: return EMSGSIZE;
|
||||
case WSAEPROTOTYPE: return EPROTOTYPE;
|
||||
case WSAENOPROTOOPT: return ENOPROTOOPT;
|
||||
case WSAEPROTONOSUPPORT: return EPROTONOSUPPORT;
|
||||
case WSAESOCKTNOSUPPORT: return ESOCKTNOSUPPORT;
|
||||
case WSAEOPNOTSUPP: return EOPNOTSUPP;
|
||||
case WSAEPFNOSUPPORT: return EPFNOSUPPORT;
|
||||
case WSAEAFNOSUPPORT: return EAFNOSUPPORT;
|
||||
case WSAEADDRINUSE: return EADDRINUSE;
|
||||
case WSAEADDRNOTAVAIL: return EADDRNOTAVAIL;
|
||||
case WSAENETDOWN: return ENETDOWN;
|
||||
case WSAENETUNREACH: return ENETUNREACH;
|
||||
case WSAENETRESET: return ENETRESET;
|
||||
case WSAECONNABORTED: return ECONNABORTED;
|
||||
case WSAECONNRESET: return ECONNRESET;
|
||||
case WSAENOBUFS: return ENOBUFS;
|
||||
case WSAEISCONN: return EISCONN;
|
||||
case WSAENOTCONN: return ENOTCONN;
|
||||
case WSAESHUTDOWN: return ESHUTDOWN;
|
||||
case WSAETOOMANYREFS: return ETOOMANYREFS;
|
||||
case WSAETIMEDOUT: return ETIMEDOUT;
|
||||
case WSAECONNREFUSED: return ECONNREFUSED;
|
||||
case WSAELOOP: return ELOOP;
|
||||
case WSAENAMETOOLONG: return ENAMETOOLONG;
|
||||
case WSAEHOSTDOWN: return EHOSTDOWN;
|
||||
case WSAEHOSTUNREACH: return EHOSTUNREACH;
|
||||
case WSAENOTEMPTY: return ENOTEMPTY;
|
||||
case WSAEPROCLIM: return EPROCLIM;
|
||||
case WSAEUSERS: return EUSERS;
|
||||
case WSAEDQUOT: return EDQUOT;
|
||||
case WSAESTALE: return ESTALE;
|
||||
case WSAEREMOTE: return EREMOTE;
|
||||
default: printf("Feature not implemented: %d %s\n", __LINE__, __FILE__); return OPAL_ERROR;
|
||||
};
|
||||
}
|
||||
|
||||
#else
|
||||
#define opal_socket_errno errno
|
||||
#endif
|
||||
|
||||
#endif /* OPAL_GET_ERROR_H */
|
||||
|
@ -35,5 +35,4 @@ include opal/sys/ia64/Makefile.am
|
||||
include opal/sys/mips/Makefile.am
|
||||
include opal/sys/powerpc/Makefile.am
|
||||
include opal/sys/sparcv9/Makefile.am
|
||||
include opal/sys/win32/Makefile.am
|
||||
include opal/sys/sync_builtin/Makefile.am
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
/* Architectures */
|
||||
#define OMPI_UNSUPPORTED 0000
|
||||
#define OMPI_WINDOWS 0001
|
||||
#define OMPI_IA32 0010
|
||||
#define OMPI_IA64 0020
|
||||
#define OMPI_AMD64 0030
|
||||
|
@ -139,9 +139,6 @@ typedef struct opal_atomic_lock_t opal_atomic_lock_t;
|
||||
*********************************************************************/
|
||||
#if defined(DOXYGEN)
|
||||
/* don't include system-level gorp when generating doxygen files */
|
||||
#elif OPAL_ASSEMBLY_ARCH == OMPI_WINDOWS
|
||||
/* windows first, as they have API-level primitives for this stuff */
|
||||
#include "opal/sys/win32/atomic.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OMPI_ALPHA
|
||||
#include "opal/sys/alpha/atomic.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OMPI_AMD64
|
||||
|
@ -93,8 +93,6 @@ BEGIN_C_DECLS
|
||||
#include "opal/sys/sparcv9/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OMPI_SPARCV9_64
|
||||
#include "opal/sys/sparcv9/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OMPI_WINDOWS
|
||||
#include "opal/sys/win32/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OMPI_MIPS
|
||||
#include "opal/sys/mips/timer.h"
|
||||
#endif
|
||||
|
@ -1,23 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2009 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# This makefile.am does not stand on its own - it is included from opal/include/Makefile.am
|
||||
|
||||
headers += \
|
||||
opal/sys/win32/atomic.h \
|
||||
opal/sys/win32/timer.h
|
@ -1,178 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OMPI_SYS_ARCH_ATOMIC_H
|
||||
#define OMPI_SYS_ARCH_ATOMIC_H 1
|
||||
|
||||
#include <windows.h>
|
||||
#if defined(HAVE_WDM_H)
|
||||
#include <wdm.h>
|
||||
#endif /* HAVE_WDM_H */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* Memory Barriers
|
||||
*
|
||||
*********************************************************************/
|
||||
#define OPAL_HAVE_ATOMIC_MEM_BARRIER 1
|
||||
|
||||
static inline void opal_atomic_mb(void)
|
||||
{
|
||||
#if defined(HAVE_WDM_H)
|
||||
return KeMemoryBarrier();
|
||||
#endif /* HAVE_WDM_H */
|
||||
}
|
||||
|
||||
static inline void opal_atomic_rmb(void)
|
||||
{
|
||||
#if defined(HAVE_WDM_H)
|
||||
return KeMemoryBarrier();
|
||||
#endif /* HAVE_WDM_H */
|
||||
}
|
||||
|
||||
static inline void opal_atomic_wmb(void)
|
||||
{
|
||||
#if defined(HAVE_WDM_H)
|
||||
return KeMemoryBarrier();
|
||||
#endif /* HAVE_WDM_H */
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* Atomic math operations
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_CMPSET_32 1
|
||||
static inline int opal_atomic_cmpset_acq_32( volatile int32_t *addr,
|
||||
int32_t oldval, int32_t newval)
|
||||
{
|
||||
#if HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE
|
||||
int32_t ret = InterlockedCompareExchangeAcquire( (long volatile*)addr,
|
||||
(long)newval, (long)oldval);
|
||||
#else
|
||||
int32_t ret = InterlockedCompareExchange( (long volatile*)addr,
|
||||
(long)newval, (long)oldval );
|
||||
#endif /* HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE */
|
||||
return (oldval == ret) ? 1: 0;
|
||||
}
|
||||
|
||||
|
||||
static inline int opal_atomic_cmpset_rel_32( volatile int32_t *addr,
|
||||
int32_t oldval, int32_t newval)
|
||||
{
|
||||
#if HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE
|
||||
int32_t ret = InterlockedCompareExchangeRelease( (long volatile*)addr,
|
||||
(long)newval, (long)oldval );
|
||||
#else
|
||||
int32_t ret = InterlockedCompareExchange( (long volatile*)addr,
|
||||
(long)newval, (long)oldval );
|
||||
#endif /* HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE */
|
||||
return (oldval == ret) ? 1: 0;
|
||||
}
|
||||
|
||||
static inline int opal_atomic_cmpset_32( volatile int32_t *addr,
|
||||
int32_t oldval, int32_t newval)
|
||||
{
|
||||
int32_t ret = InterlockedCompareExchange ((long volatile*) addr,
|
||||
(long) newval, (long) oldval);
|
||||
|
||||
return (oldval == ret) ? 1: 0;
|
||||
}
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_MATH_32 1
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_ADD_32 1
|
||||
static inline int32_t opal_atomic_add_32(volatile int32_t *addr, int32_t delta)
|
||||
{
|
||||
return InterlockedExchangeAdd ((LONG volatile *) addr,
|
||||
(LONG) delta);
|
||||
}
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_SUB_32 1
|
||||
static inline int32_t opal_atomic_sub_32(volatile int32_t *addr, int32_t delta)
|
||||
{
|
||||
return InterlockedExchangeAdd( (LONG volatile *) addr,
|
||||
(LONG) (-delta));
|
||||
}
|
||||
|
||||
#if HAVE_INTERLOCKEDCOMPAREEXCHANGE64
|
||||
#define OPAL_HAVE_ATOMIC_CMPSET_64 1
|
||||
static inline int opal_atomic_cmpset_acq_64( volatile int64_t *addr,
|
||||
int64_t oldval, int64_t newval)
|
||||
{
|
||||
/* The address should be 64 bits aligned otherwise ...
|
||||
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/interlockedcompareexchange64.asp
|
||||
*/
|
||||
#if HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE64
|
||||
int64_t ret = InterlockedCompareExchangeAcquire64 ((int64_t volatile*) addr,
|
||||
(int64_t) newval, (int64_t) oldval);
|
||||
#else
|
||||
int64_t ret = InterlockedCompareExchange64 ((int64_t volatile*) addr,
|
||||
(int64_t) newval, (int64_t) oldval);
|
||||
#endif /* HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE64 */
|
||||
return (oldval == ret) ? 1: 0;
|
||||
}
|
||||
|
||||
static inline int opal_atomic_cmpset_rel_64( volatile int64_t *addr,
|
||||
int64_t oldval, int64_t newval)
|
||||
{
|
||||
#if HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE64
|
||||
int64_t ret = InterlockedCompareExchangeRelease64 ((int64_t volatile*) addr,
|
||||
(int64_t) newval, (int64_t) oldval);
|
||||
#else
|
||||
int64_t ret = InterlockedCompareExchange64 ((int64_t volatile*) addr,
|
||||
(int64_t) newval, (int64_t) oldval);
|
||||
#endif /* HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE64 */
|
||||
return (oldval == ret) ? 1: 0;
|
||||
}
|
||||
|
||||
|
||||
static inline int opal_atomic_cmpset_64( volatile int64_t *addr,
|
||||
int64_t oldval, int64_t newval)
|
||||
{
|
||||
int64_t ret = InterlockedCompareExchange64 ((int64_t volatile*) addr,
|
||||
(int64_t) newval, (int64_t) oldval);
|
||||
return (oldval == ret) ? 1: 0;
|
||||
}
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_MATH_64 1
|
||||
#define OPAL_HAVE_ATOMIC_ADD_64 1
|
||||
static inline int64_t opal_atomic_add_64(volatile int64_t *addr, int64_t delta)
|
||||
{
|
||||
return InterlockedExchangeAdd64 ((int64_t volatile *) addr,
|
||||
(int64_t) delta);
|
||||
}
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_SUB_64 1
|
||||
static inline int64_t opal_atomic_sub_64(volatile int64_t *addr, int64_t delta)
|
||||
{
|
||||
return InterlockedExchangeAdd64 ((int64_t volatile *) addr,
|
||||
(int64_t) (-delta));
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define OPAL_HAVE_ATOMIC_CMPSET_64 0
|
||||
#define OPAL_HAVE_ATOMIC_MATH_64 0
|
||||
#define OPAL_HAVE_ATOMIC_ADD_64 0
|
||||
#define OPAL_HAVE_ATOMIC_SUB_64 0
|
||||
|
||||
#endif /* HAVE_INTERLOCKEDCOMPAREEXCHANGE64 */
|
||||
|
||||
#endif /* ! OMPI_SYS_ARCH_ATOMIC_H */
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OMPI_SYS_ARCH_TIMER_H
|
||||
#define OMPI_SYS_ARCH_TIMER_H 1
|
||||
|
||||
|
||||
typedef LONGLONG opal_timer_t;
|
||||
|
||||
opal_timer_t opal_sys_timer_get_cycles(void);
|
||||
|
||||
#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
|
||||
|
||||
#endif /* ! OMPI_SYS_ARCH_TIMER_H */
|
@ -52,7 +52,7 @@
|
||||
/*
|
||||
* Flex is trying to include the unistd.h file. As there is no configure
|
||||
* option or this, the flex generated files will try to include the file
|
||||
* even on platforms without unistd.h (such as Windows). Therefore, if we
|
||||
* even on platforms without unistd.h. Therefore, if we
|
||||
* know this file is not available, we can prevent flex from including it.
|
||||
*/
|
||||
#ifndef HAVE_UNISTD_H
|
||||
@ -220,45 +220,6 @@
|
||||
# define __opal_attribute_weak_alias__(a)
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Windows library interface declaration code
|
||||
*
|
||||
**********************************************************************/
|
||||
#if !defined(__WINDOWS__)
|
||||
# if defined(_WIN32) || defined(WIN32) || defined(WIN64)
|
||||
# define __WINDOWS__
|
||||
# endif
|
||||
#endif /* !defined(__WINDOWS__) */
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
|
||||
# if defined(_USRDLL) /* building shared libraries (.DLL) */
|
||||
# if defined(OPAL_EXPORTS)
|
||||
# define OPAL_DECLSPEC __declspec(dllexport)
|
||||
# define OPAL_MODULE_DECLSPEC
|
||||
# else
|
||||
# if defined(OPAL_IMPORTS)
|
||||
# define OPAL_DECLSPEC __declspec(dllimport)
|
||||
# else
|
||||
# define OPAL_DECLSPEC
|
||||
# endif /*defined(OPAL_IMPORTS)*/
|
||||
# if defined(OPAL_MODULE_EXPORTS)
|
||||
# define OPAL_MODULE_DECLSPEC __declspec(dllexport)
|
||||
# else
|
||||
# define OPAL_MODULE_DECLSPEC __declspec(dllimport)
|
||||
# endif /* defined(OPAL_MODULE_EXPORTS) */
|
||||
# endif /* defined(OPAL_EXPORTS) */
|
||||
# else /* building static library */
|
||||
# if defined(OPAL_IMPORTS)
|
||||
# define OPAL_DECLSPEC __declspec(dllimport)
|
||||
# else
|
||||
# define OPAL_DECLSPEC
|
||||
# endif /* defined(OPAL_IMPORTS) */
|
||||
# define OPAL_MODULE_DECLSPEC
|
||||
# endif /* defined(_USRDLL) */
|
||||
# include "opal/win32/win_compat.h"
|
||||
#else
|
||||
# if OPAL_C_HAVE_VISIBILITY
|
||||
# define OPAL_DECLSPEC __opal_attribute_visibility__("default")
|
||||
# define OPAL_MODULE_DECLSPEC __opal_attribute_visibility__("default")
|
||||
@ -266,7 +227,6 @@
|
||||
# define OPAL_DECLSPEC
|
||||
# define OPAL_MODULE_DECLSPEC
|
||||
# endif
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/*
|
||||
* Do we have <stdint.h>?
|
||||
@ -370,13 +330,8 @@ typedef unsigned char bool;
|
||||
/*
|
||||
* Set the compile-time path-separator on this system and variable separator
|
||||
*/
|
||||
#ifdef __WINDOWS__
|
||||
#define OPAL_PATH_SEP "\\"
|
||||
#define OPAL_ENV_SEP ';'
|
||||
#else
|
||||
#define OPAL_PATH_SEP "/"
|
||||
#define OPAL_ENV_SEP ':'
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@ -478,9 +433,9 @@ typedef unsigned char bool;
|
||||
* are no htonl and friends. If that's the case, provide stubs. I
|
||||
* would hope we never find a platform that doesn't have these macros
|
||||
* and would want to talk to the outside world... On other platforms
|
||||
* (like Windows) we fail to detect them correctly.
|
||||
* we fail to detect them correctly.
|
||||
*/
|
||||
#if !defined(__WINDOWS__) && !defined(HAVE_UNIX_BYTESWAP)
|
||||
#if !defined(HAVE_UNIX_BYTESWAP)
|
||||
static inline uint32_t htonl(uint32_t hostvar) { return hostvar; }
|
||||
static inline uint32_t ntohl(uint32_t netvar) { return netvar; }
|
||||
static inline uint16_t htons(uint16_t hostvar) { return hostvar; }
|
||||
@ -498,35 +453,13 @@ static inline uint16_t ntohs(uint16_t netvar) { return netvar; }
|
||||
#define __func__ __FILE__
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Because of the way we're using the opal_object inside Open MPI (i.e.
|
||||
* dynamic resolution at run-time to derive all objects from the basic
|
||||
* type), on Windows we have to build everything on C++ mode, simply
|
||||
* because the C mode does not support dynamic resolution in DLL. Therefore,
|
||||
* no automatic conversion is allowed. All types have to be explicitly casted
|
||||
* or the compiler generate an error. This is true even for the void* type. As
|
||||
* we use void* to silence others compilers in the resolution of the addr member
|
||||
* of the iovec structure, we have now to find a way around. The simplest solution
|
||||
* is to define a special type for this field (just for casting). It can be
|
||||
* set to void* on all platforms with the exception of windows where it has to be
|
||||
* char*.
|
||||
*/
|
||||
#if defined(__WINDOWS__)
|
||||
#define IOVBASE_TYPE char
|
||||
#else
|
||||
#define IOVBASE_TYPE void
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/**
|
||||
* If we generate our own bool type, we need a special way to cast the result
|
||||
* in such a way to keep the compilers silent. Right now, th only compiler who
|
||||
* complain about int to bool conversions is the Microsoft compiler.
|
||||
* in such a way to keep the compilers silent.
|
||||
*/
|
||||
#if defined(__WINDOWS__)
|
||||
# define OPAL_INT_TO_BOOL(VALUE) ((VALUE) != 0 ? true : false)
|
||||
#else
|
||||
# define OPAL_INT_TO_BOOL(VALUE) (bool)(VALUE)
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/**
|
||||
* Top level define to check 2 things: a) if we want ipv6 support, and
|
||||
|
@ -41,15 +41,11 @@
|
||||
#endif
|
||||
|
||||
#if OPAL_WANT_LIBLTDL
|
||||
#ifndef __WINDOWS__
|
||||
#if OPAL_LIBLTDL_INTERNAL
|
||||
#include "opal/libltdl/ltdl.h"
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
@ -358,12 +354,6 @@ static void find_dyn_components(const char *path, const char *type_name,
|
||||
file->filename[OPAL_PATH_MAX] = '\0';
|
||||
file->status = UNVISITED;
|
||||
|
||||
#if defined(__WINDOWS__) && defined(_DEBUG)
|
||||
/* remove the debug suffix 'd', otherwise we will fail to
|
||||
load the module in later phase. */
|
||||
file->name[strlen(file->name)-1] = '\0';
|
||||
#endif
|
||||
|
||||
opal_list_append(&found_files, (opal_list_item_t *)
|
||||
file);
|
||||
}
|
||||
|
@ -27,15 +27,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#if OPAL_WANT_LIBLTDL
|
||||
#ifndef __WINDOWS__
|
||||
#if OPAL_LIBLTDL_INTERNAL
|
||||
#include "opal/libltdl/ltdl.h"
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "opal/class/opal_list.h"
|
||||
|
@ -71,12 +71,8 @@ int mca_base_open(void)
|
||||
#if OPAL_WANT_HOME_CONFIG_FILES
|
||||
mca_base_system_default_path = strdup(opal_install_dirs.pkglibdir);
|
||||
asprintf(&mca_base_user_default_path, "%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_home_directory());
|
||||
#else
|
||||
# if defined(__WINDOWS__) && defined(_DEBUG)
|
||||
asprintf(&mca_base_system_default_path, "%s/debug", opal_install_dirs.pkglibdir);
|
||||
#else
|
||||
asprintf(&mca_base_system_default_path, "%s", opal_install_dirs.pkglibdir);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* see if the user wants to override the defaults */
|
||||
@ -133,9 +129,7 @@ static void set_defaults(opal_output_stream_t *lds)
|
||||
/* Load up defaults */
|
||||
|
||||
OBJ_CONSTRUCT(lds, opal_output_stream_t);
|
||||
#ifndef __WINDOWS__
|
||||
lds->lds_syslog_priority = LOG_INFO;
|
||||
#endif
|
||||
lds->lds_syslog_ident = "ompi";
|
||||
lds->lds_want_stderr = true;
|
||||
}
|
||||
@ -166,7 +160,6 @@ static void parse_verbose(char *e, opal_output_stream_t *lds)
|
||||
}
|
||||
|
||||
if (0 == strcasecmp(ptr, "syslog")) {
|
||||
#ifndef __WINDOWS__ /* there is no syslog */
|
||||
lds->lds_want_syslog = true;
|
||||
have_output = true;
|
||||
}
|
||||
@ -182,7 +175,6 @@ static void parse_verbose(char *e, opal_output_stream_t *lds)
|
||||
} else if (strncasecmp(ptr, "syslogid:", 9) == 0) {
|
||||
lds->lds_want_syslog = true;
|
||||
lds->lds_syslog_ident = ptr + 9;
|
||||
#endif
|
||||
}
|
||||
|
||||
else if (strcasecmp(ptr, "stdout") == 0) {
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -95,9 +95,6 @@ static char * force_agg_path = NULL;
|
||||
/*
|
||||
* local functions
|
||||
*/
|
||||
#if defined(__WINDOWS__)
|
||||
static int read_keys_from_registry(HKEY hKey, char *sub_key, char *current_name);
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
static int fixup_files(char **file_list, char * path, bool rel_path_search);
|
||||
static int read_files(char *file_list);
|
||||
static int param_register(const char *type_name,
|
||||
@ -270,11 +267,6 @@ int mca_base_param_recache_files(bool rel_path_search)
|
||||
}
|
||||
|
||||
read_files(new_files);
|
||||
#if defined(__WINDOWS__)
|
||||
read_keys_from_registry(HKEY_LOCAL_MACHINE, "SOFTWARE\\Open MPI", NULL);
|
||||
read_keys_from_registry(HKEY_CURRENT_USER, "SOFTWARE\\Open MPI", NULL);
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
free(files);
|
||||
free(new_files);
|
||||
if( NULL != new_agg_files ) {
|
||||
@ -996,131 +988,6 @@ static int read_files(char *file_list)
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
#if defined(__WINDOWS__)
|
||||
#define MAX_KEY_LENGTH 255
|
||||
#define MAX_VALUE_NAME 16383
|
||||
|
||||
static int read_keys_from_registry(HKEY hKey, char *sub_key, char *current_name)
|
||||
{
|
||||
TCHAR achKey[MAX_KEY_LENGTH]; /* buffer for subkey name */
|
||||
DWORD cbName; /* size of name string */
|
||||
TCHAR achClass[MAX_PATH] = TEXT(""); /* buffer for class name */
|
||||
DWORD cchClassName = MAX_PATH; /* size of class string */
|
||||
DWORD cSubKeys=0; /* number of subkeys */
|
||||
DWORD cbMaxSubKey; /* longest subkey size */
|
||||
DWORD cchMaxClass; /* longest class string */
|
||||
DWORD cValues; /* number of values for key */
|
||||
DWORD cchMaxValue; /* longest value name */
|
||||
DWORD cbMaxValueData; /* longest value data */
|
||||
DWORD cbSecurityDescriptor; /* size of security descriptor */
|
||||
|
||||
LPDWORD lpType;
|
||||
LPDWORD word_lpData;
|
||||
TCHAR str_lpData[MAX_VALUE_NAME];
|
||||
TCHAR *str_key_name, *type_name, *next_name;
|
||||
DWORD dwSize, i, retCode, type_len, param_type;
|
||||
TCHAR achValue[MAX_VALUE_NAME];
|
||||
DWORD cchValue = MAX_VALUE_NAME;
|
||||
HKEY hTestKey;
|
||||
char *sub_sub_key;
|
||||
mca_base_param_storage_t storage, override, lookup;
|
||||
|
||||
if( !RegOpenKeyEx( hKey, sub_key, 0, KEY_READ, &hTestKey) == ERROR_SUCCESS )
|
||||
return OPAL_ERROR;
|
||||
|
||||
/* Get the class name and the value count. */
|
||||
retCode = RegQueryInfoKey( hTestKey, /* key handle */
|
||||
achClass, /* buffer for class name */
|
||||
&cchClassName, /* size of class string */
|
||||
NULL, /* reserved */
|
||||
&cSubKeys, /* number of subkeys */
|
||||
&cbMaxSubKey, /* longest subkey size */
|
||||
&cchMaxClass, /* longest class string */
|
||||
&cValues, /* number of values for this key */
|
||||
&cchMaxValue, /* longest value name */
|
||||
&cbMaxValueData, /* longest value data */
|
||||
&cbSecurityDescriptor, /* security descriptor */
|
||||
NULL );
|
||||
|
||||
/* Enumerate the subkeys, until RegEnumKeyEx fails. */
|
||||
for (i = 0; i < cSubKeys; i++) {
|
||||
cbName = MAX_KEY_LENGTH;
|
||||
retCode = RegEnumKeyEx(hTestKey, i, achKey, &cbName, NULL, NULL, NULL, NULL);
|
||||
if (retCode != ERROR_SUCCESS) continue;
|
||||
asprintf(&sub_sub_key, "%s\\%s", sub_key, achKey);
|
||||
if( NULL != current_name ) {
|
||||
asprintf(&next_name, "%s_%s", current_name, achKey);
|
||||
} else {
|
||||
asprintf(&next_name, "%s", achKey);
|
||||
}
|
||||
read_keys_from_registry(hKey, sub_sub_key, next_name);
|
||||
free(next_name);
|
||||
free(sub_sub_key);
|
||||
}
|
||||
|
||||
/* Enumerate the key values. */
|
||||
for( i = 0; i < cValues; i++ ) {
|
||||
cchValue = MAX_VALUE_NAME;
|
||||
achValue[0] = '\0';
|
||||
retCode = RegEnumValue(hTestKey, i, achValue, &cchValue, NULL, NULL, NULL, NULL);
|
||||
if (retCode != ERROR_SUCCESS ) continue;
|
||||
|
||||
/* lpType - get the type of the value
|
||||
* dwSize - get the size of the buffer to hold the value
|
||||
*/
|
||||
retCode = RegQueryValueEx(hTestKey, achValue, NULL, (LPDWORD)&lpType, NULL, &dwSize);
|
||||
|
||||
if (strcmp(achValue,"")) {
|
||||
if (current_name!=NULL)
|
||||
asprintf(&type_name, "%s_%s", current_name, achValue);
|
||||
else
|
||||
asprintf(&type_name, "%s", achValue);
|
||||
} else {
|
||||
if (current_name!=NULL)
|
||||
asprintf(&type_name, "%s", current_name);
|
||||
else
|
||||
asprintf(&type_name, "%s", achValue);
|
||||
}
|
||||
|
||||
type_len = strcspn(type_name, "_");
|
||||
str_key_name = type_name + type_len + 1;
|
||||
if( type_len == strlen(type_name) )
|
||||
str_key_name = NULL;
|
||||
type_name[type_len] = '\0';
|
||||
|
||||
retCode = 1;
|
||||
if( lpType == (LPDWORD)REG_SZ ) { /* REG_SZ = 1 */
|
||||
retCode = RegQueryValueEx(hTestKey, achValue, NULL, NULL, (LPBYTE)&str_lpData, &dwSize);
|
||||
storage.stringval = (char*)str_lpData;
|
||||
override.stringval = (char*)str_lpData;
|
||||
param_type = MCA_BASE_PARAM_TYPE_STRING;
|
||||
} else if( lpType == (LPDWORD)REG_DWORD ) { /* REG_DWORD = 4 */
|
||||
retCode = RegQueryValueEx(hTestKey, achValue, NULL, NULL, (LPBYTE)&word_lpData, &dwSize);
|
||||
storage.intval = (int)word_lpData;
|
||||
override.intval = (int)word_lpData;
|
||||
param_type = MCA_BASE_PARAM_TYPE_INT;
|
||||
}
|
||||
if( !retCode ) {
|
||||
(void)param_register( type_name, NULL, str_key_name, NULL,
|
||||
param_type, false, false,
|
||||
&storage, NULL, &override, &lookup );
|
||||
} else {
|
||||
opal_output( 0, "error reading value of param_name: %s with %d error.\n",
|
||||
str_key_name, retCode);
|
||||
}
|
||||
|
||||
free(type_name);
|
||||
}
|
||||
|
||||
RegCloseKey( hKey );
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
|
@ -88,17 +88,10 @@ typedef struct opal_if_t {
|
||||
char if_name[IF_NAMESIZE];
|
||||
int if_index;
|
||||
uint16_t if_kernel_index;
|
||||
#ifndef __WINDOWS__
|
||||
int if_flags;
|
||||
#else
|
||||
u_long if_flags;
|
||||
#endif
|
||||
int if_speed;
|
||||
struct sockaddr_storage if_addr;
|
||||
uint32_t if_mask;
|
||||
#ifdef __WINDOWS__
|
||||
struct sockaddr_in if_bcast;
|
||||
#endif
|
||||
uint32_t if_bandwidth;
|
||||
} opal_if_t;
|
||||
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_if_t);
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
@ -310,7 +310,6 @@ int opal_cr_init(void )
|
||||
(MPIR_debug_with_checkpoint ? "True": "False"));
|
||||
#endif
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
mca_base_param_reg_int_name("opal_cr", "signal",
|
||||
"Checkpoint/Restart signal used to initialize an OPAL Only checkpoint of a program",
|
||||
false, false,
|
||||
@ -348,10 +347,6 @@ int opal_cr_init(void )
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
opal_cr_is_tool = true; /* no support for CR on Windows yet */
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
#if OPAL_ENABLE_CRDEBUG == 1
|
||||
opal_cr_debug_num_free_threads = 3;
|
||||
opal_cr_debug_free_threads = (opal_thread_t **)malloc(sizeof(opal_thread_t *) * opal_cr_debug_num_free_threads );
|
||||
@ -1413,9 +1408,7 @@ void *MPIR_checkpoint_debugger_breakpoint(void)
|
||||
{
|
||||
/* spin until debugger attaches and releases us */
|
||||
while (MPIR_checkpoint_debug_gate == 0) {
|
||||
#if defined(__WINDOWS__)
|
||||
Sleep(100); /* milliseconds */
|
||||
#elif defined(HAVE_USLEEP)
|
||||
#if defined(HAVE_USLEEP)
|
||||
usleep(100000); /* microseconds */
|
||||
#else
|
||||
sleep(1); /* seconds */
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2006-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
@ -207,20 +207,16 @@ opal_progress(void)
|
||||
events += (callbacks[i])();
|
||||
}
|
||||
|
||||
#if defined(__WINDOWS__) || defined(HAVE_SCHED_YIELD)
|
||||
#if defined(HAVE_SCHED_YIELD)
|
||||
if (call_yield && events <= 0) {
|
||||
/* If there is nothing to do - yield the processor - otherwise
|
||||
* we could consume the processor for the entire time slice. If
|
||||
* the processor is oversubscribed - this will result in a best-case
|
||||
* latency equivalent to the time-slice.
|
||||
*/
|
||||
#if defined(__WINDOWS__)
|
||||
SwitchToThread();
|
||||
#else
|
||||
sched_yield();
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
}
|
||||
#endif /* defined(__WINDOWS__) || defined(HAVE_SCHED_YIELD) */
|
||||
#endif /* defined(HAVE_SCHED_YIELD) */
|
||||
#if OPAL_ENABLE_MULTI_THREADS
|
||||
opal_atomic_add(&opal_progress_recursion_depth_counter, -1);
|
||||
#else
|
||||
|
@ -24,7 +24,6 @@ headers += \
|
||||
threads/condition.h \
|
||||
threads/mutex.h \
|
||||
threads/mutex_unix.h \
|
||||
threads/mutex_windows.h \
|
||||
threads/threads.h \
|
||||
threads/tsd.h
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -30,24 +30,6 @@ bool opal_uses_threads = false;
|
||||
bool opal_mutex_check_locks = false;
|
||||
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
|
||||
static void opal_mutex_construct(opal_mutex_t *m)
|
||||
{
|
||||
InterlockedExchange(&m->m_lock, 0);
|
||||
#if !OPAL_ENABLE_MULTI_THREADS && OPAL_ENABLE_DEBUG
|
||||
m->m_lock_debug = 0;
|
||||
m->m_lock_file = NULL;
|
||||
m->m_lock_line = 0;
|
||||
#endif /* !OPAL_ENABLE_MULTI_THREADS && OPAL_ENABLE_DEBUG */
|
||||
}
|
||||
|
||||
static void opal_mutex_destruct(opal_mutex_t *m)
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void opal_mutex_construct(opal_mutex_t *m)
|
||||
{
|
||||
#if OPAL_HAVE_POSIX_THREADS
|
||||
@ -97,8 +79,6 @@ static void opal_mutex_destruct(opal_mutex_t *m)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
OBJ_CLASS_INSTANCE(opal_mutex_t,
|
||||
opal_object_t,
|
||||
opal_mutex_construct,
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2007 Voltaire. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
@ -110,11 +110,7 @@ static inline void opal_mutex_atomic_unlock(opal_mutex_t *mutex);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#include "mutex_windows.h"
|
||||
#else
|
||||
#include "mutex_unix.h"
|
||||
#endif
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OPAL_MUTEX_WINDOWS_H
|
||||
#define OPAL_MUTEX_WINDOWS_H 1
|
||||
|
||||
/**
|
||||
* @file:
|
||||
*
|
||||
* Mutual exclusion functions: Windows implementation.
|
||||
*
|
||||
* Functions for locking of critical sections.
|
||||
*
|
||||
* On Windows, base everything on InterlockedExchange().
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
#include "opal/class/opal_object.h"
|
||||
#include "opal/sys/atomic.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
struct opal_mutex_t {
|
||||
opal_object_t super;
|
||||
volatile LONG m_lock;
|
||||
|
||||
#if OPAL_ENABLE_DEBUG
|
||||
int m_lock_debug;
|
||||
const char *m_lock_file;
|
||||
int m_lock_line;
|
||||
#endif
|
||||
};
|
||||
|
||||
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_mutex_t);
|
||||
|
||||
|
||||
static inline int opal_mutex_trylock(opal_mutex_t *m)
|
||||
{
|
||||
return (0 == InterlockedExchange(&m->m_lock, 1) ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
static inline void opal_mutex_lock(opal_mutex_t *m)
|
||||
{
|
||||
while (InterlockedExchange(&m->m_lock, 1)) {
|
||||
while (m->m_lock == 1) {
|
||||
/* spin */;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline void opal_mutex_unlock(opal_mutex_t *m)
|
||||
{
|
||||
InterlockedExchange(&m->m_lock, 0);
|
||||
}
|
||||
|
||||
|
||||
static inline int opal_mutex_atomic_trylock(opal_mutex_t *m)
|
||||
{
|
||||
return opal_mutex_trylock(m);
|
||||
}
|
||||
|
||||
|
||||
static inline void opal_mutex_atomic_lock(opal_mutex_t *m)
|
||||
{
|
||||
opal_mutex_lock(m);
|
||||
}
|
||||
|
||||
|
||||
static inline void opal_mutex_atomic_unlock(opal_mutex_t *m)
|
||||
{
|
||||
opal_mutex_unlock(m);
|
||||
}
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* OPAL_MUTEX_WINDOWS_H */
|
@ -37,87 +37,14 @@ OBJ_CLASS_INSTANCE(opal_thread_t,
|
||||
static void opal_thread_construct(opal_thread_t *t)
|
||||
{
|
||||
t->t_run = 0;
|
||||
#ifdef __WINDOWS__
|
||||
t->t_handle = (HANDLE)NULL;
|
||||
#elif OPAL_HAVE_POSIX_THREADS
|
||||
#ifdef OPAL_HAVE_POSIX_THREADS
|
||||
t->t_handle = (pthread_t) -1;
|
||||
#elif OPAL_HAVE_SOLARIS_THREADS
|
||||
t->t_handle = (thread_t) -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
|
||||
/************************************************************************
|
||||
* Windows threads
|
||||
************************************************************************/
|
||||
|
||||
int opal_thread_start(opal_thread_t *t)
|
||||
{
|
||||
DWORD tid;
|
||||
|
||||
if (OPAL_ENABLE_DEBUG) {
|
||||
if (NULL == t->t_run || t->t_handle != (HANDLE) -1L) {
|
||||
return OPAL_ERR_BAD_PARAM;
|
||||
}
|
||||
}
|
||||
|
||||
t->t_handle = CreateThread(NULL, /* default security attributes */
|
||||
0, /* default stack size */
|
||||
(LPTHREAD_START_ROUTINE) t->t_run,
|
||||
t, /* argument */
|
||||
0, /* default creation flags */
|
||||
&tid);
|
||||
|
||||
if (t->t_handle == NULL) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int opal_thread_join(opal_thread_t *t, void **thr_return)
|
||||
{
|
||||
DWORD rc;
|
||||
|
||||
if (WaitForSingleObject(t->t_handle, INFINITE) != WAIT_OBJECT_0) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
if (!GetExitCodeThread(t->t_handle, &rc)) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
if( NULL != thr_return ) {
|
||||
*thr_return = (void *)((intptr_t)rc);
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
bool opal_thread_self_compare(opal_thread_t *t)
|
||||
{
|
||||
HANDLE thread_handle;
|
||||
thread_handle = GetCurrentThread();
|
||||
return (thread_handle == t->t_handle ? true : false);
|
||||
}
|
||||
|
||||
|
||||
opal_thread_t *opal_thread_get_self(void)
|
||||
{
|
||||
opal_thread_t *t = OBJ_NEW(opal_thread_t);
|
||||
t->t_handle = GetCurrentThread();
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
void opal_thread_kill(opal_thread_t *t, int sig)
|
||||
{
|
||||
}
|
||||
|
||||
#elif OPAL_HAVE_POSIX_THREADS
|
||||
#ifdef OPAL_HAVE_POSIX_THREADS
|
||||
|
||||
/************************************************************************
|
||||
* POSIX threads
|
||||
|
@ -47,9 +47,7 @@ struct opal_thread_t {
|
||||
opal_object_t super;
|
||||
opal_thread_fn_t t_run;
|
||||
void* t_arg;
|
||||
#ifdef __WINDOWS__
|
||||
HANDLE t_handle;
|
||||
#elif OPAL_HAVE_POSIX_THREADS
|
||||
#ifdef OPAL_HAVE_POSIX_THREADS
|
||||
pthread_t t_handle;
|
||||
#elif OPAL_HAVE_SOLARIS_THREADS
|
||||
thread_t t_handle;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#include "opal/threads/tsd.h"
|
||||
|
||||
#if !OPAL_HAVE_POSIX_THREADS && !OPAL_HAVE_SOLARIS_THREADS && !defined(__WINDOWS__)
|
||||
#if !OPAL_HAVE_POSIX_THREADS && !OPAL_HAVE_SOLARIS_THREADS
|
||||
|
||||
#define TSD_ENTRIES 32
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -195,46 +195,6 @@ opal_tsd_getspecific(opal_tsd_key_t key, void **valuep)
|
||||
return thr_getspecific(key, valuep);
|
||||
}
|
||||
|
||||
#elif defined(__WINDOWS__)
|
||||
|
||||
/* BWB - FIX ME - this is still not quite right -- we also need to
|
||||
implement support for running the destructors when a thread exits,
|
||||
but I'm not sure we have a framework for doing that just yet. */
|
||||
|
||||
typedef DWORD opal_tsd_key_t;
|
||||
|
||||
static inline int
|
||||
opal_tsd_key_create(opal_tsd_key_t *key,
|
||||
opal_tsd_destructor_t destructor)
|
||||
{
|
||||
*key = TlsAlloc();
|
||||
|
||||
return (*key == TLS_OUT_OF_INDEXES) ? OPAL_ERROR : OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static inline int
|
||||
opal_tsd_key_delete(opal_tsd_key_t key)
|
||||
{
|
||||
key = TlsFree(key);
|
||||
|
||||
return (key == 0) ? OPAL_ERROR : OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static inline int
|
||||
opal_tsd_setspecific(opal_tsd_key_t key, void *value)
|
||||
{
|
||||
BOOL ret = TlsSetValue(key, (LPVOID) value);
|
||||
|
||||
return (ret) ? OPAL_SUCCESS : OPAL_ERROR;
|
||||
}
|
||||
|
||||
static inline int
|
||||
opal_tsd_getspecific(opal_tsd_key_t key, void **valuep)
|
||||
{
|
||||
*valuep = TlsGetValue(key);
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
typedef int opal_tsd_key_t;
|
||||
|
@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2007-2008 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2008 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
IF(OPAL_ENABLE_FT)
|
||||
ADD_SUBDIRECTORY(opal-restart)
|
||||
ENDIF(OPAL_ENABLE_FT)
|
||||
ADD_SUBDIRECTORY(wrappers)
|
@ -17,8 +17,6 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
EXTRA_DIST += tools/CMakeLists.txt
|
||||
|
||||
# This makefile.am does not stand on its own - it is included from
|
||||
# opal/Makefile.am
|
||||
|
||||
|
@ -1,27 +0,0 @@
|
||||
# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
FILE(GLOB_RECURSE OPAL_CHECKPOINT_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp")
|
||||
|
||||
ADD_EXECUTABLE (opal-checkpoint ${OPAL_CHECKPOINT_SOURCE_FILES})
|
||||
|
||||
ADD_DEPENDENCIES(opal-checkpoint libopen-pal)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(opal-checkpoint PROPERTIES
|
||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS ${OMPI_CXX_LAN_FLAG}")
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
SET_TARGET_PROPERTIES(opal-checkpoint PROPERTIES
|
||||
DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}")
|
||||
|
||||
TARGET_LINK_LIBRARIES (opal-checkpoint libopen-pal Ws2_32.lib shlwapi.lib)
|
||||
|
||||
INSTALL(TARGETS opal-checkpoint
|
||||
DESTINATION bin)
|
||||
INSTALL(FILES help-opal-checkpoint.txt DESTINATION share/openmpi)
|
@ -22,7 +22,7 @@
|
||||
include $(top_srcdir)/Makefile.man-page-rules
|
||||
|
||||
man_pages = opal-checkpoint.1
|
||||
EXTRA_DIST = $(man_pages:.1=.1in) CMakeLists.txt
|
||||
EXTRA_DIST = $(man_pages:.1=.1in)
|
||||
|
||||
if WANT_FT_CR
|
||||
if OMPI_INSTALL_BINARIES
|
||||
|
@ -1,27 +0,0 @@
|
||||
# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
FILE(GLOB_RECURSE OPAL_RESTART_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp")
|
||||
|
||||
ADD_EXECUTABLE (opal-restart ${OPAL_RESTART_SOURCE_FILES})
|
||||
|
||||
ADD_DEPENDENCIES(opal-restart libopen-pal)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(opal-restart PROPERTIES
|
||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS ${OMPI_CXX_LAN_FLAG}")
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
SET_TARGET_PROPERTIES(opal-restart PROPERTIES
|
||||
DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}")
|
||||
|
||||
TARGET_LINK_LIBRARIES (opal-restart libopen-pal Ws2_32.lib shlwapi.lib)
|
||||
|
||||
INSTALL(TARGETS opal-restart
|
||||
DESTINATION bin)
|
||||
INSTALL(FILES help-opal-restart.txt DESTINATION share/openmpi)
|
@ -22,7 +22,7 @@
|
||||
include $(top_srcdir)/Makefile.man-page-rules
|
||||
|
||||
man_pages = opal-restart.1
|
||||
EXTRA_DIST = $(man_pages:.1=.1in) CMakeLists.txt
|
||||
EXTRA_DIST = $(man_pages:.1=.1in)
|
||||
|
||||
if WANT_FT_CR
|
||||
if OMPI_INSTALL_BINARIES
|
||||
|
@ -1,103 +0,0 @@
|
||||
# Copyright (c) 2007-2010 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
FILE(GLOB_RECURSE OPAL_WRAPPER_SOURCE_FILES "*.h" "*.c" "*.cc" "*.cpp")
|
||||
|
||||
ADD_EXECUTABLE (opal-wrapper ${OPAL_WRAPPER_SOURCE_FILES})
|
||||
|
||||
ADD_DEPENDENCIES(opal-wrapper libopen-pal)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(opal-wrapper PROPERTIES
|
||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}OMPI_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS ${OMPI_CXX_LAN_FLAG}")
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
|
||||
SET_TARGET_PROPERTIES(opal-wrapper PROPERTIES
|
||||
DEBUG_POSTFIX "${OMPI_EXE_DEBUG_POSTFIX}")
|
||||
|
||||
TARGET_LINK_LIBRARIES (opal-wrapper libopen-pal Ws2_32.lib shlwapi.lib)
|
||||
|
||||
ADD_CUSTOM_COMMAND (TARGET opal-wrapper
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
${PROJECT_BINARY_DIR}/mpicc${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
COMMENT "Copying C compiler wrappers...")
|
||||
|
||||
IF(OMPI_BUILD_CXX_BINDINGS)
|
||||
ADD_CUSTOM_COMMAND (TARGET opal-wrapper
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIXX}.exe
|
||||
${PROJECT_BINARY_DIR}/mpic++${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
${PROJECT_BINARY_DIR}/mpicxx${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
COMMENT "Copying C++ compiler wrappers...")
|
||||
|
||||
INSTALL(FILES ${PROJECT_BINARY_DIR}/mpic++${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
${PROJECT_BINARY_DIR}/mpicxx${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
DESTINATION bin)
|
||||
ENDIF(OMPI_BUILD_CXX_BINDINGS)
|
||||
|
||||
IF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
ADD_CUSTOM_COMMAND(TARGET opal-wrapper
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
${PROJECT_BINARY_DIR}/mpifortran${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
COMMENT "Copying FORTRAN compiler wrappers...")
|
||||
|
||||
INSTALL(FILES ${PROJECT_BINARY_DIR}/mpifortran${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
DESTINATION bin)
|
||||
ENDIF(OMPI_WANT_FORTRAN_BINDINGS)
|
||||
|
||||
ADD_CUSTOM_COMMAND (TARGET opal-wrapper
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${PROJECT_SOURCE_DIR}/tools/wrappers/help-opal-wrapper.txt
|
||||
${PROJECT_BINARY_DIR}/help-opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe.txt
|
||||
COMMENT "Copying wrapper help files...")
|
||||
|
||||
INSTALL(TARGETS opal-wrapper
|
||||
DESTINATION bin)
|
||||
INSTALL(FILES help-opal-wrapper.txt
|
||||
${PROJECT_BINARY_DIR}/help-opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe.txt
|
||||
DESTINATION share/openmpi)
|
||||
INSTALL(FILES ${PROJECT_BINARY_DIR}/mpicc${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
DESTINATION bin)
|
||||
|
||||
IF(WANT_INSTALL_HEADERS)
|
||||
|
||||
ADD_CUSTOM_COMMAND (TARGET opal-wrapper
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
${PROJECT_BINARY_DIR}/opalcc${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
COMMENT "Copying renamed executables...")
|
||||
|
||||
IF(OMPI_BUILD_CXX_BINDINGS)
|
||||
ADD_CUSTOM_COMMAND (TARGET opal-wrapper
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/opal-wrapper${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
${PROJECT_BINARY_DIR}/opalc++${OMPI_EXE_DEBUG_POSTFIX}.exe
|
||||
COMMENT "Copying renamed executables...")
|
||||
|
||||
CONFIGURE_FILE(${OPAL_SOURCE_DIR}/tools/wrappers/opalc++-wrapper-data.txt.in
|
||||
${OPAL_BINARY_DIR}/tools/wrappers/opalc++-wrapper-data.txt @ONLY)
|
||||
INSTALL(FILES ${OPAL_BINARY_DIR}/tools/wrappers/opalc++-wrapper-data.txt
|
||||
DESTINATION share/openmpi)
|
||||
ENDIF(OMPI_BUILD_CXX_BINDINGS)
|
||||
|
||||
CONFIGURE_FILE(${OPAL_SOURCE_DIR}/tools/wrappers/opalcc-wrapper-data.txt.in
|
||||
${OPAL_BINARY_DIR}/tools/wrappers/opalcc-wrapper-data.txt @ONLY)
|
||||
INSTALL(FILES ${OPAL_BINARY_DIR}/tools/wrappers/opalcc-wrapper-data.txt
|
||||
DESTINATION share/openmpi)
|
||||
|
||||
ENDIF(WANT_INSTALL_HEADERS)
|
@ -21,7 +21,7 @@
|
||||
DEFS="-DEXEEXT=\"$(EXEEXT)\""
|
||||
|
||||
real_man_pages = generic_wrapper.1 opal_wrapper.1
|
||||
EXTRA_DIST = $(real_man_pages:.1=.1in) CMakeLists.txt
|
||||
EXTRA_DIST = $(real_man_pages:.1=.1in)
|
||||
|
||||
include $(top_srcdir)/Makefile.man-page-rules
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -56,13 +56,8 @@
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/util/os_path.h"
|
||||
|
||||
#if defined(__WINDOWS__) && defined(_MSC_VER)
|
||||
#define OPAL_INCLUDE_FLAG "/I"
|
||||
#define OPAL_LIBDIR_FLAG "/LIBPATH:"
|
||||
#else
|
||||
#define OPAL_INCLUDE_FLAG "-I"
|
||||
#define OPAL_LIBDIR_FLAG "-L"
|
||||
#endif /* !defined(__WINDOWS__) && defined(_MSC_VER) */
|
||||
|
||||
struct options_data_t {
|
||||
char **compiler_args;
|
||||
@ -321,13 +316,8 @@ data_callback(const char *key, const char *value)
|
||||
if (0 != strcmp(options_data[parse_options_idx].path_includedir, "/usr/include") ||
|
||||
0 == strncmp(options_data[parse_options_idx].language, "Fortran", strlen("Fortran"))) {
|
||||
char *line;
|
||||
#if defined(__WINDOWS__)
|
||||
asprintf(&line, OPAL_INCLUDE_FLAG"\"%s\"",
|
||||
options_data[parse_options_idx].path_includedir);
|
||||
#else
|
||||
asprintf(&line, OPAL_INCLUDE_FLAG"%s",
|
||||
options_data[parse_options_idx].path_includedir);
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
opal_argv_append_nosize(&options_data[parse_options_idx].preproc_flags, line);
|
||||
free(line);
|
||||
}
|
||||
@ -335,24 +325,10 @@ data_callback(const char *key, const char *value)
|
||||
} else if (0 == strcmp(key, "libdir")) {
|
||||
if (NULL != value) options_data[parse_options_idx].path_libdir =
|
||||
opal_install_dirs_expand(value);
|
||||
#if defined(__WINDOWS__) && defined(_MSC_VER)
|
||||
opal_argv_append_nosize( &options_data[parse_options_idx].link_flags, "/link" );
|
||||
#endif /* defined(__WINDOWS__) && defined(_MSC_VER) */
|
||||
if (0 != strcmp(options_data[parse_options_idx].path_libdir, "/usr/lib")) {
|
||||
char *line;
|
||||
#if defined(__WINDOWS__)
|
||||
# if defined(_MSC_VER)
|
||||
asprintf(&line, OPAL_LIBDIR_FLAG"\"%s\"",
|
||||
options_data[parse_options_idx].path_libdir);
|
||||
# else
|
||||
/* linked DLLs are in bin for MinGW build*/
|
||||
asprintf(&line, OPAL_LIBDIR_FLAG"\"%s/../bin\"",
|
||||
options_data[parse_options_idx].path_libdir);
|
||||
# endif /* defined(_MSC_VER) */
|
||||
#else
|
||||
asprintf(&line, OPAL_LIBDIR_FLAG"%s",
|
||||
options_data[parse_options_idx].path_libdir);
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
opal_argv_append_nosize(&options_data[parse_options_idx].link_flags, line);
|
||||
free(line);
|
||||
}
|
||||
|
@ -43,23 +43,13 @@ static inline char* opal_find_last_path_separator( const char* filename, size_t
|
||||
|
||||
/* First skip the latest separators */
|
||||
for ( ; p >= filename; p-- ) {
|
||||
#if defined(__WINDOWS__)
|
||||
if( (*p != '\\') && (*p != '/') )
|
||||
break;
|
||||
#else
|
||||
if( *p != OPAL_PATH_SEP[0] )
|
||||
break;
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
}
|
||||
|
||||
for ( ; p >= filename; p-- ) {
|
||||
#if defined(__WINDOWS__)
|
||||
if( (*p == '\\') || (*p == '/') )
|
||||
return p;
|
||||
#else
|
||||
if( *p == OPAL_PATH_SEP[0] )
|
||||
return p;
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
}
|
||||
|
||||
return NULL; /* nothing found inside the filename */
|
||||
@ -82,22 +72,6 @@ char *opal_basename(const char *filename)
|
||||
return strdup(filename);
|
||||
}
|
||||
|
||||
/* On Windows, automatically exclude the drive designator */
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
if( isalpha(filename[0]) && (':' == filename[1]) ) {
|
||||
if( strlen(filename) == 2 ) {
|
||||
return strdup(filename);
|
||||
} else if( strlen(filename) == 3 && (sep == filename[2]) ) {
|
||||
return strdup(filename);
|
||||
}
|
||||
filename += 2;
|
||||
if( sep == filename[0] ) {
|
||||
++filename;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Remove trailing sep's (note that we already know that strlen > 0) */
|
||||
tmp = strdup(filename);
|
||||
for (i = strlen(tmp) - 1; i > 0; --i) {
|
||||
|
@ -35,12 +35,6 @@
|
||||
int opal_daemon_init(char *working_dir)
|
||||
{
|
||||
#if defined(HAVE_FORK)
|
||||
#ifndef __WINDOWS__
|
||||
/* it seems that there is an entirely different way to write daemons in
|
||||
WINDOWS land. Firstly, they are called services and the way to
|
||||
go about it is to get a service handle annd then call CreateService()
|
||||
So, I am guessing that this piece of code is called only by UNIX versions */
|
||||
|
||||
pid_t pid;
|
||||
int fd;
|
||||
|
||||
@ -85,10 +79,6 @@ int opal_daemon_init(char *working_dir)
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
#else
|
||||
printf ("This function has not been implemented in windows yet, file %s line %d\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
#endif
|
||||
|
||||
#else /* HAVE_FORK */
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
|
@ -36,7 +36,6 @@
|
||||
|
||||
int opal_few(char *argv[], int *status)
|
||||
{
|
||||
#ifndef __WINDOWS__
|
||||
#if defined(HAVE_FORK) && defined(HAVE_EXECVE) && defined(HAVE_WAITPID)
|
||||
pid_t pid, ret;
|
||||
|
||||
@ -81,47 +80,4 @@ int opal_few(char *argv[], int *status)
|
||||
#else
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD process_stat;
|
||||
char* command = argv[0];
|
||||
char* exec_command;
|
||||
|
||||
ZeroMemory (&si, sizeof(si));
|
||||
ZeroMemory (&pi, sizeof(pi));
|
||||
|
||||
_flushall(); /* Push all output */
|
||||
|
||||
GetStartupInfo (&si);
|
||||
argv[0] = opal_basename( command );
|
||||
exec_command = opal_argv_join( argv, ' ' );
|
||||
free( argv[0] );
|
||||
argv[0] = command;
|
||||
if (!CreateProcess (argv[0],
|
||||
(LPSTR)exec_command,
|
||||
NULL,
|
||||
NULL,
|
||||
TRUE,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
&si,
|
||||
&pi)){
|
||||
*status = (int)GetLastError();
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
/* wait for child to die */
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
if( 0 == GetExitCodeProcess(pi.hProcess, &process_stat) ) {
|
||||
*status = (int)GetLastError();
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
*status = (int)process_stat;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
@ -194,11 +194,7 @@ int opal_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
||||
int error;
|
||||
struct addrinfo hints, *res = NULL, *r;
|
||||
#else
|
||||
#ifndef __WINDOWS__
|
||||
in_addr_t inaddr;
|
||||
#else
|
||||
unsigned long inaddr;
|
||||
#endif
|
||||
struct hostent *h;
|
||||
#endif
|
||||
|
||||
@ -397,8 +393,6 @@ int opal_ifindextomask(int if_index, uint32_t* if_mask, int length)
|
||||
/*
|
||||
* Lookup the interface by opal_list index and return the
|
||||
* flags assigned to the interface.
|
||||
*
|
||||
* Bug: Make return type portable (compatible with Windows)
|
||||
*/
|
||||
|
||||
int opal_ifindextoflags(int if_index, uint32_t* if_flags)
|
||||
|
@ -16,15 +16,11 @@
|
||||
#include "opal/util/output.h"
|
||||
|
||||
#if OPAL_WANT_LIBLTDL
|
||||
#ifndef __WINDOWS__
|
||||
#if OPAL_LIBLTDL_INTERNAL
|
||||
#include "opal/libltdl/ltdl.h"
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#else
|
||||
#include "ltdl.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if OPAL_WANT_LIBLTDL
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -30,11 +30,7 @@
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/constants.h"
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#define OPAL_DEFAULT_TMPDIR "C:\\TEMP"
|
||||
#else
|
||||
#define OPAL_DEFAULT_TMPDIR "/tmp"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Merge two environ-like char arrays, ensuring that there are no
|
||||
@ -206,11 +202,9 @@ int opal_unsetenv(const char *name, char ***env)
|
||||
for (i = 0; (*env)[i] != NULL; ++i) {
|
||||
if (0 != strncmp((*env)[i], compare, len))
|
||||
continue;
|
||||
#if !defined(__WINDOWS__)
|
||||
if (environ != *env) {
|
||||
free((*env)[i]);
|
||||
}
|
||||
#endif
|
||||
for (; (*env)[i] != NULL; ++i)
|
||||
(*env)[i] = (*env)[i + 1];
|
||||
found = true;
|
||||
@ -238,11 +232,6 @@ const char* opal_home_directory( void )
|
||||
{
|
||||
char* home = getenv("HOME");
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
if( NULL == home )
|
||||
home = getenv("USERPROFILE");
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
return home;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -133,16 +133,12 @@ OPAL_DECLSPEC const char* opal_tmp_directory( void );
|
||||
|
||||
/* Some care is needed with environ on OS X when dealing with shared
|
||||
libraries. Handle that care here... */
|
||||
#if !defined(__WINDOWS__)
|
||||
|
||||
#ifdef HAVE__NSGETENVIRON
|
||||
#define environ (*_NSGetEnviron())
|
||||
#else
|
||||
OPAL_DECLSPEC extern char **environ;
|
||||
#endif
|
||||
|
||||
#endif /* !defined(__WINDOWS__) */
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* OPAL_ENVIRON */
|
||||
|
@ -108,17 +108,6 @@ int opal_openpty(int *amaster, int *aslave, char *name,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#elif defined(__WINDOWS__)
|
||||
|
||||
/* yeah, let's assume for the moment that ptys don't work on windows */
|
||||
|
||||
int opal_openpty(int *amaster, int *aslave, char *name,
|
||||
struct termios *termp, struct winsize *winp)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
#elif defined(HAVE_OPENPTY)
|
||||
|
||||
int opal_openpty(int *amaster, int *aslave, char *name,
|
||||
|
@ -84,44 +84,9 @@ int opal_os_dirpath_create(const char *path, const mode_t mode)
|
||||
building up a directory name. Check to see if that dirname
|
||||
exists. If it doesn't, create it. */
|
||||
|
||||
/* Notes about stat(): Windows has funny definitions of what will
|
||||
return 0 from stat(). "C:" will return failure, while "C:\"
|
||||
will return success. Similarly, "C:\foo" will return success,
|
||||
while "C:\foo\" will return failure (assuming that a folder
|
||||
named "foo" exists under C:\).
|
||||
|
||||
POSIX implementations of stat() are generally a bit more
|
||||
forgiving; most will return true for "/foo" and "/foo/"
|
||||
(assuming /foo exists). But we might as well abide by the same
|
||||
rules as Windows and generally disallow checking for names
|
||||
ending with path_sep (the only possible allowable one is
|
||||
checking for "/", which is the root directory, and is
|
||||
guaranteed to exist on valid POSIX filesystems, and is
|
||||
therefore not worth checking for). */
|
||||
|
||||
len = opal_argv_count(parts);
|
||||
for (i = 0; i < len; ++i) {
|
||||
if (i == 0) {
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
/* In the Windows case, check for "<drive>:" case (i.e.,
|
||||
an absolute pathname). If this is the case, ensure
|
||||
that it ends in a path_sep. */
|
||||
|
||||
if (2 == strlen(parts[0]) && isalpha(parts[0][0]) &&
|
||||
':' == parts[0][1]) {
|
||||
strcat(tmp, parts[i]);
|
||||
strcat(tmp, path_sep);
|
||||
}
|
||||
|
||||
/* Otherwise, it's a relative path. Per the comment
|
||||
above, we don't want a '\' at the end, so just append
|
||||
this part. */
|
||||
|
||||
else {
|
||||
strcat(tmp, parts[i]);
|
||||
}
|
||||
#else
|
||||
/* If in POSIX-land, ensure that we never end a directory
|
||||
name with path_sep */
|
||||
|
||||
@ -129,7 +94,6 @@ int opal_os_dirpath_create(const char *path, const mode_t mode)
|
||||
strcat(tmp, path_sep);
|
||||
}
|
||||
strcat(tmp, parts[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If it's not the first part, ensure that there's a
|
||||
@ -178,6 +142,12 @@ int opal_os_dirpath_destroy(const char *path,
|
||||
{
|
||||
int rc, exit_status = OPAL_SUCCESS;
|
||||
bool is_dir = false;
|
||||
DIR *dp;
|
||||
struct dirent *ep;
|
||||
char *filenm;
|
||||
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
|
||||
struct stat buf;
|
||||
#endif
|
||||
|
||||
if (NULL == path) { /* protect against error */
|
||||
return OPAL_ERROR;
|
||||
@ -191,15 +161,6 @@ int opal_os_dirpath_destroy(const char *path,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
{
|
||||
DIR *dp;
|
||||
struct dirent *ep;
|
||||
char *filenm;
|
||||
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
|
||||
struct stat buf;
|
||||
#endif
|
||||
|
||||
/* Open up the directory */
|
||||
dp = opendir(path);
|
||||
if (NULL == dp) {
|
||||
@ -279,76 +240,6 @@ int opal_os_dirpath_destroy(const char *path,
|
||||
|
||||
/* Done with this directory */
|
||||
closedir(dp);
|
||||
}
|
||||
#else
|
||||
{
|
||||
char search_path[MAX_PATH];
|
||||
HANDLE file;
|
||||
WIN32_FIND_DATA file_data;
|
||||
TCHAR *file_name;
|
||||
|
||||
strncpy(search_path, path, strlen(path)+1);
|
||||
strncat (search_path, OPAL_PATH_SEP"*", 3);
|
||||
file = FindFirstFile(search_path, &file_data);
|
||||
|
||||
if (INVALID_HANDLE_VALUE == file) {
|
||||
FindClose(file);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
do {
|
||||
/* Skip . and .. */
|
||||
if ((0 == strcmp(file_data.cFileName, ".")) ||
|
||||
(0 == strcmp(file_data.cFileName, "..")) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
is_dir = false;
|
||||
if(file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
is_dir = true;
|
||||
}
|
||||
/*
|
||||
* If not recursively decending, then if we find a directory then fail
|
||||
* since we were not told to remove it.
|
||||
*/
|
||||
if( is_dir && !recursive) {
|
||||
/* Set the error indicating that we found a directory,
|
||||
* but continue removing files
|
||||
*/
|
||||
exit_status = OPAL_ERROR;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Will the caller allow us to remove this file/directory */
|
||||
if( NULL != cbfunc) {
|
||||
/*
|
||||
* Caller does not wish to remove this file/directory,
|
||||
* continue with the rest of the entries
|
||||
*/
|
||||
if( !cbfunc(path, file_data.cFileName) ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
file_name = opal_os_path(false, path, file_data.cFileName, NULL);
|
||||
if( is_dir ) {
|
||||
if( OPAL_SUCCESS != (rc = opal_os_dirpath_destroy(file_name,
|
||||
recursive,
|
||||
cbfunc) ) ) {
|
||||
exit_status = rc;
|
||||
free(file_name);
|
||||
FindClose(file);
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
DeleteFile(file_name);
|
||||
}
|
||||
free(file_name);
|
||||
} while( 0 != FindNextFile(file, &file_data) );
|
||||
|
||||
FindClose(file);
|
||||
}
|
||||
#endif
|
||||
|
||||
cleanup:
|
||||
|
||||
@ -363,7 +254,6 @@ int opal_os_dirpath_destroy(const char *path,
|
||||
}
|
||||
|
||||
bool opal_os_dirpath_is_empty(const char *path ) {
|
||||
#ifndef __WINDOWS__
|
||||
DIR *dp;
|
||||
struct dirent *ep;
|
||||
|
||||
@ -384,44 +274,10 @@ bool opal_os_dirpath_is_empty(const char *path ) {
|
||||
}
|
||||
|
||||
return true;
|
||||
#else
|
||||
char search_path[MAX_PATH];
|
||||
HANDLE file;
|
||||
WIN32_FIND_DATA file_data;
|
||||
bool found = false;
|
||||
|
||||
if (NULL != path) {
|
||||
strncpy(search_path, path, strlen(path)+1);
|
||||
strncat (search_path, "\\*", 3);
|
||||
|
||||
file = FindFirstFile(search_path, &file_data);
|
||||
if (INVALID_HANDLE_VALUE == file) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
do {
|
||||
if (0 != strcmp(file_data.cFileName, ".") || 0 != strcmp(file_data.cFileName, "..")) {
|
||||
found = true;
|
||||
goto cleanup;
|
||||
}
|
||||
} while (0 != FindNextFile(file, &file_data));
|
||||
}
|
||||
cleanup:
|
||||
FindClose(file);
|
||||
return found;
|
||||
#endif /* ifndef __WINDOWS__ */
|
||||
}
|
||||
|
||||
int opal_os_dirpath_access(const char *path, const mode_t in_mode ) {
|
||||
#ifndef __WINDOWS__
|
||||
struct stat buf;
|
||||
#else
|
||||
# ifndef _MSC_VER
|
||||
struct stat buf;
|
||||
# else
|
||||
struct __stat64 buf;
|
||||
# endif
|
||||
#endif
|
||||
mode_t loc_mode = S_IRWXU; /* looking for full rights */
|
||||
|
||||
/*
|
||||
@ -431,11 +287,7 @@ int opal_os_dirpath_access(const char *path, const mode_t in_mode ) {
|
||||
loc_mode = in_mode;
|
||||
}
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
if (0 == stat(path, &buf)) { /* exists - check access */
|
||||
#else
|
||||
if (0 == _stat64(path, &buf)) { /* exist -- check */
|
||||
#endif
|
||||
if ((buf.st_mode & loc_mode) == loc_mode) { /* okay, I can work here */
|
||||
return(OPAL_SUCCESS);
|
||||
}
|
||||
|
@ -59,9 +59,7 @@ char *opal_os_path(bool relative, ...)
|
||||
strcpy(path, ".");
|
||||
strcat(path, path_sep);
|
||||
} else {
|
||||
#ifndef __WINDOWS__
|
||||
strcpy(path, path_sep);
|
||||
#endif
|
||||
}
|
||||
return(path);
|
||||
}
|
||||
@ -88,12 +86,8 @@ char *opal_os_path(bool relative, ...)
|
||||
}
|
||||
|
||||
va_start(ap, relative);
|
||||
/* Windows does not require to have the initial separator. */
|
||||
if( NULL != (element = va_arg(ap, char*)) ) {
|
||||
if (path_sep[0] != element[0]) {
|
||||
#ifdef __WINDOWS__
|
||||
if( relative )
|
||||
#endif /* __WINDOWS__ */
|
||||
strcat(path, path_sep);
|
||||
}
|
||||
strcat(path, element);
|
||||
|
@ -67,35 +67,9 @@ OPAL_DECLSPEC char *opal_os_path(bool relative, ...) __opal_attribute_malloc__ _
|
||||
|
||||
/**
|
||||
* Convert the path to be OS friendly. On UNIX this function will
|
||||
* be empty, when on Windows it will convert all '/' to '\\' and
|
||||
* eventually remove the '/cygdrive/' from the beginning of the
|
||||
* path (if the configure was runned under Cygwin).
|
||||
* be empty.
|
||||
*/
|
||||
#if defined(__WINDOWS__)
|
||||
static inline char* opal_make_filename_os_friendly( char* filename )
|
||||
{
|
||||
char* p = filename;
|
||||
size_t length;
|
||||
|
||||
if( NULL == filename )
|
||||
return NULL;
|
||||
|
||||
length = strlen(filename);
|
||||
if( strncmp( filename, "/cygdrive/", 10 ) == 0 ) {
|
||||
memmove( filename + 1, filename + 10, length - 10 );
|
||||
filename[0] = filename[1];
|
||||
filename[1] = ':';
|
||||
filename[length - 10 + 1] = '\0';
|
||||
}
|
||||
for( ; *p != '\0'; p++ ) {
|
||||
if( *p == '/' )
|
||||
*p = '\\';
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
#else
|
||||
#define opal_make_filename_os_friendly(PATH) (PATH)
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -60,11 +60,7 @@ typedef struct {
|
||||
bool ldi_syslog;
|
||||
int ldi_syslog_priority;
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
char *ldi_syslog_ident;
|
||||
#else
|
||||
HANDLE ldi_syslog_ident;
|
||||
#endif
|
||||
char *ldi_prefix;
|
||||
int ldi_prefix_len;
|
||||
|
||||
@ -94,7 +90,7 @@ static int output(int output_id, const char *format, va_list arglist);
|
||||
|
||||
|
||||
#define OPAL_OUTPUT_MAX_STREAMS 64
|
||||
#if defined(__WINDOWS__) || defined(HAVE_SYSLOG)
|
||||
#if defined(HAVE_SYSLOG)
|
||||
#define USE_SYSLOG 1
|
||||
#else
|
||||
#define USE_SYSLOG 0
|
||||
@ -164,12 +160,6 @@ bool opal_output_init(void)
|
||||
}
|
||||
|
||||
OBJ_CONSTRUCT(&verbose, opal_output_stream_t);
|
||||
#if defined(__WINDOWS__)
|
||||
{
|
||||
WSADATA wsaData;
|
||||
WSAStartup( MAKEWORD(2,2), &wsaData );
|
||||
}
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
if (opal_output_redirected_to_syslog) {
|
||||
verbose.lds_want_syslog = true;
|
||||
verbose.lds_syslog_priority = opal_output_redirected_syslog_pri;
|
||||
@ -350,10 +340,6 @@ void opal_output_close(int output_id)
|
||||
if (i >= OPAL_OUTPUT_MAX_STREAMS && syslog_opened) {
|
||||
closelog();
|
||||
}
|
||||
#elif defined(__WINDOWS__)
|
||||
if(info[output_id].ldi_syslog_ident != NULL) {
|
||||
DeregisterEventSource(info[output_id].ldi_syslog_ident);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -508,9 +494,6 @@ void opal_output_finalize(void)
|
||||
OBJ_DESTRUCT(&verbose);
|
||||
OBJ_DESTRUCT(&mutex);
|
||||
}
|
||||
#if defined(__WINDOWS__)
|
||||
WSACleanup();
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
@ -626,12 +609,6 @@ static int do_open(int output_id, opal_output_stream_t * lds)
|
||||
info[i].ldi_syslog_ident = NULL;
|
||||
openlog("opal", LOG_PID, LOG_USER);
|
||||
}
|
||||
#elif defined(__WINDOWS__)
|
||||
if (NULL == (info[i].ldi_syslog_ident =
|
||||
RegisterEventSource(NULL, TEXT("opal: ")))) {
|
||||
/* handle the error */
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
#endif
|
||||
syslog_opened = true;
|
||||
info[i].ldi_syslog_priority = lds->lds_syslog_priority;
|
||||
@ -777,13 +754,9 @@ static int open_file(int i)
|
||||
|
||||
/* Make the file be close-on-exec to prevent child inheritance
|
||||
* problems */
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/* TODO: Need to find out the equivalent in windows */
|
||||
if (-1 == fcntl(info[i].ldi_fd, F_SETFD, 1)) {
|
||||
return OPAL_ERR_IN_ERRNO;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -827,12 +800,10 @@ static void free_descriptor(int output_id)
|
||||
}
|
||||
ldi->ldi_file_suffix = NULL;
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
if (NULL != ldi->ldi_syslog_ident) {
|
||||
free(ldi->ldi_syslog_ident);
|
||||
}
|
||||
ldi->ldi_syslog_ident = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -60,15 +60,9 @@ static char *list_env_get(char *var, char **list);
|
||||
|
||||
bool opal_path_is_absolute( const char *path )
|
||||
{
|
||||
#if defined(__WINDOWS__)
|
||||
/* On Windows an absolute path always start with [a-z]:\ or with \\ */
|
||||
if( (isalpha(path[0]) && (':' == path[1])) ||
|
||||
('\\' == path[0]) && ('\\' == path[1]) ) return true;
|
||||
#else
|
||||
if( OPAL_PATH_SEP[0] == *path ) {
|
||||
return true;
|
||||
}
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -367,13 +361,7 @@ char* opal_find_absolute_path( char* app_name )
|
||||
|
||||
if( NULL != abs_app_name ) {
|
||||
char* resolved_path = (char*)malloc(OPAL_PATH_MAX);
|
||||
#if !defined(__WINDOWS__)
|
||||
realpath( abs_app_name, resolved_path );
|
||||
#else
|
||||
#ifdef HAVE_SHLWAPI_H
|
||||
PathCanonicalize(resolved_path, abs_app_name);
|
||||
#endif
|
||||
#endif /* !defined(__WINDOWS__) */
|
||||
if( abs_app_name != app_name ) free(abs_app_name);
|
||||
return resolved_path;
|
||||
}
|
||||
@ -419,10 +407,6 @@ char* opal_find_absolute_path( char* app_name )
|
||||
* statfs(const char *path, struct statfs *buf);
|
||||
* with f_fstypename, contains a string of length MFSTYPENAMELEN
|
||||
* return 0 success, -1 on failure with errno set.
|
||||
* Windows (interix):
|
||||
* statvfs(const char *path, struct statvfs *buf);
|
||||
* with unsigned long f_fsid
|
||||
* return 0 success, -1 on failure with errno set.
|
||||
*/
|
||||
#ifndef LL_SUPER_MAGIC
|
||||
#define LL_SUPER_MAGIC 0x0BD00BD0 /* Lustre magic number */
|
||||
@ -442,7 +426,6 @@ char* opal_find_absolute_path( char* app_name )
|
||||
|
||||
bool opal_path_nfs(char *fname)
|
||||
{
|
||||
#if !defined(__WINDOWS__)
|
||||
int i;
|
||||
int rc;
|
||||
int trials;
|
||||
@ -530,17 +513,12 @@ found:
|
||||
return true;
|
||||
|
||||
#undef FS_TYPES_NUM
|
||||
|
||||
#else
|
||||
return false;
|
||||
#endif /* __WINDOWS__ */
|
||||
}
|
||||
|
||||
int
|
||||
opal_path_df(const char *path,
|
||||
uint64_t *out_avail)
|
||||
{
|
||||
#if !defined(__WINDOWS__)
|
||||
int rc = -1;
|
||||
int trials = 5;
|
||||
int err = 0;
|
||||
@ -582,27 +560,4 @@ opal_path_df(const char *path,
|
||||
path, *out_avail));
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
|
||||
#else /* defined __WINDOWS__ */
|
||||
*out_avail = 0;
|
||||
if (!GetDiskFreeSpaceEx(NULL, (PULARGE_INTEGER)out_avail, NULL, NULL)) {
|
||||
DWORD dwSectorsPerCluster = 0, dwBytesPerSector = 0;
|
||||
DWORD dwFreeClusters = 0, dwTotalClusters = 0;
|
||||
|
||||
if (!GetDiskFreeSpaceA(NULL, &dwSectorsPerCluster,
|
||||
&dwBytesPerSector, &dwFreeClusters, &dwTotalClusters)) {
|
||||
OPAL_OUTPUT_VERBOSE((10, 2, "opal_path_df: GetDiskFreeSpaceA on "
|
||||
"path: %s failed with errno: %d (%s)\n",
|
||||
path, err, strerror(err)));
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
*out_avail = dwFreeClusters * dwSectorsPerCluster * dwBytesPerSector;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((10, 2, "opal_path_df: stat(v)fs states "
|
||||
"path: %s has %"PRIu64 " B of free space.",
|
||||
path, *out_avail));
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
#endif /* !defined(__WINDOWS__) */
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ static char *unable_to_print_msg = "Unable to print stack trace!\n";
|
||||
*
|
||||
* FIXME: Should distinguish for systems, which don't have siginfo...
|
||||
*/
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__)
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE
|
||||
static void show_stackframe (int signo, siginfo_t * info, void * p)
|
||||
{
|
||||
char print_buffer[1024];
|
||||
@ -379,7 +379,7 @@ static void show_stackframe (int signo, siginfo_t * info, void * p)
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
#endif /* OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) */
|
||||
#endif /* OPAL_WANT_PRETTY_PRINT_STACKTRACE */
|
||||
|
||||
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE
|
||||
@ -453,7 +453,7 @@ char *opal_stackframe_output_string(void)
|
||||
*/
|
||||
int opal_util_register_stackhandlers (void)
|
||||
{
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__)
|
||||
#if OPAL_WANT_PRETTY_PRINT_STACKTRACE
|
||||
struct sigaction act, old;
|
||||
char * string_value;
|
||||
char * tmp;
|
||||
@ -535,7 +535,7 @@ int opal_util_register_stackhandlers (void)
|
||||
}
|
||||
}
|
||||
free(string_value);
|
||||
#endif /* OPAL_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) */
|
||||
#endif /* OPAL_WANT_PRETTY_PRINT_STACKTRACE */
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
@ -56,9 +56,7 @@ OPAL_DECLSPEC opal_sys_limits_t opal_sys_limits = {
|
||||
|
||||
int opal_util_init_sys_limits(void)
|
||||
{
|
||||
#ifndef __WINDOWS__
|
||||
struct rlimit rlim, rlim_set;
|
||||
#endif
|
||||
int value;
|
||||
bool set_lims;
|
||||
|
||||
@ -67,9 +65,6 @@ int opal_util_init_sys_limits(void)
|
||||
false, false, (int)false, &value);
|
||||
set_lims = OPAL_INT_TO_BOOL(value);
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
/* George: please insert whatever is needed here someday */
|
||||
#else
|
||||
/* get/set the system limits on number of files we can have open */
|
||||
if (0 <= getrlimit (RLIMIT_NOFILE, &rlim)) {
|
||||
if (set_lims) {
|
||||
@ -110,7 +105,6 @@ int opal_util_init_sys_limits(void)
|
||||
|
||||
/* indicate we initialized the limits structure */
|
||||
opal_sys_limits.initialized = true;
|
||||
#endif
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
x
Ссылка в новой задаче
Block a user