From 4257467fecee52c791b46b6a7a2751edd3874498 Mon Sep 17 00:00:00 2001 From: Prabhanjan Kambadur Date: Fri, 22 Oct 2004 16:06:05 +0000 Subject: [PATCH] this is the big windows commit. there are more things which have gone into this than i can remember. but basically, we are looking for 1. header file and source file protections using #ifdef WIN32 2. new files and directories to support windows functionality 3. appropritate linkage symbols added (OMPI_DECLSPEC) for windows 4. some functions are unimplemented on the windows side. this is mostly because there might not be need to implement it in windows land. eg., forking a daemon off 5. Introduced locking mechanisms for windows This commit was SVN r3286. --- contrib/configure.ac | 824 +++ contrib/find_occurence.pl | 28 + contrib/fix_indent.pl | 41 + contrib/generate_file_list.pl | 19 + contrib/headers.txt | 10 - contrib/offenders.list | 488 -- contrib/results.txt | 63 - include/mpi.h | 1384 ++--- include/ompi_config_bottom.h | 47 +- src/class/ompi_bitmap.h | 19 +- src/class/ompi_free_list.h | 2 +- src/class/ompi_hash_table.h | 32 +- src/class/ompi_list.h | 4 +- src/class/ompi_object.h | 14 +- src/class/ompi_pointer_array.h | 2 +- src/class/ompi_rb_tree.h | 4 +- src/class/ompi_value_array.h | 8 +- src/communicator/comm_cid.c | 2 +- src/communicator/comm_dyn.c | 2 +- src/communicator/communicator.h | 8 +- src/errhandler/errclass.h | 4 +- src/errhandler/errcode-internal.h | 4 +- src/errhandler/errcode.h | 4 +- src/errhandler/errhandler.h | 8 +- src/errhandler/errhandler_predefined.c | 2 +- src/event/WIN32-Code/config.h | 1 - src/event/WIN32-Code/misc.c | 1 + src/event/WIN32-Code/win32.c | 73 +- src/event/compat/sys/_time.h | 2 + src/event/err.c | 1 + src/file/file.h | 4 +- src/group/group.h | 4 +- src/include/malloc.h | 4 +- src/include/sys/atomic.h | 19 +- src/include/sys/win32/atomic.h | 278 + src/include/totalview.h | 2 +- src/include/types.h | 15 +- src/info/info.h | 8 +- src/mca/allocator/allocator.h | 2 +- src/mca/allocator/base/allocator_base_open.c | 7 +- src/mca/allocator/base/base.h | 8 +- src/mca/base/base.h | 34 +- src/mca/base/mca_base_component_repository.c | 4 +- src/mca/base/mca_base_module_exchange.h | 12 +- src/mca/base/mca_base_msgbuf.h | 16 +- src/mca/base/mca_base_open.c | 15 +- src/mca/base/mca_base_param.h | 20 +- src/mca/base/mca_base_param_internal.h | 2 +- src/mca/coll/base/base.h | 36 +- src/mca/coll/base/coll_base_open.c | 8 +- src/mca/coll/basic/coll_basic.h | 4 +- .../coll/demo/coll-demo-version.h.template.in | 19 + src/mca/coll/sm/coll_sm.h | 2 +- src/mca/common/sm/common_sm_mmap.c | 6 + src/mca/common/sm/common_sm_mmap.h | 2 +- src/mca/io/base/base.h | 24 +- src/mca/io/base/io_base_open.c | 8 +- src/mca/llm/base/base.h | 10 +- src/mca/llm/base/base_internal.h | 16 +- src/mca/llm/base/llm_base_open.c | 6 +- src/mca/llm/base/llm_base_parse_hostfile.c | 4 +- src/mca/llm/hostfile/src/llm_hostfile.h | 2 +- src/mca/mpool/base/base.h | 16 +- src/mca/mpool/base/mpool_base_open.c | 6 +- src/mca/mpool/sm/mpool_sm.h | 4 +- src/mca/ns/base/base.h | 52 +- src/mca/ns/base/ns_base_open.c | 6 +- src/mca/ns/base/ns_base_select.c | 7 +- src/mca/ns/ns.h | 3 + src/mca/ns/replica/src/ns_replica.c | 10 +- src/mca/oob/base/base.h | 40 +- src/mca/oob/base/oob_base_open.c | 6 +- src/mca/oob/base/oob_base_ping.c | 6 +- src/mca/oob/base/oob_base_recv.c | 4 +- src/mca/oob/base/oob_base_recv_nb.c | 5 +- src/mca/oob/base/oob_base_send.c | 6 + src/mca/oob/base/oob_base_send_nb.c | 5 +- src/mca/oob/oob.h | 13 +- src/mca/oob/tcp/oob_tcp.c | 8 + src/mca/oob/tcp/oob_tcp.h | 2 +- src/mca/oob/tcp/oob_tcp_addr.c | 8 + src/mca/oob/tcp/oob_tcp_addr.h | 4 + src/mca/oob/tcp/oob_tcp_peer.c | 14 +- src/mca/oob/tcp/oob_tcp_peer.h | 2 + src/mca/pcm/base/base.h | 20 +- src/mca/pcm/base/base_job_track.h | 2 + src/mca/pcm/base/pcm_base_open.c | 7 +- src/mca/pcm/wmi/src/pcm_wmi.h | 2 + src/mca/pcm/wmi/src/pcm_wmi_component.c | 4 +- src/mca/pcmclient/base/base.h | 14 +- src/mca/pcmclient/base/pcmclient_base_open.c | 6 +- src/mca/pcmclient/env/pcmclient_env.c | 12 +- .../pcmclient/env/pcmclient_env_component.c | 4 +- src/mca/pcmclient/rms/pcmclient_rms.c | 6 +- .../pcmclient/rms/pcmclient_rms_component.c | 2 + src/mca/pcmclient/seed/pcmclient_seed.c | 6 +- src/mca/pcmclient/seed/pcmclient_seed.h | 2 +- .../pcmclient/seed/pcmclient_seed_component.c | 2 + .../pcmclient/singleton/pcmclient_singleton.c | 10 +- .../singleton/pcmclient_singleton_component.c | 6 +- src/mca/pml/base/base.h | 14 +- src/mca/pml/base/pml_base_open.c | 6 +- src/mca/pml/base/pml_base_recvreq.h | 3 +- src/mca/pml/base/pml_base_request.h | 2 +- src/mca/pml/base/pml_base_sendreq.h | 2 +- src/mca/pml/pml.h | 2 +- src/mca/pml/teg/src/pml_ptl_array.h | 2 +- src/mca/pml/teg/src/pml_teg.h | 50 +- src/mca/pml/teg/src/pml_teg_proc.h | 2 +- src/mca/pml/teg/src/pml_teg_sendreq.c | 2 +- src/mca/ptl/base/base.h | 16 +- src/mca/ptl/base/ptl_base_comm.h | 4 +- src/mca/ptl/base/ptl_base_fragment.h | 2 +- src/mca/ptl/base/ptl_base_header.h | 5 +- src/mca/ptl/base/ptl_base_open.c | 6 +- src/mca/ptl/base/ptl_base_recvfrag.h | 2 +- src/mca/ptl/base/ptl_base_sendfrag.h | 2 +- src/mca/ptl/self/ptl_self.c | 10 + src/mca/ptl/self/ptl_self_component.c | 10 + src/mca/ptl/tcp/src/ptl_tcp.h | 6 + src/mca/ptl/tcp/src/ptl_tcp_addr.h | 6 + src/mca/ptl/tcp/src/ptl_tcp_component.c | 10 + src/mca/ptl/tcp/src/ptl_tcp_peer.c | 10 + src/mca/ptl/tcp/src/ptl_tcp_peer.h | 6 + src/mca/ptl/tcp/src/ptl_tcp_proc.h | 6 + src/mca/ptl/tcp/src/ptl_tcp_recvfrag.c | 4 + src/mca/ptl/tcp/src/ptl_tcp_recvfrag.h | 14 +- src/mca/ptl/tcp/src/ptl_tcp_sendfrag.c | 4 + src/mca/ptl/tcp/src/ptl_tcp_sendfrag.h | 12 +- src/mca/ptl/tcp/src/ptl_tcp_sendreq.c | 4 + src/mca/ptl/tcp/src/ptl_tcp_sendreq.h | 7 +- src/mca/topo/base/base.h | 50 +- src/mca/topo/base/topo_base_open.c | 6 +- src/mca/topo/unity/src/topo_unity.h | 3 +- src/mpi/c/bindings.h | 2 +- src/mpi/c/comm_compare.c | 24 +- src/mpi/cxx/constants.h | 312 +- src/mpi/cxx/mpicxx.h | 2 +- src/mpi/f77/constants.h | 8 +- src/mpi/runtime/mpiruntime.h | 10 +- src/mpi/runtime/params.h | 6 +- src/op/op.h | 32 +- src/proc/proc.h | 5 +- src/request/grequest.h | 7 +- src/request/request.h | 28 +- src/runtime/ompi_progress.h | 2 +- src/runtime/ompi_rte_wait.c | 62 +- src/runtime/ompi_vm_register.c | 12 +- src/runtime/runtime.h | 52 +- src/runtime/runtime_types.h | 10 +- src/threads/condition_pthread.h | 2 +- src/threads/condition_spinlock.h | 2 +- src/threads/mutex.c | 2 +- src/threads/mutex.h | 11 +- src/threads/mutex_unix.h | 2 +- src/threads/mutex_windows.h | 7 +- src/threads/thread.h | 6 +- src/util/argv.h | 20 +- src/util/bufpack.c | 2 +- src/util/bufpack.h | 21 +- src/util/cmd_line.h | 22 +- src/util/daemon_init.c | 13 +- src/util/daemon_init.h | 2 +- src/util/few.c | 42 +- src/util/few.h | 3 +- src/util/if.c | 134 +- src/util/if.h | 19 +- src/util/malloc.h | 17 +- src/util/numtostr.c | 2 +- src/util/numtostr.h | 5 +- src/util/os_create_dirpath.h | 10 +- src/util/os_path.h | 3 +- src/util/output.c | 27 +- src/util/output.h | 20 +- src/util/path.h | 9 +- src/util/pow2.h | 4 +- src/util/printf.h | 9 +- src/util/proc_info.h | 9 +- src/util/session_dir.c | 73 +- src/util/session_dir.h | 5 +- src/util/show_help.h | 4 +- src/util/strncpy.h | 3 +- src/util/sys_info.c | 39 +- src/util/sys_info.h | 5 +- src/util/universe_setup_file_io.h | 4 +- src/util/varargs.h | 25 + src/win/win.h | 2 +- src/win32/generated_include/config.h | 196 + src/win32/generated_include/libltdl/ltdl.h | 366 ++ src/win32/generated_include/ompi_config.h | 533 ++ .../llm_base_parse_hostfile_lex.c | 1594 ++++++ src/win32/generated_source/ltdl.c | 4489 +++++++++++++++++ .../mca_base_parse_paramfile_lex.c | 1651 ++++++ src/win32/generated_source/show_help_lex.c | 1645 ++++++ src/win32/ompi_misc.h | 40 + src/win32/ompi_time.h | 122 +- src/win32/ompi_util.h | 11 +- src/win32/win_compat.h | 17 +- vcproj/bootproxy/bootproxy.vcproj | 126 + vcproj/console/console.vcproj | 126 + vcproj/mpic++/mpic++.vcproj | 134 + vcproj/mpiexec/mpiexec.vcproj | 122 + vcproj/mpif77/mpif77.vcproj | 134 + vcproj/mpif90/mpif90.vcproj | 134 + vcproj/mpirun/mpirun.vcproj | 125 + vcproj/ompi/ompi.sln | 98 + vcproj/ompi/ompi.vcproj | 2415 +++++++++ vcproj/ompi_info/ompi_info.vcproj | 140 + vcproj/ompid/ompid.vcproj | 143 + vcproj/openmpi/openmpi.vcproj | 128 + vcproj/wrappers/wrappers.vcproj | 134 + win_examples/export/hello.c | 15 + win_examples/export/hello.h | 35 + win_examples/export/main.c | 14 + win_examples/export/makefile | 10 + win_examples/windows_make/component.c | 29 + win_examples/windows_make/component.h | 19 + win_examples/windows_make/loading.c | 36 + win_examples/windows_make/makefile | 10 + 219 files changed, 18134 insertions(+), 2140 deletions(-) create mode 100644 contrib/configure.ac create mode 100755 contrib/find_occurence.pl create mode 100755 contrib/fix_indent.pl create mode 100755 contrib/generate_file_list.pl delete mode 100644 contrib/offenders.list delete mode 100644 contrib/results.txt create mode 100644 src/include/sys/win32/atomic.h create mode 100644 src/mca/coll/demo/coll-demo-version.h.template.in create mode 100644 src/util/varargs.h create mode 100644 src/win32/generated_include/config.h create mode 100644 src/win32/generated_include/libltdl/ltdl.h create mode 100644 src/win32/generated_include/ompi_config.h create mode 100644 src/win32/generated_source/llm_base_parse_hostfile_lex.c create mode 100644 src/win32/generated_source/ltdl.c create mode 100644 src/win32/generated_source/mca_base_parse_paramfile_lex.c create mode 100644 src/win32/generated_source/show_help_lex.c create mode 100644 src/win32/ompi_misc.h create mode 100755 vcproj/bootproxy/bootproxy.vcproj create mode 100755 vcproj/console/console.vcproj create mode 100755 vcproj/mpic++/mpic++.vcproj create mode 100755 vcproj/mpiexec/mpiexec.vcproj create mode 100755 vcproj/mpif77/mpif77.vcproj create mode 100755 vcproj/mpif90/mpif90.vcproj create mode 100755 vcproj/mpirun/mpirun.vcproj create mode 100755 vcproj/ompi/ompi.sln create mode 100755 vcproj/ompi/ompi.vcproj create mode 100755 vcproj/ompi_info/ompi_info.vcproj create mode 100755 vcproj/ompid/ompid.vcproj create mode 100755 vcproj/openmpi/openmpi.vcproj create mode 100755 vcproj/wrappers/wrappers.vcproj create mode 100644 win_examples/export/hello.c create mode 100644 win_examples/export/hello.h create mode 100644 win_examples/export/main.c create mode 100644 win_examples/export/makefile create mode 100644 win_examples/windows_make/component.c create mode 100644 win_examples/windows_make/component.h create mode 100644 win_examples/windows_make/loading.c create mode 100644 win_examples/windows_make/makefile diff --git a/contrib/configure.ac b/contrib/configure.ac new file mode 100644 index 0000000000..189833ced7 --- /dev/null +++ b/contrib/configure.ac @@ -0,0 +1,824 @@ +# -*- shell-script -*- +# +# $HEADER$ +# + + +############################################################################ +# Initialization, version number, and other random setup/init stuff +############################################################################ + +# Init autoconf + +AC_INIT(./src/mpi/c/init.c) +AC_PREREQ(2.58) +AC_CONFIG_AUX_DIR(./config) + +# Get the version of OMPI that we are installing + +OMPI_GET_VERSION($srcdir/VERSION, OMPI) + +AC_SUBST(OMPI_MAJOR_VERSION) +AC_SUBST(OMPI_MINOR_VERSION) +AC_SUBST(OMPI_RELEASE_VERSION) +AC_SUBST(OMPI_ALPHA_VERSION) +AC_SUBST(OMPI_BETA_VERSION) +AC_SUBST(OMPI_SVN_VERSION) +AC_SUBST(OMPI_VERSION) + +# +# Start it up +# + +OMPI_CONFIGURE_SETUP +ompi_show_title "Configuring OMPI version $OMPI_VERSION" +ompi_show_subtitle "Initialization, setup" + +# +# Init automake +# The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and +# VERSION macors +# + +AM_INIT_AUTOMAKE(openmpi, $OMPI_VERSION, 'no') + +# +# GNU C and autotools are inconsistent about whether this is defined +# so let's make it true everywhere for now... +# +AC_GNU_SOURCE + +OMPI_TOP_BUILDDIR="`pwd`" +AC_SUBST(OMPI_TOP_BUILDDIR) +cd "$srcdir" +OMPI_TOP_SRCDIR="`pwd`" +AC_SUBST(OMPI_TOP_SRCDIR) +cd "$OMPI_TOP_BUILDDIR" + +AC_MSG_NOTICE([builddir: $OMPI_TOP_BUILDDIR]) +AC_MSG_NOTICE([srcdir: $OMPI_TOP_SRCDIR]) +if test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"; then + AC_MSG_NOTICE([Detected VPATH build]) +fi + +# Setup the top of the include/ompi_config.h file + +AH_TOP([/* -*- c -*- + * + * $HEADER$ + * + * Function: - OS, CPU and compiler dependent configuration + */ + +#ifndef OMPI_CONFIG_H +#define OMPI_CONFIG_H +]) +AH_BOTTOM([ +#include "ompi_config_bottom.h" +#endif /* OMPI_CONFIG_H */ +]) + +# Other basic setup stuff (shared with components) + +OMPI_BASIC_SETUP + +top_ompi_srcdir="$OMPI_TOP_SRCDIR" +AC_SUBST(top_ompi_srcdir) +top_ompi_builddir="$OMPI_TOP_BUILDDIR" +AC_SUBST(top_ompi_builddir) + +############################################################################ +# Configuration options +############################################################################ + +OMPI_CONFIGURE_OPTIONS + +############################################################################ +# Libtool: part one +# (before C compiler setup) +############################################################################ + +# +# Part one of libtool magic. Enable static so that we have the --with +# tests done up here and can check for OS. Save the values of +# $enable_static and $enable_shared before setting the defaults, +# because if the user specified --[en|dis]able-[static|shared] on the +# command line, they'll already be set. In this way, we can tell if +# the user requested something or if the default was set here. +# + +ompi_enable_shared="$enable_shared" +ompi_enable_static="$enable_static" +AM_ENABLE_SHARED +AM_DISABLE_STATIC + + +############################################################################ +# Check for compilers and preprocessors +############################################################################ +ompi_show_title "Compiler and preprocessor tests" + +################################## +# C compiler characteristics +################################## + +OMPI_SETUP_CC + +# +# Check for some types +# + +AC_CHECK_TYPES(long long) +AC_CHECK_TYPES(long double) +AC_CHECK_TYPES(int8_t) +AC_CHECK_TYPES(uint8_t) +AC_CHECK_TYPES(int16_t) +AC_CHECK_TYPES(uint16_t) +AC_CHECK_TYPES(int32_t) +AC_CHECK_TYPES(uint32_t) +AC_CHECK_TYPES(int64_t) +AC_CHECK_TYPES(uint64_t) +AC_CHECK_TYPES(intptr_t) +AC_CHECK_TYPES(uintptr_t) + +# +# Check for type sizes +# + +AC_CHECK_SIZEOF(char) +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +if test $ac_cv_type_long_long = yes; then + AC_CHECK_SIZEOF(long long) +fi +if test $ac_cv_type_long_double = yes; then + AC_CHECK_SIZEOF(long double) +fi +AC_CHECK_SIZEOF(float) +AC_CHECK_SIZEOF(double) +AC_CHECK_SIZEOF(void *) + +# +# Check for type alignments +# + +OMPI_C_GET_ALIGNMENT(char, OMPI_ALIGNMENT_CHAR) +OMPI_C_GET_ALIGNMENT(short, OMPI_ALIGNMENT_SHORT) +OMPI_C_GET_ALIGNMENT(wchar_t, OMPI_ALIGNMENT_WCHAR) +OMPI_C_GET_ALIGNMENT(int, OMPI_ALIGNMENT_INT) +OMPI_C_GET_ALIGNMENT(long, OMPI_ALIGNMENT_LONG) +if test $ac_cv_type_long_long = yes; then + OMPI_C_GET_ALIGNMENT(long long, OMPI_ALIGNMENT_LONG_LONG) +fi +OMPI_C_GET_ALIGNMENT(float, OMPI_ALIGNMENT_FLOAT) +OMPI_C_GET_ALIGNMENT(double, OMPI_ALIGNMENT_DOUBLE) +if test $ac_cv_type_long_double = yes; then + OMPI_C_GET_ALIGNMENT(long double, OMPI_ALIGNMENT_LONG_DOUBLE) +fi +OMPI_C_GET_ALIGNMENT(void *, OMPI_ALIGNMENT_VOID_P) + +# +# Check for other compiler characteristics +# + +if test "$GCC" = "yes"; then + + # gcc 2.96 will emit oodles of warnings if you use "inline" with + # -pedantic (which we do in developer builds). However, + # "__inline__" is ok. So we have to force gcc to select the + # right one. If you use -pedantic, the AC_C_INLINE test will fail + # (because it names a function foo() -- without the (void)). So + # we turn off all the picky flags, turn on -ansi mode (which is + # implied by -pedantic), and set warnings to be errors. Hence, + # this does the following (for 2.96): + # + # - causes the check for "inline" to emit a warning, which then + # fails + # - checks for __inline__, which then emits no error, and works + # + # This also works nicely for gcc 3.x because "inline" will work on + # the first check, and all is fine. :-) + + CFLAGS_save="$CFLAGS" + CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY -Werror -ansi" +fi +AC_C_INLINE +AC_C_RESTRICT +OMPI_C_WEAK_SYMBOLS +if test "$GCC" = "yes"; then + CFLAGS="$CFLAGS_save" +fi + +# If we want the profiling layer: +# - If the C compiler has weak symbols, use those. +# - If not, then set to compile the code again with #define's in a +# separate directory. + +if test "$WANT_WEAK_SYMBOLS" = "0"; then + OMPI_C_HAVE_WEAK_SYMBOLS=0 +fi +if test "$WANT_MPI_PROFILING" = "1"; then + if test "$OMPI_C_HAVE_WEAK_SYMBOLS" = "1"; then + OMPI_PROFILING_COMPILE_SEPARATELY=0 + else + OMPI_PROFILING_COMPILE_SEPARATELY=1 + fi +else + OMPI_PROFILING_COMPILE_SEPARATELY=0 +fi + +# +# There are 2 layers to the MPI Language binidings One layer generates +# MPI_* bindings. The other layer generates PMPI_* bindings. The +# following conditions determine whether each (or both) these layers +# are built. +# 1. MPI_* bindings are needed if: +# - Profiling is not required +# - Profiling is required but weak symbols are not +# supported +# 2. PMPI_* bindings are needed if profiling is required. Hence we +# define 2 conditionals which tell us whether each of these layers +# need to be built or NOT +# + +AM_CONDITIONAL(WANT_MPI_BINDINGS_LAYER, + test "$WANT_MPI_PROFILING" = 0 -o "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1) + +AM_CONDITIONAL(WANT_PMPI_BINDINGS_LAYER, + test "$WANT_MPI_PROFILING" = 1) +AM_CONDITIONAL(COMPILE_PROFILING_SEPARATELY, + test "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1) +AC_DEFINE_UNQUOTED(OMPI_ENABLE_MPI_PROFILING, $WANT_MPI_PROFILING, + [Whether we want MPI profiling or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_WEAK_SYMBOLS, $OMPI_C_HAVE_WEAK_SYMBOLS, + [Wehther we have weak symbols or not]) + + +################################## +# C++ compiler characteristics +################################## + +OMPI_SETUP_CXX + +# check for type sizes + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +#AC_CHECK_SIZEOF(BOOL) + +# check for type alignments + +#OMPI_C_GET_ALIGNMENT(BOOL, OMPI_ALIGNMENT_CXX_BOOL) +AC_LANG_RESTORE + +# check if we want C++ support + +AM_CONDITIONAL(WANT_MPI_CXX_BINDINGS, + test "$WANT_MPI_CXX_SUPPORT" = 1) +AC_DEFINE_UNQUOTED(OMPI_WANT_CXX_BINDINGS, $WANT_MPI_CXX_SUPPORT, + [Whether we want MPI cxx support or not]) + + +################################## +# Fortran +################################## + +OMPI_HAVE_FORTRAN_INTEGER1=0 +OMPI_HAVE_FORTRAN_INTEGER2=0 +OMPI_HAVE_FORTRAN_INTEGER4=0 +OMPI_HAVE_FORTRAN_INTEGER8=0 +OMPI_HAVE_FORTRAN_INTEGER16=0 +OMPI_HAVE_FORTRAN_REAL4=0 +OMPI_HAVE_FORTRAN_REAL8=0 +OMPI_HAVE_FORTRAN_REAL16=0 +OMPI_HAVE_FORTRAN_COMPLEX8=0 +OMPI_HAVE_FORTRAN_COMPLEX16=0 +OMPI_HAVE_FORTRAN_COMPLEX32=0 + +OMPI_SIZEOF_FORTRAN_INT=0 +OMPI_SIZEOF_FORTRAN_REAL=0 +OMPI_SIZEOF_FORTRAN_DBLPREC=0 +OMPI_SIZEOF_FORTRAN_COMPLEX=0 +OMPI_SIZEOF_FORTRAN_DBLCOMPLEX=0 + +OMPI_ALIGNMENT_FORTRAN_INT=0 +OMPI_ALIGNMENT_FORTRAN_REAL=0 +OMPI_ALIGNMENT_FORTRAN_DBLPREC=0 +OMPI_ALIGNMENT_FORTRAN_COMPLEX=0 +OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX=0 + +OMPI_SETUP_F77 +OMPI_F77_FIND_EXT_SYMBOL_CONVENTION($OMPI_F77) + +# Even if we don't want fortran support, we have to have a size for +# INTEGER because it's needed to define MPI_Fint, which is part of +# mpi.h. Hence, if we don't want fortran support, we set the size of +# Fortran INTEGER's to sizeof(int). +# +# Similarly, we need C types for LOGICAL, REAL, and DOUBLE PRECISION +# for the MPI_Op reduction back-end routines. + +if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then + OMPI_SIZEOF_FORTRAN_LOGICAL=$ac_cv_sizeof_int + OMPI_SIZEOF_FORTRAN_INT=$ac_cv_sizeof_int + OMPI_SIZEOF_FORTRAN_REAL=$ac_cv_sizeof_float + OMPI_SIZEOF_FORTRAN_DBLPREC=$ac_cv_sizeof_double +else + # If we want fortran support, then get the sizes and alignments of + # all the rest of the fortran types + + OMPI_F77_CHECK_TYPE(INTEGER*1, OMPI_HAVE_FORTRAN_INTEGER1) + OMPI_F77_CHECK_TYPE(INTEGER*2, OMPI_HAVE_FORTRAN_INTEGER2) + OMPI_F77_CHECK_TYPE(INTEGER*4, OMPI_HAVE_FORTRAN_INTEGER4) + OMPI_F77_CHECK_TYPE(INTEGER*8, OMPI_HAVE_FORTRAN_INTEGER8) + OMPI_F77_CHECK_TYPE(INTEGER*16, OMPI_HAVE_FORTRAN_INTEGER16) + + OMPI_F77_CHECK_TYPE(REAL*4, OMPI_HAVE_FORTRAN_REAL4) + OMPI_F77_CHECK_TYPE(REAL*8, OMPI_HAVE_FORTRAN_REAL8) + OMPI_F77_CHECK_TYPE(REAL*16, OMPI_HAVE_FORTRAN_REAL16) + + OMPI_F77_CHECK_TYPE(COMPLEX*8, OMPI_HAVE_FORTRAN_COMPLEX8) + OMPI_F77_CHECK_TYPE(COMPLEX*16, OMPI_HAVE_FORTRAN_COMPLEX16) + OMPI_F77_CHECK_TYPE(COMPLEX*32, OMPI_HAVE_FORTRAN_COMPLEX32) + + OMPI_F77_GET_SIZEOF(LOGICAL, OMPI_SIZEOF_FORTRAN_LOGICAL) + OMPI_F77_GET_SIZEOF(INTEGER, OMPI_SIZEOF_FORTRAN_INT) + OMPI_F77_GET_SIZEOF(REAL, OMPI_SIZEOF_FORTRAN_REAL) + OMPI_F77_GET_SIZEOF(DOUBLE PRECISION, OMPI_SIZEOF_FORTRAN_DBLPREC) + OMPI_F77_GET_SIZEOF(COMPLEX, OMPI_SIZEOF_FORTRAN_COMPLEX) + OMPI_F77_GET_SIZEOF(DOUBLE COMPLEX, OMPI_SIZEOF_FORTRAN_DBLCOMPLEX) + + OMPI_F77_GET_ALIGNMENT(LOGICAL, OMPI_ALIGNMENT_FORTRAN_LOGICAL) + OMPI_F77_GET_ALIGNMENT(INTEGER, OMPI_ALIGNMENT_FORTRAN_INT) + OMPI_F77_GET_ALIGNMENT(REAL, OMPI_ALIGNMENT_FORTRAN_REAL) + OMPI_F77_GET_ALIGNMENT(DOUBLE PRECISION, OMPI_ALIGNMENT_FORTRAN_DBLPREC) + OMPI_F77_GET_ALIGNMENT(COMPLEX, OMPI_ALIGNMENT_FORTRAN_COMPLEX) + OMPI_F77_GET_ALIGNMENT(DOUBLE COMPLEX, OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX) +fi + +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER1, $OMPI_HAVE_FORTRAN_INTEGER1, + [Whether we have FORTRAN INTEGER1 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER2, $OMPI_HAVE_FORTRAN_INTEGER2, + [Whether we have FORTRAN INTEGER2 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER4, $OMPI_HAVE_FORTRAN_INTEGER4, + [Whether we have FORTRAN INTEGER4 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER8, $OMPI_HAVE_FORTRAN_INTEGER8, + [Whether we have FORTRAN INTEGER8 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER16, $OMPI_HAVE_FORTRAN_INTEGER16, + [Whether we have FORTRAN INTEGER16 or not]) + +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_REAL4, $OMPI_HAVE_FORTRAN_REAL4, + [Whether we have FORTRAN REAL4 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_REAL8, $OMPI_HAVE_FORTRAN_REAL8, + [Whether we have FORTRAN REAL8 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_REAL16, $OMPI_HAVE_FORTRAN_REAL16, + [Whether we have FORTRAN REAL16 or not]) + +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_COMPLEX8, $OMPI_HAVE_FORTRAN_COMPLEX8, + [Whether we have FORTRAN COMPLEX8 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_COMPLEX16, $OMPI_HAVE_FORTRAN_COMPLEX16, + [Whether we have FORTRAN COMPLEX16 or not]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_COMPLEX32, $OMPI_HAVE_FORTRAN_COMPLEX32, + [Whether we have FORTRAN COMPLEX32 or not]) + +AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_LOGICAL, $OMPI_SIZEOF_FORTRAN_LOGICAL, + [Size of fortran logical]) +AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_INT, $OMPI_SIZEOF_FORTRAN_INT, + [Size of fortran integer]) +AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_REAL, $OMPI_SIZEOF_FORTRAN_REAL, + [Size of fortran real]) +AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_DBLPREC, $OMPI_SIZEOF_FORTRAN_DBLPREC, + [Size of fortran double precision]) +AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_COMPLEX, $OMPI_SIZEOF_FORTRAN_COMPLEX, + [Size of fortran complex]) +AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_DBLCOMPLEX, + $OMPI_SIZEOF_FORTRAN_DBLCOMPLEX, + [Size of fortran double complex]) + +AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_LOGICAL, + $OMPI_ALIGNMENT_FORTRAN_LOGICAL, + [Alignment of fortran logical]) +AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_INT, $OMPI_ALIGNMENT_FORTRAN_INT, + [Alignment of fortran integer]) +AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_REAL, $OMPI_ALIGNMENT_FORTRAN_REAL, + [alignment of fortran real]) +AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLPREC, + $OMPI_ALIGNMENT_FORTRAN_DBLPREC, + [Alignment of fortran double precision]) +AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_COMPLEX, + $OMPI_ALIGNMENT_FORTRAN_COMPLEX, + [Alignment of fortran complex]) +AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX, + $OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX, + [Alignment of fortran double complex]) + +# +# There are 2 layers to the MPI f77 layer. The only extra thing that +# determine f77 bindings is that fortran can be disabled by user. In +# such cases, we need to not build the target at all. One layer +# generates MPI_f77* bindings. The other layer generates PMPI_f77* +# bindings. The following conditions determine whether each (or both) +# these layers are built. +# +# Superceeding clause: +# - fortran77 bindings should be enabled, else everything is +# disabled +# 1. MPI_f77* bindings are needed if: +# - Profiling is not required +# - Profiling is required but weak symbols are not +# supported +# 2. PMPI_* bindings are needed if profiling is required. Hence we +# define 2 conditionals which tell us whether each of these layers +# need to be built or NOT +# +AM_CONDITIONAL(WANT_MPI_F77_BINDINGS_LAYER, + test \( "$WANT_MPI_PROFILING" = 0 -o "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1 \) -a "$OMPI_WANT_F77_BINDINGS" = 1) + +AM_CONDITIONAL(WANT_PMPI_F77_BINDINGS_LAYER, + test "$OMPI_WANT_F77_BINDINGS" = 1 -a "$WANT_MPI_PROFILING" = 1) + +# +# Fortran 90 setup +# + +################################## +# Header files +################################## + +ompi_show_title "Header file tests" + +AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h dlfcn.h \ + inttypes.h libgen.h net/if.h netdb.h netinet/in.h netinet/tcp.h \ + poll.h pthread.h pwd.h sched.h stdint.h strings.h stropts.h \ + sys/ipc.h sys/mman.h sys/resource.h sys/select.h sys/socket.h \ + sys/statvfs.h sys/time.h sys/uio.h sys/utsname.h sys/wait.h \ + syslog.h termios.h ulimit.h unistd.h]) + +# snprintf declaration +# gethostname declaration +# headers: +# stropts.h grh.h netinet/tcp.h sys/select.h sys/resource.h pty.h util.h +# rpc/types.h rpc/xdr.h sched.h strings.h + +# SA_RESTART in signal.h +# sa_len in struct sockaddr +# union semun in sys/sem.h + +# Note that sometimes we have , but it doesn't work (e.g., +# have both Portland and GNU installed; using pgcc will find GNU's +# , which all it does -- by standard -- is define "bool" to +# "_Bool" [see +# http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html], +# and Portland has no idea what to do with _Bool). + +# So first figure out if we have (i.e., check the value of +# the macro HAVE_STDBOOL_H from the result of AC_CHECK_HEADERS, +# above). If we do have it, then check to see if it actually works. +# Define OMPI_USE_STDBOOL_H as approrpaite. +AC_CHECK_HEADERS([stdbool.h], [have_stdbool_h=1], [have_stdbool_h=0]) +AC_MSG_CHECKING([if works]) +if test "$have_stdbool_h" = "1"; then + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ +AC_INCLUDES_DEFAULT +#if HAVE_STDBOOL_H +#include +#endif]], +[[bool bar, foo = true; bar = foo;]]), +[OMPI_USE_STDBOOL_H=1 MSG=yes],[OMPI_USE_STDBOOL_H=0 MSG=no]) +else + OMPI_USE_STDBOOL_H=0 + MSG="no (don't have )" +fi +AC_DEFINE_UNQUOTED(OMPI_USE_STDBOOL_H, $OMPI_USE_STDBOOL_H, + [Whether to use or not]) +AC_MSG_RESULT([$MSG]) + + +################################## +# Libraries +################################## + +ompi_show_title "Library and Function tests" + +# -lsocket +# -lnsl +# -lutil (openpty) +# openpty +# atexit +# getcwd +# snprintf +# atoll +# strtoll +# yield +# sched_yield +# vscanf + +AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf]) + +# +# Make sure we can copy va_lists (need check declared, not linkable) +# + +AC_CHECK_DECL(va_copy, OMPI_HAVE_VA_COPY=1, OMPI_HAVE_VA_COPY=0, + [#include ]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_VA_COPY, $OMPI_HAVE_VA_COPY, + [Whether we have va_copy or not]) + +AC_CHECK_DECL(__va_copy, OMPI_HAVE_UNDERSCORE_VA_COPY=1, + OMPI_HAVE_UNDERSCORE_VA_COPY=0, [#include ]) +AC_DEFINE_UNQUOTED(OMPI_HAVE_UNDERSCORE_VA_COPY, $OMPI_HAVE_UNDERSCORE_VA_COPY, + [Whether we have __va_copy or not]) + + +################################## +# System-specific tests +################################## + +ompi_show_title "System-specific tests" + +# +# Determine corresponding C types for Fortran: LOGICAL, INTEGER, REAL, +# DOUBLE PRECISION. If we don't have a fortran compiler, assume some +# sensible defaults (although the values don't really matter). We +# need these types for the back-end MPI_Op reduction functions, +# regardless of whether we have a fortran compiler or not. +# + +if test "$OMPI_F77" != "none"; then + OMPI_FIND_TYPE(Fortran LOGICAL, FORTRAN_LOGICAL, + char int int32_t) + OMPI_FIND_TYPE(Fortran INTEGER, FORTRAN_INT, + int32_t int intr64_t long:long long) + OMPI_FIND_TYPE(Fortran REAL, FORTRAN_REAL, + float double long:double) + OMPI_FIND_TYPE(Fortran DOUBLE PRECISION, FORTRAN_DBLPREC, + float double long:double) +else + MPI_FORTRAN_LOGICAL_TYPE=char + MPI_FORTRAN_INT_TYPE=int + MPI_FORTRAN_REAL_TYPE=float + MPI_FORTRAN_DBLPREC_TYPE=double + AC_MSG_WARN([*** WARNING: Did not detect a f77 compiler. Assuming default corresponding types]) + AC_MSG_WARN([*** Fortran LOGICAL = C $MPI_FORTRAN_LOGICAL_TYPE]) + AC_MSG_WARN([*** Fortran INTEGER = C $MPI_FORTRAN_INT_TYPE]) + AC_MSG_WARN([*** Fortran REAL = C $MPI_FORTRAN_REAL_TYPE]) + AC_MSG_WARN([*** Fortran DOUBLE PRECISION = C $MPI_FORTRAN_DBLPREC_TYPE]) +fi +AC_DEFINE_UNQUOTED(MPI_Fint, $MPI_FORTRAN_INT_TYPE, + [C type corresponding to Fortran INTEGER]) + +AC_DEFINE_UNQUOTED(ompi_fortran_logical_t, $MPI_FORTRAN_LOGICAL_TYPE, + [C type corresponding to Fortran LOGICAL]) +AC_DEFINE_UNQUOTED(ompi_fortran_integer_t, $MPI_FORTRAN_INT_TYPE, + [C type corresponding to Fortran LOGICAL]) +AC_DEFINE_UNQUOTED(ompi_fortran_real_t, $MPI_FORTRAN_REAL_TYPE, + [C type corresponding to Fortran REAL]) +AC_DEFINE_UNQUOTED(ompi_fortran_dblprec_t, $MPI_FORTRAN_DBLPREC_TYPE, + [C type corresponding to Fortran DOUBLE PRECISION]) + +# +# Test to determine type of MPI_Offset. This is searched in the following order +# int64_t, long long, long, int. If none of these are 8 bytes, then we should +# search for int32_t, long long, long, int. +# +MPI_OFFSET_TYPE="not found" +AC_MSG_CHECKING([checking for type of MPI_Offset]) +if test "$ac_cv_type_int64_t" == "yes"; then + MPI_OFFSET_TYPE=int64_t +elif test "$ac_cv_type_long_long_t" == "yes" -a "$ac_cv_sizeof_long_long" == 8; then + MPI_OFFSET_TYPE="long long" +elif test "$ac_cv_type_long_t" == "yes" -a "$ac_cv_sizeof_long" == 8; then + MPI_OFFSET_TYPE="long" +elif test "ac_cv_sizeof_int" == 8; then + MPI_OFFSET_TYPE=int +elif test "$ac_cv_type_int32_t" == "yes"; then + MPI_OFFSET_TYPE=int32_t +elif test "$ac_cv_type_long_long_t" == "yes" -a "$ac_cv_sizeof_long_long" == 4; then + MPI_OFFSET_TYPE="long long" +elif test "$ac_cv_type_long_t" == "yes" -a "$ac_cv_sizeof_long" == 4; then + MPI_OFFSET_TYPE="long" +elif test "ac_cv_sizeof_int" == 4; then + MPI_OFFSET_TYPE=int +fi +AC_MSG_RESULT([$MPI_OFFSET_TYPE]) +if test "$MPI_FINT_TYPE" = "not found"; then + AC_MSG_WARN([*** WARNING: Unable to find the right definition for MPI_Offset]) + AC_MSG_ERROR([Cannot continue]) +fi +AC_DEFINE_UNQUOTED(MPI_Offset, $MPI_OFFSET_TYPE, [Type of MPI_Offset]) + + +# all: endian +# all: SYSV semaphores +# all: SYSV shared memory +# all: thread flavor +# all: size of FD_SET +# all: FD passing (or not!!) +# all: BSD vs. SYSV ptys +# all: sizeof struct stat members +# all: type of getsockopt optlen +# all: type of recvfrom optlen + +# +# Check out what thread support we have +# + +OMPI_CONFIG_THREADS +CFLAGS="$CFLAGS $THREAD_CFLAGS" +CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS" +CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" +CXXCPPFLAGS="$CXXCPPFLAGS $THREAD_CXXCPPFLAGS" +LDFLAGS="$LDFLAGS $THREAD_LDFLAGS" +LIBS="$LIBS $THREAD_LIBS" + +WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $THREAD_CFLAGS" +WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $THREAD_CXXFLAGS" +WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $THREAD_FFLAGS" +WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $THREAD_FFLAGS" +WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $THREAD_LDFLAGS" +WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $THREAD_LIBS" + +# +# What is the local equivalent of "ln -s" +# + +AC_PROG_LN_S + +# +# We need as and lex +# +AM_PROG_AS +AM_PROG_LEX + +# If we don't have GNU Flex and we don't have a generated .c file +# (distribution tarballs will have the .c file included, but SVN +# checkouts will not), then error. Must have GNU Flex -- other +# versions of Lex are not workable (all things being equal, since this +# is *only* required for developers, we decided that it really was not +# worth it to be portable between different versions of lex ;-). + +if test -z "$LEX" -o -n "`echo $LEX | grep missing`" -o \ + "`basename $LEX`" != "flex"; then + if test ! -f "$srcdir/src/util/show_help_lex.c"; then + AC_MSG_WARN([*** Could not find GNU Flex on your system.]) + AC_MSG_WARN([*** GNU Flex required for developer builds of Open MPI.]) + AC_MSG_WARN([*** Other versions of Lex are not supported.]) + AC_MSG_WARN([*** YOU DO NOT NEED FLEX FOR DISTRIBUTION TARBALLS!]) + AC_MSG_WARN([*** If you absolutely cannot install GNU Flex on this system]) + AC_MSG_WARN([*** consider using a distribution tarball, or generate the]) + AC_MSG_WARN([*** following files on another system (using Flex) and]) + AC_MSG_WARN([*** copy them here:]) + for lfile in `find . -name \*.l -print`; do + cfile="`echo $lfile | cut -d. -f-2`" + AC_MSG_WARN([*** $cfile.c]) + done + AC_MSG_ERROR([Cannot continue]) + fi +fi + +# +# File system case sensitivity +# + +OMPI_CASE_SENSITIVE_FS_SETUP + +# AIX: FIONBIO in sys/ioctl.h +# glibc: memcpy + + +################################## +# MCA +################################## + +ompi_show_title "MPI Component Architecture (MCA) setup -- not required now " + +############################################################################ +# Final top-level OMPI configuration +############################################################################ + +ompi_show_title "Final top-level OMPI configuration" + +############################################################################ +# Libevent setup +############################################################################ + +ompi_show_subtitle "Libevent 3rd party event handler" +CFLAGS_save="$CFLAGS" +CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY" +OMPI_SETUP_LIBEVENT +CFLAGS="$CFLAGS_save" + + +############################################################################ +# Libtool: part two +# (after C compiler setup) +############################################################################ + +ompi_show_subtitle "Libtool configuration skipped" + +WANT_LIBLTDL = 0; +AC_DEFINE_UNQUOTED(OMPI_WANT_LIBLTDL, $WANT_LIBLTDL, + [Whether to include support for libltdl or not]) + + +############################################################################ +# final wrapper compiler config +############################################################################ + +ompi_show_subtitle "Wrapper compiler flags" + +# +# This is needed for VPATH builds, so that it will -I the appropriate +# include directory (don't know why automake doesn't do this +# automatically). We delayed doing it until now just so that +# '-I$(top_srcdir)' doesn't show up in any of the configure output -- +# purely aesthetic. +# + +CPPFLAGS='-I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/src'" $CPPFLAGS" +CXXCPPFLAGS='-I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/src'" $CXXCPPFLAGS" + +# +# Adding WRAPPER_* flags so that extra flags needed for wrappper compilers +# +# WRAPPER_EXTRA_CFLAGS +# +AC_MSG_CHECKING([for mpicc CFLAGS]) +OMPI_UNIQ(WRAPPER_EXTRA_CFLAGS) +AC_SUBST(WRAPPER_EXTRA_CFLAGS) +AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$WRAPPER_EXTRA_CFLAGS", + [Additional CFLAGS to pass through the wrapper compilers]) +AC_MSG_RESULT([$WRAPPER_EXTRA_CFLAGS]) + +# +# WRAPPER_EXTRA_CXXFLAGS +# +AC_MSG_CHECKING([for mpiCC CXXFLAGS]) +OMPI_UNIQ(WRAPPER_EXTRA_CXXFLAGS) +AC_SUBST(WRAPPER_EXTRA_CXXFLAGS) +AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS, "$WRAPPER_EXTRA_CXXFLAGS", + [Additional CXXFLAGS to pass through the wrapper compilers]) +AC_MSG_RESULT([$WRAPPER_EXTRA_CXXFLAGS]) + +# +# WRAPPER_EXTRA_FFLAGS +# +AC_MSG_CHECKING([for mpif77/mpif90 FFLAGS]) +OMPI_UNIQ(WRAPPER_EXTRA_FFLAGS) +AC_SUBST(WRAPPER_EXTRA_FFLAGS) +AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS, "$WRAPPER_EXTRA_FFLAGS", + [Additional FFLAGS to pass through the wrapper compilers]) +AC_MSG_RESULT([$WRAPPER_EXTRA_FFLAGS]) + +# +# WRAPPER_EXTRA_FCFLAGS +# +AC_MSG_CHECKING([for mpif77/mpif90 FCFLAGS]) +OMPI_UNIQ(WRAPPER_EXTRA_FCFLAGS) +AC_SUBST(WRAPPER_EXTRA_FCFLAGS) +AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS", + [Additional FCFLAGS to pass through the wrapper compilers]) +AC_MSG_RESULT([$WRAPPER_EXTRA_FCFLAGS]) + +# +# WRAPPER_EXTRA_LDFLAGS +# +AC_MSG_CHECKING([for wrapper compiler LDFLAGS]) +OMPI_UNIQ(WRAPPER_EXTRA_LDFLAGS) +AC_SUBST(WRAPPER_EXTRA_LDFLAGS) +AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LDFLAGS, "$WRAPPER_EXTRA_LDFLAGS", + [Additional LDFLAGS to pass through the wrapper compilers]) +AC_MSG_RESULT([$WRAPPER_EXTRA_LDFLAGS]) + +# +# WRAPPER_EXTRA_LIBS +# +AC_MSG_CHECKING([for wrapper compiler LIBS]) +AC_SUBST(WRAPPER_EXTRA_LIBS) +AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LIBS, "$WRAPPER_EXTRA_LIBS", + [Additional LIBS to pass through the wrapper compilers]) +AC_MSG_RESULT([$WRAPPER_EXTRA_LIBS]) + +# +# Delayed the substitution of CFLAGS and CXXFLAGS until now because +# they may have been modified throughout the course of this script. +# + +AC_SUBST(CFLAGS) +AC_SUBST(CPPFLAGS) +AC_SUBST(CXXFLAGS) +AC_SUBST(CXXCPPFLAGS) +AC_SUBST(FFLAGS) +AC_SUBST(FCFLAGS) + + +############################################################################ +# Party on +############################################################################ + +ompi_show_subtitle "Final output" + +AM_CONFIG_HEADER([include/ompi_config.h]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/contrib/find_occurence.pl b/contrib/find_occurence.pl new file mode 100755 index 0000000000..d3b11fa459 --- /dev/null +++ b/contrib/find_occurence.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +if (scalar(@ARGV) != 2) { + print "Usage: #find_occurence \n"; + exit(3); +} + +$search_string = @ARGV[0]; +$source_path = @ARGV[1]; + +open (SOURCE_FILES, "find $source_path -name *.c |") || print "could not open the pipe\n"; +while () { + + #open the file and delete the occurence + + $file_name = $_; + + open (FILE, "$file_name") || print "Could not open $file_name for reading\n"; + + while () { + if (/$search_string/) { + print $file_name; + } + } + close(FILE); +} + +close(SOURCE_FILES); diff --git a/contrib/fix_indent.pl b/contrib/fix_indent.pl new file mode 100755 index 0000000000..a9f416366d --- /dev/null +++ b/contrib/fix_indent.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl +#To keep brian happy + +if (scalar(@ARGV) != 1) { + print "We need a source tree path\n"; + exit(3); +} + +$source_path = @ARGV[0]; + +open(HEADERS, "find $source_path -name *.h |"); +while() { + open(TEMP, ">temp.txt"); + $file_name = $_; + print $file_name; + open(FILE, "$file_name"); + while() { + s/^(#)([\s|\t]*)(\w)/$1$3/; + print TEMP; + } + close(TEMP); + close(FILE); + system("mv temp.txt $file_name"); +} +close(HEADERS); + +open(SOURCES, "find $source_path -name *.c |"); +while() { + open(TEMP, ">temp.txt"); + $file_name = $_; + print $file_name; + open(FILE, "$file_name"); + while() { + s/^(#)([\s|\t]*)(\w)/$1$3/; + print TEMP; + } + close(TEMP); + close(FILE); + system("mv temp.txt $file_name"); +} +close(SOURCES); diff --git a/contrib/generate_file_list.pl b/contrib/generate_file_list.pl new file mode 100755 index 0000000000..aebdeb87ef --- /dev/null +++ b/contrib/generate_file_list.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +if (scalar(@ARGV) != 1) { + print "Usage: generate_file_list \n"; + exit(3); +} + +$file_name = @ARGV[0]; +open(FILE,"$file_name") || print "File count not be opened\n"; +open(TEMP,"> file_list") || print "Could not open file for writing\n"; +while () { + if (/Index/) { + s/^Index:\s*//g; + print TEMP; + } +} +close(TEMP); +close($file_name); + diff --git a/contrib/headers.txt b/contrib/headers.txt index 0a37df7c9e..e69de29bb2 100644 --- a/contrib/headers.txt +++ b/contrib/headers.txt @@ -1,10 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/contrib/offenders.list b/contrib/offenders.list deleted file mode 100644 index 0dce9e1f18..0000000000 --- a/contrib/offenders.list +++ /dev/null @@ -1,488 +0,0 @@ -#include --> ./src/datatype/dt_pack.c -#include --> ./src/datatype/dt_unpack.c -#include --> ./src/datatype/dt_optimize.c -#include --> ./src/datatype/fake_stack.c -#include --> ./src/mca/oob/tcp/oob_tcp_addr.c -#include --> ./src/mca/oob/tcp/oob_tcp_peer.c -#include --> ./src/mca/oob/tcp/oob_tcp.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/svc/stdio.old/cioapp.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_component.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_component.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.c -#include --> ./src/mca/ptl/prof/ptl_prof_component.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_component.c -#include --> ./src/mca/ptl/self/ptl_self_component.c -#include --> ./src/mca/ptl/self/ptl_self.c -#include --> ./src/util/if.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/syslog.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_priv.h -#include --> ./src/datatype/dt_args.c -#include --> ./src/datatype/dt_args.c -#include --> ./src/mca/oob/cofs/src/oob_cofs.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/session_dir.c -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_priv.h -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/event/kqueue.c -#include --> ./src/event/poll.c -#include --> ./src/event/epoll.c -#include --> ./src/event/signal.c -#include --> ./src/event/select.c -#include --> ./src/event/event.c -#include --> ./src/event/WIN32-Code/win32.c -#include --> ./src/util/session_dir.c -#include --> ./src/event/test/test-init.c -#include --> ./src/event/test/bench.c -#include --> ./src/event/test/test-eof.c -#include --> ./src/event/test/regress.c -#include --> ./src/event/test/test-time.c -#include --> ./src/event/test/test-weof.c -#include --> ./src/event/sample/signal-test.c -#include --> ./src/event/sample/event-test.c -#include --> ./src/event/sample/time-test.c -#include --> ./src/mca/io/romio/romio-dist/mpi-io/fortran/deletef.c -#include --> ./src/mca/io/romio/romio-dist/mpi-io/fortran/get_viewf.c -#include --> ./src/mca/io/romio/romio-dist/mpi-io/fortran/set_viewf.c -#include --> ./src/mca/io/romio/romio-dist/mpi-io/fortran/openf.c -#include --> ./test/include/atomic.c -#include --> ./src/mca/ptl/gm/tests/mpi-ping.c -#include --> ./src/util/pty.c -#include --> ./src/event/kqueue.c -#include --> ./include/ompi_stdint.h -#include --> ./test/rte/ompi_session_dir.c -#include --> ./test/util/ompi_session_dir.c -#include --> ./src/mca/gpr/replica/gpr_replica.c -#include --> ./src/mca/gpr/replica/gpr_replica_internals.c -#include --> ./src/mca/svc/stdio.old/cioapp.c -#include --> ./src/util/os_create_dirpath.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/sys_info.c -#include --> ./src/util/os_path.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./test/mpi/environment/chello.c -#include --> ./src/datatype/dt_args.c -#include --> ./src/mpi/cxx/mpicxx.h -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/util/if.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/svc/stdio.old/cioapp.c -#include --> ./src/tools/ompid/ompid.c -#include --> ./src/util/if.c -#include --> ./src/util/session_dir.c -#include --> ./src/runtime/runtime_types.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.c -#include --> ./test/util/ompi_pack.c -#include --> ./src/mpi/c/comm_join.c -#include --> ./src/mpi/c/profile/pcomm_join.c -#include --> ./src/mca/oob/tcp/oob_tcp_addr.c -#include --> ./src/mca/oob/tcp/oob_tcp_peer.c -#include --> ./src/mca/oob/tcp/oob_tcp.c -#include --> ./src/mca/oob/base/oob_base_send_nb.c -#include --> ./src/mca/oob/base/oob_base_send.c -#include --> ./src/mca/oob/base/oob_base_ping.c -#include --> ./src/mca/oob/base/oob_base_recv_nb.c -#include --> ./src/mca/oob/base/oob_base_recv.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/msg.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_component.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_component.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.c -#include --> ./src/mca/ptl/prof/ptl_prof_component.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_component.c -#include --> ./src/mca/ptl/self/ptl_self_component.c -#include --> ./src/mca/ptl/self/ptl_self.c -#include --> ./src/util/if.c -#include --> ./src/util/bufpack.c -#include --> ./src/mca/oob/tcp/oob_tcp_addr.h -#include --> ./src/mca/oob/tcp/oob_tcp_peer.h -#include --> ./src/mca/svc/stdio.old/snipe_lite/syslog.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_peer.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_frag.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_priv.h -#include --> ./src/mca/ptl/elan/src/ptl_elan.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_proc.h -#include --> ./src/mca/ptl/sm/src/ptl_sm.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_addr.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_req.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_sendfrag.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.h -#include --> ./src/mca/ptl/gm/src/ptl_gm.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_proc.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendfrag.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_addr.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_recvfrag.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendreq.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_proc.h -#include --> ./src/mca/oob/tcp/oob_tcp_peer.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/ad_pfs/ad_pfs.h -#include --> ./src/datatype/dt_args.c -#include --> ./src/util/strncpy.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/session_dir.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/event/poll.c -#include --> ./src/mca/svc/stdio.old/libsio.h -#include --> ./src/mca/svc/stdio.old/libcio.h -#include --> ./test/include/atomic.c -#include --> ./src/threads/condition_pthread.h -#include --> ./src/threads/mutex_unix.h -#include --> ./src/threads/thread.h -#include --> ./src/mca/pcm/base/pcm_base_ioexecvp.c -#include --> ./src/mca/pcm/rsh/pcm_rsh_spawn.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/sys_info.c -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/mca/svc/stdio.old/cioapp.c -#include --> ./src/mca/pcm/rms/src/pcm_rms_component.c -#include --> ./test/class/ompi_hash_table.c -#include --> ./test/class/ompi_rb_tree.c -#include --> ./src/event/epoll.c -#include --> ./src/event/epoll_sub.c -#include --> ./include/ompi_config_bottom.h -#include --> ./include/ompi_stdint.h -#include --> ./src/mca/ptl/ib/src/ptl_ib_priv.h -#include --> ./src/mca/pcm/base/pcm_base_ioexecvp.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/event/kqueue.c -#include --> ./src/event/poll.c -#include --> ./src/event/epoll.c -#include --> ./src/event/signal.c -#include --> ./src/event/select.c -#include --> ./src/event/event.c -#include --> ./src/event/rtsig.c -#include --> ./src/event/epoll.c -#include --> ./src/event/epoll_sub.c -#include --> ./src/mca/oob/tcp/oob_tcp_peer.c -#include --> ./src/mca/common/sm/common_sm_mmap.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_priv.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_frag.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_sendreq.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_sendfrag.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_recvfrag.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_frag.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_req.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_sendfrag.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendfrag.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_recvfrag.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendreq.c -#include --> ./src/mca/pcmclient/singleton/pcmclient_singleton.c -#include --> ./src/event/kqueue.c -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/util/if.c -#include --> ./src/util/pty.c -#include --> ./src/mca/common/sm/common_sm_mmap.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_component.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./test/rte/ompi_session_dir.c -#include --> ./test/util/ompi_session_dir.c -#include --> ./test/util/ompi_os_path.c -#include --> ./test/util/ompi_pack.c -#include --> ./test/util/ompi_os_create_dirpath.c -#include --> ./test/util/ompi_sys_info.c -#include --> ./src/event/epoll_sub.c -#include --> ./src/mca/pcm/base/pcm_base_ioexecvp.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/tools/openmpi/openmpi.c -#include --> ./src/tools/ompid/ompid.c -#include --> ./src/tools/mpirun/mpirun.c -#include --> ./src/util/output.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/os_path.c -#include --> ./src/runtime/runtime_types.h -#include --> ./src/tools/openmpi/openmpi.h -#include --> ./src/event/rtsig.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/event/sample/signal-test.c -#include --> ./src/event/sample/event-test.c -#include --> ./src/event/sample/time-test.c -#include --> ./src/event/kqueue.c -#include --> ./src/event/poll.c -#include --> ./src/event/epoll.c -#include --> ./src/event/signal.c -#include --> ./src/event/select.c -#include --> ./src/event/event.c -#include --> ./src/event/WIN32-Code/win32.c -#include --> ./src/event/rtsig.c -#include --> ./src/event/test/bench.c -#include --> ./src/event/epoll.c -#include --> ./src/mca/pcm/base/pcm_base_ioexecvp.c -#include --> ./src/mca/pcm/rsh/pcm_rsh_spawn.c -#include --> ./src/mca/ptl/gm/tests/mpi-ping.c -#include --> ./src/include/types.h -#include --> ./src/mca/svc/stdio.old/libsio.h -#include --> ./src/mca/svc/stdio.old/libcio.h -#include --> ./src/event/test/bench.c -#include --> ./src/event/test/regress.c -#include --> ./src/event/test/test-init.c -#include --> ./src/event/test/bench.c -#include --> ./src/event/test/test-eof.c -#include --> ./src/event/test/regress.c -#include --> ./src/event/test/test-weof.c -#include --> ./src/mpi/c/comm_join.c -#include --> ./src/mpi/c/profile/pcomm_join.c -#include --> ./src/mca/oob/tcp/oob_tcp_addr.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/svc/stdio.old/cioapp.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_component.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_component.c -#include --> ./src/mca/ptl/prof/ptl_prof_component.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_component.c -#include --> ./src/mca/ptl/self/ptl_self_component.c -#include --> ./src/mca/ptl/self/ptl_self.c -#include --> ./src/util/if.c -#include --> ./src/util/session_dir.c -#include --> ./src/include/types.h -#include --> ./src/include/ompi.h -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.h -#include --> ./src/mca/svc/stdio.old/snipe_lite/syslog.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_peer.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_frag.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_priv.h -#include --> ./src/mca/ptl/elan/src/ptl_elan.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_proc.h -#include --> ./src/mca/ptl/sm/src/ptl_sm.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_addr.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_req.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_sendfrag.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.h -#include --> ./src/mca/ptl/gm/src/ptl_gm.h -#include --> ./src/mca/ptl/gm/src/ptl_gm_proc.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendfrag.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_addr.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_recvfrag.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendreq.h -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_proc.h -#include --> ./src/util/if.h -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/event/epoll_sub.c -#include --> ./src/event/test/test-init.c -#include --> ./src/event/test/bench.c -#include --> ./src/event/test/test-eof.c -#include --> ./src/event/test/regress.c -#include --> ./src/event/test/test-time.c -#include --> ./src/event/test/test-weof.c -#include --> ./src/event/sample/signal-test.c -#include --> ./src/event/sample/event-test.c -#include --> ./src/event/sample/time-test.c -#include --> ./src/event/kqueue.c -#include --> ./src/event/poll.c -#include --> ./src/event/epoll.c -#include --> ./src/event/signal.c -#include --> ./src/event/select.c -#include --> ./src/event/event.c -#include --> ./src/event/rtsig.c -#include --> ./src/runtime/universe_exists.c -#include --> ./src/runtime/ompi_rte_wait.c -#include --> ./src/mpi/c/wtime.c -#include --> ./src/mca/pcm/base/pcm_base_ioexecvp.c -#include --> ./src/mca/pcm/rsh/pcm_rsh_spawn.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/svc/stdio.old/cioapp.c -#include --> ./src/mca/ptl/elan/tests/lat.c -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/mca/ptl/elan/tests/check_bw.c -#include --> ./src/mca/ptl/elan/tests/bw.c -#include --> ./src/mca/ptl/elan/tests/check.c -#include --> ./src/mca/ptl/gm/tests/lat.c -#include --> ./src/mca/ptl/ib/src/ptl_ib_peer.c -#include --> ./src/datatype/ddt_test.c -#include --> ./src/event/event.h -#include --> ./src/threads/condition_spinlock.h -#include --> ./src/mca/svc/stdio.old/libsio.h -#include --> ./src/mca/svc/stdio.old/libcio.h -#include --> ./src/event/event.c -#include --> ./test/mca/oob/oob_test_self.c -#include --> ./test/mca/oob/oob_test.c -#include --> ./test/mca/oob/oob_test_packed.c -#include --> ./src/mca/oob/tcp/oob_tcp_peer.c -#include --> ./src/communicator/comm_dyn.c -#include --> ./src/util/bufpack.c -#include --> ./src/mca/oob/base/base.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_pvfs/ad_pvfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_piofs/ad_piofs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_testfs/ad_testfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_pfs/ad_pfs.h -#include --> ./src/datatype/datatype.h -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./test/mca/ns/test_ns_proxy.c -#include --> ./test/mca/gpr/test_gpr_proxy.c -#include --> ./src/runtime/ompi_rte_wait.c -#include --> ./src/mca/pcm/base/pcm_base_ioexecvp.c -#include --> ./src/mca/pcm/rsh/pcm_rsh_spawn.c -#include --> ./src/tools/bootproxy/bootproxy.c -#include --> ./src/util/few.c -#include --> ./src/mca/base/mca_base_open.c -#include --> ./src/util/output.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/session_dir.c -#include --> ./test/mca/oob/oob_test_self.c -#include --> ./test/mca/oob/oob_test.c -#include --> ./test/mca/oob/oob_test_packed.c -#include --> ./test/rte/ompi_session_dir.c -#include --> ./test/rte/sigchld.c -#include --> ./test/util/ompi_session_dir.c -#include --> ./test/util/ompi_os_create_dirpath.c -#include --> ./src/event/test/test-init.c -#include --> ./src/event/test/bench.c -#include --> ./src/event/test/test-eof.c -#include --> ./src/event/test/regress.c -#include --> ./src/event/test/test-time.c -#include --> ./src/event/test/test-weof.c -#include --> ./src/event/sample/signal-test.c -#include --> ./src/event/sample/event-test.c -#include --> ./src/event/sample/time-test.c -#include --> ./src/event/kqueue.c -#include --> ./src/event/poll.c -#include --> ./src/event/epoll.c -#include --> ./src/event/epoll_sub.c -#include --> ./src/event/signal.c -#include --> ./src/event/select.c -#include --> ./src/event/event.c -#include --> ./src/event/rtsig.c -#include --> ./src/mpi/c/comm_join.c -#include --> ./src/mpi/c/profile/pcomm_join.c -#include --> ./src/mpi/c/profile/pget_processor_name.c -#include --> ./src/mpi/c/get_processor_name.c -#include --> ./src/mca/oob/tcp/oob_tcp_peer.c -#include --> ./src/mca/oob/tcp/oob_tcp.c -#include --> ./src/mca/oob/cofs/src/oob_cofs.c -#include --> ./src/mca/oob/cofs/src/oob_cofs_component.c -#include --> ./src/mca/pcm/rms/src/pcm_rms.c -#include --> ./src/mca/pcm/rms/src/pcm_rms_component.c -#include --> ./src/mca/pcm/bproc/src/pcm_bproc_component.c -#include --> ./src/mca/pcm/ompid/pcm_ompid.c -#include --> ./src/mca/pcm/ompid/pcm_ompid_component.c -#include --> ./src/mca/pcm/base/pcm_base_ioexecvp.c -#include --> ./src/mca/pcm/wmi/src/pcm_wmi_component.c -#include --> ./src/mca/pcm/rsh/pcm_rsh_spawn.c -#include --> ./src/mca/pcm/rsh/pcm_rsh_component.c -#include --> ./src/mca/ns/base/ns_base_select.c -#include --> ./src/mca/llm/base/llm_base_parse_hostfile.c -#include --> ./src/mca/llm/base/llm_base_parse_hostfile_lex.c -#include --> ./src/mca/llm/base/llm_base_parse_hostfile_lex.c -#include --> ./src/mca/common/sm/common_sm_mmap.c -#include --> ./src/mca/gpr/replica/gpr_replica.c -#include --> ./src/mca/gpr/replica/gpr_replica_internals.c -#include --> ./src/mca/gpr/base/gpr_base_select.c -#include --> ./src/mca/svc/stdio.old/snipe_lite/snipe_lite.c -#include --> ./src/mca/svc/stdio.old/cioapp.c -#include --> ./src/mca/ptl/elan/tests/lat.c -#include --> ./src/mca/ptl/elan/tests/init_elan.c -#include --> ./src/mca/ptl/elan/tests/check_bw.c -#include --> ./src/mca/ptl/elan/tests/bw.c -#include --> ./src/mca/ptl/elan/tests/check.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_component.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_priv.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_comm_init.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_init.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_peer.c -#include --> ./src/mca/ptl/elan/src/ptl_elan_frag.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_component.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_sendreq.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_sendfrag.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_recvfrag.c -#include --> ./src/mca/ptl/sm/src/ptl_sm_frag.c -#include --> ./src/mca/ptl/gm/tests/mpi-ping.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_priv.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_component.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_req.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_sendfrag.c -#include --> ./src/mca/ptl/gm/src/ptl_gm_peer.c -#include --> ./src/mca/ptl/prof/ptl_prof_component.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendfrag.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_peer.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_recvfrag.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_sendreq.c -#include --> ./src/mca/ptl/tcp/src/ptl_tcp_component.c -#include --> ./src/mca/ptl/self/ptl_self_component.c -#include --> ./src/mca/ptl/self/ptl_self.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_seek.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_delete.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/ad_flush.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_delete.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_flush.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_fstype.c -#include --> ./src/mca/io/romio/romio-dist/adio/common/mca_io_romio_dist_ad_seek.c -#include --> ./src/mca/base/mca_base_parse_paramfile_lex.c -#include --> ./src/mca/base/mca_base_parse_paramfile_lex.c -#include --> ./src/mca/pcmclient/seed/pcmclient_seed.c -#include --> ./src/mca/pcmclient/seed/pcmclient_seed_component.c -#include --> ./src/mca/pcmclient/rms/pcmclient_rms.c -#include --> ./src/mca/pcmclient/rms/pcmclient_rms_component.c -#include --> ./src/mca/pcmclient/singleton/pcmclient_singleton.c -#include --> ./src/mca/pcmclient/singleton/pcmclient_singleton_component.c -#include --> ./src/mca/pcmclient/env/pcmclient_env.c -#include --> ./src/mca/pcmclient/env/pcmclient_env_component.c -#include --> ./src/tools/bootproxy/bootproxy.c -#include --> ./src/tools/openmpi/openmpi.c -#include --> ./src/tools/ompid/ompid.c -#include --> ./src/tools/mpirun/mpirun.c -#include --> ./src/util/if.c -#include --> ./src/util/output.c -#include --> ./src/util/proc_info.c -#include --> ./src/util/os_create_dirpath.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/session_dir.c -#include --> ./src/util/daemon_init.c -#include --> ./src/util/sys_info.c -#include --> ./src/util/os_path.c -#include --> ./src/util/universe_setup_file_io.c -#include --> ./src/util/bufpack.c -#include --> ./src/util/few.c -#include --> ./src/util/path.c -#include --> ./src/util/show_help_lex.c -#include --> ./src/util/show_help_lex.c -#include --> ./src/mca/svc/stdio.old/libsio.h -#include --> ./src/mca/svc/stdio.old/libcio.h -#include --> ./src/mca/ptl/elan/src/ptl_elan_priv.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_sfs/ad_sfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_ufs/ad_ufs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_pvfs/ad_pvfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_xfs/ad_xfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_hfs/ad_hfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_piofs/ad_piofs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_nfs/ad_nfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_testfs/ad_testfs.h -#include --> ./src/mca/io/romio/romio-dist/adio/ad_pfs/ad_pfs.h -#include --> ./src/datatype/datatype.h diff --git a/contrib/results.txt b/contrib/results.txt deleted file mode 100644 index 23e67ab27b..0000000000 --- a/contrib/results.txt +++ /dev/null @@ -1,63 +0,0 @@ -alloca.h -arpa/inet.h -datatype.h -datatype_internal.h -dirent.h -elan/capability.h -elan/elan.h -elan4/library.h -err.h -etc_misc.h -event.h -fortran.h -getopt.h -grp.h -inttypes.h -libgen.h -linux/nfs_fs.h -mpi.h -net/if.h -netdb.h -netinet/gm.h -netinet/in.h -netinet/tcp.h -nx.h -ompi_config.h -ompi_debug.h -ompi_internal.h -pfs/pfs.h -poll.h -pthread.h -pwd.h -qsnet/fence.h -resolv.h -rms/rmsapi.h -stdint.h -strings.h -sys/_time.h -sys/epoll.h -sys/errno.h -sys/event.h -sys/fcntl.h -sys/ioctl.h -sys/mman.h -sys/mount.h -sys/param.h -sys/poll.h -sys/queue.h -sys/resource.h -sys/select.h -sys/signal.h -sys/socket.h -sys/sockio.h -sys/statvfs.h -sys/syscall.h -sys/time.h -sys/tree.h -sys/uio.h -sys/vfs.h -sys/wait.h -syslog.h -terror.h -typical.h -unistd.h diff --git a/include/mpi.h b/include/mpi.h index 1377302888..989faf34d8 100644 --- a/include/mpi.h +++ b/include/mpi.h @@ -60,32 +60,32 @@ typedef struct ompi_status_public_t ompi_status_public_t; /* * User typedefs */ - typedef int (MPI_Copy_function)(MPI_Comm, int, void *, +OMPI_DECLSPEC typedef int (MPI_Copy_function)(MPI_Comm, int, void *, void *, void *, int *); - typedef int (MPI_Delete_function)(MPI_Comm, int, void *, void *); - typedef int (MPI_Datarep_extent_function)(MPI_Datatype, MPI_Aint *, +OMPI_DECLSPEC typedef int (MPI_Delete_function)(MPI_Comm, int, void *, void *); +OMPI_DECLSPEC typedef int (MPI_Datarep_extent_function)(MPI_Datatype, MPI_Aint *, void *); - typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, +OMPI_DECLSPEC typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, void *, MPI_Offset, void *); - typedef void (MPI_Comm_errhandler_fn)(MPI_Comm *, int *, ...); - typedef void (MPI_File_errhandler_fn)(MPI_File *, int *, ...); - typedef void (MPI_Win_errhandler_fn)(MPI_Win *, int *, ...); - typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...); - typedef void (MPI_User_function)(void *, void *, int *, MPI_Datatype *); - typedef int (MPI_Comm_copy_attr_function)(MPI_Comm, int, void *, +OMPI_DECLSPEC typedef void (MPI_Comm_errhandler_fn)(MPI_Comm *, int *, ...); +OMPI_DECLSPEC typedef void (MPI_File_errhandler_fn)(MPI_File *, int *, ...); +OMPI_DECLSPEC typedef void (MPI_Win_errhandler_fn)(MPI_Win *, int *, ...); +OMPI_DECLSPEC typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...); +OMPI_DECLSPEC typedef void (MPI_User_function)(void *, void *, int *, MPI_Datatype *); +OMPI_DECLSPEC typedef int (MPI_Comm_copy_attr_function)(MPI_Comm, int, void *, void *, void *, int *); - typedef int (MPI_Comm_delete_attr_function)(MPI_Comm, int, void *, void *); - typedef int (MPI_Type_copy_attr_function)(MPI_Datatype, int, void *, +OMPI_DECLSPEC typedef int (MPI_Comm_delete_attr_function)(MPI_Comm, int, void *, void *); +OMPI_DECLSPEC typedef int (MPI_Type_copy_attr_function)(MPI_Datatype, int, void *, void *, void *, int *); - typedef int (MPI_Type_delete_attr_function)(MPI_Datatype, int, +OMPI_DECLSPEC typedef int (MPI_Type_delete_attr_function)(MPI_Datatype, int, void *, void *); - typedef int (MPI_Win_copy_attr_function)(MPI_Win, int, void *, +OMPI_DECLSPEC typedef int (MPI_Win_copy_attr_function)(MPI_Win, int, void *, void *, void *, int *); - typedef int (MPI_Win_delete_attr_function)(MPI_Win, int, void *, void *); - typedef int (MPI_Grequest_query_function)(void *, MPI_Status *); - typedef int (MPI_Grequest_free_function)(void *); - typedef int (MPI_Grequest_cancel_function)(void *, int); +OMPI_DECLSPEC typedef int (MPI_Win_delete_attr_function)(MPI_Win, int, void *, void *); +OMPI_DECLSPEC typedef int (MPI_Grequest_query_function)(void *, MPI_Status *); +OMPI_DECLSPEC typedef int (MPI_Grequest_free_function)(void *); +OMPI_DECLSPEC typedef int (MPI_Grequest_cancel_function)(void *, int); /* * Miscellaneous constants @@ -267,7 +267,7 @@ enum { /* * Datatype combiners. */ -enum { +OMPI_DECLSPEC enum { MPI_COMBINER_NAMED, MPI_COMBINER_DUP, MPI_COMBINER_CONTIGUOUS, @@ -337,37 +337,37 @@ enum { #define MPI_WIN_DUP_FN OMPI_C_MPI_WIN_DUP_FN #endif -int OMPI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datatype datatype, int type_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datatype datatype, int type_keyval, void* attribute_val_out, void* flag ); -int OMPI_C_MPI_TYPE_NULL_COPY_FN( MPI_Datatype datatype, int type_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_TYPE_NULL_COPY_FN( MPI_Datatype datatype, int type_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); -int OMPI_C_MPI_TYPE_DUP_FN( MPI_Datatype datatype, int type_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_TYPE_DUP_FN( MPI_Datatype datatype, int type_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); -int OMPI_C_MPI_COMM_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_COMM_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval, void* attribute_val_out, void* flag ); -int OMPI_C_MPI_COMM_NULL_COPY_FN( MPI_Comm comm, int comm_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_COMM_NULL_COPY_FN( MPI_Comm comm, int comm_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); -int OMPI_C_MPI_COMM_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state, +OMPI_DECLSPEC int OMPI_C_MPI_COMM_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); -int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval, void* attribute_val_out, void* flag ); -int OMPI_C_MPI_NULL_COPY_FN( MPI_Comm comm, int comm_keyval, void* extra_state, +OMPI_DECLSPEC int OMPI_C_MPI_NULL_COPY_FN( MPI_Comm comm, int comm_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); -int OMPI_C_MPI_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state, +OMPI_DECLSPEC int OMPI_C_MPI_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); -int OMPI_C_MPI_WIN_NULL_DELETE_FN( MPI_Win window, int win_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_WIN_NULL_DELETE_FN( MPI_Win window, int win_keyval, void* attribute_val_out, void* flag ); -int OMPI_C_MPI_WIN_NULL_COPY_FN( MPI_Win window, int win_keyval, +OMPI_DECLSPEC int OMPI_C_MPI_WIN_NULL_COPY_FN( MPI_Win window, int win_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); -int OMPI_C_MPI_WIN_DUP_FN( MPI_Win window, int win_keyval, void* extra_state, +OMPI_DECLSPEC int OMPI_C_MPI_WIN_DUP_FN( MPI_Win window, int win_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, int* flag ); @@ -375,66 +375,66 @@ int OMPI_C_MPI_WIN_DUP_FN( MPI_Win window, int win_keyval, void* extra_state, /* * External variables */ -extern struct ompi_communicator_t ompi_mpi_comm_world; -extern struct ompi_communicator_t ompi_mpi_comm_self; -extern struct ompi_communicator_t ompi_mpi_comm_null; +OMPI_DECLSPEC extern struct ompi_communicator_t ompi_mpi_comm_world; +OMPI_DECLSPEC extern struct ompi_communicator_t ompi_mpi_comm_self; +OMPI_DECLSPEC extern struct ompi_communicator_t ompi_mpi_comm_null; -extern struct ompi_group_t ompi_mpi_group_empty; -extern struct ompi_group_t ompi_mpi_group_null; +OMPI_DECLSPEC extern struct ompi_group_t ompi_mpi_group_empty; +OMPI_DECLSPEC extern struct ompi_group_t ompi_mpi_group_null; -extern struct ompi_request_t ompi_request_null; +OMPI_DECLSPEC extern struct ompi_request_t ompi_request_null; -extern struct ompi_op_t ompi_mpi_op_null; -extern struct ompi_op_t ompi_mpi_op_max, ompi_mpi_op_min; -extern struct ompi_op_t ompi_mpi_op_sum, ompi_mpi_op_prod; -extern struct ompi_op_t ompi_mpi_op_land, ompi_mpi_op_band; -extern struct ompi_op_t ompi_mpi_op_lor, ompi_mpi_op_bor; -extern struct ompi_op_t ompi_mpi_op_lxor, ompi_mpi_op_bxor; -extern struct ompi_op_t ompi_mpi_op_maxloc, ompi_mpi_op_minloc; -extern struct ompi_op_t ompi_mpi_op_replace; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_null; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_max, ompi_mpi_op_min; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_sum, ompi_mpi_op_prod; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_land, ompi_mpi_op_band; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_lor, ompi_mpi_op_bor; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_lxor, ompi_mpi_op_bxor; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_maxloc, ompi_mpi_op_minloc; +OMPI_DECLSPEC extern struct ompi_op_t ompi_mpi_op_replace; -extern struct ompi_datatype_t ompi_mpi_char, ompi_mpi_byte; -extern struct ompi_datatype_t ompi_mpi_int, ompi_mpi_logic; -extern struct ompi_datatype_t ompi_mpi_short, ompi_mpi_long; -extern struct ompi_datatype_t ompi_mpi_float, ompi_mpi_double; -extern struct ompi_datatype_t ompi_mpi_long_double; -extern struct ompi_datatype_t ompi_mpi_cplex, ompi_mpi_packed; -extern struct ompi_datatype_t ompi_mpi_unsigned_char; -extern struct ompi_datatype_t ompi_mpi_unsigned_short; -extern struct ompi_datatype_t ompi_mpi_unsigned, ompi_mpi_datatype_null; -extern struct ompi_datatype_t ompi_mpi_unsigned_long; -extern struct ompi_datatype_t ompi_mpi_ub, ompi_mpi_lb; -extern struct ompi_datatype_t ompi_mpi_float_int, ompi_mpi_double_int; -extern struct ompi_datatype_t ompi_mpi_long_int, ompi_mpi_2int; -extern struct ompi_datatype_t ompi_mpi_short_int, ompi_mpi_dblcplex; -extern struct ompi_datatype_t ompi_mpi_integer, ompi_mpi_real; -extern struct ompi_datatype_t ompi_mpi_dblprec, ompi_mpi_character; -extern struct ompi_datatype_t ompi_mpi_2real, ompi_mpi_2dblprec; -extern struct ompi_datatype_t ompi_mpi_2integer, ompi_mpi_longdbl_int; -extern struct ompi_datatype_t ompi_mpi_wchar, ompi_mpi_long_long_int; -extern struct ompi_datatype_t ompi_mpi_long_long, ompi_mpi_unsigned_long_long; -extern struct ompi_datatype_t ompi_mpi_cxx_cplex, ompi_mpi_cxx_dblcplex; -extern struct ompi_datatype_t ompi_mpi_cxx_ldblcplex; -extern struct ompi_datatype_t ompi_mpi_cxx_bool; -extern struct ompi_datatype_t ompi_mpi_2cplex, ompi_mpi_2dblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_char, ompi_mpi_byte; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_int, ompi_mpi_logic; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_short, ompi_mpi_long; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_float, ompi_mpi_double; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_long_double; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cplex, ompi_mpi_packed; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned_char; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned_short; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned, ompi_mpi_datatype_null; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_unsigned_long; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_ub, ompi_mpi_lb; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_float_int, ompi_mpi_double_int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_long_int, ompi_mpi_2int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_short_int, ompi_mpi_dblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer, ompi_mpi_real; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_dblprec, ompi_mpi_character; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_2real, ompi_mpi_2dblprec; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_2integer, ompi_mpi_longdbl_int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_wchar, ompi_mpi_long_long_int; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_long_long, ompi_mpi_unsigned_long_long; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cxx_cplex, ompi_mpi_cxx_dblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cxx_ldblcplex; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_cxx_bool; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_2cplex, ompi_mpi_2dblcplex; /* other MPI2 datatype */ -extern struct ompi_datatype_t ompi_mpi_real4, ompi_mpi_real8; -extern struct ompi_datatype_t ompi_mpi_real16; -extern struct ompi_datatype_t ompi_mpi_complex8, ompi_mpi_complex16; -extern struct ompi_datatype_t ompi_mpi_real32; -extern struct ompi_datatype_t ompi_mpi_integer1, ompi_mpi_integer2, ompi_mpi_integer4; -extern struct ompi_datatype_t ompi_mpi_integer16; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_real4, ompi_mpi_real8; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_real16; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_complex8, ompi_mpi_complex16; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_real32; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer1, ompi_mpi_integer2, ompi_mpi_integer4; +OMPI_DECLSPEC extern struct ompi_datatype_t ompi_mpi_integer16; -extern struct ompi_errhandler_t ompi_mpi_errhandler_null; -extern struct ompi_errhandler_t ompi_mpi_errors_are_fatal; -extern struct ompi_errhandler_t ompi_mpi_errors_return; +OMPI_DECLSPEC extern struct ompi_errhandler_t ompi_mpi_errhandler_null; +OMPI_DECLSPEC extern struct ompi_errhandler_t ompi_mpi_errors_are_fatal; +OMPI_DECLSPEC extern struct ompi_errhandler_t ompi_mpi_errors_return; -extern struct ompi_file_t ompi_mpi_file_null; +OMPI_DECLSPEC extern struct ompi_file_t ompi_mpi_file_null; -extern struct ompi_info_t ompi_mpi_info_null; +OMPI_DECLSPEC extern struct ompi_info_t ompi_mpi_info_null; -extern MPI_Fint *MPI_F_STATUS_IGNORE; -extern MPI_Fint *MPI_F_STATUSES_IGNORE; +OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE; +OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE; /* * MPI predefined handles @@ -516,1020 +516,1020 @@ extern MPI_Fint *MPI_F_STATUSES_IGNORE; */ /* JMS: Look for missing functions (e.g., MPI_File_*) */ - int MPI_Abort(MPI_Comm comm, int errorcode); - int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, +OMPI_DECLSPEC int MPI_Abort(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); - int MPI_Add_error_class(int *errorclass); - int MPI_Add_error_code(int errorclass, int *errorcode); - int MPI_Add_error_string(int errorcode, char *string); - int MPI_Address(void *location, MPI_Aint *address); - int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int MPI_Add_error_class(int *errorclass); +OMPI_DECLSPEC int MPI_Add_error_code(int errorclass, int *errorcode); +OMPI_DECLSPEC int MPI_Add_error_string(int errorcode, char *string); +OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); - int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm); - int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, +OMPI_DECLSPEC int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr); - int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); - int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, +OMPI_DECLSPEC int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm); - int MPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, +OMPI_DECLSPEC int MPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm); - int MPI_Attr_delete(MPI_Comm comm, int keyval); - int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); - int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); - int MPI_Barrier(MPI_Comm comm); - int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Attr_delete(MPI_Comm comm, int keyval); +OMPI_DECLSPEC int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); +OMPI_DECLSPEC int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); +OMPI_DECLSPEC int MPI_Barrier(MPI_Comm comm); +OMPI_DECLSPEC int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm); - int MPI_Bsend(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Bsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int MPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Buffer_attach(void *buffer, int size); - int MPI_Buffer_detach(void *buffer, int *size); - int MPI_Cancel(MPI_Request *request); - int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords); - int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, +OMPI_DECLSPEC int MPI_Buffer_attach(void *buffer, int size); +OMPI_DECLSPEC int MPI_Buffer_detach(void *buffer, int *size); +OMPI_DECLSPEC int MPI_Cancel(MPI_Request *request); +OMPI_DECLSPEC int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords); +OMPI_DECLSPEC int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart); - int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, +OMPI_DECLSPEC int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords); - int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims, +OMPI_DECLSPEC int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims, int *periods, int *newrank); - int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); - int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, +OMPI_DECLSPEC int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); +OMPI_DECLSPEC int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest); - int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm); - int MPI_Cartdim_get(MPI_Comm comm, int *ndims); - int MPI_Close_port(char *port_name); - int MPI_Comm_accept(char *port_name, MPI_Info info, int root, +OMPI_DECLSPEC int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm); +OMPI_DECLSPEC int MPI_Cartdim_get(MPI_Comm comm, int *ndims); +OMPI_DECLSPEC int MPI_Close_port(char *port_name); +OMPI_DECLSPEC int MPI_Comm_accept(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm); - MPI_Fint MPI_Comm_c2f(MPI_Comm comm); - int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode); - int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result); - int MPI_Comm_connect(char *port_name, MPI_Info info, int root, +OMPI_DECLSPEC MPI_Fint MPI_Comm_c2f(MPI_Comm comm); +OMPI_DECLSPEC int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result); +OMPI_DECLSPEC int MPI_Comm_connect(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm); - int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, +OMPI_DECLSPEC int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler); - int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, +OMPI_DECLSPEC int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, MPI_Comm_delete_attr_function *comm_delete_attr_fn, int *comm_keyval, void *extra_state); - int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); - int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval); - int MPI_Comm_disconnect(MPI_Comm *comm); - int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); - MPI_Comm MPI_Comm_f2c(MPI_Fint comm); - int MPI_Comm_free_keyval(int *comm_keyval); - int MPI_Comm_free(MPI_Comm *comm); - int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, +OMPI_DECLSPEC int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); +OMPI_DECLSPEC int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval); +OMPI_DECLSPEC int MPI_Comm_disconnect(MPI_Comm *comm); +OMPI_DECLSPEC int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC MPI_Comm MPI_Comm_f2c(MPI_Fint comm); +OMPI_DECLSPEC int MPI_Comm_free_keyval(int *comm_keyval); +OMPI_DECLSPEC int MPI_Comm_free(MPI_Comm *comm); +OMPI_DECLSPEC int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag); - int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); - int MPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); - int MPI_Comm_get_parent(MPI_Comm *parent); - int MPI_Comm_group(MPI_Comm comm, MPI_Group *group); - int MPI_Comm_join(int fd, MPI_Comm *intercomm); - int MPI_Comm_rank(MPI_Comm comm, int *rank); - int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); - int MPI_Comm_remote_size(MPI_Comm comm, int *size); - int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); - int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); - int MPI_Comm_set_name(MPI_Comm comm, char *comm_name); - int MPI_Comm_size(MPI_Comm comm, int *size); - int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, +OMPI_DECLSPEC int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); +OMPI_DECLSPEC int MPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); +OMPI_DECLSPEC int MPI_Comm_get_parent(MPI_Comm *parent); +OMPI_DECLSPEC int MPI_Comm_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int MPI_Comm_join(int fd, MPI_Comm *intercomm); +OMPI_DECLSPEC int MPI_Comm_rank(MPI_Comm comm, int *rank); +OMPI_DECLSPEC int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int MPI_Comm_remote_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); +OMPI_DECLSPEC int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Comm_set_name(MPI_Comm comm, char *comm_name); +OMPI_DECLSPEC int MPI_Comm_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes); - int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, +OMPI_DECLSPEC int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, int *array_of_maxprocs, MPI_Info *array_of_info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes); - int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); - int MPI_Comm_test_inter(MPI_Comm comm, int *flag); - int MPI_Dims_create(int nnodes, int ndims, int *dims); - MPI_Fint MPI_Errhandler_c2f(MPI_Errhandler errhandler); - int MPI_Errhandler_create(MPI_Handler_function *function, +OMPI_DECLSPEC int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); +OMPI_DECLSPEC int MPI_Comm_test_inter(MPI_Comm comm, int *flag); +OMPI_DECLSPEC int MPI_Dims_create(int nnodes, int ndims, int *dims); +OMPI_DECLSPEC MPI_Fint MPI_Errhandler_c2f(MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function, MPI_Errhandler *errhandler); - MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler); - int MPI_Errhandler_free(MPI_Errhandler *errhandler); - int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); - int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); - int MPI_Error_class(int errorcode, int *errorclass); - int MPI_Error_string(int errorcode, char *string, int *resultlen); - int MPI_Exscan(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler); +OMPI_DECLSPEC int MPI_Errhandler_free(MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Error_class(int errorcode, int *errorclass); +OMPI_DECLSPEC int MPI_Error_string(int errorcode, char *string, int *resultlen); +OMPI_DECLSPEC int MPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - MPI_Fint MPI_File_c2f(MPI_File file); - MPI_File MPI_File_f2c(MPI_Fint file); - int MPI_File_call_errhandler(MPI_File fh, int errorcode); - int MPI_File_create_errhandler(MPI_File_errhandler_fn *function, +OMPI_DECLSPEC MPI_Fint MPI_File_c2f(MPI_File file); +OMPI_DECLSPEC MPI_File MPI_File_f2c(MPI_Fint file); +OMPI_DECLSPEC int MPI_File_call_errhandler(MPI_File fh, int errorcode); +OMPI_DECLSPEC int MPI_File_create_errhandler(MPI_File_errhandler_fn *function, MPI_Errhandler *errhandler); - int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler); - int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler); - int MPI_File_open(MPI_Comm comm, char *filename, int amode, +OMPI_DECLSPEC int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh); - int MPI_File_close(MPI_File *fh); - int MPI_File_delete(char *filename, MPI_Info info); - int MPI_File_set_size(MPI_File fh, MPI_Offset size); - int MPI_File_preallocate(MPI_File fh, MPI_Offset size); - int MPI_File_get_size(MPI_File fh, MPI_Offset *size); - int MPI_File_get_group(MPI_File fh, MPI_Group *group); - int MPI_File_get_amode(MPI_File fh, int *amode); - int MPI_File_set_info(MPI_File fh, MPI_Info info); - int MPI_File_get_info(MPI_File fh, MPI_Info *info_used); - int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, +OMPI_DECLSPEC int MPI_File_close(MPI_File *fh); +OMPI_DECLSPEC int MPI_File_delete(char *filename, MPI_Info info); +OMPI_DECLSPEC int MPI_File_set_size(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int MPI_File_preallocate(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int MPI_File_get_size(MPI_File fh, MPI_Offset *size); +OMPI_DECLSPEC int MPI_File_get_group(MPI_File fh, MPI_Group *group); +OMPI_DECLSPEC int MPI_File_get_amode(MPI_File fh, int *amode); +OMPI_DECLSPEC int MPI_File_set_info(MPI_File fh, MPI_Info info); +OMPI_DECLSPEC int MPI_File_get_info(MPI_File fh, MPI_Info *info_used); +OMPI_DECLSPEC int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info); - int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, +OMPI_DECLSPEC int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep); - int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int MPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int MPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int MPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int MPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); - int MPI_File_get_position(MPI_File fh, MPI_Offset *offset); - int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, +OMPI_DECLSPEC int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int MPI_File_get_position(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp); - int MPI_File_read_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_write_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_write_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_iread_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int MPI_File_read_ordered(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_write_ordered(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_write_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); - int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); - int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype); - int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); - int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype); - int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status); - int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); - int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status); - int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); - int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status); - int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent); - int MPI_File_set_atomicity(MPI_File fh, int flag); - int MPI_File_get_atomicity(MPI_File fh, int *flag); - int MPI_File_sync(MPI_File fh); +OMPI_DECLSPEC int MPI_File_set_atomicity(MPI_File fh, int flag); +OMPI_DECLSPEC int MPI_File_get_atomicity(MPI_File fh, int *flag); +OMPI_DECLSPEC int MPI_File_sync(MPI_File fh); /* * file functions end */ - int MPI_Finalize(void); - int MPI_Finalized(int *flag); - int MPI_Free_mem(void *base); - int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int MPI_Finalize(void); +OMPI_DECLSPEC int MPI_Finalized(int *flag); +OMPI_DECLSPEC int MPI_Free_mem(void *base); +OMPI_DECLSPEC int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); - int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm); - int MPI_Get_address(void *location, MPI_Aint *address); - int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); - int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Get_address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count); - int MPI_Get(void *origin_addr, int origin_count, +OMPI_DECLSPEC int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); - int MPI_Get_processor_name(char *name, int *resultlen); - int MPI_Get_version(int *version, int *subversion); - int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, +OMPI_DECLSPEC int MPI_Get_processor_name(char *name, int *resultlen); +OMPI_DECLSPEC int MPI_Get_version(int *version, int *subversion); +OMPI_DECLSPEC int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph); - int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, +OMPI_DECLSPEC int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges); - int MPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, +OMPI_DECLSPEC int MPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, int *newrank); - int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors); - int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, +OMPI_DECLSPEC int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors); +OMPI_DECLSPEC int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int *neighbors); - int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges); - int MPI_Grequest_complete(MPI_Request request); - int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, +OMPI_DECLSPEC int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges); +OMPI_DECLSPEC int MPI_Grequest_complete(MPI_Request request); +OMPI_DECLSPEC int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request); - MPI_Fint MPI_Group_c2f(MPI_Group group); - int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); - int MPI_Group_difference(MPI_Group group1, MPI_Group group2, +OMPI_DECLSPEC MPI_Fint MPI_Group_c2f(MPI_Group group); +OMPI_DECLSPEC int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); +OMPI_DECLSPEC int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); - int MPI_Group_excl(MPI_Group group, int n, int *ranks, +OMPI_DECLSPEC int MPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup); - MPI_Group MPI_Group_f2c(MPI_Fint group); - int MPI_Group_free(MPI_Group *group); - int MPI_Group_incl(MPI_Group group, int n, int *ranks, +OMPI_DECLSPEC MPI_Group MPI_Group_f2c(MPI_Fint group); +OMPI_DECLSPEC int MPI_Group_free(MPI_Group *group); +OMPI_DECLSPEC int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup); - int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, +OMPI_DECLSPEC int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); - int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], +OMPI_DECLSPEC int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup); - int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], +OMPI_DECLSPEC int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup); - int MPI_Group_rank(MPI_Group group, int *rank); - int MPI_Group_size(MPI_Group group, int *size); - int MPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, +OMPI_DECLSPEC int MPI_Group_rank(MPI_Group group, int *rank); +OMPI_DECLSPEC int MPI_Group_size(MPI_Group group, int *size); +OMPI_DECLSPEC int MPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2); - int MPI_Group_union(MPI_Group group1, MPI_Group group2, +OMPI_DECLSPEC int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); - int MPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int MPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - MPI_Fint MPI_Info_c2f(MPI_Info info); - int MPI_Info_create(MPI_Info *info); - int MPI_Info_delete(MPI_Info info, char *key); - int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo); - MPI_Info MPI_Info_f2c(MPI_Fint info); - int MPI_Info_free(MPI_Info *info); - int MPI_Info_get(MPI_Info info, char *key, int valuelen, +OMPI_DECLSPEC MPI_Fint MPI_Info_c2f(MPI_Info info); +OMPI_DECLSPEC int MPI_Info_create(MPI_Info *info); +OMPI_DECLSPEC int MPI_Info_delete(MPI_Info info, char *key); +OMPI_DECLSPEC int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo); +OMPI_DECLSPEC MPI_Info MPI_Info_f2c(MPI_Fint info); +OMPI_DECLSPEC int MPI_Info_free(MPI_Info *info); +OMPI_DECLSPEC int MPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag); - int MPI_Info_get_nkeys(MPI_Info info, int *nkeys); - int MPI_Info_get_nthkey(MPI_Info info, int n, char *key); - int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, +OMPI_DECLSPEC int MPI_Info_get_nkeys(MPI_Info info, int *nkeys); +OMPI_DECLSPEC int MPI_Info_get_nthkey(MPI_Info info, int n, char *key); +OMPI_DECLSPEC int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag); - int MPI_Info_set(MPI_Info info, char *key, char *value); - int MPI_Init(int *argc, char ***argv); - int MPI_Initialized(int *flag); - int MPI_Init_thread(int *argc, char ***argv, int required, +OMPI_DECLSPEC int MPI_Info_set(MPI_Info info, char *key, char *value); +OMPI_DECLSPEC int MPI_Init(int *argc, char ***argv); +OMPI_DECLSPEC int MPI_Initialized(int *flag); +OMPI_DECLSPEC int MPI_Init_thread(int *argc, char ***argv, int required, int *provided); - int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, +OMPI_DECLSPEC int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm bridge_comm, int remote_leader, int tag, MPI_Comm *newintercomm); - int MPI_Intercomm_merge(MPI_Comm intercomm, int high, +OMPI_DECLSPEC int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintercomm); - int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, +OMPI_DECLSPEC int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status); - int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, +OMPI_DECLSPEC int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int MPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int MPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Is_thread_main(int *flag); - int MPI_Keyval_create(MPI_Copy_function *copy_fn, +OMPI_DECLSPEC int MPI_Is_thread_main(int *flag); +OMPI_DECLSPEC int MPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state); - int MPI_Keyval_free(int *keyval); - int MPI_Lookup_name(char *service_name, MPI_Info info, char *port_name); - MPI_Fint MPI_Op_c2f(MPI_Op op); - int MPI_Op_create(MPI_User_function *function, int commute, +OMPI_DECLSPEC int MPI_Keyval_free(int *keyval); +OMPI_DECLSPEC int MPI_Lookup_name(char *service_name, MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Fint MPI_Op_c2f(MPI_Op op); +OMPI_DECLSPEC int MPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op); - int MPI_Open_port(MPI_Info info, char *port_name); - MPI_Op MPI_Op_f2c(MPI_Fint op); - int MPI_Op_free(MPI_Op *op); - int MPI_Pack_external(char *datarep, void *inbuf, int incount, +OMPI_DECLSPEC int MPI_Open_port(MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Op MPI_Op_f2c(MPI_Fint op); +OMPI_DECLSPEC int MPI_Op_free(MPI_Op *op); +OMPI_DECLSPEC int MPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position); - int MPI_Pack_external_size(char *datarep, int incount, +OMPI_DECLSPEC int MPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size); - int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outsize, int *position, MPI_Comm comm); - int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, +OMPI_DECLSPEC int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size); - int MPI_Pcontrol(const int level, ...); - int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); - int MPI_Publish_name(char *service_name, MPI_Info info, +OMPI_DECLSPEC int MPI_Pcontrol(const int level, ...); +OMPI_DECLSPEC int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Publish_name(char *service_name, MPI_Info info, char *port_name); - int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, +OMPI_DECLSPEC int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); - int MPI_Query_thread(int *provided); - int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, +OMPI_DECLSPEC int MPI_Query_thread(int *provided); +OMPI_DECLSPEC int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, +OMPI_DECLSPEC int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status); - int MPI_Reduce(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); - int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, +OMPI_DECLSPEC int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - int MPI_Register_datarep(char *datarep, +OMPI_DECLSPEC int MPI_Register_datarep(char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state); - MPI_Fint MPI_Request_c2f(MPI_Request request); - MPI_Request MPI_Request_f2c(MPI_Fint request); - int MPI_Request_free(MPI_Request *request); - int MPI_Request_get_status(MPI_Request request, int *flag, +OMPI_DECLSPEC MPI_Fint MPI_Request_c2f(MPI_Request request); +OMPI_DECLSPEC MPI_Request MPI_Request_f2c(MPI_Fint request); +OMPI_DECLSPEC int MPI_Request_free(MPI_Request *request); +OMPI_DECLSPEC int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status); - int MPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int MPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int MPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Scan(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); - int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, +OMPI_DECLSPEC int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); - int MPI_Send_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status); - int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status); - int MPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int MPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int MPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int MPI_Start(MPI_Request *request); - int MPI_Startall(int count, MPI_Request *array_of_requests); - int MPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status); - int MPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status); - int MPI_Status_set_cancelled(MPI_Status *status, int flag); - int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, +OMPI_DECLSPEC int MPI_Start(MPI_Request *request); +OMPI_DECLSPEC int MPI_Startall(int count, MPI_Request *array_of_requests); +OMPI_DECLSPEC int MPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status); +OMPI_DECLSPEC int MPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status); +OMPI_DECLSPEC int MPI_Status_set_cancelled(MPI_Status *status, int flag); +OMPI_DECLSPEC int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count); - int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag, +OMPI_DECLSPEC int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag, MPI_Status array_of_statuses[]); - int MPI_Testany(int count, MPI_Request array_of_requests[], int *index, +OMPI_DECLSPEC int MPI_Testany(int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status); - int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status); - int MPI_Test_cancelled(MPI_Status *status, int *flag); - int MPI_Testsome(int incount, MPI_Request array_of_requests[], +OMPI_DECLSPEC int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status); +OMPI_DECLSPEC int MPI_Test_cancelled(MPI_Status *status, int *flag); +OMPI_DECLSPEC int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount, int array_of_indices[], MPI_Status array_of_statuses[]); - int MPI_Topo_test(MPI_Comm comm, int *status); - MPI_Fint MPI_Type_c2f(MPI_Datatype datatype); - int MPI_Type_commit(MPI_Datatype *type); - int MPI_Type_contiguous(int count, MPI_Datatype oldtype, +OMPI_DECLSPEC int MPI_Topo_test(MPI_Comm comm, int *status); +OMPI_DECLSPEC MPI_Fint MPI_Type_c2f(MPI_Datatype datatype); +OMPI_DECLSPEC int MPI_Type_commit(MPI_Datatype *type); +OMPI_DECLSPEC int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_create_darray(int size, int rank, int ndims, +OMPI_DECLSPEC int MPI_Type_create_darray(int size, int rank, int ndims, int gsize_array[], int distrib_array[], int darg_array[], int psize_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); - int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); - int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); - int MPI_Type_create_hindexed(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_create_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, +OMPI_DECLSPEC int MPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, +OMPI_DECLSPEC int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, MPI_Type_delete_attr_function *type_delete_attr_fn, int *type_keyval, void *extra_state); - int MPI_Type_create_indexed_block(int count, int blocklength, +OMPI_DECLSPEC int MPI_Type_create_indexed_block(int count, int blocklength, int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_create_struct(int count, int array_of_block_lengths[], +OMPI_DECLSPEC int MPI_Type_create_struct(int count, int array_of_block_lengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype); - int MPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], +OMPI_DECLSPEC int MPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], int start_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, +OMPI_DECLSPEC int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype); - int MPI_Type_delete_attr(MPI_Datatype type, int type_keyval); - int MPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); - int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); - int MPI_Type_free(MPI_Datatype *type); - int MPI_Type_free_keyval(int *type_keyval); - MPI_Datatype MPI_Type_f2c(MPI_Fint datatype); - int MPI_Type_get_attr(MPI_Datatype type, int type_keyval, +OMPI_DECLSPEC int MPI_Type_delete_attr(MPI_Datatype type, int type_keyval); +OMPI_DECLSPEC int MPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); +OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); +OMPI_DECLSPEC int MPI_Type_free(MPI_Datatype *type); +OMPI_DECLSPEC int MPI_Type_free_keyval(int *type_keyval); +OMPI_DECLSPEC MPI_Datatype MPI_Type_f2c(MPI_Fint datatype); +OMPI_DECLSPEC int MPI_Type_get_attr(MPI_Datatype type, int type_keyval, void *attribute_val, int *flag); - int MPI_Type_get_contents(MPI_Datatype mtype, int max_integers, +OMPI_DECLSPEC int MPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int max_addresses, int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]); - int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers, +OMPI_DECLSPEC int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); - int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, +OMPI_DECLSPEC int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent); - int MPI_Type_get_name(MPI_Datatype type, char *type_name, +OMPI_DECLSPEC int MPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen); - int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, +OMPI_DECLSPEC int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent); - int MPI_Type_hindexed(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride, +OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_indexed(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int MPI_Type_indexed(int count, int array_of_blocklengths[], int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); - int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); - int MPI_Type_set_attr(MPI_Datatype type, int type_keyval, +OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); +OMPI_DECLSPEC int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); +OMPI_DECLSPEC int MPI_Type_set_attr(MPI_Datatype type, int type_keyval, void *attr_val); - int MPI_Type_set_name(MPI_Datatype type, char *type_name); - int MPI_Type_size(MPI_Datatype type, int *size); - int MPI_Type_struct(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int MPI_Type_set_name(MPI_Datatype type, char *type_name); +OMPI_DECLSPEC int MPI_Type_size(MPI_Datatype type, int *size); +OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype); - int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); - int MPI_Type_vector(int count, int blocklength, int stride, +OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); +OMPI_DECLSPEC int MPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype); - int MPI_Unpack(void *inbuf, int insize, int *position, +OMPI_DECLSPEC int MPI_Unpack(void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm); - int MPI_Unpublish_name(char *service_name, MPI_Info info, +OMPI_DECLSPEC int MPI_Unpublish_name(char *service_name, MPI_Info info, char *port_name); - int MPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, +OMPI_DECLSPEC int MPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype); - int MPI_Waitall(int count, MPI_Request *array_of_requests, +OMPI_DECLSPEC int MPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses); - int MPI_Waitany(int count, MPI_Request *array_of_requests, +OMPI_DECLSPEC int MPI_Waitany(int count, MPI_Request *array_of_requests, int *index, MPI_Status *status); - int MPI_Wait(MPI_Request *request, MPI_Status *status); - int MPI_Waitsome(int incount, MPI_Request *array_of_requests, +OMPI_DECLSPEC int MPI_Wait(MPI_Request *request, MPI_Status *status); +OMPI_DECLSPEC int MPI_Waitsome(int incount, MPI_Request *array_of_requests, int *outcount, int *array_of_indices, MPI_Status *array_of_statuses); - MPI_Fint MPI_Win_c2f(MPI_Win win); - int MPI_Win_call_errhandler(MPI_Win win, int errorcode); - int MPI_Win_complete(MPI_Win win); - int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, +OMPI_DECLSPEC MPI_Fint MPI_Win_c2f(MPI_Win win); +OMPI_DECLSPEC int MPI_Win_call_errhandler(MPI_Win win, int errorcode); +OMPI_DECLSPEC int MPI_Win_complete(MPI_Win win); +OMPI_DECLSPEC int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win); - int MPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, +OMPI_DECLSPEC int MPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, MPI_Errhandler *errhandler); - int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, +OMPI_DECLSPEC int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, MPI_Win_delete_attr_function *win_delete_attr_fn, int *win_keyval, void *extra_state); - int MPI_Win_delete_attr(MPI_Win win, int win_keyval); - MPI_Win MPI_Win_f2c(MPI_Fint win); - int MPI_Win_fence(int assert, MPI_Win win); - int MPI_Win_free(MPI_Win *win); - int MPI_Win_free_keyval(int *win_keyval); - int MPI_Win_get_attr(MPI_Win win, int win_keyval, +OMPI_DECLSPEC int MPI_Win_delete_attr(MPI_Win win, int win_keyval); +OMPI_DECLSPEC MPI_Win MPI_Win_f2c(MPI_Fint win); +OMPI_DECLSPEC int MPI_Win_fence(int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_free(MPI_Win *win); +OMPI_DECLSPEC int MPI_Win_free_keyval(int *win_keyval); +OMPI_DECLSPEC int MPI_Win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag); - int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler); - int MPI_Win_get_group(MPI_Win win, MPI_Group *group); - int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen); - int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win); - int MPI_Win_post(MPI_Group group, int assert, MPI_Win win); - int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val); - int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler); - int MPI_Win_set_name(MPI_Win win, char *win_name); - int MPI_Win_start(MPI_Group group, int assert, MPI_Win win); - int MPI_Win_test(MPI_Win win, int *flag); - int MPI_Win_unlock(int rank, MPI_Win win); - int MPI_Win_wait(MPI_Win win); - double MPI_Wtick(void); - double MPI_Wtime(void); +OMPI_DECLSPEC int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int MPI_Win_get_group(MPI_Win win, MPI_Group *group); +OMPI_DECLSPEC int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen); +OMPI_DECLSPEC int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_post(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val); +OMPI_DECLSPEC int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler); +OMPI_DECLSPEC int MPI_Win_set_name(MPI_Win win, char *win_name); +OMPI_DECLSPEC int MPI_Win_start(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_test(MPI_Win win, int *flag); +OMPI_DECLSPEC int MPI_Win_unlock(int rank, MPI_Win win); +OMPI_DECLSPEC int MPI_Win_wait(MPI_Win win); +OMPI_DECLSPEC double MPI_Wtick(void); +OMPI_DECLSPEC double MPI_Wtime(void); /* * Profiling MPI API */ - int PMPI_Abort(MPI_Comm comm, int errorcode); - int PMPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, +OMPI_DECLSPEC int PMPI_Abort(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int PMPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); - int PMPI_Add_error_class(int *errorclass); - int PMPI_Add_error_code(int errorclass, int *errorcode); - int PMPI_Add_error_string(int errorcode, char *string); - int PMPI_Address(void *location, MPI_Aint *address); - int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int PMPI_Add_error_class(int *errorclass); +OMPI_DECLSPEC int PMPI_Add_error_code(int errorclass, int *errorcode); +OMPI_DECLSPEC int PMPI_Add_error_string(int errorcode, char *string); +OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); - int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm); - int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info, +OMPI_DECLSPEC int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr); - int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); - int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, +OMPI_DECLSPEC int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm); - int PMPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, +OMPI_DECLSPEC int PMPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm); - int PMPI_Attr_delete(MPI_Comm comm, int keyval); - int PMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); - int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); - int PMPI_Barrier(MPI_Comm comm); - int PMPI_Bcast(void *buffer, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Attr_delete(MPI_Comm comm, int keyval); +OMPI_DECLSPEC int PMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); +OMPI_DECLSPEC int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); +OMPI_DECLSPEC int PMPI_Barrier(MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm); - int PMPI_Bsend(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Bsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int PMPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Buffer_attach(void *buffer, int size); - int PMPI_Buffer_detach(void *buffer, int *size); - int PMPI_Cancel(MPI_Request *request); - int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords); - int PMPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, +OMPI_DECLSPEC int PMPI_Buffer_attach(void *buffer, int size); +OMPI_DECLSPEC int PMPI_Buffer_detach(void *buffer, int *size); +OMPI_DECLSPEC int PMPI_Cancel(MPI_Request *request); +OMPI_DECLSPEC int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords); +OMPI_DECLSPEC int PMPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart); - int PMPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, +OMPI_DECLSPEC int PMPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords); - int PMPI_Cart_map(MPI_Comm comm, int ndims, int *dims, +OMPI_DECLSPEC int PMPI_Cart_map(MPI_Comm comm, int ndims, int *dims, int *periods, int *newrank); - int PMPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); - int PMPI_Cart_shift(MPI_Comm comm, int direction, int disp, +OMPI_DECLSPEC int PMPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); +OMPI_DECLSPEC int PMPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest); - int PMPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm); - int PMPI_Cartdim_get(MPI_Comm comm, int *ndims); - int PMPI_Close_port(char *port_name); - int PMPI_Comm_accept(char *port_name, MPI_Info info, int root, +OMPI_DECLSPEC int PMPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm); +OMPI_DECLSPEC int PMPI_Cartdim_get(MPI_Comm comm, int *ndims); +OMPI_DECLSPEC int PMPI_Close_port(char *port_name); +OMPI_DECLSPEC int PMPI_Comm_accept(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm); - MPI_Fint PMPI_Comm_c2f(MPI_Comm comm); - int PMPI_Comm_call_errhandler(MPI_Comm comm, int errorcode); - int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result); - int PMPI_Comm_connect(char *port_name, MPI_Info info, int root, +OMPI_DECLSPEC MPI_Fint PMPI_Comm_c2f(MPI_Comm comm); +OMPI_DECLSPEC int PMPI_Comm_call_errhandler(MPI_Comm comm, int errorcode); +OMPI_DECLSPEC int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result); +OMPI_DECLSPEC int PMPI_Comm_connect(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm); - int PMPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, +OMPI_DECLSPEC int PMPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler); - int PMPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, +OMPI_DECLSPEC int PMPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, MPI_Comm_delete_attr_function *comm_delete_attr_fn, int *comm_keyval, void *extra_state); - int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); - int PMPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval); - int PMPI_Comm_disconnect(MPI_Comm *comm); - int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); - MPI_Comm PMPI_Comm_f2c(MPI_Fint comm); - int PMPI_Comm_free_keyval(int *comm_keyval); - int PMPI_Comm_free(MPI_Comm *comm); - int PMPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, +OMPI_DECLSPEC int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); +OMPI_DECLSPEC int PMPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval); +OMPI_DECLSPEC int PMPI_Comm_disconnect(MPI_Comm *comm); +OMPI_DECLSPEC int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); +OMPI_DECLSPEC MPI_Comm PMPI_Comm_f2c(MPI_Fint comm); +OMPI_DECLSPEC int PMPI_Comm_free_keyval(int *comm_keyval); +OMPI_DECLSPEC int PMPI_Comm_free(MPI_Comm *comm); +OMPI_DECLSPEC int PMPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag); - int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); - int PMPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); - int PMPI_Comm_get_parent(MPI_Comm *parent); - int PMPI_Comm_group(MPI_Comm comm, MPI_Group *group); - int PMPI_Comm_join(int fd, MPI_Comm *intercomm); - int PMPI_Comm_rank(MPI_Comm comm, int *rank); - int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); - int PMPI_Comm_remote_size(MPI_Comm comm, int *size); - int PMPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); - int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); - int PMPI_Comm_set_name(MPI_Comm comm, char *comm_name); - int PMPI_Comm_size(MPI_Comm comm, int *size); - int PMPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, +OMPI_DECLSPEC int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler); +OMPI_DECLSPEC int PMPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen); +OMPI_DECLSPEC int PMPI_Comm_get_parent(MPI_Comm *parent); +OMPI_DECLSPEC int PMPI_Comm_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int PMPI_Comm_join(int fd, MPI_Comm *intercomm); +OMPI_DECLSPEC int PMPI_Comm_rank(MPI_Comm comm, int *rank); +OMPI_DECLSPEC int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group); +OMPI_DECLSPEC int PMPI_Comm_remote_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int PMPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val); +OMPI_DECLSPEC int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Comm_set_name(MPI_Comm comm, char *comm_name); +OMPI_DECLSPEC int PMPI_Comm_size(MPI_Comm comm, int *size); +OMPI_DECLSPEC int PMPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes); - int PMPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, +OMPI_DECLSPEC int PMPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, int *array_of_maxprocs, MPI_Info *array_of_info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes); - int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); - int PMPI_Comm_test_inter(MPI_Comm comm, int *flag); - int PMPI_Dims_create(int nnodes, int ndims, int *dims); - MPI_Fint PMPI_Errhandler_c2f(MPI_Errhandler errhandler); - int PMPI_Errhandler_create(MPI_Handler_function *function, +OMPI_DECLSPEC int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); +OMPI_DECLSPEC int PMPI_Comm_test_inter(MPI_Comm comm, int *flag); +OMPI_DECLSPEC int PMPI_Dims_create(int nnodes, int ndims, int *dims); +OMPI_DECLSPEC MPI_Fint PMPI_Errhandler_c2f(MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function, MPI_Errhandler *errhandler); - MPI_Errhandler PMPI_Errhandler_f2c(MPI_Fint errhandler); - int PMPI_Errhandler_free(MPI_Errhandler *errhandler); - int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); - int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); - int PMPI_Error_class(int errorcode, int *errorclass); - int PMPI_Error_string(int errorcode, char *string, int *resultlen); - int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC MPI_Errhandler PMPI_Errhandler_f2c(MPI_Fint errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_free(MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Error_class(int errorcode, int *errorclass); +OMPI_DECLSPEC int PMPI_Error_string(int errorcode, char *string, int *resultlen); +OMPI_DECLSPEC int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - MPI_Fint PMPI_File_c2f(MPI_File file); - MPI_File PMPI_File_f2c(MPI_Fint file); - int PMPI_File_call_errhandler(MPI_File fh, int errorcode); - int PMPI_File_create_errhandler(MPI_File_errhandler_fn *function, +OMPI_DECLSPEC MPI_Fint PMPI_File_c2f(MPI_File file); +OMPI_DECLSPEC MPI_File PMPI_File_f2c(MPI_Fint file); +OMPI_DECLSPEC int PMPI_File_call_errhandler(MPI_File fh, int errorcode); +OMPI_DECLSPEC int PMPI_File_create_errhandler(MPI_File_errhandler_fn *function, MPI_Errhandler *errhandler); - int PMPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler); - int PMPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler); - int PMPI_File_open(MPI_Comm comm, char *filename, int amode, +OMPI_DECLSPEC int PMPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh); - int PMPI_File_close(MPI_File *fh); - int PMPI_File_delete(char *filename, MPI_Info info); - int PMPI_File_set_size(MPI_File fh, MPI_Offset size); - int PMPI_File_preallocate(MPI_File fh, MPI_Offset size); - int PMPI_File_get_size(MPI_File fh, MPI_Offset *size); - int PMPI_File_get_group(MPI_File fh, MPI_Group *group); - int PMPI_File_get_amode(MPI_File fh, int *amode); - int PMPI_File_set_info(MPI_File fh, MPI_Info info); - int PMPI_File_get_info(MPI_File fh, MPI_Info *info_used); - int PMPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, +OMPI_DECLSPEC int PMPI_File_close(MPI_File *fh); +OMPI_DECLSPEC int PMPI_File_delete(char *filename, MPI_Info info); +OMPI_DECLSPEC int PMPI_File_set_size(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int PMPI_File_preallocate(MPI_File fh, MPI_Offset size); +OMPI_DECLSPEC int PMPI_File_get_size(MPI_File fh, MPI_Offset *size); +OMPI_DECLSPEC int PMPI_File_get_group(MPI_File fh, MPI_Group *group); +OMPI_DECLSPEC int PMPI_File_get_amode(MPI_File fh, int *amode); +OMPI_DECLSPEC int PMPI_File_set_info(MPI_File fh, MPI_Info info); +OMPI_DECLSPEC int PMPI_File_get_info(MPI_File fh, MPI_Info *info_used); +OMPI_DECLSPEC int PMPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info); - int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, +OMPI_DECLSPEC int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep); - int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int PMPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int PMPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int PMPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int PMPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype +OMPI_DECLSPEC int PMPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); - int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset); - int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, +OMPI_DECLSPEC int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp); - int PMPI_File_read_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_write_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_write_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); - int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); - int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); - int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); - int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence); +OMPI_DECLSPEC int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset); +OMPI_DECLSPEC int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype); - int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); - int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, +OMPI_DECLSPEC int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype); - int PMPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status); - int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); - int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int PMPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status); - int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); - int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, +OMPI_DECLSPEC int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype); - int PMPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status); - int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status); +OMPI_DECLSPEC int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent); - int PMPI_File_set_atomicity(MPI_File fh, int flag); - int PMPI_File_get_atomicity(MPI_File fh, int *flag); - int PMPI_File_sync(MPI_File fh); - int PMPI_Finalize(void); - int PMPI_Finalized(int *flag); - int PMPI_Free_mem(void *base); - int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int PMPI_File_set_atomicity(MPI_File fh, int flag); +OMPI_DECLSPEC int PMPI_File_get_atomicity(MPI_File fh, int *flag); +OMPI_DECLSPEC int PMPI_File_sync(MPI_File fh); +OMPI_DECLSPEC int PMPI_Finalize(void); +OMPI_DECLSPEC int PMPI_Finalized(int *flag); +OMPI_DECLSPEC int PMPI_Free_mem(void *base); +OMPI_DECLSPEC int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); - int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm); - int PMPI_Get_address(void *location, MPI_Aint *address); - int PMPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); - int PMPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Get_address(void *location, MPI_Aint *address); +OMPI_DECLSPEC int PMPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); +OMPI_DECLSPEC int PMPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count); - int PMPI_Get(void *origin_addr, int origin_count, +OMPI_DECLSPEC int PMPI_Get(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); - int PMPI_Get_processor_name(char *name, int *resultlen); - int PMPI_Get_version(int *version, int *subversion); - int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, +OMPI_DECLSPEC int PMPI_Get_processor_name(char *name, int *resultlen); +OMPI_DECLSPEC int PMPI_Get_version(int *version, int *subversion); +OMPI_DECLSPEC int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph); - int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, +OMPI_DECLSPEC int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges); - int PMPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, +OMPI_DECLSPEC int PMPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, int *newrank); - int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors); - int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, +OMPI_DECLSPEC int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors); +OMPI_DECLSPEC int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int *neighbors); - int PMPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges); - int PMPI_Grequest_complete(MPI_Request request); - int PMPI_Grequest_start(MPI_Grequest_query_function *query_fn, +OMPI_DECLSPEC int PMPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges); +OMPI_DECLSPEC int PMPI_Grequest_complete(MPI_Request request); +OMPI_DECLSPEC int PMPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request); - MPI_Fint PMPI_Group_c2f(MPI_Group group); - int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); - int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, +OMPI_DECLSPEC MPI_Fint PMPI_Group_c2f(MPI_Group group); +OMPI_DECLSPEC int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); +OMPI_DECLSPEC int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); - int PMPI_Group_excl(MPI_Group group, int n, int *ranks, +OMPI_DECLSPEC int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup); - MPI_Group PMPI_Group_f2c(MPI_Fint group); - int PMPI_Group_free(MPI_Group *group); - int PMPI_Group_incl(MPI_Group group, int n, int *ranks, +OMPI_DECLSPEC MPI_Group PMPI_Group_f2c(MPI_Fint group); +OMPI_DECLSPEC int PMPI_Group_free(MPI_Group *group); +OMPI_DECLSPEC int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup); - int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2, +OMPI_DECLSPEC int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); - int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], +OMPI_DECLSPEC int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup); - int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], +OMPI_DECLSPEC int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup); - int PMPI_Group_rank(MPI_Group group, int *rank); - int PMPI_Group_size(MPI_Group group, int *size); - int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, +OMPI_DECLSPEC int PMPI_Group_rank(MPI_Group group, int *rank); +OMPI_DECLSPEC int PMPI_Group_size(MPI_Group group, int *size); +OMPI_DECLSPEC int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2); - int PMPI_Group_union(MPI_Group group1, MPI_Group group2, +OMPI_DECLSPEC int PMPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup); - int PMPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int PMPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - MPI_Fint PMPI_Info_c2f(MPI_Info info); - int PMPI_Info_create(MPI_Info *info); - int PMPI_Info_delete(MPI_Info info, char *key); - int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo); - MPI_Info PMPI_Info_f2c(MPI_Fint info); - int PMPI_Info_free(MPI_Info *info); - int PMPI_Info_get(MPI_Info info, char *key, int valuelen, +OMPI_DECLSPEC MPI_Fint PMPI_Info_c2f(MPI_Info info); +OMPI_DECLSPEC int PMPI_Info_create(MPI_Info *info); +OMPI_DECLSPEC int PMPI_Info_delete(MPI_Info info, char *key); +OMPI_DECLSPEC int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo); +OMPI_DECLSPEC MPI_Info PMPI_Info_f2c(MPI_Fint info); +OMPI_DECLSPEC int PMPI_Info_free(MPI_Info *info); +OMPI_DECLSPEC int PMPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag); - int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys); - int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key); - int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, +OMPI_DECLSPEC int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys); +OMPI_DECLSPEC int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key); +OMPI_DECLSPEC int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag); - int PMPI_Info_set(MPI_Info info, char *key, char *value); - int PMPI_Init(int *argc, char ***argv); - int PMPI_Initialized(int *flag); - int PMPI_Init_thread(int *argc, char ***argv, int required, +OMPI_DECLSPEC int PMPI_Info_set(MPI_Info info, char *key, char *value); +OMPI_DECLSPEC int PMPI_Init(int *argc, char ***argv); +OMPI_DECLSPEC int PMPI_Initialized(int *flag); +OMPI_DECLSPEC int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided); - int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, +OMPI_DECLSPEC int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm bridge_comm, int remote_leader, int tag, MPI_Comm *newintercomm); - int PMPI_Intercomm_merge(MPI_Comm intercomm, int high, +OMPI_DECLSPEC int PMPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintercomm); - int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, +OMPI_DECLSPEC int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status); - int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, +OMPI_DECLSPEC int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int PMPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int PMPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Is_thread_main(int *flag); - int PMPI_Keyval_create(MPI_Copy_function *copy_fn, +OMPI_DECLSPEC int PMPI_Is_thread_main(int *flag); +OMPI_DECLSPEC int PMPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state); - int PMPI_Keyval_free(int *keyval); - int PMPI_Lookup_name(char *service_name, MPI_Info info, char *port_name); - MPI_Fint PMPI_Op_c2f(MPI_Op op); - int PMPI_Op_create(MPI_User_function *function, int commute, +OMPI_DECLSPEC int PMPI_Keyval_free(int *keyval); +OMPI_DECLSPEC int PMPI_Lookup_name(char *service_name, MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Fint PMPI_Op_c2f(MPI_Op op); +OMPI_DECLSPEC int PMPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op); - int PMPI_Open_port(MPI_Info info, char *port_name); - MPI_Op PMPI_Op_f2c(MPI_Fint op); - int PMPI_Op_free(MPI_Op *op); - int PMPI_Pack_external(char *datarep, void *inbuf, int incount, +OMPI_DECLSPEC int PMPI_Open_port(MPI_Info info, char *port_name); +OMPI_DECLSPEC MPI_Op PMPI_Op_f2c(MPI_Fint op); +OMPI_DECLSPEC int PMPI_Op_free(MPI_Op *op); +OMPI_DECLSPEC int PMPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position); - int PMPI_Pack_external_size(char *datarep, int incount, +OMPI_DECLSPEC int PMPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size); - int PMPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outsize, int *position, MPI_Comm comm); - int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, +OMPI_DECLSPEC int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size); - int PMPI_Pcontrol(const int level, ...); - int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); - int PMPI_Publish_name(char *service_name, MPI_Info info, +OMPI_DECLSPEC int PMPI_Pcontrol(const int level, ...); +OMPI_DECLSPEC int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Publish_name(char *service_name, MPI_Info info, char *port_name); - int PMPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, +OMPI_DECLSPEC int PMPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); - int PMPI_Query_thread(int *provided); - int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, +OMPI_DECLSPEC int PMPI_Query_thread(int *provided); +OMPI_DECLSPEC int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, +OMPI_DECLSPEC int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status); - int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); - int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, +OMPI_DECLSPEC int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - int PMPI_Register_datarep(char *datarep, +OMPI_DECLSPEC int PMPI_Register_datarep(char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state); - MPI_Fint PMPI_Request_c2f(MPI_Request request); - MPI_Request PMPI_Request_f2c(MPI_Fint request); - int PMPI_Request_free(MPI_Request *request); - int PMPI_Request_get_status(MPI_Request request, int *flag, +OMPI_DECLSPEC MPI_Fint PMPI_Request_c2f(MPI_Request request); +OMPI_DECLSPEC MPI_Request PMPI_Request_f2c(MPI_Fint request); +OMPI_DECLSPEC int PMPI_Request_free(MPI_Request *request); +OMPI_DECLSPEC int PMPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status); - int PMPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int PMPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int PMPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Scan(void *sendbuf, void *recvbuf, int count, +OMPI_DECLSPEC int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); - int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, +OMPI_DECLSPEC int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); - int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +OMPI_DECLSPEC int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status); - int PMPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status); - int PMPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); - int PMPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, +OMPI_DECLSPEC int PMPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); - int PMPI_Start(MPI_Request *request); - int PMPI_Startall(int count, MPI_Request *array_of_requests); - int PMPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status); - int PMPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status); - int PMPI_Status_set_cancelled(MPI_Status *status, int flag); - int PMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, +OMPI_DECLSPEC int PMPI_Start(MPI_Request *request); +OMPI_DECLSPEC int PMPI_Startall(int count, MPI_Request *array_of_requests); +OMPI_DECLSPEC int PMPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status); +OMPI_DECLSPEC int PMPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status); +OMPI_DECLSPEC int PMPI_Status_set_cancelled(MPI_Status *status, int flag); +OMPI_DECLSPEC int PMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count); - int PMPI_Testall(int count, MPI_Request array_of_requests[], int *flag, +OMPI_DECLSPEC int PMPI_Testall(int count, MPI_Request array_of_requests[], int *flag, MPI_Status array_of_statuses[]); - int PMPI_Testany(int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status); - int PMPI_Test(MPI_Request *request, int *flag, MPI_Status *status); - int PMPI_Test_cancelled(MPI_Status *status, int *flag); - int PMPI_Testsome(int incount, MPI_Request array_of_requests[], +OMPI_DECLSPEC int PMPI_Testany(int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Test(MPI_Request *request, int *flag, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Test_cancelled(MPI_Status *status, int *flag); +OMPI_DECLSPEC int PMPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount, int array_of_indices[], MPI_Status array_of_statuses[]); - int PMPI_Topo_test(MPI_Comm comm, int *status); - MPI_Fint PMPI_Type_c2f(MPI_Datatype datatype); - int PMPI_Type_commit(MPI_Datatype *type); - int PMPI_Type_contiguous(int count, MPI_Datatype oldtype, +OMPI_DECLSPEC int PMPI_Topo_test(MPI_Comm comm, int *status); +OMPI_DECLSPEC MPI_Fint PMPI_Type_c2f(MPI_Datatype datatype); +OMPI_DECLSPEC int PMPI_Type_commit(MPI_Datatype *type); +OMPI_DECLSPEC int PMPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_create_darray(int size, int rank, int ndims, +OMPI_DECLSPEC int PMPI_Type_create_darray(int size, int rank, int ndims, int gsize_array[], int distrib_array[], int darg_array[], int psize_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); - int PMPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); - int PMPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); - int PMPI_Type_create_hindexed(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int PMPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_f90_integer(int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_create_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, +OMPI_DECLSPEC int PMPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, +OMPI_DECLSPEC int PMPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, MPI_Type_delete_attr_function *type_delete_attr_fn, int *type_keyval, void *extra_state); - int PMPI_Type_create_indexed_block(int count, int blocklength, +OMPI_DECLSPEC int PMPI_Type_create_indexed_block(int count, int blocklength, int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_create_struct(int count, int array_of_block_lengths[], +OMPI_DECLSPEC int PMPI_Type_create_struct(int count, int array_of_block_lengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype); - int PMPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], +OMPI_DECLSPEC int PMPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], int start_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, +OMPI_DECLSPEC int PMPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype); - int PMPI_Type_delete_attr(MPI_Datatype type, int type_keyval); - int PMPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); - int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); - int PMPI_Type_free(MPI_Datatype *type); - int PMPI_Type_free_keyval(int *type_keyval); - MPI_Datatype PMPI_Type_f2c(MPI_Fint datatype); - int PMPI_Type_get_attr(MPI_Datatype type, int type_keyval, +OMPI_DECLSPEC int PMPI_Type_delete_attr(MPI_Datatype type, int type_keyval); +OMPI_DECLSPEC int PMPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype); +OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); +OMPI_DECLSPEC int PMPI_Type_free(MPI_Datatype *type); +OMPI_DECLSPEC int PMPI_Type_free_keyval(int *type_keyval); +OMPI_DECLSPEC MPI_Datatype PMPI_Type_f2c(MPI_Fint datatype); +OMPI_DECLSPEC int PMPI_Type_get_attr(MPI_Datatype type, int type_keyval, void *attribute_val, int *flag); - int PMPI_Type_get_contents(MPI_Datatype mtype, int max_integers, +OMPI_DECLSPEC int PMPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int max_addresses, int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]); - int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers, +OMPI_DECLSPEC int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); - int PMPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, +OMPI_DECLSPEC int PMPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent); - int PMPI_Type_get_name(MPI_Datatype type, char *type_name, +OMPI_DECLSPEC int PMPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen); - int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, +OMPI_DECLSPEC int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent); - int PMPI_Type_hindexed(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride, +OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_indexed(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int PMPI_Type_indexed(int count, int array_of_blocklengths[], int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); - int PMPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); - int PMPI_Type_set_attr(MPI_Datatype type, int type_keyval, +OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); +OMPI_DECLSPEC int PMPI_Type_match_size(int typeclass, int size, MPI_Datatype *type); +OMPI_DECLSPEC int PMPI_Type_set_attr(MPI_Datatype type, int type_keyval, void *attr_val); - int PMPI_Type_set_name(MPI_Datatype type, char *type_name); - int PMPI_Type_size(MPI_Datatype type, int *size); - int PMPI_Type_struct(int count, int array_of_blocklengths[], +OMPI_DECLSPEC int PMPI_Type_set_name(MPI_Datatype type, char *type_name); +OMPI_DECLSPEC int PMPI_Type_size(MPI_Datatype type, int *size); +OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype); - int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); - int PMPI_Type_vector(int count, int blocklength, int stride, +OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); +OMPI_DECLSPEC int PMPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype); - int PMPI_Unpack(void *inbuf, int insize, int *position, +OMPI_DECLSPEC int PMPI_Unpack(void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm); - int PMPI_Unpublish_name(char *service_name, MPI_Info info, +OMPI_DECLSPEC int PMPI_Unpublish_name(char *service_name, MPI_Info info, char *port_name); - int PMPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, +OMPI_DECLSPEC int PMPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype); - int PMPI_Waitall(int count, MPI_Request *array_of_requests, +OMPI_DECLSPEC int PMPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses); - int PMPI_Waitany(int count, MPI_Request *array_of_requests, +OMPI_DECLSPEC int PMPI_Waitany(int count, MPI_Request *array_of_requests, int *index, MPI_Status *status); - int PMPI_Wait(MPI_Request *request, MPI_Status *status); - int PMPI_Waitsome(int incount, MPI_Request *array_of_requests, +OMPI_DECLSPEC int PMPI_Wait(MPI_Request *request, MPI_Status *status); +OMPI_DECLSPEC int PMPI_Waitsome(int incount, MPI_Request *array_of_requests, int *outcount, int *array_of_indices, MPI_Status *array_of_statuses); - MPI_Fint PMPI_Win_c2f(MPI_Win win); - int PMPI_Win_call_errhandler(MPI_Win win, int errorcode); - int PMPI_Win_complete(MPI_Win win); - int PMPI_Win_create(void *base, MPI_Aint size, int disp_unit, +OMPI_DECLSPEC MPI_Fint PMPI_Win_c2f(MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_call_errhandler(MPI_Win win, int errorcode); +OMPI_DECLSPEC int PMPI_Win_complete(MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win); - int PMPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, +OMPI_DECLSPEC int PMPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, MPI_Errhandler *errhandler); - int PMPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, +OMPI_DECLSPEC int PMPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, MPI_Win_delete_attr_function *win_delete_attr_fn, int *win_keyval, void *extra_state); - int PMPI_Win_delete_attr(MPI_Win win, int win_keyval); - MPI_Win PMPI_Win_f2c(MPI_Fint win); - int PMPI_Win_fence(int assert, MPI_Win win); - int PMPI_Win_free(MPI_Win *win); - int PMPI_Win_free_keyval(int *win_keyval); - int PMPI_Win_get_attr(MPI_Win win, int win_keyval, +OMPI_DECLSPEC int PMPI_Win_delete_attr(MPI_Win win, int win_keyval); +OMPI_DECLSPEC MPI_Win PMPI_Win_f2c(MPI_Fint win); +OMPI_DECLSPEC int PMPI_Win_fence(int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_free(MPI_Win *win); +OMPI_DECLSPEC int PMPI_Win_free_keyval(int *win_keyval); +OMPI_DECLSPEC int PMPI_Win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag); - int PMPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler); - int PMPI_Win_get_group(MPI_Win win, MPI_Group *group); - int PMPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen); - int PMPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win); - int PMPI_Win_post(MPI_Group group, int assert, MPI_Win win); - int PMPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val); - int PMPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler); - int PMPI_Win_set_name(MPI_Win win, char *win_name); - int PMPI_Win_start(MPI_Group group, int assert, MPI_Win win); - int PMPI_Win_test(MPI_Win win, int *flag); - int PMPI_Win_unlock(int rank, MPI_Win win); - int PMPI_Win_wait(MPI_Win win); - double PMPI_Wtick(void); - double PMPI_Wtime(void); +OMPI_DECLSPEC int PMPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler); +OMPI_DECLSPEC int PMPI_Win_get_group(MPI_Win win, MPI_Group *group); +OMPI_DECLSPEC int PMPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen); +OMPI_DECLSPEC int PMPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_post(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val); +OMPI_DECLSPEC int PMPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler); +OMPI_DECLSPEC int PMPI_Win_set_name(MPI_Win win, char *win_name); +OMPI_DECLSPEC int PMPI_Win_start(MPI_Group group, int assert, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_test(MPI_Win win, int *flag); +OMPI_DECLSPEC int PMPI_Win_unlock(int rank, MPI_Win win); +OMPI_DECLSPEC int PMPI_Win_wait(MPI_Win win); +OMPI_DECLSPEC double PMPI_Wtick(void); +OMPI_DECLSPEC double PMPI_Wtime(void); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/include/ompi_config_bottom.h b/include/ompi_config_bottom.h index 2fd5223ff6..77fa236b5e 100644 --- a/include/ompi_config_bottom.h +++ b/include/ompi_config_bottom.h @@ -10,11 +10,30 @@ * need to #ifndef/#endif protection here. */ -/* +#ifndef OMPI_CONFIG_BOTTOM_H +#define OMPI_CONFIG_BOTTOM_H + +#if defined(WIN32) +#include "win32/win_compat.h" +#endif + +#ifndef OMPI_DECLSPEC +#define OMPI_DECLSPEC +#endif + +#ifndef OMPI_COMP_EXPORT +#define OMPI_COMP_EXPORT +#endif + +/* * If we're in C, bring in the bool type and true/false constants. */ -#ifndef __cplusplus -#if OMPI_USE_STDBOOL_H +#if !defined(__cplusplus) +#ifdef WIN32 +#define bool BOOL +#define false FALSE +#define true TRUE +#elif OMPI_USE_STDBOOL_H /* If we're using , there is an implicit assumption that the C++ bool is the same size and has the same alignment. */ #include @@ -166,25 +185,9 @@ extern "C" { #if defined(c_plusplus) || defined(__cplusplus) } - #endif -/* For windoze weirdness. A symbol is not considered part of a DLL - interface unless it is exported. Hence these macros. It needs to - be prepended to the declaration of every symbol which needs to be - exported from a DLL. For us, this would be all MPI_ functions and - also all function from within Open MPI which are used by other - execuatables such as ompi_info, mpicc, etc. Visual studio defines - WIN32 and is the standard way of knowing whether we are compiling - using its native compiler (random note: the compiler itself does - not define this macro -- it's passed as -DWIN32 automatically). - Also, they simply define the macro as opposed to defining it to - something. I guess they dont program defensively :-) */ +/* this is needed for windows ONLY. It is defined in src/win32/win_compat.h + if we are running on windwos, else it is defined to nothing here */ -#if defined (WIN32) - #define OMPI_EXPORT __declspec(dllexport) - #define OMPI_IMPORT __declspec(dllimport) -#else - #define OMPI_EXPORT - #define OMPI_IMPORT -#endif +#endif /* OMPI_CONFIG_BOTTOM_H */ diff --git a/src/class/ompi_bitmap.h b/src/class/ompi_bitmap.h index a9c87eab72..adc1b181f0 100644 --- a/src/class/ompi_bitmap.h +++ b/src/class/ompi_bitmap.h @@ -27,8 +27,6 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t ompi_bitmap_t_class; - struct ompi_bitmap_t { ompi_object_t super; /**< Subclass of ompi_object_t */ unsigned char *bitmap; /**< The actual bitmap array of characters */ @@ -41,8 +39,7 @@ struct ompi_bitmap_t { typedef struct ompi_bitmap_t ompi_bitmap_t; -OBJ_CLASS_DECLARATION(ompi_bitmap_t); - +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_bitmap_t); /** * Initializes the bitmap and sets its size. This must be called @@ -53,7 +50,7 @@ OBJ_CLASS_DECLARATION(ompi_bitmap_t); * @return OMPI error code or success * */ -int ompi_bitmap_init (ompi_bitmap_t *bm, size_t size); +OMPI_DECLSPEC int ompi_bitmap_init (ompi_bitmap_t *bm, size_t size); /** @@ -66,7 +63,7 @@ int ompi_bitmap_init (ompi_bitmap_t *bm, size_t size); * @return OMPI error code or success * */ -int ompi_bitmap_set_bit(ompi_bitmap_t *bm, size_t bit); +OMPI_DECLSPEC int ompi_bitmap_set_bit(ompi_bitmap_t *bm, size_t bit); /** @@ -78,7 +75,7 @@ int ompi_bitmap_set_bit(ompi_bitmap_t *bm, size_t bit); * @return OMPI error code if the bit is out of range, else success * */ -int ompi_bitmap_clear_bit(ompi_bitmap_t *bm, size_t bit); +OMPI_DECLSPEC int ompi_bitmap_clear_bit(ompi_bitmap_t *bm, size_t bit); /** @@ -91,7 +88,7 @@ int ompi_bitmap_clear_bit(ompi_bitmap_t *bm, size_t bit); * 0 if the bit is not set * */ -int ompi_bitmap_is_set_bit(ompi_bitmap_t *bm, size_t bit); +OMPI_DECLSPEC int ompi_bitmap_is_set_bit(ompi_bitmap_t *bm, size_t bit); /** @@ -102,7 +99,7 @@ int ompi_bitmap_is_set_bit(ompi_bitmap_t *bm, size_t bit); * @return err OMPI_SUCCESS on success */ -int ompi_bitmap_find_and_set_first_unset_bit(ompi_bitmap_t *bm, +OMPI_DECLSPEC int ompi_bitmap_find_and_set_first_unset_bit(ompi_bitmap_t *bm, size_t *position); @@ -113,7 +110,7 @@ int ompi_bitmap_find_and_set_first_unset_bit(ompi_bitmap_t *bm, * @return OMPI error code if bm is NULL * */ -int ompi_bitmap_clear_all_bits(ompi_bitmap_t *bm); +OMPI_DECLSPEC int ompi_bitmap_clear_all_bits(ompi_bitmap_t *bm); /** @@ -122,7 +119,7 @@ int ompi_bitmap_clear_all_bits(ompi_bitmap_t *bm); * @return OMPI error code if bm is NULL * */ -int ompi_bitmap_set_all_bits(ompi_bitmap_t *bm); +OMPI_DECLSPEC int ompi_bitmap_set_all_bits(ompi_bitmap_t *bm); /** diff --git a/src/class/ompi_free_list.h b/src/class/ompi_free_list.h index 89c2856240..2c59bd5a7b 100644 --- a/src/class/ompi_free_list.h +++ b/src/class/ompi_free_list.h @@ -15,7 +15,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t ompi_free_list_t_class; +OMPI_DECLSPEC extern ompi_class_t ompi_free_list_t_class; struct mca_mem_pool_t; diff --git a/src/class/ompi_hash_table.h b/src/class/ompi_hash_table.h index db19d7e85f..f9ce29b43d 100644 --- a/src/class/ompi_hash_table.h +++ b/src/class/ompi_hash_table.h @@ -22,7 +22,7 @@ extern "C" { #endif -extern ompi_class_t ompi_hash_table_t_class; +OMPI_DECLSPEC extern ompi_class_t ompi_hash_table_t_class; struct ompi_hash_table_t @@ -50,7 +50,7 @@ typedef struct ompi_hash_table_t ompi_hash_table_t; * */ -int ompi_hash_table_init(ompi_hash_table_t* ht, size_t table_size); +OMPI_DECLSPEC int ompi_hash_table_init(ompi_hash_table_t* ht, size_t table_size); /** @@ -74,7 +74,7 @@ static inline size_t ompi_hash_table_get_size(ompi_hash_table_t *ht) * */ -int ompi_hash_table_remove_all(ompi_hash_table_t *ht); +OMPI_DECLSPEC int ompi_hash_table_remove_all(ompi_hash_table_t *ht); /** * Retrieve value via uint32_t key. @@ -85,7 +85,7 @@ int ompi_hash_table_remove_all(ompi_hash_table_t *ht); * */ -void *ompi_hash_table_get_value_uint32(ompi_hash_table_t* table, uint32_t key); +OMPI_DECLSPEC void *ompi_hash_table_get_value_uint32(ompi_hash_table_t* table, uint32_t key); /** * Set value based on uint32_t key. @@ -97,7 +97,7 @@ void *ompi_hash_table_get_value_uint32(ompi_hash_table_t* table, uint32_t key); * */ -int ompi_hash_table_set_value_uint32(ompi_hash_table_t* table, uint32_t key, void* value); +OMPI_DECLSPEC int ompi_hash_table_set_value_uint32(ompi_hash_table_t* table, uint32_t key, void* value); /** * Remove value based on uint32_t key. @@ -108,7 +108,7 @@ int ompi_hash_table_set_value_uint32(ompi_hash_table_t* table, uint32_t key, voi * */ -int ompi_hash_table_remove_value_uint32(ompi_hash_table_t* table, uint32_t key); +OMPI_DECLSPEC int ompi_hash_table_remove_value_uint32(ompi_hash_table_t* table, uint32_t key); /** * Retrieve value via uint64_t key. @@ -119,7 +119,7 @@ int ompi_hash_table_remove_value_uint32(ompi_hash_table_t* table, uint32_t key); * */ -void *ompi_hash_table_get_value_uint64(ompi_hash_table_t *table, uint64_t key); +OMPI_DECLSPEC void *ompi_hash_table_get_value_uint64(ompi_hash_table_t *table, uint64_t key); /** * Set value based on uint64_t key. @@ -131,7 +131,7 @@ void *ompi_hash_table_get_value_uint64(ompi_hash_table_t *table, uint64_t key); * */ -int ompi_hash_table_set_value_uint64(ompi_hash_table_t *table, uint64_t key, void* value); +OMPI_DECLSPEC int ompi_hash_table_set_value_uint64(ompi_hash_table_t *table, uint64_t key, void* value); /** * Remove value based on uint64_t key. @@ -142,7 +142,7 @@ int ompi_hash_table_set_value_uint64(ompi_hash_table_t *table, uint64_t key, voi * */ -int ompi_hash_table_remove_value_uint64(ompi_hash_table_t *table, uint64_t key); +OMPI_DECLSPEC int ompi_hash_table_remove_value_uint64(ompi_hash_table_t *table, uint64_t key); /** * Retrieve value via arbitrary length binary key. @@ -153,7 +153,7 @@ int ompi_hash_table_remove_value_uint64(ompi_hash_table_t *table, uint64_t key); * */ -void *ompi_hash_table_get_value_ptr(ompi_hash_table_t *table, const void* key, size_t keylen); +OMPI_DECLSPEC void *ompi_hash_table_get_value_ptr(ompi_hash_table_t *table, const void* key, size_t keylen); /** * Set value based on arbitrary length binary key. @@ -165,7 +165,7 @@ void *ompi_hash_table_get_value_ptr(ompi_hash_table_t *table, const void* key, s * */ -int ompi_hash_table_set_value_ptr(ompi_hash_table_t *table, const void* key, size_t keylen, void* value); +OMPI_DECLSPEC int ompi_hash_table_set_value_ptr(ompi_hash_table_t *table, const void* key, size_t keylen, void* value); /** * Remove value based on arbitrary length binary key. @@ -176,7 +176,7 @@ int ompi_hash_table_set_value_ptr(ompi_hash_table_t *table, const void* key, siz * */ -int ompi_hash_table_remove_value_ptr(ompi_hash_table_t *table, const void* key, size_t keylen); +OMPI_DECLSPEC int ompi_hash_table_remove_value_ptr(ompi_hash_table_t *table, const void* key, size_t keylen); /** The following functions are only for allowing iterating through @@ -201,7 +201,7 @@ int ompi_hash_table_remove_value_ptr(ompi_hash_table_t *table, const void* key, * */ -int ompi_hash_table_get_first_key_uint32(ompi_hash_table_t *table, uint32_t *key, +OMPI_DECLSPEC int ompi_hash_table_get_first_key_uint32(ompi_hash_table_t *table, uint32_t *key, void **value, void **node); @@ -219,7 +219,7 @@ int ompi_hash_table_get_first_key_uint32(ompi_hash_table_t *table, uint32_t *key * */ -int ompi_hash_table_get_next_key_uint32(ompi_hash_table_t *table, uint32_t *key, +OMPI_DECLSPEC int ompi_hash_table_get_next_key_uint32(ompi_hash_table_t *table, uint32_t *key, void **value, void *in_node, void **out_node); @@ -237,7 +237,7 @@ int ompi_hash_table_get_next_key_uint32(ompi_hash_table_t *table, uint32_t *key, * */ -int ompi_hash_table_get_first_key_uint64(ompi_hash_table_t *table, uint64_t *key, +OMPI_DECLSPEC int ompi_hash_table_get_first_key_uint64(ompi_hash_table_t *table, uint64_t *key, void **value, void **node); @@ -255,7 +255,7 @@ int ompi_hash_table_get_first_key_uint64(ompi_hash_table_t *table, uint64_t *key * */ -int ompi_hash_table_get_next_key_uint64(ompi_hash_table_t *table, uint64_t *key, +OMPI_DECLSPEC int ompi_hash_table_get_next_key_uint64(ompi_hash_table_t *table, uint64_t *key, void **value, void *in_node, void **out_node); diff --git a/src/class/ompi_list.h b/src/class/ompi_list.h index bd8e3f1d2a..114898f03b 100644 --- a/src/class/ompi_list.h +++ b/src/class/ompi_list.h @@ -39,13 +39,13 @@ extern "C" { * * The class for the list container. */ -OBJ_CLASS_DECLARATION(ompi_list_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_list_t); /** * \internal * * Base class for items that are put in list (ompi_list_t) containers. */ -OBJ_CLASS_DECLARATION(ompi_list_item_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_list_item_t); /** diff --git a/src/class/ompi_object.h b/src/class/ompi_object.h index 69bd21d20d..5c7c770ea7 100644 --- a/src/class/ompi_object.h +++ b/src/class/ompi_object.h @@ -103,7 +103,7 @@ #include #include -#ifdef __WINDOWS__ +#ifdef WIN32 #include #else #include "include/sys/atomic.h" @@ -120,8 +120,8 @@ # define BEGIN_C_DECLS extern "C" { # define END_C_DECLS } #else -# define BEGIN_C_DECLS /* empty */ -# define END_C_DECLS /* empty */ +#define BEGIN_C_DECLS /* empty */ +#define END_C_DECLS /* empty */ #endif @@ -293,12 +293,12 @@ struct ompi_object_t { volatile int obj_reference_count; /**< reference count */ }; -OBJ_CLASS_DECLARATION(ompi_object_t); +BEGIN_C_DECLS +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_object_t); /* declarations *******************************************************/ -BEGIN_C_DECLS /** * Lazy initialization of class descriptor. * @@ -307,7 +307,7 @@ BEGIN_C_DECLS * * @param class Pointer to class descriptor */ -void ompi_class_initialize(ompi_class_t *); +OMPI_DECLSPEC void ompi_class_initialize(ompi_class_t *); END_C_DECLS /** @@ -405,7 +405,7 @@ static inline ompi_object_t *ompi_obj_new(size_t size, ompi_class_t * cls) */ static inline int ompi_obj_update(ompi_object_t *object, int inc) { -#ifdef __WINDOWS__ +#ifdef WIN32 int newval; LONG volatile *addr; diff --git a/src/class/ompi_pointer_array.h b/src/class/ompi_pointer_array.h index 15140293fc..69525685b9 100644 --- a/src/class/ompi_pointer_array.h +++ b/src/class/ompi_pointer_array.h @@ -15,7 +15,7 @@ extern "C" { * typedefs */ typedef struct ompi_pointer_array_t ompi_pointer_array_t; -extern ompi_class_t ompi_pointer_array_t_class; +OMPI_DECLSPEC extern ompi_class_t ompi_pointer_array_t_class; /* * dynamic pointer array diff --git a/src/class/ompi_rb_tree.h b/src/class/ompi_rb_tree.h index 4f1a563581..ff9d34da8f 100644 --- a/src/class/ompi_rb_tree.h +++ b/src/class/ompi_rb_tree.h @@ -65,9 +65,9 @@ struct ompi_rb_tree_t { typedef struct ompi_rb_tree_t ompi_rb_tree_t; /** declare the tree node as a class */ -OBJ_CLASS_DECLARATION(ompi_rb_tree_node_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rb_tree_node_t); /** declare the tree as a class */ -OBJ_CLASS_DECLARATION(ompi_rb_tree_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rb_tree_t); /* Function pointers for map traversal function */ /** diff --git a/src/class/ompi_value_array.h b/src/class/ompi_value_array.h index 7d664e3983..859baf7da6 100644 --- a/src/class/ompi_value_array.h +++ b/src/class/ompi_value_array.h @@ -14,14 +14,14 @@ #include "util/output.h" #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif /* * @file Array of elements maintained by value. */ +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif -extern ompi_class_t ompi_value_array_t_class; +OMPI_DECLSPEC extern ompi_class_t ompi_value_array_t_class; struct ompi_value_array_t diff --git a/src/communicator/comm_cid.c b/src/communicator/comm_cid.c index e834a69191..0f4d339196 100644 --- a/src/communicator/comm_cid.c +++ b/src/communicator/comm_cid.c @@ -80,7 +80,7 @@ struct ompi_comm_reg_t{ uint32_t cid; }; typedef struct ompi_comm_reg_t ompi_comm_reg_t; -OBJ_CLASS_DECLARATION(ompi_comm_reg_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_comm_reg_t); static void ompi_comm_reg_constructor(ompi_comm_reg_t *regcom); static void ompi_comm_reg_destructor(ompi_comm_reg_t *regcom); diff --git a/src/communicator/comm_dyn.c b/src/communicator/comm_dyn.c index c866dd5893..ebe08ed15f 100644 --- a/src/communicator/comm_dyn.c +++ b/src/communicator/comm_dyn.c @@ -27,7 +27,7 @@ #include "mca/oob/base/base.h" #include "runtime/runtime.h" - +#include "util/printf.h" extern char **environ; int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root, diff --git a/src/communicator/communicator.h b/src/communicator/communicator.h index ef2b0f11ac..a0d827d1e4 100644 --- a/src/communicator/communicator.h +++ b/src/communicator/communicator.h @@ -21,7 +21,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t ompi_communicator_t_class; +OMPI_DECLSPEC extern ompi_class_t ompi_communicator_t_class; #define OMPI_COMM_INTER 0x00000001 #define OMPI_COMM_CART 0x00000002 @@ -58,7 +58,7 @@ extern ompi_class_t ompi_communicator_t_class; #define OMPI_COMM_CID_INTRA_BRIDGE 0x00000080 #define OMPI_COMM_CID_INTRA_OOB 0x00000100 -extern ompi_pointer_array_t ompi_mpi_communicators; +OMPI_DECLSPEC extern ompi_pointer_array_t ompi_mpi_communicators; struct ompi_communicator_t { ompi_object_t c_base; @@ -129,7 +129,7 @@ struct ompi_communicator_t { /**< Allow the basic module to cache data on the communicator */ }; typedef struct ompi_communicator_t ompi_communicator_t; -extern ompi_communicator_t *ompi_mpi_comm_parent; +OMPI_DECLSPEC extern ompi_communicator_t *ompi_mpi_comm_parent; /** @@ -175,7 +175,7 @@ static inline int ompi_comm_remote_size(ompi_communicator_t* comm) static inline ompi_communicator_t *ompi_comm_lookup(uint32_t cid) { /* array of pointers to communicators, indexed by context ID */ - extern ompi_pointer_array_t ompi_mpi_communicators; + OMPI_DECLSPEC extern ompi_pointer_array_t ompi_mpi_communicators; return (ompi_communicator_t*)ompi_pointer_array_get_item(&ompi_mpi_communicators, cid); } diff --git a/src/errhandler/errclass.h b/src/errhandler/errclass.h index 49ad51de02..c59148181e 100644 --- a/src/errhandler/errclass.h +++ b/src/errhandler/errclass.h @@ -26,8 +26,8 @@ struct ompi_errclass_t { }; typedef struct ompi_errclass_t ompi_errclass_t; -extern ompi_pointer_array_t ompi_errclasses; -extern int ompi_errclass_lastused; +OMPI_DECLSPEC extern ompi_pointer_array_t ompi_errclasses; +OMPI_DECLSPEC extern int ompi_errclass_lastused; /** * Check for a valid error class */ diff --git a/src/errhandler/errcode-internal.h b/src/errhandler/errcode-internal.h index dcd9caa2dc..9d5a88b118 100644 --- a/src/errhandler/errcode-internal.h +++ b/src/errhandler/errcode-internal.h @@ -29,8 +29,8 @@ struct ompi_errcode_intern_t { }; typedef struct ompi_errcode_intern_t ompi_errcode_intern_t; -extern ompi_pointer_array_t ompi_errcodes_intern; -extern int ompi_errcode_intern_lastused; +OMPI_DECLSPEC extern ompi_pointer_array_t ompi_errcodes_intern; +OMPI_DECLSPEC extern int ompi_errcode_intern_lastused; /** * Return the MPI errcode for a given internal error code diff --git a/src/errhandler/errcode.h b/src/errhandler/errcode.h index 691bad3bcb..4c123473eb 100644 --- a/src/errhandler/errcode.h +++ b/src/errhandler/errcode.h @@ -27,8 +27,8 @@ struct ompi_mpi_errcode_t { }; typedef struct ompi_mpi_errcode_t ompi_mpi_errcode_t; -extern ompi_pointer_array_t ompi_mpi_errcodes; -extern int ompi_mpi_errcode_lastused; +OMPI_DECLSPEC extern ompi_pointer_array_t ompi_mpi_errcodes; +OMPI_DECLSPEC extern int ompi_mpi_errcode_lastused; /** * Check for a valid error code diff --git a/src/errhandler/errhandler.h b/src/errhandler/errhandler.h index 57524da42b..0db0495641 100644 --- a/src/errhandler/errhandler.h +++ b/src/errhandler/errhandler.h @@ -80,22 +80,22 @@ typedef struct ompi_errhandler_t ompi_errhandler_t; /** * Global variable for MPI_ERRHANDLER_NULL */ -extern ompi_errhandler_t ompi_mpi_errhandler_null; +OMPI_DECLSPEC extern ompi_errhandler_t ompi_mpi_errhandler_null; /** * Global variable for MPI_ERRORS_ARE_FATAL */ -extern ompi_errhandler_t ompi_mpi_errors_are_fatal; +OMPI_DECLSPEC extern ompi_errhandler_t ompi_mpi_errors_are_fatal; /** * Global variable for MPI_ERRORS_RETURN */ -extern ompi_errhandler_t ompi_mpi_errors_return; +OMPI_DECLSPEC extern ompi_errhandler_t ompi_mpi_errors_return; /** * Table for Fortran <-> C errhandler handle conversion */ -extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table; +OMPI_DECLSPEC extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table; /** diff --git a/src/errhandler/errhandler_predefined.c b/src/errhandler/errhandler_predefined.c index 3ec537f990..17cd3bf84d 100644 --- a/src/errhandler/errhandler_predefined.c +++ b/src/errhandler/errhandler_predefined.c @@ -14,7 +14,7 @@ #include "file/file.h" #include "win/win.h" #include "runtime/runtime.h" - +#include "util/printf.h" /* * Local functions diff --git a/src/event/WIN32-Code/config.h b/src/event/WIN32-Code/config.h index 2f65ac07c6..05d84d42f2 100644 --- a/src/event/WIN32-Code/config.h +++ b/src/event/WIN32-Code/config.h @@ -86,7 +86,6 @@ #define HAVE_SYS_EVENT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_QUEUE_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 diff --git a/src/event/WIN32-Code/misc.c b/src/event/WIN32-Code/misc.c index f3458f24af..a16804b49f 100644 --- a/src/event/WIN32-Code/misc.c +++ b/src/event/WIN32-Code/misc.c @@ -1,3 +1,4 @@ +#include "ompi_config.h" #include #include #include diff --git a/src/event/WIN32-Code/win32.c b/src/event/WIN32-Code/win32.c index e22f395a61..289848e9b9 100644 --- a/src/event/WIN32-Code/win32.c +++ b/src/event/WIN32-Code/win32.c @@ -25,6 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "ompi_config.h" #include "config.h" #include @@ -50,12 +51,14 @@ #define log_error(x) perror(x) #endif -#include "event.h" +#include "event/event.h" +#include "event/compat/sys/queue.h" +#include "event/compat/err.h" -extern struct event_list timequeue; -extern struct event_list eventqueue; -extern struct event_list addqueue; -extern struct event_list signalqueue; +extern struct ompi_event_list ompi_timequeue; +extern struct ompi_event_list ompi_eventqueue; +extern struct ompi_event_list ompi_addqueue; +extern struct ompi_event_list ompi_signalqueue; #define NEVENT 64 @@ -69,12 +72,12 @@ void signal_process(void); int signal_recalc(void); void *win32_init (void); -int win32_insert (void *, struct event *); -int win32_del (void *, struct event *); +int win32_insert (void *, struct ompi_event *); +int win32_del (void *, struct ompi_event *); int win32_recalc (void *, int); int win32_dispatch (void *, struct timeval *); -struct eventop win32ops = { +struct ompi_eventop ompi_win32ops = { "win32", win32_init, win32_insert, @@ -91,7 +94,7 @@ static int timeval_to_ms(struct timeval *tv) void * win32_init(void) { - return (&win32ops); + return (&ompi_win32ops); } int @@ -101,13 +104,13 @@ win32_recalc(void *arg, int max) } int -win32_insert(struct win32op *wop, struct event *ev) +win32_insert(struct win32op *wop, struct ompi_event *ev) { - if (ev->ev_events & EV_SIGNAL) { - if (ev->ev_events & (EV_READ|EV_WRITE)) - errx(1, "%s: EV_SIGNAL incompatible use", - __func__); - if((int)signal(EVENT_SIGNAL(ev), signal_handler) == -1) + if (ev->ev_events & OMPI_EV_SIGNAL) { + if (ev->ev_events & (OMPI_EV_READ|OMPI_EV_WRITE)) + errx(1, "%s: OMPI_EV_SIGNAL incompatible use", + __FUNCTION__); + if((int)signal(OMPI_EVENT_SIGNAL(ev), signal_handler) == -1) return (-1); return (0); @@ -121,10 +124,10 @@ win32_dispatch(void *arg, struct timeval *tv) { int res = 0; struct win32op *wop = arg; - struct event *ev; + struct ompi_event *ev; int evres; - TAILQ_FOREACH(ev, &eventqueue, ev_next) { + TAILQ_FOREACH(ev, &ompi_eventqueue, ev_next) { res = WaitForSingleObject(ev->ev_fd, timeval_to_ms(tv)); if(res == WAIT_TIMEOUT || res == WAIT_FAILED) { @@ -134,15 +137,15 @@ win32_dispatch(void *arg, struct timeval *tv) signal_process(); evres = 0; - if(ev->ev_events & EV_READ) - evres |= EV_READ; + if(ev->ev_events & OMPI_EV_READ) + evres |= OMPI_EV_READ; - if(ev->ev_events & EV_WRITE) - evres |= EV_WRITE; + if(ev->ev_events & OMPI_EV_WRITE) + evres |= OMPI_EV_WRITE; if(evres) { - if(!(ev->ev_events & EV_PERSIST)) - event_del(ev); - event_active(ev, evres, 1); + if(!(ev->ev_events & OMPI_EV_PERSIST)) + ompi_event_del(ev); + ompi_event_active(ev, evres, 1); } } @@ -153,9 +156,9 @@ win32_dispatch(void *arg, struct timeval *tv) } int -win32_del(struct win32op *arg, struct event *ev) +win32_del(struct win32op *arg, struct ompi_event *ev) { - return ((int)signal(EVENT_SIGNAL(ev), SIG_IGN)); + return ((int)signal(OMPI_EVENT_SIGNAL(ev), SIG_IGN)); } static int signal_handler(int sig) @@ -169,11 +172,11 @@ static int signal_handler(int sig) int signal_recalc(void) { - struct event *ev; + struct ompi_event *ev; /* Reinstall our signal handler. */ - TAILQ_FOREACH(ev, &signalqueue, ev_signal_next) { - if((int)signal(EVENT_SIGNAL(ev), signal_handler) == -1) + TAILQ_FOREACH(ev, &ompi_signalqueue, ev_signal_next) { + if((int)signal(OMPI_EVENT_SIGNAL(ev), signal_handler) == -1) return (-1); } return (0); @@ -182,15 +185,15 @@ signal_recalc(void) void signal_process(void) { - struct event *ev; + struct ompi_event *ev; short ncalls; - TAILQ_FOREACH(ev, &signalqueue, ev_signal_next) { - ncalls = evsigcaught[EVENT_SIGNAL(ev)]; + TAILQ_FOREACH(ev, &ompi_signalqueue, ev_signal_next) { + ncalls = evsigcaught[OMPI_EVENT_SIGNAL(ev)]; if (ncalls) { - if (!(ev->ev_events & EV_PERSIST)) - event_del(ev); - event_active(ev, EV_SIGNAL, ncalls); + if (!(ev->ev_events & OMPI_EV_PERSIST)) + ompi_event_del(ev); + ompi_event_active(ev, OMPI_EV_SIGNAL, ncalls); } } diff --git a/src/event/compat/sys/_time.h b/src/event/compat/sys/_time.h index 9415f7ad44..a39c5fa570 100644 --- a/src/event/compat/sys/_time.h +++ b/src/event/compat/sys/_time.h @@ -32,6 +32,7 @@ * @(#)time.h 8.2 (Berkeley) 7/10/94 */ +#ifndef OMPI_TIME_H #ifndef _SYS_TIME_H_ #define _SYS_TIME_H_ @@ -163,3 +164,4 @@ struct clockinfo { /* --- stuff got cut here - niels --- */ #endif /* !_SYS_TIME_H_ */ +#endif /* !OMPI_TIME_H */ diff --git a/src/event/err.c b/src/event/err.c index 4fc03c1d42..4989876365 100644 --- a/src/event/err.c +++ b/src/event/err.c @@ -35,6 +35,7 @@ * SUCH DAMAGE. */ +#include "ompi_config.h" #include #include #include diff --git a/src/file/file.h b/src/file/file.h index fb90bd3713..58db489a9f 100644 --- a/src/file/file.h +++ b/src/file/file.h @@ -78,13 +78,13 @@ typedef struct ompi_file_t ompi_file_t; /** * Back-end instances for MPI_FILE_NULL */ -extern ompi_file_t ompi_mpi_file_null; +OMPI_DECLSPEC extern ompi_file_t ompi_mpi_file_null; /** * Fortran to C conversion table */ -extern ompi_pointer_array_t ompi_file_f_to_c_table; +OMPI_DECLSPEC extern ompi_pointer_array_t ompi_file_f_to_c_table; diff --git a/src/group/group.h b/src/group/group.h index ddcd5037f9..fd3f943ae8 100644 --- a/src/group/group.h +++ b/src/group/group.h @@ -32,7 +32,7 @@ struct ompi_group_t { for each process in the group */ }; typedef struct ompi_group_t ompi_group_t; -OBJ_CLASS_DECLARATION(ompi_group_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_group_t); /* Some definitions for the flags */ @@ -44,7 +44,7 @@ OBJ_CLASS_DECLARATION(ompi_group_t); /** * Table for Fortran <-> C group handle conversion */ -extern ompi_pointer_array_t *ompi_group_f_to_c_table; +OMPI_DECLSPEC extern ompi_pointer_array_t *ompi_group_f_to_c_table; /* diff --git a/src/include/malloc.h b/src/include/malloc.h index 22692fbdeb..00a89ed480 100644 --- a/src/include/malloc.h +++ b/src/include/malloc.h @@ -118,8 +118,8 @@ extern "C" { */ void ompi_free(void *addr, char *file, int line); -extern int ompi_malloc_debug_level; -extern int ompi_malloc_output; +OMPI_DECLSPEC extern int ompi_malloc_debug_level; +OMPI_DECLSPEC extern int ompi_malloc_output; static inline void ompi_malloc_debug(int level); diff --git a/src/include/sys/atomic.h b/src/include/sys/atomic.h index 972e700c46..ec15858822 100644 --- a/src/include/sys/atomic.h +++ b/src/include/sys/atomic.h @@ -20,7 +20,7 @@ #include "ompi_config.h" -#ifdef __GNUC__ +#if defined(__GNUC__) || defined (WIN32) #define STATIC_INLINE static inline #else #define STATIC_INLINE @@ -310,6 +310,13 @@ static inline void ompi_atomic_unlock(ompi_lock_t *lock); * the definitions are in system specific .s files in src/util. */ +/* Include win32/atomic.h if we are in windows platform. Else, we + can go through other compilers and options. */ +#ifdef WIN32 +#define OMPI_HAVE_ATOMIC_WIN32 1 +#include "include/sys/win32/atomic.h" +#else /* only now go through this stuff */ + #if defined(__alpha__) # define OMPI_HAVE_ATOMIC 1 # ifdef __GNUC__ @@ -410,7 +417,7 @@ static inline int ompi_atomic_cmpset_rel_int(volatile int *addr, (uint64_t) newval); } -#else +#else #error @@ -522,6 +529,11 @@ static inline int ompi_atomic_fetch_and_set_int(volatile int *addr, int newval) return (oldval); } +#endif /* OMPI_HAVE_ATOMIC */ + +#endif /* ifdef WIN32 */ + +#if OMPI_HAVE_ATOMIC || OMPI_HAVE_ATOMIC_WIN32 /* * Atomic locks @@ -565,7 +577,6 @@ static inline void ompi_atomic_unlock(ompi_lock_t *lock) lock->u.lock = OMPI_ATOMIC_UNLOCKED; } } - -#endif /* OMPI_HAVE_ATOMIC */ +#endif /* OMPI_HAVE_ATOMIC || OMPI_HAVE_ATOMIC_WIN32 */ #endif /* OMPI_SYS_ATOMIC_H */ diff --git a/src/include/sys/win32/atomic.h b/src/include/sys/win32/atomic.h new file mode 100644 index 0000000000..430351d050 --- /dev/null +++ b/src/include/sys/win32/atomic.h @@ -0,0 +1,278 @@ +/* + * $HEADER$ + */ + +#ifndef OMPI_SYS_ARCH_ATOMIC_H +#define OMPI_SYS_ARCH_ATOMIC_H 1 + +#if 1 +/* + * On ia64, we use cmpxchg, which supports acquire/release semantics natively. + */ + +static inline void ompi_atomic_mb(void) { + +#if 0 + return KeMemoryBarrier(); +#endif +} + + +static inline void ompi_atomic_rmb(void) { + +#if 0 + return KeMemoryBarrier(); +#endif +} + + +static inline void ompi_atomic_wmb(void) { + +#if 0 + return KeMemoryBarrier(); +#endif +} + + +static inline int ompi_atomic_cmpset_acq_32(volatile uint32_t *addr, + uint32_t oldval, + uint32_t newval) { + +#if 0 + LONG ret = InterlockedCompareExchangeAcquire ((LONG volatile*) addr, + (LONG) newval, + (LONG) oldval); + return (oldval == ret) ? 1: 0; +#else + return 0; +#endif +} + + +static inline int ompi_atomic_cmpset_rel_32(volatile uint32_t *addr, + uint32_t oldval, + uint32_t newval) { + +#if 0 + LONG ret = InterlockedCompareExchangeRelease ((LONG volatile*) addr, + (LONG) newval, + (LONG) oldval); + return (oldval == ret) ? 1: 0; +#else + return 0; +#endif +} + + +static inline int ompi_atomic_cmpset_32(volatile uint32_t *addr, + uint32_t oldval, + uint32_t newval) { +#if 0 + LONG ret = InterlockedCompareExchange ((LONG volatile*) addr, + (LONG) newval, + (LONG) oldval); + + return (oldval == ret) ? 1: 0; +#else + return 0; +#endif +} + + + +static inline int ompi_atomic_cmpset_acq_64(volatile uint64_t *addr, + uint64_t oldval, + uint64_t newval) { + +#if 0 + LONGLONG ret = InterlockedCompareExchangeAcquire64 ((LONGLONG volatile*) addr, + (LONGLONG) newval, + (LONGLONG) oldval); + return (oldval == ret) ? 1: 0; +#else + return 0; +#endif +} + + +static inline int ompi_atomic_cmpset_rel_64(volatile uint64_t *addr, + uint64_t oldval, + uint64_t newval) { + +#if 0 + LONGLONG ret = InterlockedCompareExchangeRelease64 ((LONGLONG volatile*) addr, + (LONGLONG) newval, + (LONGLONG) oldval); + return (oldval == ret) ? 1: 0; +#else + return 0; +#endif +} + + +static inline int ompi_atomic_cmpset_64(volatile uint64_t *addr, + uint64_t oldval, + uint64_t newval) { +#if 0 + LONGLONG ret = InterlockedCompareExchange64 ((LONGLONG volatile*) addr, + (LONGLONG) newval, + (LONGLONG) oldval); + + return (oldval == ret) ? 1: 0; +#else + return 0; +#endif +} + +static inline uint32_t ompi_atomic_add_32(volatile uint32_t *addr, int delta) { + + return InterlockedExchangeAdd ((LONG volatile *) addr, + (LONG) delta); + +} + +static inline uint64_t ompi_atomic_add_64(volatile uint64_t *addr, int delta) { + +#if 0 + return InterlockedExchangeAdd64 ((LONGLONG volatile *) addr, + (LONGLONG) delta); +#else + return 0; +#endif + +} + +static inline int ompi_atomic_add_int (volatile int *addr, int delta) { + +#if 0 +#if SIZEOF_INT == 4 + return InterlockedExchangeAdd ((LONG volatile *) addr, + (LONG) delta); +#elif SIZEOF_INT == 8 + return InterlockedExchangeAdd64 ((LONG volatile *) addr, + (LONG) delta); +#else +#error +#endif +#else + return 0; +#endif +} + +static inline int ompi_atomic_fetch_and_set_int(volatile int *addr, int newval) { + +#if 0 +#if SIZEOF_INT == 4 + return InterlockedExchangeAdd ((LONG volatile *) addr, + (LONG) newval); +#elif SIZEOF_INT == 8 + return InterlockedExchangeAdd64 ((LONG volatile *) addr, + (LONG) newval); +#else +#error +#endif +#else + return 0; +#endif +} + +static inline int ompi_atomic_cmpset_int(volatile int *addr, + int oldval, + int newval) { +#if 0 +#if SIZEOF_INT == 4 + return ompi_atomic_cmpset_32 (addr, oldval, newval); +#elif SIZEOF_INT == 8 + return ompi_atomic_cmpset_64 (addr, oldval, newval); +#else +#error +#endif +#else + return 0; +#endif +} + +static inline int ompi_atomic_cmpset_acq_int(volatile int *addr, + int oldval, + int newval) { +#if 0 +#if SIZEOF_INT == 4 + return ompi_atomic_cmpset_acq_32 (addr, oldval, newval); +#elif SIZEOF_INT == 8 + return ompi_atomic_cmpset_acq_64 (addr, oldval, newval); +#else +#error +#endif +#else + return 0; +#endif +} + +static inline int ompi_atomic_cmpset_rel_int(volatile int *addr, + int oldval, + int newval) { +#if 0 +#if SIZEOF_INT == 4 + return ompi_atomic_cmpset_rel_32 (addr, oldval, newval); +#elif SIZEOF_INT == 8 + return ompi_atomic_cmpset_rel_64 (addr, oldval, newval); +#else +#error +#endif +#else + return 0; +#endif +} + +static inline int ompi_atomic_cmpset_ptr(volatile void *addr, + void *oldval, + void *newval) { + + PVOID ret = InterlockedCompareExchangePointer ((PVOID volatile *) addr, + (PVOID) newval, + (PVOID) oldval); + return (ret == oldval)? 1: 0; +} + +static inline int ompi_atomic_cmpset_acq_ptr(volatile void *addr, + void *oldval, + void *newval) { +#if 0 +#if SIZEOF_INT == 4 + return ompi_atomic_cmpset_acq_32((volatile uint32_t *) addr, + (uint32_t) oldval, + (uint32_t) newval); +#elif SIZEOF_INT == 8 + return ompi_atomic_cmpset_acq_64((volatile uint32_t *) addr, + (uint64_t) oldval, + (uint64_t) newval); +#else +#error +#endif +#else + return 0; +#endif +} + +static inline int ompi_atomic_cmpset_rel_ptr(volatile void *addr, + void *oldval, + void *newval) { + +#if 0 +#if SIZEOF_INT == 4 + return ompi_atomic_cmpset_rel_ecq_32((volatile uint32_t *) addr, + (uint32_t) oldval, + (uint32_t) newval); +#elif SIZEOF_INT == 8 + return ompi_atomic_cmpset_rel__64((volatile uint32_t *) addr, + (uint64_t) oldval, + (uint64_t) newval); +#else +#error +#endif +#else + return 0; +#endif +} +#endif +#endif /* ! OMPI_SYS_ARCH_ATOMIC_H */ diff --git a/src/include/totalview.h b/src/include/totalview.h index 6fbfc901af..b6acf23014 100644 --- a/src/include/totalview.h +++ b/src/include/totalview.h @@ -5,7 +5,7 @@ #ifndef OMPI_TOTALVIEW_H #define OMPI_TOTALVIEW_H -extern int ompi_tv_comm_sequence_number; +OMPI_DECLSPEC extern int ompi_tv_comm_sequence_number; #endif /* OMPI_TOTALVIEW_H */ diff --git a/src/include/types.h b/src/include/types.h index 6414a10843..1e82bb7bc7 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -5,6 +5,8 @@ #ifndef OMPI_TYPES_H #define OMPI_TYPES_H +#include "ompi_config.h" + #ifdef HAVE_SYS_TYPES_H #include #endif @@ -14,8 +16,8 @@ #ifdef HAVE_SYS_SELECT_H #include #endif -#include "ompi_config.h" +#ifndef WIN32 /* * Increase FD_SETSIZE */ @@ -42,6 +44,17 @@ typedef struct ompi_fd_set_t ompi_fd_set_t; #define OMPI_FD_CLR(fd,fds) FD_CLR((fd),(fd_set*)(fds)) #define OMPI_FD_ISSET(fd,fds) FD_ISSET((fd),(fd_set*)(fds)) +#else /* if we are on windows */ + +typedef fd_set ompi_fd_set_t; +#define OMPI_FD_ZERO(fds) FD_ZERO((fds)) +#define OMPI_FD_SET(fd,fds) FD_SET((fd),(fds)) +#define OMPI_FD_CLR(fd,fds) FD_CLR((fd),(fds)) +#define OMPI_FD_ISSET(fd,fds) FD_ISSET((fd),(fds)) + +#endif /* wIN32 */ + + /* * handle to describe a parallel job */ diff --git a/src/info/info.h b/src/info/info.h index 25015b27b8..0e7de01c75 100644 --- a/src/info/info.h +++ b/src/info/info.h @@ -59,24 +59,24 @@ typedef struct ompi_info_entry_t ompi_info_entry_t; /** * Table for Fortran <-> C translation table */ -extern ompi_pointer_array_t ompi_info_f_to_c_table; +OMPI_DECLSPEC extern ompi_pointer_array_t ompi_info_f_to_c_table; /** * Global instance for MPI_INFO_NULL */ -extern ompi_info_t ompi_mpi_info_null; +OMPI_DECLSPEC extern ompi_info_t ompi_mpi_info_null; /** * \internal * Some declarations needed to use OBJ_NEW and OBJ_DESTRUCT macros */ -OBJ_CLASS_DECLARATION(ompi_info_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_info_t); /** * \internal * Some declarations needed to use OBJ_NEW and OBJ_DESTRUCT macros */ -OBJ_CLASS_DECLARATION(ompi_info_entry_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_info_entry_t); #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/mca/allocator/allocator.h b/src/mca/allocator/allocator.h index e086f6900e..7082cfc322 100644 --- a/src/mca/allocator/allocator.h +++ b/src/mca/allocator/allocator.h @@ -123,7 +123,7 @@ typedef struct mca_allocator_base_component_1_0_0_t mca_allocator_base_component /** * The output integer used for the mca base */ -extern int mca_allocator_base_output; +OMPI_DECLSPEC extern int mca_allocator_base_output; #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/src/mca/allocator/base/allocator_base_open.c b/src/mca/allocator/base/allocator_base_open.c index e376321a93..6b8fb997f3 100644 --- a/src/mca/allocator/base/allocator_base_open.c +++ b/src/mca/allocator/base/allocator_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include "mca/mca.h" @@ -18,8 +18,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_allocator_base_static_components[] = {NULL}; +#else #include "mca/allocator/base/static-components.h" - +#endif /* * Global variables diff --git a/src/mca/allocator/base/base.h b/src/mca/allocator/base/base.h index 3879f23b3c..bff1079c43 100644 --- a/src/mca/allocator/base/base.h +++ b/src/mca/allocator/base/base.h @@ -42,9 +42,9 @@ OBJ_CLASS_DECLARATION(mca_mpool_base_selected_module_t); * Global functions for MCA: overall allocator open and close */ - int mca_allocator_base_open(void); - int mca_allocator_base_close(void); - mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name); +OMPI_DECLSPEC int mca_allocator_base_open(void); +OMPI_DECLSPEC int mca_allocator_base_close(void); +OMPI_DECLSPEC mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name); /* @@ -53,7 +53,7 @@ OBJ_CLASS_DECLARATION(mca_mpool_base_selected_module_t); /** * The list of all the selected components. */ -extern ompi_list_t mca_allocator_base_components; +OMPI_DECLSPEC extern ompi_list_t mca_allocator_base_components; #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/src/mca/base/base.h b/src/mca/base/base.h index 862f1aede0..e9280a70cd 100644 --- a/src/mca/base/base.h +++ b/src/mca/base/base.h @@ -51,7 +51,7 @@ OBJ_CLASS_DECLARATION(mca_base_component_priority_list_item_t); /* * Public variables */ -extern int mca_base_param_component_path; +OMPI_DECLSPEC extern int mca_base_param_component_path; /* @@ -72,7 +72,7 @@ extern int mca_base_param_component_path; * invoked during ompi_mpi_init() and specifically invoked in the * special case of the laminfo command. */ - int mca_base_open(void); +OMPI_DECLSPEC int mca_base_open(void); /** * Last function called in the MCA @@ -87,56 +87,56 @@ extern int mca_base_param_component_path; * during ompi_mpi_finalize() and specifically invoked during the * special case of the laminfo command. */ - int mca_base_close(void); +OMPI_DECLSPEC int mca_base_close(void); /* mca_base_cmd_line.c */ - int mca_base_cmd_line_setup(ompi_cmd_line_t *cmd); - int mca_base_cmd_line_process_args(ompi_cmd_line_t *cmd); - int mca_base_cmd_line_process_arg(const char *param, const char *value); +OMPI_DECLSPEC int mca_base_cmd_line_setup(ompi_cmd_line_t *cmd); +OMPI_DECLSPEC int mca_base_cmd_line_process_args(ompi_cmd_line_t *cmd); +OMPI_DECLSPEC int mca_base_cmd_line_process_arg(const char *param, const char *value); /* mca_base_component_compare.c */ - int mca_base_component_compare_priority(mca_base_component_priority_list_item_t *a, +OMPI_DECLSPEC int mca_base_component_compare_priority(mca_base_component_priority_list_item_t *a, mca_base_component_priority_list_item_t *b); - int mca_base_component_compare(const mca_base_component_t *a, +OMPI_DECLSPEC int mca_base_component_compare(const mca_base_component_t *a, const mca_base_component_t *b); int mca_base_component_compatible(const mca_base_component_t *a, const mca_base_component_t *b); /* mca_base_component_find.c */ - int mca_base_component_find(const char *directory, const char *type, +OMPI_DECLSPEC int mca_base_component_find(const char *directory, const char *type, const mca_base_component_t *static_components[], ompi_list_t *found_components); /* mca_base_component_register.c */ - int mca_base_component_repository_initialize(void); - int mca_base_component_repository_retain(char *type, +OMPI_DECLSPEC int mca_base_component_repository_initialize(void); +OMPI_DECLSPEC int mca_base_component_repository_retain(char *type, lt_dlhandle component_handle, const mca_base_component_t *component_struct); - int mca_base_component_repository_link(const char *src_type, +OMPI_DECLSPEC int mca_base_component_repository_link(const char *src_type, const char *src_name, const char *depend_type, const char *depend_name); - void mca_base_component_repository_release(const mca_base_component_t *component); - void mca_base_component_repository_finalize(void); +OMPI_DECLSPEC void mca_base_component_repository_release(const mca_base_component_t *component); +OMPI_DECLSPEC void mca_base_component_repository_finalize(void); /* mca_base_components_open.c */ - int mca_base_components_open(const char *type_name, int output_id, +OMPI_DECLSPEC int mca_base_components_open(const char *type_name, int output_id, const mca_base_component_t **static_components, ompi_list_t *components_available); /* mca_base_components_close.c */ - int mca_base_components_close(int output_id, ompi_list_t *components_available, +OMPI_DECLSPEC int mca_base_components_close(int output_id, ompi_list_t *components_available, const mca_base_component_t *skip); /* mca_base_init_select_components.c */ - int mca_base_init_select_components(int requested, +OMPI_DECLSPEC int mca_base_init_select_components(int requested, bool allow_multi_user_threads, bool have_hidden_threads, int *provided); diff --git a/src/mca/base/mca_base_component_repository.c b/src/mca/base/mca_base_component_repository.c index d9c5ef17e9..b98753b8e8 100644 --- a/src/mca/base/mca_base_component_repository.c +++ b/src/mca/base/mca_base_component_repository.c @@ -2,9 +2,11 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include #include diff --git a/src/mca/base/mca_base_module_exchange.h b/src/mca/base/mca_base_module_exchange.h index 9b667da4cf..b4c51c30a5 100644 --- a/src/mca/base/mca_base_module_exchange.h +++ b/src/mca/base/mca_base_module_exchange.h @@ -9,7 +9,9 @@ #include "ompi_config.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif #include "proc/proc.h" #include "mca/mca.h" @@ -72,7 +74,7 @@ extern "C" { * in some format that peer processes will be able to read it, * regardless of pointer sizes or endian bias. */ - int mca_base_modex_send(mca_base_component_t *source_component, +OMPI_DECLSPEC int mca_base_modex_send(mca_base_component_t *source_component, const void *buffer, size_t size); /** @@ -108,24 +110,24 @@ extern "C" { * count). See the explanation in mca_base_modex_send() for why the * number of bytes is split into two parts. */ - int mca_base_modex_recv(mca_base_component_t *dest_component, +OMPI_DECLSPEC int mca_base_modex_recv(mca_base_component_t *dest_component, ompi_proc_t *source_proc, void **buffer, size_t *size); /* * Called to subscribe to registry. */ - int mca_base_modex_exchange(void); +OMPI_DECLSPEC int mca_base_modex_exchange(void); /** * */ - int mca_base_modex_init(void); +OMPI_DECLSPEC int mca_base_modex_init(void); /** * */ - int mca_base_modex_finalize(void); +OMPI_DECLSPEC int mca_base_modex_finalize(void); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/base/mca_base_msgbuf.h b/src/mca/base/mca_base_msgbuf.h index e4ee696c4a..cc25c77950 100644 --- a/src/mca/base/mca_base_msgbuf.h +++ b/src/mca/base/mca_base_msgbuf.h @@ -61,7 +61,7 @@ typedef struct mca_base_msgbuffer_s* mca_base_msgbuf_t; * unlimited buffer. * * Giving a req size just makes it more memory efficient. */ -mca_base_msgbuf_t mca_base_msgbuf_new (size_t reqsize); +OMPI_DECLSPEC mca_base_msgbuf_t mca_base_msgbuf_new (size_t reqsize); /* make a copy of an existing buffer * @@ -72,7 +72,7 @@ mca_base_msgbuf_t mca_base_msgbuf_new (size_t reqsize); * * this is usefull for the registry and is needed as unpack is * destructive */ -int mca_base_msgbuf_copy (mca_base_msgbuf_t* copybufid, mca_base_msgbuf_t orgbufid); +OMPI_DECLSPEC int mca_base_msgbuf_copy (mca_base_msgbuf_t* copybufid, mca_base_msgbuf_t orgbufid); /* set a buffer to a block of memory so that you do not pack/memory copy * @@ -85,7 +85,7 @@ int mca_base_msgbuf_copy (mca_base_msgbuf_t* copybufid, mca_base_msgbuf_t orgbu * to pack a buffer but do a send from memory directly * a free on this special buffer just frees its structure not the memory */ -mca_base_msgbuf_t mca_base_msgbuf_construct (void* ptr, size_t datasize); +OMPI_DECLSPEC mca_base_msgbuf_t mca_base_msgbuf_construct (void* ptr, size_t datasize); /* explicit free of a buffer when not auto freeing them * @@ -96,7 +96,7 @@ mca_base_msgbuf_t mca_base_msgbuf_construct (void* ptr, size_t datasize); * This routine resets the handle the user passing inso that they can only * free it once */ -int mca_base_msgbuf_free (mca_base_msgbuf_t* bufid); +OMPI_DECLSPEC int mca_base_msgbuf_free (mca_base_msgbuf_t* bufid); /* pack and non-string typed data * @@ -110,7 +110,7 @@ int mca_base_msgbuf_free (mca_base_msgbuf_t* bufid); * If the buffer fills up, it will automatically resize unless allocated * with fixed buffer size. */ -int mca_base_msgbuf_pack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items, mca_base_msgbuf_data_t datatype); +OMPI_DECLSPEC int mca_base_msgbuf_pack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items, mca_base_msgbuf_data_t datatype); /* unpack non-string typed data @@ -127,7 +127,7 @@ int mca_base_msgbuf_pack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items, * request, the routine will unpack what it can and then return an error. * The user is responsible for unpacking a message correctly. */ -int mca_base_msgbuf_unpack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items, mca_base_msgbuf_data_t datatype); +OMPI_DECLSPEC int mca_base_msgbuf_unpack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items, mca_base_msgbuf_data_t datatype); /* pack a NULL terminated string * @@ -139,7 +139,7 @@ int mca_base_msgbuf_unpack (mca_base_msgbuf_t bufid, void* ptr, size_t num_item * If the buffer fills up, it will automatically resize unless allocated * with a fixed buffer size. */ -int mca_base_msgbuf_pack_string (mca_base_msgbuf_t bufid, char* strptr); +OMPI_DECLSPEC int mca_base_msgbuf_pack_string (mca_base_msgbuf_t bufid, char* strptr); /* unpack a NULL terminated string * @@ -153,7 +153,7 @@ int mca_base_msgbuf_pack_string (mca_base_msgbuf_t bufid, char* strptr); * then the routine truncates the string but always NULL terminates it. * */ -int mca_base_msgbuf_unpack_string (mca_base_msgbuf_t bufid, char* strptr, size_t maxlen); +OMPI_DECLSPEC int mca_base_msgbuf_unpack_string (mca_base_msgbuf_t bufid, char* strptr, size_t maxlen); /* constants */ diff --git a/src/mca/base/mca_base_open.c b/src/mca/base/mca_base_open.c index bb6bb3a504..516fb9f2d7 100644 --- a/src/mca/base/mca_base_open.c +++ b/src/mca/base/mca_base_open.c @@ -2,12 +2,14 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include -#include +#if HAVE_SYSLOG_H +#include +#endif #include "util/output.h" #include "util/printf.h" #include "mca/mca.h" @@ -88,7 +90,9 @@ static void set_defaults(ompi_output_stream_t *lds) lds->lds_is_debugging = false; lds->lds_verbose_level = 0; lds->lds_want_syslog = false; +#ifndef WIN32 lds->lds_syslog_priority = LOG_INFO; +#endif lds->lds_syslog_ident = "ompi"; lds->lds_want_stdout = false; lds->lds_want_stderr = true; @@ -121,8 +125,10 @@ static void parse_verbose(char *e, ompi_output_stream_t *lds) if (NULL != next) *next = '\0'; + if (0 == strcasecmp(ptr, "syslog")) { - lds->lds_want_syslog = true; +#ifndef WIN32 /* there is no syslog */ + lds->lds_want_syslog = true; have_output = true; } else if (strncasecmp(ptr, "syslogpri:", 10) == 0) { @@ -137,7 +143,8 @@ static void parse_verbose(char *e, ompi_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) { lds->lds_want_stdout = true; diff --git a/src/mca/base/mca_base_param.h b/src/mca/base/mca_base_param.h index 085936522a..65ab513c84 100644 --- a/src/mca/base/mca_base_param.h +++ b/src/mca/base/mca_base_param.h @@ -64,7 +64,7 @@ extern "C" { * invoked internally (by mca_base_open()) and is only documented * here for completeness. */ - int mca_base_param_init(void); +OMPI_DECLSPEC int mca_base_param_init(void); /** * Register an integer MCA parameter. @@ -108,7 +108,7 @@ extern "C" { * returned, but the default value will be changed to reflect the * last registration. */ - int mca_base_param_register_int(const char *type_name, +OMPI_DECLSPEC int mca_base_param_register_int(const char *type_name, const char *component_name, const char *param_name, const char *mca_param_name, @@ -136,7 +136,7 @@ extern "C" { * associated string default value (which is allowed to be NULL). * See mca_base_param_register_int() for all other details. */ - int mca_base_param_register_string(const char *type_name, +OMPI_DECLSPEC int mca_base_param_register_string(const char *type_name, const char *component_name, const char *param_name, const char *mca_param_name, @@ -165,7 +165,7 @@ extern "C" { * versions will cross reference and attempt to find parameter * values on attributes. */ - int mca_base_param_kv_associate(size_t index, int keyval); +OMPI_DECLSPEC int mca_base_param_kv_associate(size_t index, int keyval); /** * Look up an integer MCA parameter. @@ -183,7 +183,7 @@ extern "C" { * The value of a specific MCA parameter can be looked up using the * return value from mca_base_param_register_int(). */ - int mca_base_param_lookup_int(int index, int *value); +OMPI_DECLSPEC int mca_base_param_lookup_int(int index, int *value); /** * Look up an integer MCA parameter, to include looking in @@ -205,7 +205,7 @@ extern "C" { * value. The function mca_base_param_kv_associate() must have been * called first to associate a keyval with the index. */ - int mca_base_param_kv_lookup_int(int index, +OMPI_DECLSPEC int mca_base_param_kv_lookup_int(int index, struct ompi_hash_table_t *attrs, int *value); @@ -225,7 +225,7 @@ extern "C" { * The value of a specific MCA parameter can be looked up using the * return value from mca_base_param_register_string(). */ - int mca_base_param_lookup_string(int index, char **value); +OMPI_DECLSPEC int mca_base_param_lookup_string(int index, char **value); /** * Look up a string MCA parameter, to include looking in attributes. @@ -246,7 +246,7 @@ extern "C" { * parameter value. The function mca_base_param_kv_associate() must * have been called first to associate a keyval with the index. */ - int mca_base_param_kv_lookup_string(int index, +OMPI_DECLSPEC int mca_base_param_kv_lookup_string(int index, struct ompi_hash_table_t *attrs, char **value); @@ -269,7 +269,7 @@ extern "C" { * can be used with mca_base_param_lookup_int() and * mca_base_param_lookup_string(). */ - int mca_base_param_find(const char *type, const char *component, +OMPI_DECLSPEC int mca_base_param_find(const char *type, const char *component, const char *param); /** @@ -286,7 +286,7 @@ extern "C" { * when the process is shutting down (e.g., during MPI_FINALIZE). It * is only documented here for completeness. */ - int mca_base_param_finalize(void); +OMPI_DECLSPEC int mca_base_param_finalize(void); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/base/mca_base_param_internal.h b/src/mca/base/mca_base_param_internal.h index 5dad9d52ed..27954820cb 100644 --- a/src/mca/base/mca_base_param_internal.h +++ b/src/mca/base/mca_base_param_internal.h @@ -140,7 +140,7 @@ OBJ_CLASS_DECLARATION(mca_base_param_file_value_t); * * Global list of params and values read in from MCA parameter files */ -extern ompi_list_t mca_base_param_file_values; +OMPI_DECLSPEC extern ompi_list_t mca_base_param_file_values; #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/mca/coll/base/base.h b/src/mca/coll/base/base.h index e17d72d1e4..0cbe9b6ba8 100644 --- a/src/mca/coll/base/base.h +++ b/src/mca/coll/base/base.h @@ -51,7 +51,7 @@ extern "C" { * public interface member -- and is only mentioned here for * completeness. */ - int mca_coll_base_open(void); +OMPI_DECLSPEC int mca_coll_base_open(void); /** * Create list of available coll components. @@ -78,7 +78,7 @@ extern "C" { * functions -- it is not considered a public interface member -- * and is only mentioned here for completeness. */ - int mca_coll_base_find_available(bool *allow_multi_user_threads, +OMPI_DECLSPEC int mca_coll_base_find_available(bool *allow_multi_user_threads, bool *have_hidden_threads); /** @@ -137,7 +137,7 @@ extern "C" { * communicator creation functions may be re-entered (albiet with * different arguments). */ - int mca_coll_base_comm_select(struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_coll_base_comm_select(struct ompi_communicator_t *comm, struct mca_base_component_t *preferred); /** @@ -161,7 +161,7 @@ extern "C" { * mca_coll_base_select(), as result of this function, other * communicators may also be destroyed. */ - int mca_coll_base_comm_unselect(struct ompi_communicator_t *comm); +OMPI_DECLSPEC int mca_coll_base_comm_unselect(struct ompi_communicator_t *comm); /** * Finalize the coll usage on a communicator. @@ -170,7 +170,7 @@ extern "C" { * * @retval OMPI_SUCCESS Always. */ - int mca_coll_base_comm_finalize(struct ompi_communicator_t *comm); +OMPI_DECLSPEC int mca_coll_base_comm_finalize(struct ompi_communicator_t *comm); /** * Shut down the coll MCA framework. @@ -183,7 +183,7 @@ extern "C" { * * It must be the last function invoked on the coll MCA framework. */ - int mca_coll_base_close(void); +OMPI_DECLSPEC int mca_coll_base_close(void); /* @@ -194,56 +194,56 @@ extern "C" { * Index number from the "coll" MCA parameter, created when the coll * framework is initialized and used during scope selection. */ -extern int mca_coll_base_param; +OMPI_DECLSPEC extern int mca_coll_base_param; /** * Coll framework debugging stream ID used with ompi_output() and * ompi_output_verbose(). */ -extern int mca_coll_base_output; +OMPI_DECLSPEC extern int mca_coll_base_output; /** * JMS should this move to the basic component? */ -extern int mca_coll_base_crossover; +OMPI_DECLSPEC extern int mca_coll_base_crossover; /** * JMS should this move to the basic component? */ -extern int mca_coll_base_associative; +OMPI_DECLSPEC extern int mca_coll_base_associative; /** * JMS should this move to the basic component? */ -extern int mca_coll_base_reduce_crossover; +OMPI_DECLSPEC extern int mca_coll_base_reduce_crossover; /** * JMS should this move to the basic component? */ -extern int mca_coll_base_bcast_collmaxlin; +OMPI_DECLSPEC extern int mca_coll_base_bcast_collmaxlin; /** * JMS should this move to the basic component? */ -extern int mca_coll_base_bcast_collmaxdim; +OMPI_DECLSPEC extern int mca_coll_base_bcast_collmaxdim; /** * Indicator as to whether the list of opened coll components is valid or * not. */ -extern bool mca_coll_base_components_opened_valid; +OMPI_DECLSPEC extern bool mca_coll_base_components_opened_valid; /** * List of all opened components; created when the coll framework is * initialized and destroyed when we reduce the list to all available * coll components. */ -extern ompi_list_t mca_coll_base_components_opened; +OMPI_DECLSPEC extern ompi_list_t mca_coll_base_components_opened; /** * Indicator as to whether the list of available coll components is valid * or not. */ -extern bool mca_coll_base_components_available_valid; +OMPI_DECLSPEC extern bool mca_coll_base_components_available_valid; /** * List of all available components; created by reducing the list of open * components to all those who indicate that they may run during this * process. */ -extern ompi_list_t mca_coll_base_components_available; +OMPI_DECLSPEC extern ompi_list_t mca_coll_base_components_available; /** * Pointer to the "basic" component so that it can be found easily @@ -251,7 +251,7 @@ extern ompi_list_t mca_coll_base_components_available; * common denominator between all coll components and may be used * interchangably). */ -extern const mca_coll_base_component_1_0_0_t *mca_coll_base_basic_component; +OMPI_DECLSPEC extern const mca_coll_base_component_1_0_0_t *mca_coll_base_basic_component; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/coll/base/coll_base_open.c b/src/mca/coll/base/coll_base_open.c index 86c1802b51..28b5827b2d 100644 --- a/src/mca/coll/base/coll_base_open.c +++ b/src/mca/coll/base/coll_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include "util/output.h" @@ -19,8 +19,12 @@ * statements and the definition of an array of pointers to each * component's public mca_base_component_t struct. */ - +#ifdef WIN32 + const mca_base_component_t *mca_coll_base_static_components[] = {NULL}; +#else #include "mca/coll/base/static-components.h" +#endif + /* diff --git a/src/mca/coll/basic/coll_basic.h b/src/mca/coll/basic/coll_basic.h index 8502d00586..3af9d2e378 100644 --- a/src/mca/coll/basic/coll_basic.h +++ b/src/mca/coll/basic/coll_basic.h @@ -21,8 +21,8 @@ extern "C" { * Globally exported variable */ -extern const mca_coll_base_component_1_0_0_t mca_coll_basic_component; -extern int mca_coll_basic_priority_param; +OMPI_COMP_EXPORT extern const mca_coll_base_component_1_0_0_t mca_coll_basic_component; +OMPI_COMP_EXPORT extern int mca_coll_basic_priority_param; /* diff --git a/src/mca/coll/demo/coll-demo-version.h.template.in b/src/mca/coll/demo/coll-demo-version.h.template.in new file mode 100644 index 0000000000..8828ee1031 --- /dev/null +++ b/src/mca/coll/demo/coll-demo-version.h.template.in @@ -0,0 +1,19 @@ +/* + * This file is automatically created by autogen.sh; it should not + * be edited by hand!! + * + * List of version number for this component + */ + +#ifndef MCA_COLL_DEMO_VERSION_H +#define MCA_COLL_DEMO_VERSION_H + +#define MCA_COLL_DEMO_MAJOR_VERSION @MCA_COLL_DEMO_MAJOR_VERSION@ +#define MCA_COLL_DEMO_MINOR_VERSION @MCA_COLL_DEMO_MINOR_VERSION@ +#define MCA_COLL_DEMO_RELEASE_VERSION @MCA_COLL_DEMO_RELEASE_VERSION@ +#define MCA_COLL_DEMO_ALPHA_VERSION @MCA_COLL_DEMO_ALPHA_VERSION@ +#define MCA_COLL_DEMO_BETA_VERSION @MCA_COLL_DEMO_BETA_VERSION@ +#define MCA_COLL_DEMO_SVN_VERSION "@MCA_COLL_DEMO_SVN_VERSION@" +#define MCA_COLL_DEMO_FULL_VERSION "@MCA_COLL_DEMO_VERSION@" + +#endif /* MCA_COLL_DEMO_VERSION_H */ diff --git a/src/mca/coll/sm/coll_sm.h b/src/mca/coll/sm/coll_sm.h index 4fd0cc8a26..3d775fe7fa 100644 --- a/src/mca/coll/sm/coll_sm.h +++ b/src/mca/coll/sm/coll_sm.h @@ -36,7 +36,7 @@ typedef struct mca_coll_base_module_comm_t { * Globally exported variables */ -extern const mca_coll_base_component_1_0_0_t mca_coll_sm_component; +OMPI_DECLSPEC extern const mca_coll_base_component_1_0_0_t mca_coll_sm_component; /* diff --git a/src/mca/common/sm/common_sm_mmap.c b/src/mca/common/sm/common_sm_mmap.c index 9abfda28bf..45271c78b1 100644 --- a/src/mca/common/sm/common_sm_mmap.c +++ b/src/mca/common/sm/common_sm_mmap.c @@ -1,13 +1,19 @@ #include "ompi_config.h" #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include #include +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include +#ifdef HAVE_SYS_MMAN_H #include +#endif #include "include/constants.h" #include "util/output.h" diff --git a/src/mca/common/sm/common_sm_mmap.h b/src/mca/common/sm/common_sm_mmap.h index 73d270dabb..1c9bf653b7 100644 --- a/src/mca/common/sm/common_sm_mmap.h +++ b/src/mca/common/sm/common_sm_mmap.h @@ -67,7 +67,7 @@ void mca_common_sm_mmap_free(void* addr); * Instance that is shared between components that use shared memory */ -extern mca_common_sm_mmap_t *mca_common_sm_mmap; +OMPI_DECLSPEC extern mca_common_sm_mmap_t *mca_common_sm_mmap; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/io/base/base.h b/src/mca/io/base/base.h index ed57427584..18ff94dd25 100644 --- a/src/mca/io/base/base.h +++ b/src/mca/io/base/base.h @@ -45,7 +45,7 @@ extern "C" { * public interface member -- and is only mentioned here for * completeness. */ - int mca_io_base_open(void); +OMPI_DECLSPEC int mca_io_base_open(void); /** * Create list of available io components. @@ -72,7 +72,7 @@ extern "C" { * functions -- it is not considered a public interface member -- * and is only mentioned here for completeness. */ - int mca_io_base_find_available(bool *allow_multi_user_threads, +OMPI_DECLSPEC int mca_io_base_find_available(bool *allow_multi_user_threads, bool *have_hidden_threads); /** @@ -125,7 +125,7 @@ extern "C" { * file handle, or no component was selected and an error is * returned up the stack. */ - int mca_io_base_file_select(struct ompi_file_t *file, +OMPI_DECLSPEC int mca_io_base_file_select(struct ompi_file_t *file, struct mca_base_component_t *preferred); /** @@ -148,7 +148,7 @@ extern "C" { * mca_io_base_select(), as result of this function, other * file handles may also be destroyed. */ - int mca_io_base_file_unselect(struct ompi_file_t *file); +OMPI_DECLSPEC int mca_io_base_file_unselect(struct ompi_file_t *file); /** * Invoke a back-end component to delete a file. @@ -162,7 +162,7 @@ extern "C" { * the available components (rather than some pre-selected * module). See io.h for details. */ - int mca_io_base_delete(char *filename, struct ompi_info_t *info); +OMPI_DECLSPEC int mca_io_base_delete(char *filename, struct ompi_info_t *info); /** * Shut down the io MCA framework. @@ -175,7 +175,7 @@ extern "C" { * * It must be the last function invoked on the io MCA framework. */ - int mca_io_base_close(void); +OMPI_DECLSPEC int mca_io_base_close(void); /* @@ -186,35 +186,35 @@ extern "C" { * Index number from the "io" MCA parameter, created when the io * framework is initialized and used during scope selection. */ -extern int mca_io_base_param; +OMPI_DECLSPEC extern int mca_io_base_param; /** * io framework debugging stream ID used with ompi_output() and * ompi_output_verbose(). */ -extern int mca_io_base_output; +OMPI_DECLSPEC extern int mca_io_base_output; /** * Indicator as to whether the list of opened io components is valid or * not. */ -extern bool mca_io_base_components_opened_valid; +OMPI_DECLSPEC extern bool mca_io_base_components_opened_valid; /** * List of all opened components; created when the io framework is * initialized and destroyed when we reduce the list to all available * io components. */ -extern ompi_list_t mca_io_base_components_opened; +OMPI_DECLSPEC extern ompi_list_t mca_io_base_components_opened; /** * Indicator as to whether the list of available io components is valid * or not. */ -extern bool mca_io_base_components_available_valid; +OMPI_DECLSPEC extern bool mca_io_base_components_available_valid; /** * List of all available components; created by reducing the list of open * components to all those who indicate that they may run during this * process. */ -extern ompi_list_t mca_io_base_components_available; +OMPI_DECLSPEC extern ompi_list_t mca_io_base_components_available; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/io/base/io_base_open.c b/src/mca/io/base/io_base_open.c index 37817ae737..684b0cf47b 100644 --- a/src/mca/io/base/io_base_open.c +++ b/src/mca/io/base/io_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include "util/output.h" @@ -19,9 +19,11 @@ * statements and the definition of an array of pointers to each * component's public mca_base_component_t struct. */ - +#ifdef WIN32 + const mca_base_component_t *mca_io_base_static_components[] = {NULL}; +#else #include "mca/io/base/static-components.h" - +#endif /* * Global variables; most of which are loaded by back-ends of MCA diff --git a/src/mca/llm/base/base.h b/src/mca/llm/base/base.h index a983eff8d4..7cc0633fa2 100644 --- a/src/mca/llm/base/base.h +++ b/src/mca/llm/base/base.h @@ -23,17 +23,17 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - int mca_llm_base_open(void); - int mca_llm_base_select(const char *active_pcm, +OMPI_DECLSPEC int mca_llm_base_open(void); +OMPI_DECLSPEC int mca_llm_base_select(const char *active_pcm, mca_llm_base_module_t **selected, bool have_threads); - int mca_llm_base_close(void); +OMPI_DECLSPEC int mca_llm_base_close(void); /* * Globals */ -extern int mca_llm_base_output; -extern ompi_list_t mca_llm_base_components_available; +OMPI_DECLSPEC extern int mca_llm_base_output; +OMPI_DECLSPEC extern ompi_list_t mca_llm_base_components_available; #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/src/mca/llm/base/base_internal.h b/src/mca/llm/base/base_internal.h index 3d019e3d30..f0d54a0484 100644 --- a/src/mca/llm/base/base_internal.h +++ b/src/mca/llm/base/base_internal.h @@ -53,7 +53,7 @@ struct mca_llm_base_hostfile_data_t { /** shorten ompi_rte_base_hostfile_data_t declarations */ typedef struct mca_llm_base_hostfile_data_t mca_llm_base_hostfile_data_t; /** create the required instance information */ -OBJ_CLASS_DECLARATION(mca_llm_base_hostfile_data_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_llm_base_hostfile_data_t); #if defined(c_plusplus) || defined(__cplusplus) @@ -64,7 +64,7 @@ extern "C" { * unit tests or mca_llm_base_open. In other words, you probably * don't want to call this function. */ - void mca_llm_base_setup(void); + OMPI_DECLSPEC void mca_llm_base_setup(void); /** @@ -73,7 +73,7 @@ extern "C" { * \return ompi_list_t containing a list of * mca_llm_base_hostfile_node_t information. */ - ompi_list_t *mca_llm_base_parse_hostfile(const char* filename); + OMPI_DECLSPEC ompi_list_t *mca_llm_base_parse_hostfile(const char* filename); /** @@ -86,7 +86,7 @@ extern "C" { * \note If the same key is used with different values, the hosts * are considered different. */ - int mca_llm_base_collapse_resources(ompi_list_t *hostlist); + OMPI_DECLSPEC int mca_llm_base_collapse_resources(ompi_list_t *hostlist); /** @@ -96,7 +96,7 @@ extern "C" { * \param hostlist An ompi_list_t containing * mca_llm_base_hostfile_node_t instances. */ - int mca_llm_base_map_resources(int nodes, + OMPI_DECLSPEC int mca_llm_base_map_resources(int nodes, int procs, ompi_list_t *hostlist); @@ -106,12 +106,12 @@ extern "C" { * mca_llm_base_hostfile_node_t instances and wrap it in an * ompi_node_allocation_t list. */ - ompi_list_t *mca_llm_base_create_node_allocation(ompi_list_t *hostlist); + OMPI_DECLSPEC ompi_list_t *mca_llm_base_create_node_allocation(ompi_list_t *hostlist); /** * free a list of mca_llm_base_hostfile_node_t instances */ - void mca_llm_base_deallocate(ompi_list_t *hostlist); + OMPI_DECLSPEC void mca_llm_base_deallocate(ompi_list_t *hostlist); #if defined(c_plusplus) || defined(__cplusplus) } @@ -120,6 +120,6 @@ extern "C" { /** * Mutex wrapping the \code mca_llm_base_parse_hostfile function. */ -extern ompi_mutex_t mca_llm_base_parse_mutex; +OMPI_DECLSPEC extern ompi_mutex_t mca_llm_base_parse_mutex; #endif diff --git a/src/mca/llm/base/llm_base_open.c b/src/mca/llm/base/llm_base_open.c index 354872cdf1..d11b1d466b 100644 --- a/src/mca/llm/base/llm_base_open.c +++ b/src/mca/llm/base/llm_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/llm/llm.h" @@ -18,7 +18,11 @@ * module's public mca_base_module_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_llm_base_static_components[] = {NULL}; +#else #include "mca/llm/base/static-components.h" +#endif /* * Global variables diff --git a/src/mca/llm/base/llm_base_parse_hostfile.c b/src/mca/llm/base/llm_base_parse_hostfile.c index 83f96bc79b..df89acdd11 100644 --- a/src/mca/llm/base/llm_base_parse_hostfile.c +++ b/src/mca/llm/base/llm_base_parse_hostfile.c @@ -2,9 +2,11 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" +#ifdef HAVE_UNISTD_H #include +#endif #include "class/ompi_list.h" #include "runtime/runtime.h" diff --git a/src/mca/llm/hostfile/src/llm_hostfile.h b/src/mca/llm/hostfile/src/llm_hostfile.h index 5774bc9e74..ad145e5384 100644 --- a/src/mca/llm/hostfile/src/llm_hostfile.h +++ b/src/mca/llm/hostfile/src/llm_hostfile.h @@ -18,7 +18,7 @@ extern "C" { /* * Globally exported variable */ -extern const mca_llm_base_component_1_0_0_t mca_llm_hostfile_component; +OMPI_COMP_EXPORT extern const mca_llm_base_component_1_0_0_t mca_llm_hostfile_component; /* * llm API functions diff --git a/src/mca/mpool/base/base.h b/src/mca/mpool/base/base.h index d3763fa76d..44a605d913 100644 --- a/src/mca/mpool/base/base.h +++ b/src/mca/mpool/base/base.h @@ -30,19 +30,19 @@ OBJ_CLASS_DECLARATION(mca_mpool_base_selected_module_t); * Global functions for MCA: overall mpool open and close */ - int mca_mpool_base_open(void); - int mca_mpool_base_init(bool *allow_multi_user_threads); - int mca_mpool_base_close(void); - mca_mpool_base_component_t* mca_mpool_component_lookup(const char* name); - mca_mpool_base_module_t* mca_mpool_module_lookup(const char* name); +OMPI_DECLSPEC int mca_mpool_base_open(void); +OMPI_DECLSPEC int mca_mpool_base_init(bool *allow_multi_user_threads); +OMPI_DECLSPEC int mca_mpool_base_close(void); +OMPI_DECLSPEC mca_mpool_base_component_t* mca_mpool_component_lookup(const char* name); +OMPI_DECLSPEC mca_mpool_base_module_t* mca_mpool_module_lookup(const char* name); /* * Globals */ -extern int mca_mpool_base_output; -extern ompi_list_t mca_mpool_base_components; -extern ompi_list_t mca_mpool_base_modules; +OMPI_DECLSPEC extern int mca_mpool_base_output; +OMPI_DECLSPEC extern ompi_list_t mca_mpool_base_components; +OMPI_DECLSPEC extern ompi_list_t mca_mpool_base_modules; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/mpool/base/mpool_base_open.c b/src/mca/mpool/base/mpool_base_open.c index 3f17a3198e..2565dad880 100644 --- a/src/mca/mpool/base/mpool_base_open.c +++ b/src/mca/mpool/base/mpool_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include "mca/mca.h" @@ -18,7 +18,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_mpool_base_static_components[] = {NULL}; +#else #include "mca/mpool/base/static-components.h" +#endif /* diff --git a/src/mca/mpool/sm/mpool_sm.h b/src/mca/mpool/sm/mpool_sm.h index be8f6f8bb4..3938f18434 100644 --- a/src/mca/mpool/sm/mpool_sm.h +++ b/src/mca/mpool/sm/mpool_sm.h @@ -25,8 +25,8 @@ struct mca_mpool_sm_component_t { }; typedef struct mca_mpool_sm_component_t mca_mpool_sm_component_t; -extern mca_mpool_sm_component_t mca_mpool_sm_component; -extern mca_mpool_base_module_t mca_mpool_sm_module; +OMPI_COMP_EXPORT extern mca_mpool_sm_component_t mca_mpool_sm_component; +OMPI_COMP_EXPORT extern mca_mpool_base_module_t mca_mpool_sm_module; /* * Returns base address of shared memory mapping. diff --git a/src/mca/ns/base/base.h b/src/mca/ns/base/base.h index e9a833f649..d6a818ecc5 100644 --- a/src/mca/ns/base/base.h +++ b/src/mca/ns/base/base.h @@ -33,54 +33,54 @@ extern "C" { }; typedef struct ompi_name_server_namelist_t ompi_name_server_namelist_t; - OBJ_CLASS_DECLARATION(ompi_name_server_namelist_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_name_server_namelist_t); - int mca_ns_base_open(void); - int mca_ns_base_select(bool *allow_multi_user_threads, +OMPI_DECLSPEC int mca_ns_base_open(void); +OMPI_DECLSPEC int mca_ns_base_select(bool *allow_multi_user_threads, bool *have_hidden_threads); - int mca_ns_base_close(void); +OMPI_DECLSPEC int mca_ns_base_close(void); /* * Base functions that are common to all implementations - can be overridden */ - int ns_base_assign_cellid_to_process(ompi_process_name_t* name); +OMPI_DECLSPEC int ns_base_assign_cellid_to_process(ompi_process_name_t* name); - ompi_process_name_t* ns_base_create_process_name(mca_ns_base_cellid_t cell, +OMPI_DECLSPEC ompi_process_name_t* ns_base_create_process_name(mca_ns_base_cellid_t cell, mca_ns_base_jobid_t job, mca_ns_base_vpid_t vpid); - ompi_process_name_t* ns_base_copy_process_name(ompi_process_name_t* name); +OMPI_DECLSPEC ompi_process_name_t* ns_base_copy_process_name(ompi_process_name_t* name); - ompi_process_name_t* ns_base_convert_string_to_process_name(const char* name); +OMPI_DECLSPEC ompi_process_name_t* ns_base_convert_string_to_process_name(const char* name); - char* ns_base_get_proc_name_string(const ompi_process_name_t* name); +OMPI_DECLSPEC char* ns_base_get_proc_name_string(const ompi_process_name_t* name); - char* ns_base_get_vpid_string(const ompi_process_name_t* name); +OMPI_DECLSPEC char* ns_base_get_vpid_string(const ompi_process_name_t* name); - char* ns_base_get_jobid_string(const ompi_process_name_t* name); +OMPI_DECLSPEC char* ns_base_get_jobid_string(const ompi_process_name_t* name); - char* ns_base_convert_jobid_to_string(const mca_ns_base_jobid_t jobid); +OMPI_DECLSPEC char* ns_base_convert_jobid_to_string(const mca_ns_base_jobid_t jobid); - char* ns_base_get_cellid_string(const ompi_process_name_t* name); +OMPI_DECLSPEC char* ns_base_get_cellid_string(const ompi_process_name_t* name); - mca_ns_base_vpid_t ns_base_get_vpid(const ompi_process_name_t* name); +OMPI_DECLSPEC mca_ns_base_vpid_t ns_base_get_vpid(const ompi_process_name_t* name); - mca_ns_base_jobid_t ns_base_get_jobid(const ompi_process_name_t* name); +OMPI_DECLSPEC mca_ns_base_jobid_t ns_base_get_jobid(const ompi_process_name_t* name); - mca_ns_base_cellid_t ns_base_get_cellid(const ompi_process_name_t* name); +OMPI_DECLSPEC mca_ns_base_cellid_t ns_base_get_cellid(const ompi_process_name_t* name); - int ns_base_compare(ompi_ns_cmp_bitmask_t fields, +OMPI_DECLSPEC int ns_base_compare(ompi_ns_cmp_bitmask_t fields, const ompi_process_name_t* name1, const ompi_process_name_t* name2); - mca_ns_base_cellid_t ns_base_create_cellid(void); +OMPI_DECLSPEC mca_ns_base_cellid_t ns_base_create_cellid(void); - mca_ns_base_jobid_t ns_base_create_jobid(void); +OMPI_DECLSPEC mca_ns_base_jobid_t ns_base_create_jobid(void); - mca_ns_base_vpid_t ns_base_reserve_range(mca_ns_base_jobid_t job, mca_ns_base_vpid_t range); +OMPI_DECLSPEC mca_ns_base_vpid_t ns_base_reserve_range(mca_ns_base_jobid_t job, mca_ns_base_vpid_t range); - int ns_base_free_name(ompi_process_name_t* name); +OMPI_DECLSPEC int ns_base_free_name(ompi_process_name_t* name); @@ -88,11 +88,11 @@ extern "C" { * globals that might be needed */ -extern int mca_ns_base_output; -extern mca_ns_base_module_t ompi_name_server; /* holds selected module's function pointers */ -extern bool mca_ns_base_selected; -extern ompi_list_t mca_ns_base_components_available; -extern mca_ns_base_component_t mca_ns_base_selected_component; +OMPI_DECLSPEC extern int mca_ns_base_output; +OMPI_DECLSPEC extern mca_ns_base_module_t ompi_name_server; /* holds selected module's function pointers */ +OMPI_DECLSPEC extern bool mca_ns_base_selected; +OMPI_DECLSPEC extern ompi_list_t mca_ns_base_components_available; +OMPI_DECLSPEC extern mca_ns_base_component_t mca_ns_base_selected_component; /* * external API functions will be documented in the mca/ns/ns.h file diff --git a/src/mca/ns/base/ns_base_open.c b/src/mca/ns/base/ns_base_open.c index dfaa8938a3..3bd0900d0d 100644 --- a/src/mca/ns/base/ns_base_open.c +++ b/src/mca/ns/base/ns_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/base/mca_base_param.h" @@ -19,7 +19,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_ns_base_static_components[] = {NULL}; +#else #include "mca/ns/base/static-components.h" +#endif /* * globals diff --git a/src/mca/ns/base/ns_base_select.c b/src/mca/ns/base/ns_base_select.c index 67d28da1ad..12969b8410 100644 --- a/src/mca/ns/base/ns_base_select.c +++ b/src/mca/ns/base/ns_base_select.c @@ -2,14 +2,17 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include - +#endif #include "runtime/runtime.h" #include "util/output.h" #include "util/proc_info.h" diff --git a/src/mca/ns/ns.h b/src/mca/ns/ns.h index 8d2a3cc629..a4cb9ecfcc 100644 --- a/src/mca/ns/ns.h +++ b/src/mca/ns/ns.h @@ -20,7 +20,9 @@ #include "ompi_config.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include "include/types.h" @@ -33,6 +35,7 @@ /* * useful defines for bit-masks */ + #define OMPI_NS_CMP_CELLID 0x01 #define OMPI_NS_CMP_JOBID 0x02 #define OMPI_NS_CMP_VPID 0x04 diff --git a/src/mca/ns/replica/src/ns_replica.c b/src/mca/ns/replica/src/ns_replica.c index 7008a25582..9b92c412ac 100644 --- a/src/mca/ns/replica/src/ns_replica.c +++ b/src/mca/ns/replica/src/ns_replica.c @@ -38,16 +38,16 @@ mca_ns_base_cellid_t ns_replica_create_cellid(void) mca_ns_base_jobid_t ns_replica_create_jobid(void) { - mca_ns_replica_name_tracker_t *new; + mca_ns_replica_name_tracker_t *new_nt; OMPI_THREAD_LOCK(&mca_ns_replica_mutex); if ((MCA_NS_BASE_JOBID_MAX-2) >= mca_ns_replica_last_used_jobid) { mca_ns_replica_last_used_jobid = mca_ns_replica_last_used_jobid + 1; - new = OBJ_NEW(mca_ns_replica_name_tracker_t); - new->job = mca_ns_replica_last_used_jobid; - new->last_used_vpid = 0; - ompi_list_append(&mca_ns_replica_name_tracker, &new->item); + new_nt = OBJ_NEW(mca_ns_replica_name_tracker_t); + new_nt->job = mca_ns_replica_last_used_jobid; + new_nt->last_used_vpid = 0; + ompi_list_append(&mca_ns_replica_name_tracker, &new_nt->item); OMPI_THREAD_UNLOCK(&mca_ns_replica_mutex); return(mca_ns_replica_last_used_jobid); } else { diff --git a/src/mca/oob/base/base.h b/src/mca/oob/base/base.h index f1241f693f..6a8e519384 100644 --- a/src/mca/oob/base/base.h +++ b/src/mca/oob/base/base.h @@ -10,7 +10,9 @@ #define _MCA_OOB_BASE_H_ #include "mca/mca.h" #include "mca/ns/ns.h" -#include +#ifdef HAVE_SYS_UIO_H + #include +#endif #include "util/bufpack.h" @@ -18,9 +20,9 @@ * Well known address */ -extern ompi_process_name_t mca_oob_name_any; -extern ompi_process_name_t mca_oob_name_seed; -extern ompi_process_name_t mca_oob_name_self; +OMPI_DECLSPEC extern ompi_process_name_t mca_oob_name_any; +OMPI_DECLSPEC extern ompi_process_name_t mca_oob_name_seed; +OMPI_DECLSPEC extern ompi_process_name_t mca_oob_name_self; /** * The wildcard for recieves from any peer. @@ -92,7 +94,7 @@ extern "C" { * an OOB module prior to calling this routine. */ -char* mca_oob_get_contact_info(void); +OMPI_DECLSPEC char* mca_oob_get_contact_info(void); /** * Pre-populate the cache of contact information required by the OOB @@ -104,7 +106,7 @@ char* mca_oob_get_contact_info(void); * */ -int mca_oob_set_contact_info(const char*); +OMPI_DECLSPEC int mca_oob_set_contact_info(const char*); /** * A routine to ping a given process name to determine if it is reachable. @@ -117,13 +119,13 @@ int mca_oob_set_contact_info(const char*); * an error status is returned. */ -int mca_oob_ping(ompi_process_name_t* name, struct timeval* tv); +OMPI_DECLSPEC int mca_oob_ping(ompi_process_name_t* name, struct timeval* tv); /** * A barrier across all processes w/in the same job. */ -int mca_oob_barrier(void); +OMPI_DECLSPEC int mca_oob_barrier(void); /** * Extract from the contact info the peer process identifier. @@ -137,7 +139,7 @@ int mca_oob_barrier(void); * the process name. */ -int mca_oob_parse_contact_info(const char* uri, ompi_process_name_t* peer, char*** uris); +OMPI_DECLSPEC int mca_oob_parse_contact_info(const char* uri, ompi_process_name_t* peer, char*** uris); /** @@ -148,7 +150,7 @@ int mca_oob_parse_contact_info(const char* uri, ompi_process_name_t* peer, char* * must currently be set before calling mca_oob_base_init(). */ -int mca_oob_set_contact_info(const char*); +OMPI_DECLSPEC int mca_oob_set_contact_info(const char*); /** * Similiar to unix writev(2). @@ -170,7 +172,7 @@ int mca_oob_set_contact_info(const char*); * address. */ -int mca_oob_send( +OMPI_DECLSPEC int mca_oob_send( ompi_process_name_t* peer, struct iovec *msg, int count, @@ -186,7 +188,7 @@ int mca_oob_send( * @return OMPI error code (<0) on error or number of bytes actually sent. */ -int mca_oob_send_packed( +OMPI_DECLSPEC int mca_oob_send_packed( ompi_process_name_t* peer, ompi_buffer_t buffer, int tag, @@ -222,7 +224,7 @@ int mca_oob_send_packed( * */ -int mca_oob_recv( +OMPI_DECLSPEC int mca_oob_recv( ompi_process_name_t* peer, struct iovec *msg, int count, @@ -246,7 +248,7 @@ int mca_oob_recv( * */ -int mca_oob_recv_packed ( +OMPI_DECLSPEC int mca_oob_recv_packed ( ompi_process_name_t* peer, ompi_buffer_t *buf, int* tag); @@ -312,7 +314,7 @@ typedef void (*mca_oob_callback_packed_fn_t)( * */ -int mca_oob_send_nb( +OMPI_DECLSPEC int mca_oob_send_nb( ompi_process_name_t* peer, struct iovec* msg, int count, @@ -338,7 +340,7 @@ int mca_oob_send_nb( * */ -int mca_oob_send_packed_nb( +OMPI_DECLSPEC int mca_oob_send_packed_nb( ompi_process_name_t* peer, ompi_buffer_t buffer, int tag, @@ -362,7 +364,7 @@ int mca_oob_send_packed_nb( * that matches the call parameters. */ -int mca_oob_recv_nb( +OMPI_DECLSPEC int mca_oob_recv_nb( ompi_process_name_t* peer, struct iovec* msg, int count, @@ -379,7 +381,7 @@ int mca_oob_recv_nb( * @return OMPI error code (<0) on error or number of bytes actually received. */ -int mca_oob_recv_cancel( +OMPI_DECLSPEC int mca_oob_recv_cancel( ompi_process_name_t* peer, int tag); @@ -399,7 +401,7 @@ int mca_oob_recv_cancel( * that matches the call parameters. */ -int mca_oob_recv_packed_nb( +OMPI_DECLSPEC int mca_oob_recv_packed_nb( ompi_process_name_t* peer, int tag, int flags, diff --git a/src/mca/oob/base/oob_base_open.c b/src/mca/oob/base/oob_base_open.c index 2dd81be8cd..78cf9545ac 100644 --- a/src/mca/oob/base/oob_base_open.c +++ b/src/mca/oob/base/oob_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/base/mca_base_param.h" @@ -16,7 +16,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_oob_base_static_components[] = {NULL}; +#else #include "mca/oob/base/static-components.h" +#endif /* diff --git a/src/mca/oob/base/oob_base_ping.c b/src/mca/oob/base/oob_base_ping.c index a69b12009d..7427decf3e 100644 --- a/src/mca/oob/base/oob_base_ping.c +++ b/src/mca/oob/base/oob_base_ping.c @@ -4,9 +4,13 @@ #include "ompi_config.h" #include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include - +#endif + #include "include/constants.h" #include "mca/oob/oob.h" #include "mca/oob/base/base.h" diff --git a/src/mca/oob/base/oob_base_recv.c b/src/mca/oob/base/oob_base_recv.c index 60992eb4c1..33d945a079 100644 --- a/src/mca/oob/base/oob_base_recv.c +++ b/src/mca/oob/base/oob_base_recv.c @@ -2,12 +2,14 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "include/constants.h" #include "mca/oob/oob.h" #include "mca/oob/base/base.h" +#ifdef HAVE_NETINET_IN_H #include +#endif #include #include "util/bufpack.h" diff --git a/src/mca/oob/base/oob_base_recv_nb.c b/src/mca/oob/base/oob_base_recv_nb.c index 0ced4da043..dcee4887c6 100644 --- a/src/mca/oob/base/oob_base_recv_nb.c +++ b/src/mca/oob/base/oob_base_recv_nb.c @@ -2,14 +2,15 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "include/constants.h" #include "mca/oob/oob.h" #include "mca/oob/base/base.h" #include +#ifdef HAVE_NETINET_IN_H #include - +#endif /* * Internal type to handle non-blocking packed receive. diff --git a/src/mca/oob/base/oob_base_send.c b/src/mca/oob/base/oob_base_send.c index 526b6e8b5f..3e68ae1688 100644 --- a/src/mca/oob/base/oob_base_send.c +++ b/src/mca/oob/base/oob_base_send.c @@ -4,8 +4,14 @@ #include "ompi_config.h" #include + +#ifdef HAVE_SYS_TYPES_H #include +#endif + +#ifdef HAVE_NETINET_IN_H #include +#endif #include "include/constants.h" #include "mca/oob/oob.h" diff --git a/src/mca/oob/base/oob_base_send_nb.c b/src/mca/oob/base/oob_base_send_nb.c index de1d18a395..3d4f87093b 100644 --- a/src/mca/oob/base/oob_base_send_nb.c +++ b/src/mca/oob/base/oob_base_send_nb.c @@ -2,13 +2,16 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "include/constants.h" #include "mca/oob/oob.h" #include "mca/oob/base/base.h" #include + +#ifdef HAVE_NETINET_IN_H #include +#endif /* diff --git a/src/mca/oob/oob.h b/src/mca/oob/oob.h index 176b9973f5..5eb05b535c 100644 --- a/src/mca/oob/oob.h +++ b/src/mca/oob/oob.h @@ -226,7 +226,8 @@ typedef mca_oob_base_component_1_0_0_t mca_oob_base_component_t; * This is the first module on the list. This is here temporarily * to make things work */ -extern mca_oob_t mca_oob; + +OMPI_DECLSPEC extern mca_oob_t mca_oob; /** * associate a component and a module that belongs to it @@ -259,11 +260,11 @@ OBJ_CLASS_DECLARATION(mca_oob_base_info_t); /* * Global struct holding the selected module's function pointers */ -extern int mca_oob_base_output; -extern char* mca_oob_base_include; -extern char* mca_oob_base_exclude; -extern ompi_list_t mca_oob_base_components; -extern ompi_list_t mca_oob_base_modules; +OMPI_DECLSPEC extern int mca_oob_base_output; +OMPI_DECLSPEC extern char* mca_oob_base_include; +OMPI_DECLSPEC extern char* mca_oob_base_exclude; +OMPI_DECLSPEC extern ompi_list_t mca_oob_base_components; +OMPI_DECLSPEC extern ompi_list_t mca_oob_base_modules; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/oob/tcp/oob_tcp.c b/src/mca/oob/tcp/oob_tcp.c index 387712daf1..39fb750038 100644 --- a/src/mca/oob/tcp/oob_tcp.c +++ b/src/mca/oob/tcp/oob_tcp.c @@ -3,11 +3,19 @@ */ #include "ompi_config.h" +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #include +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #include "util/output.h" #include "util/if.h" #include "mca/oob/tcp/oob_tcp.h" diff --git a/src/mca/oob/tcp/oob_tcp.h b/src/mca/oob/tcp/oob_tcp.h index 72b90f6b90..5361cff8a0 100644 --- a/src/mca/oob/tcp/oob_tcp.h +++ b/src/mca/oob/tcp/oob_tcp.h @@ -252,7 +252,7 @@ struct mca_oob_tcp_component_t { */ typedef struct mca_oob_tcp_component_t mca_oob_tcp_component_t; -extern mca_oob_tcp_component_t mca_oob_tcp_component; +OMPI_COMP_EXPORT extern mca_oob_tcp_component_t mca_oob_tcp_component; #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/mca/oob/tcp/oob_tcp_addr.c b/src/mca/oob/tcp/oob_tcp_addr.c index aedce74e4d..94061749a8 100644 --- a/src/mca/oob/tcp/oob_tcp_addr.c +++ b/src/mca/oob/tcp/oob_tcp_addr.c @@ -1,8 +1,16 @@ #include "ompi_config.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #include #include "include/constants.h" #include "util/if.h" diff --git a/src/mca/oob/tcp/oob_tcp_addr.h b/src/mca/oob/tcp/oob_tcp_addr.h index d6bc6619f0..36618f9281 100644 --- a/src/mca/oob/tcp/oob_tcp_addr.h +++ b/src/mca/oob/tcp/oob_tcp_addr.h @@ -10,8 +10,12 @@ #define _MCA_OOB_TCP_ADDR_H_ #include "ompi_config.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "class/ompi_object.h" #include "util/bufpack.h" #include "mca/ns/ns.h" diff --git a/src/mca/oob/tcp/oob_tcp_peer.c b/src/mca/oob/tcp/oob_tcp_peer.c index b57f935050..a9eebc2840 100644 --- a/src/mca/oob/tcp/oob_tcp_peer.c +++ b/src/mca/oob/tcp/oob_tcp_peer.c @@ -2,14 +2,26 @@ * $HEADER$ */ #include "ompi_config.h" +#ifdef HAVE_UNISTD_H #include +#endif #include +#ifdef HAVE_SYS_UIO_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include -#include +#endif +#include +#ifdef HAVE_NETINET_TCP_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #include "util/output.h" #include "mca/gpr/base/base.h" #include "mca/gpr/gpr.h" diff --git a/src/mca/oob/tcp/oob_tcp_peer.h b/src/mca/oob/tcp/oob_tcp_peer.h index 6d8a3edebc..c2dd09af8f 100644 --- a/src/mca/oob/tcp/oob_tcp_peer.h +++ b/src/mca/oob/tcp/oob_tcp_peer.h @@ -10,7 +10,9 @@ #define _MCA_OOB_TCP_PEER_H_ #include "ompi_config.h" +#ifdef HAVE_NETINET_IN_H #include +#endif #include #include "class/ompi_list.h" diff --git a/src/mca/pcm/base/base.h b/src/mca/pcm/base/base.h index 4e34639f99..a56d5b4578 100644 --- a/src/mca/pcm/base/base.h +++ b/src/mca/pcm/base/base.h @@ -19,22 +19,22 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - int mca_pcm_base_open(void); +OMPI_DECLSPEC int mca_pcm_base_open(void); /* modules is a pointer to an array of pointers to mca_pcm_base_module_t structs */ - int mca_pcm_base_select(bool have_threads, +OMPI_DECLSPEC int mca_pcm_base_select(bool have_threads, int constraint, mca_pcm_base_module_t ***modules, size_t *modules_len); - int mca_pcm_base_close(void); +OMPI_DECLSPEC int mca_pcm_base_close(void); /* communicate the important parts of our structs around */ - int mca_pcm_base_send_schedule(FILE *fd, +OMPI_DECLSPEC int mca_pcm_base_send_schedule(FILE *fd, mca_ns_base_jobid_t jobid, ompi_rte_node_schedule_t *sched, int num_procs); - int mca_pcm_base_recv_schedule(FILE *fd, +OMPI_DECLSPEC int mca_pcm_base_recv_schedule(FILE *fd, mca_ns_base_jobid_t *jobid, ompi_rte_node_schedule_t *sched, int *num_procs); @@ -46,9 +46,9 @@ extern "C" { * nodes when spawning processes into \c out_envp. All variables * starting with OMPI_ are copied. */ - int mca_pcm_base_build_base_env(char **in_env, int *envc, char ***out_envp); +OMPI_DECLSPEC int mca_pcm_base_build_base_env(char **in_env, int *envc, char ***out_envp); - char* mca_pcm_base_get_username(mca_llm_base_hostfile_node_t *node); +OMPI_DECLSPEC char* mca_pcm_base_get_username(mca_llm_base_hostfile_node_t *node); /** * Get unique id string available from PCM components @@ -58,15 +58,15 @@ extern "C" { * for example). This function provides an interface for * retriving that information from the components. */ - char *mca_pcm_base_get_unique_id(void); +OMPI_DECLSPEC char *mca_pcm_base_get_unique_id(void); /* * Globals */ -extern int mca_pcm_base_output; -extern ompi_list_t mca_pcm_base_components_available; +OMPI_DECLSPEC extern int mca_pcm_base_output; +OMPI_DECLSPEC extern ompi_list_t mca_pcm_base_components_available; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/pcm/base/base_job_track.h b/src/mca/pcm/base/base_job_track.h index 9af69b5383..509e1a2cf9 100644 --- a/src/mca/pcm/base/base_job_track.h +++ b/src/mca/pcm/base/base_job_track.h @@ -8,7 +8,9 @@ #include "ompi_config.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif #include "mca/ns/ns.h" #include "runtime/runtime_types.h" diff --git a/src/mca/pcm/base/pcm_base_open.c b/src/mca/pcm/base/pcm_base_open.c index fe582a3c6b..cf27938fb4 100644 --- a/src/mca/pcm/base/pcm_base_open.c +++ b/src/mca/pcm/base/pcm_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/pcm/pcm.h" @@ -18,8 +18,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_pcm_base_static_components[] = {NULL}; +#else #include "mca/pcm/base/static-components.h" - +#endif /* * Global variables diff --git a/src/mca/pcm/wmi/src/pcm_wmi.h b/src/mca/pcm/wmi/src/pcm_wmi.h index 134977a546..d17237cd31 100644 --- a/src/mca/pcm/wmi/src/pcm_wmi.h +++ b/src/mca/pcm/wmi/src/pcm_wmi.h @@ -15,7 +15,9 @@ #include "include/types.h" #include "class/ompi_list.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif #ifndef MCA_PCM_WMI_H_ #define MCA_PCM_WMI_H_ diff --git a/src/mca/pcm/wmi/src/pcm_wmi_component.c b/src/mca/pcm/wmi/src/pcm_wmi_component.c index 726a3a3aca..f28c4ea5d2 100644 --- a/src/mca/pcm/wmi/src/pcm_wmi_component.c +++ b/src/mca/pcm/wmi/src/pcm_wmi_component.c @@ -4,8 +4,8 @@ * */ -#include "ompi_config.h" +#include "ompi_config.h" #include "pcm_wmi.h" #include "include/constants.h" #include "include/types.h" @@ -19,7 +19,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* * Struct of function pointers and all that to let us be initialized diff --git a/src/mca/pcmclient/base/base.h b/src/mca/pcmclient/base/base.h index 4955e9bbe3..f39bb2adaa 100644 --- a/src/mca/pcmclient/base/base.h +++ b/src/mca/pcmclient/base/base.h @@ -19,19 +19,19 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - int mca_pcmclient_base_open(void); - int mca_pcmclient_base_select(bool *allow_multi_user_threads, +OMPI_DECLSPEC int mca_pcmclient_base_open(void); +OMPI_DECLSPEC int mca_pcmclient_base_select(bool *allow_multi_user_threads, bool *have_hidden_threads); - int mca_pcmclient_base_close(void); +OMPI_DECLSPEC int mca_pcmclient_base_close(void); /* * Globals */ -extern int mca_pcmclient_base_output; -extern ompi_list_t mca_pcmclient_base_components_available; -extern mca_pcmclient_base_component_t mca_pcmclient_base_selected_component; -extern mca_pcmclient_base_module_t mca_pcmclient; +OMPI_DECLSPEC extern int mca_pcmclient_base_output; +OMPI_DECLSPEC extern ompi_list_t mca_pcmclient_base_components_available; +OMPI_DECLSPEC extern mca_pcmclient_base_component_t mca_pcmclient_base_selected_component; +OMPI_DECLSPEC extern mca_pcmclient_base_module_t mca_pcmclient; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/pcmclient/base/pcmclient_base_open.c b/src/mca/pcmclient/base/pcmclient_base_open.c index 269592ac40..fe2af557bd 100644 --- a/src/mca/pcmclient/base/pcmclient_base_open.c +++ b/src/mca/pcmclient/base/pcmclient_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/pcmclient/pcmclient.h" @@ -15,7 +15,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_pcmclient_base_static_components[] = {NULL}; +#else #include "mca/pcmclient/base/static-components.h" +#endif /* diff --git a/src/mca/pcmclient/env/pcmclient_env.c b/src/mca/pcmclient/env/pcmclient_env.c index 791d97bd75..141a4a26e1 100644 --- a/src/mca/pcmclient/env/pcmclient_env.c +++ b/src/mca/pcmclient/env/pcmclient_env.c @@ -2,21 +2,25 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/pcmclient/pcmclient.h" #include "mca/pcmclient/env/pcmclient_env.h" #include "include/types.h" #include "include/constants.h" #include +#ifdef HAVE_SYS_TYPES_H #include +#endif #include +#ifdef HAVE_UNISTD_H #include +#endif -extern int mca_pcmclient_env_num_procs; -extern int mca_pcmclient_env_procid; -extern ompi_process_name_t *mca_pcmclient_env_procs; +OMPI_COMP_EXPORT extern int mca_pcmclient_env_num_procs; +OMPI_COMP_EXPORT extern int mca_pcmclient_env_procid; +OMPI_COMP_EXPORT extern ompi_process_name_t *mca_pcmclient_env_procs; int diff --git a/src/mca/pcmclient/env/pcmclient_env_component.c b/src/mca/pcmclient/env/pcmclient_env_component.c index 86739fe812..6b34f31bac 100644 --- a/src/mca/pcmclient/env/pcmclient_env_component.c +++ b/src/mca/pcmclient/env/pcmclient_env_component.c @@ -17,12 +17,14 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* * Struct of function pointers and all that to let us be initialized */ -mca_pcmclient_base_component_1_0_0_t mca_pcmclient_env_component = { +OMPI_COMP_EXPORT mca_pcmclient_base_component_1_0_0_t mca_pcmclient_env_component = { { MCA_PCMCLIENT_BASE_VERSION_1_0_0, diff --git a/src/mca/pcmclient/rms/pcmclient_rms.c b/src/mca/pcmclient/rms/pcmclient_rms.c index afd57f9a4b..09a90dc4df 100644 --- a/src/mca/pcmclient/rms/pcmclient_rms.c +++ b/src/mca/pcmclient/rms/pcmclient_rms.c @@ -2,17 +2,21 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/pcmclient/pcmclient.h" #include "mca/pcmclient/rms/pcmclient_rms.h" #include "include/types.h" #include "include/constants.h" #include +#ifdef HAVE_SYS_TYPES_H #include +#endif #include +#ifdef HAVE_UNISTD_H #include +#endif extern int mca_pcmclient_rms_num_procs; extern int mca_pcmclient_rms_procid; diff --git a/src/mca/pcmclient/rms/pcmclient_rms_component.c b/src/mca/pcmclient/rms/pcmclient_rms_component.c index e7ed87917a..3ca3604cf4 100644 --- a/src/mca/pcmclient/rms/pcmclient_rms_component.c +++ b/src/mca/pcmclient/rms/pcmclient_rms_component.c @@ -17,7 +17,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* * Struct of function pointers and all that to let us be initialized diff --git a/src/mca/pcmclient/seed/pcmclient_seed.c b/src/mca/pcmclient/seed/pcmclient_seed.c index fb3af94cc2..8a87b994b6 100644 --- a/src/mca/pcmclient/seed/pcmclient_seed.c +++ b/src/mca/pcmclient/seed/pcmclient_seed.c @@ -2,17 +2,21 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/pcmclient/pcmclient.h" #include "mca/pcmclient/seed/pcmclient_seed.h" #include "include/types.h" #include "include/constants.h" #include +#ifdef HAVE_SYS_TYPES_H #include +#endif #include +#ifdef HAVE_UNISTD_H #include +#endif static ompi_process_name_t peers[] = { diff --git a/src/mca/pcmclient/seed/pcmclient_seed.h b/src/mca/pcmclient/seed/pcmclient_seed.h index 48861996f1..913a995c88 100644 --- a/src/mca/pcmclient/seed/pcmclient_seed.h +++ b/src/mca/pcmclient/seed/pcmclient_seed.h @@ -26,4 +26,4 @@ int mca_pcmclient_seed_finalize(void); */ int mca_pcmclient_seed_get_peers(ompi_process_name_t **peers, size_t *npeers); ompi_process_name_t* mca_pcmclient_seed_get_self(void); - +OMPI_COMP_EXPORT mca_pcmclient_base_component_1_0_0_t mca_pcmclient_seed_component; diff --git a/src/mca/pcmclient/seed/pcmclient_seed_component.c b/src/mca/pcmclient/seed/pcmclient_seed_component.c index 2d5a24a4e8..a25845d21c 100644 --- a/src/mca/pcmclient/seed/pcmclient_seed_component.c +++ b/src/mca/pcmclient/seed/pcmclient_seed_component.c @@ -17,7 +17,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* * Struct of function pointers and all that to let us be initialized diff --git a/src/mca/pcmclient/singleton/pcmclient_singleton.c b/src/mca/pcmclient/singleton/pcmclient_singleton.c index 6e5dfa2f74..168cffaf1a 100644 --- a/src/mca/pcmclient/singleton/pcmclient_singleton.c +++ b/src/mca/pcmclient/singleton/pcmclient_singleton.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include "mca/pcmclient/pcmclient.h" #include "mca/pcmclient/singleton/pcmclient_singleton.h" #include "mca/oob/base/base.h" @@ -12,12 +12,16 @@ #include "mca/ns/ns.h" #include +#ifdef HAVE_SYS_TYPES_H #include -#include +#endif +#include #include +#ifdef HAVE_UNISTD_H #include +#endif -extern ompi_process_name_t *mca_pcmclient_singleton_procs; +OMPI_COMP_EXPORT extern ompi_process_name_t *mca_pcmclient_singleton_procs; static int diff --git a/src/mca/pcmclient/singleton/pcmclient_singleton_component.c b/src/mca/pcmclient/singleton/pcmclient_singleton_component.c index ca24e1321e..49006404cf 100644 --- a/src/mca/pcmclient/singleton/pcmclient_singleton_component.c +++ b/src/mca/pcmclient/singleton/pcmclient_singleton_component.c @@ -17,12 +17,14 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* * Struct of function pointers and all that to let us be initialized */ -mca_pcmclient_base_component_1_0_0_t mca_pcmclient_singleton_component = { +OMPI_COMP_EXPORT mca_pcmclient_base_component_1_0_0_t mca_pcmclient_singleton_component = { { MCA_PCMCLIENT_BASE_VERSION_1_0_0, @@ -41,7 +43,7 @@ mca_pcmclient_base_component_1_0_0_t mca_pcmclient_singleton_component = { }; -struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_singleton_1_0_0 = { +OMPI_COMP_EXPORT struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_singleton_1_0_0 = { mca_pcmclient_singleton_get_self, mca_pcmclient_singleton_get_peers, }; diff --git a/src/mca/pml/base/base.h b/src/mca/pml/base/base.h index f52d387e71..b53af3912a 100644 --- a/src/mca/pml/base/base.h +++ b/src/mca/pml/base/base.h @@ -18,20 +18,20 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - int mca_pml_base_open(void); - int mca_pml_base_select(mca_pml_base_module_t *selected, +OMPI_DECLSPEC int mca_pml_base_open(void); +OMPI_DECLSPEC int mca_pml_base_select(mca_pml_base_module_t *selected, bool *allow_multi_user_threads, bool *have_hidden_threads); - int mca_pml_base_close(void); +OMPI_DECLSPEC int mca_pml_base_close(void); /* * Globals */ -extern int mca_pml_base_output; -extern ompi_list_t mca_pml_base_components_available; -extern mca_pml_base_component_t mca_pml_base_selected_component; -extern mca_pml_base_module_t mca_pml; +OMPI_DECLSPEC extern int mca_pml_base_output; +OMPI_DECLSPEC extern ompi_list_t mca_pml_base_components_available; +OMPI_DECLSPEC extern mca_pml_base_component_t mca_pml_base_selected_component; +OMPI_DECLSPEC extern mca_pml_base_module_t mca_pml; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/pml/base/pml_base_open.c b/src/mca/pml/base/pml_base_open.c index 6439af552c..4cc1b9bcf2 100644 --- a/src/mca/pml/base/pml_base_open.c +++ b/src/mca/pml/base/pml_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include "mca/mca.h" @@ -18,7 +18,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_pml_base_static_components[] = {NULL}; +#else #include "mca/pml/base/static-components.h" +#endif static int mca_pml_base_progress(void) { diff --git a/src/mca/pml/base/pml_base_recvreq.h b/src/mca/pml/base/pml_base_recvreq.h index bfb719b2a3..3e94b8b7f0 100644 --- a/src/mca/pml/base/pml_base_recvreq.h +++ b/src/mca/pml/base/pml_base_recvreq.h @@ -11,8 +11,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t mca_pml_base_recv_request_t_class; - +OMPI_DECLSPEC extern ompi_class_t mca_pml_base_recv_request_t_class; /** * Base type for receive requests. */ diff --git a/src/mca/pml/base/pml_base_request.h b/src/mca/pml/base/pml_base_request.h index ad50e223b0..2303120a65 100644 --- a/src/mca/pml/base/pml_base_request.h +++ b/src/mca/pml/base/pml_base_request.h @@ -16,7 +16,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t mca_pml_base_request_t_class; +OMPI_DECLSPEC extern ompi_class_t mca_pml_base_request_t_class; /** * Type of request. diff --git a/src/mca/pml/base/pml_base_sendreq.h b/src/mca/pml/base/pml_base_sendreq.h index 78023789d0..db61daab42 100644 --- a/src/mca/pml/base/pml_base_sendreq.h +++ b/src/mca/pml/base/pml_base_sendreq.h @@ -14,7 +14,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t mca_pml_base_send_request_t_class; +OMPI_DECLSPEC extern ompi_class_t mca_pml_base_send_request_t_class; /** diff --git a/src/mca/pml/pml.h b/src/mca/pml/pml.h index 7276044df9..25bc5a6b72 100644 --- a/src/mca/pml/pml.h +++ b/src/mca/pml/pml.h @@ -475,7 +475,7 @@ struct mca_pml_base_module_1_0_0_t { }; typedef struct mca_pml_base_module_1_0_0_t mca_pml_base_module_1_0_0_t; typedef mca_pml_base_module_1_0_0_t mca_pml_base_module_t; -extern mca_pml_base_module_t mca_pml; +OMPI_DECLSPEC extern mca_pml_base_module_t mca_pml; /* * Macro for use in components that are of type pml v1.0.0 diff --git a/src/mca/pml/teg/src/pml_ptl_array.h b/src/mca/pml/teg/src/pml_ptl_array.h index ee0dabdce5..17e4ca1385 100644 --- a/src/mca/pml/teg/src/pml_ptl_array.h +++ b/src/mca/pml/teg/src/pml_ptl_array.h @@ -13,7 +13,7 @@ extern "C" { #endif -extern ompi_class_t mca_pml_teg_ptl_array_t_class; +OMPI_DECLSPEC extern ompi_class_t mca_pml_teg_ptl_array_t_class; /** * A data structure associated with a ompi_proc_t that caches diff --git a/src/mca/pml/teg/src/pml_teg.h b/src/mca/pml/teg/src/pml_teg.h index 80eeca0f0e..7d1fcf0b8a 100644 --- a/src/mca/pml/teg/src/pml_teg.h +++ b/src/mca/pml/teg/src/pml_teg.h @@ -61,26 +61,26 @@ struct mca_pml_teg_t { }; typedef struct mca_pml_teg_t mca_pml_teg_t; -extern mca_pml_teg_t mca_pml_teg; +OMPI_COMP_EXPORT extern mca_pml_teg_t mca_pml_teg; /* * PML module functions. */ -extern mca_pml_base_component_1_0_0_t mca_pml_teg_component; +OMPI_COMP_EXPORT extern mca_pml_base_component_1_0_0_t mca_pml_teg_component; -extern int mca_pml_teg_component_open(void); -extern int mca_pml_teg_component_close(void); +OMPI_COMP_EXPORT extern int mca_pml_teg_component_open(void); +OMPI_COMP_EXPORT extern int mca_pml_teg_component_close(void); -extern mca_pml_base_module_t* mca_pml_teg_component_init( +OMPI_COMP_EXPORT extern mca_pml_base_module_t* mca_pml_teg_component_init( int *priority, bool *allow_multi_user_threads, bool *have_hidden_threads ); -extern int mca_pml_teg_component_fini(void); +OMPI_COMP_EXPORT extern int mca_pml_teg_component_fini(void); @@ -88,37 +88,37 @@ extern int mca_pml_teg_component_fini(void); * PML interface functions. */ -extern int mca_pml_teg_add_comm( +OMPI_COMP_EXPORT extern int mca_pml_teg_add_comm( struct ompi_communicator_t* comm ); -extern int mca_pml_teg_del_comm( +OMPI_COMP_EXPORT extern int mca_pml_teg_del_comm( struct ompi_communicator_t* comm ); -extern int mca_pml_teg_add_procs( +OMPI_COMP_EXPORT extern int mca_pml_teg_add_procs( struct ompi_proc_t **procs, size_t nprocs ); -extern int mca_pml_teg_del_procs( +OMPI_COMP_EXPORT extern int mca_pml_teg_del_procs( struct ompi_proc_t **procs, size_t nprocs ); -extern int mca_pml_teg_add_ptls( +OMPI_COMP_EXPORT extern int mca_pml_teg_add_ptls( ompi_list_t *ptls ); -extern int mca_pml_teg_control( +OMPI_COMP_EXPORT extern int mca_pml_teg_control( int param, void *size, size_t value ); -extern int mca_pml_teg_progress(void); +OMPI_COMP_EXPORT extern int mca_pml_teg_progress(void); -extern int mca_pml_teg_iprobe( +OMPI_COMP_EXPORT extern int mca_pml_teg_iprobe( int dst, int tag, struct ompi_communicator_t* comm, @@ -126,24 +126,24 @@ extern int mca_pml_teg_iprobe( ompi_status_public_t* status ); -extern int mca_pml_teg_probe( +OMPI_COMP_EXPORT extern int mca_pml_teg_probe( int dst, int tag, struct ompi_communicator_t* comm, ompi_status_public_t* status ); -extern int mca_pml_teg_cancel( +OMPI_COMP_EXPORT extern int mca_pml_teg_cancel( ompi_request_t* request ); -extern int mca_pml_teg_cancelled( +OMPI_COMP_EXPORT extern int mca_pml_teg_cancelled( ompi_request_t* request, int *flag ); -extern int mca_pml_teg_isend_init( +OMPI_COMP_EXPORT extern int mca_pml_teg_isend_init( void *buf, size_t count, ompi_datatype_t *datatype, @@ -154,7 +154,7 @@ extern int mca_pml_teg_isend_init( struct ompi_request_t **request ); -extern int mca_pml_teg_isend( +OMPI_COMP_EXPORT extern int mca_pml_teg_isend( void *buf, size_t count, ompi_datatype_t *datatype, @@ -165,7 +165,7 @@ extern int mca_pml_teg_isend( struct ompi_request_t **request ); -extern int mca_pml_teg_send( +OMPI_COMP_EXPORT extern int mca_pml_teg_send( void *buf, size_t count, ompi_datatype_t *datatype, @@ -175,7 +175,7 @@ extern int mca_pml_teg_send( struct ompi_communicator_t* comm ); -extern int mca_pml_teg_irecv_init( +OMPI_COMP_EXPORT extern int mca_pml_teg_irecv_init( void *buf, size_t count, ompi_datatype_t *datatype, @@ -185,7 +185,7 @@ extern int mca_pml_teg_irecv_init( struct ompi_request_t **request ); -extern int mca_pml_teg_irecv( +OMPI_COMP_EXPORT extern int mca_pml_teg_irecv( void *buf, size_t count, ompi_datatype_t *datatype, @@ -195,7 +195,7 @@ extern int mca_pml_teg_irecv( struct ompi_request_t **request ); -extern int mca_pml_teg_recv( +OMPI_COMP_EXPORT extern int mca_pml_teg_recv( void *buf, size_t count, ompi_datatype_t *datatype, @@ -205,9 +205,9 @@ extern int mca_pml_teg_recv( ompi_status_public_t* status ); -extern int mca_pml_teg_progress(void); +OMPI_COMP_EXPORT extern int mca_pml_teg_progress(void); -extern int mca_pml_teg_start( +OMPI_COMP_EXPORT extern int mca_pml_teg_start( size_t count, ompi_request_t** requests ); diff --git a/src/mca/pml/teg/src/pml_teg_proc.h b/src/mca/pml/teg/src/pml_teg_proc.h index a1769a7e15..5fff0c40fc 100644 --- a/src/mca/pml/teg/src/pml_teg_proc.h +++ b/src/mca/pml/teg/src/pml_teg_proc.h @@ -31,7 +31,7 @@ struct mca_pml_proc_t { typedef struct mca_pml_proc_t mca_pml_proc_t; -extern ompi_class_t mca_pml_teg_proc_t_class; +OMPI_COMP_EXPORT extern ompi_class_t mca_pml_teg_proc_t_class; typedef struct mca_pml_proc_t mca_pml_teg_proc_t; /** diff --git a/src/mca/pml/teg/src/pml_teg_sendreq.c b/src/mca/pml/teg/src/pml_teg_sendreq.c index 6efe7d9fbc..e239beef64 100644 --- a/src/mca/pml/teg/src/pml_teg_sendreq.c +++ b/src/mca/pml/teg/src/pml_teg_sendreq.c @@ -2,10 +2,10 @@ * $HEADER$ */ -#include "ompi_config.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +#include "ompi_config.h" #include "include/constants.h" #include "mca/ptl/ptl.h" #include "pml_teg.h" diff --git a/src/mca/ptl/base/base.h b/src/mca/ptl/base/base.h index 8ea18ce355..30b5e29825 100644 --- a/src/mca/ptl/base/base.h +++ b/src/mca/ptl/base/base.h @@ -30,20 +30,20 @@ typedef struct mca_ptl_base_selected_module_t mca_ptl_base_selected_module_t; * Global functions for MCA: overall PTL open and close */ - int mca_ptl_base_open(void); - int mca_ptl_base_select(bool *allow_multi_user_threads, +OMPI_DECLSPEC int mca_ptl_base_open(void); +OMPI_DECLSPEC int mca_ptl_base_select(bool *allow_multi_user_threads, bool *have_hidden_threads); - int mca_ptl_base_close(void); +OMPI_DECLSPEC int mca_ptl_base_close(void); /* * Globals */ -extern int mca_ptl_base_output; -extern char* mca_ptl_base_include; -extern char* mca_ptl_base_exclude; -extern ompi_list_t mca_ptl_base_components_opened; -extern ompi_list_t mca_ptl_base_modules_initialized; +OMPI_DECLSPEC extern int mca_ptl_base_output; +OMPI_DECLSPEC extern char* mca_ptl_base_include; +OMPI_DECLSPEC extern char* mca_ptl_base_exclude; +OMPI_DECLSPEC extern ompi_list_t mca_ptl_base_components_opened; +OMPI_DECLSPEC extern ompi_list_t mca_ptl_base_modules_initialized; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/ptl/base/ptl_base_comm.h b/src/mca/ptl/base/ptl_base_comm.h index c4de6d4cdf..e6292a4f8e 100644 --- a/src/mca/ptl/base/ptl_base_comm.h +++ b/src/mca/ptl/base/ptl_base_comm.h @@ -14,7 +14,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t mca_pml_ptl_comm_t_class; +OMPI_DECLSPEC extern ompi_class_t mca_pml_ptl_comm_t_class; /** * Cached on ompi_communicator_t to hold queues/state @@ -42,7 +42,7 @@ typedef struct mca_pml_comm_t mca_pml_ptl_comm_t; * @return OMPI_SUCCESS or error status on failure. */ -extern int mca_pml_ptl_comm_init_size(mca_pml_ptl_comm_t* comm, size_t size); +OMPI_DECLSPEC extern int mca_pml_ptl_comm_init_size(mca_pml_ptl_comm_t* comm, size_t size); /** * Obtain the next sequence number (MPI) for a given destination rank. diff --git a/src/mca/ptl/base/ptl_base_fragment.h b/src/mca/ptl/base/ptl_base_fragment.h index ea7df11b55..83f5aec492 100644 --- a/src/mca/ptl/base/ptl_base_fragment.h +++ b/src/mca/ptl/base/ptl_base_fragment.h @@ -15,7 +15,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t mca_ptl_base_frag_t_class; +OMPI_DECLSPEC extern ompi_class_t mca_ptl_base_frag_t_class; /** * Base type for fragment descriptors. diff --git a/src/mca/ptl/base/ptl_base_header.h b/src/mca/ptl/base/ptl_base_header.h index 35e4a8289b..7008369a6b 100644 --- a/src/mca/ptl/base/ptl_base_header.h +++ b/src/mca/ptl/base/ptl_base_header.h @@ -9,9 +9,12 @@ #include "ompi_config.h" #include "mca/ptl/ptl.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include - +#endif #define MCA_PTL_HDR_TYPE_MATCH 0 #define MCA_PTL_HDR_TYPE_FRAG 1 diff --git a/src/mca/ptl/base/ptl_base_open.c b/src/mca/ptl/base/ptl_base_open.c index d0a06e1cd1..7d336a2911 100644 --- a/src/mca/ptl/base/ptl_base_open.c +++ b/src/mca/ptl/base/ptl_base_open.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include "mca/mca.h" @@ -19,7 +19,11 @@ * component's public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_ptl_base_static_components[] = {NULL}; +#else #include "mca/ptl/base/static-components.h" +#endif /* diff --git a/src/mca/ptl/base/ptl_base_recvfrag.h b/src/mca/ptl/base/ptl_base_recvfrag.h index 452dccdced..a2fd2c5510 100644 --- a/src/mca/ptl/base/ptl_base_recvfrag.h +++ b/src/mca/ptl/base/ptl_base_recvfrag.h @@ -15,7 +15,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t mca_ptl_base_recv_frag_t_class; +OMPI_DECLSPEC extern ompi_class_t mca_ptl_base_recv_frag_t_class; /** * Base type for receive fragment descriptors. diff --git a/src/mca/ptl/base/ptl_base_sendfrag.h b/src/mca/ptl/base/ptl_base_sendfrag.h index 4201d271ab..e18ec26baa 100644 --- a/src/mca/ptl/base/ptl_base_sendfrag.h +++ b/src/mca/ptl/base/ptl_base_sendfrag.h @@ -13,7 +13,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t mca_ptl_base_send_frag_t_class; +OMPI_DECLSPEC extern ompi_class_t mca_ptl_base_send_frag_t_class; /** * Base type for send fragment descriptors diff --git a/src/mca/ptl/self/ptl_self.c b/src/mca/ptl/self/ptl_self.c index 4201e749e6..b9d537fd26 100644 --- a/src/mca/ptl/self/ptl_self.c +++ b/src/mca/ptl/self/ptl_self.c @@ -4,13 +4,23 @@ */ #include "ompi_config.h" #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #include "include/constants.h" #include "event/event.h" diff --git a/src/mca/ptl/self/ptl_self_component.c b/src/mca/ptl/self/ptl_self_component.c index 45ac60856e..e4dcac747d 100644 --- a/src/mca/ptl/self/ptl_self_component.c +++ b/src/mca/ptl/self/ptl_self_component.c @@ -4,13 +4,23 @@ */ #include "ompi_config.h" #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #include "include/constants.h" #include "event/event.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp.h b/src/mca/ptl/tcp/src/ptl_tcp.h index 942bf7eb2b..cf43c14ca6 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp.h +++ b/src/mca/ptl/tcp/src/ptl_tcp.h @@ -7,9 +7,15 @@ #ifndef MCA_PTL_TCP_H #define MCA_PTL_TCP_H +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "class/ompi_free_list.h" #include "event/event.h" #include "mca/pml/pml.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_addr.h b/src/mca/ptl/tcp/src/ptl_tcp_addr.h index c9ffe9abd6..a48fc396fa 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_addr.h +++ b/src/mca/ptl/tcp/src/ptl_tcp_addr.h @@ -7,9 +7,15 @@ #ifndef MCA_PTL_TCP_ADDR_H #define MCA_PTL_TCP_ADDR_H +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif /** diff --git a/src/mca/ptl/tcp/src/ptl_tcp_component.c b/src/mca/ptl/tcp/src/ptl_tcp_component.c index 1ae82c9b5b..a13b1d1b6c 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_component.c +++ b/src/mca/ptl/tcp/src/ptl_tcp_component.c @@ -3,13 +3,23 @@ */ #include "ompi_config.h" #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #include "include/constants.h" #include "event/event.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_peer.c b/src/mca/ptl/tcp/src/ptl_tcp_peer.c index 5bcf65b3bd..8995d8df24 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_peer.c +++ b/src/mca/ptl/tcp/src/ptl_tcp_peer.c @@ -4,13 +4,23 @@ #include "ompi_config.h" #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include +#ifdef HAVE_SYS_TYPES_H #include +#endif #include +#ifdef HAVE_NETINET_TCP_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #include "include/types.h" #include "mca/pml/base/pml_base_sendreq.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_peer.h b/src/mca/ptl/tcp/src/ptl_tcp_peer.h index d28dd85907..beb46b470b 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_peer.h +++ b/src/mca/ptl/tcp/src/ptl_tcp_peer.h @@ -7,9 +7,15 @@ #ifndef MCA_PTL_TCP_PEER_H #define MCA_PTL_TCP_PEER_H +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "class/ompi_list.h" #include "event/event.h" #include "mca/pml/pml.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_proc.h b/src/mca/ptl/tcp/src/ptl_tcp_proc.h index 67306993b2..e81bb656d7 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_proc.h +++ b/src/mca/ptl/tcp/src/ptl_tcp_proc.h @@ -7,9 +7,15 @@ #ifndef MCA_PTL_TCP_PROC_H #define MCA_PTL_TCP_PROC_H +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "mca/ns/ns.h" #include "class/ompi_object.h" #include "proc/proc.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.c b/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.c index cb6f064e8c..0a1cf10055 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.c +++ b/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.c @@ -2,8 +2,12 @@ * $HEADER$ */ #include "ompi_config.h" +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include "mca/pml/base/pml_base_sendreq.h" #include "ptl_tcp.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.h b/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.h index 9a5820fa42..46bffd220e 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.h +++ b/src/mca/ptl/tcp/src/ptl_tcp_recvfrag.h @@ -8,11 +8,17 @@ #ifndef MCA_PTL_TCP_RECV_FRAG_H #define MCA_PTL_TCP_RECV_FRAG_H -#include -#include -#include -#include #include "ompi_config.h" +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif #include "include/sys/atomic.h" #include "mca/ptl/base/ptl_base_recvfrag.h" #include "ptl_tcp_peer.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.c b/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.c index 33c31ef1cd..5676e6efcd 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.c +++ b/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.c @@ -2,8 +2,12 @@ * $HEADER$ */ #include "ompi_config.h" +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include "include/types.h" #include "datatype/datatype.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.h b/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.h index 263d898890..8fe03a3e58 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.h +++ b/src/mca/ptl/tcp/src/ptl_tcp_sendfrag.h @@ -7,10 +7,16 @@ #ifndef MCA_PTL_TCP_SEND_FRAG_H #define MCA_PTL_TCP_SEND_FRAG_H -#include -#include -#include #include "ompi_config.h" +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif #include "include/sys/atomic.h" #include "mca/pml/base/pml_base_sendreq.h" #include "mca/ptl/base/ptl_base_sendfrag.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_sendreq.c b/src/mca/ptl/tcp/src/ptl_tcp_sendreq.c index d0322a77ef..653e0bfe4b 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_sendreq.c +++ b/src/mca/ptl/tcp/src/ptl_tcp_sendreq.c @@ -2,8 +2,12 @@ * $HEADER$ */ #include "ompi_config.h" +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include "include/types.h" #include "mca/pml/base/pml_base_sendreq.h" diff --git a/src/mca/ptl/tcp/src/ptl_tcp_sendreq.h b/src/mca/ptl/tcp/src/ptl_tcp_sendreq.h index 40214d0cc6..0202747dd9 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp_sendreq.h +++ b/src/mca/ptl/tcp/src/ptl_tcp_sendreq.h @@ -8,9 +8,15 @@ #ifndef MCA_PTL_TCP_SEND_REQUEST_H #define MCA_PTL_TCP_SEND_REQUEST_H +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "ompi_config.h" #include "mca/pml/base/pml_base_sendreq.h" #include "ptl_tcp_sendfrag.h" @@ -18,7 +24,6 @@ extern "C" { #endif extern ompi_class_t mca_ptl_tcp_send_request_t_class; - /** * TCP send request derived type. The send request contains both the * base send request, and space for the first TCP send fragment descriptor. diff --git a/src/mca/topo/base/base.h b/src/mca/topo/base/base.h index 3af6a70242..3a8407ae79 100644 --- a/src/mca/topo/base/base.h +++ b/src/mca/topo/base/base.h @@ -18,22 +18,22 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - int mca_topo_base_open(void); +OMPI_DECLSPEC int mca_topo_base_open(void); - int mca_topo_base_close(void); +OMPI_DECLSPEC int mca_topo_base_close(void); - int mca_topo_base_comm_select(struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_comm_select(struct ompi_communicator_t *comm, struct mca_base_component_t *preferred); - int mca_topo_base_comm_unselect(struct ompi_communicator_t *comm); +OMPI_DECLSPEC int mca_topo_base_comm_unselect(struct ompi_communicator_t *comm); - int mca_topo_base_find_available (bool *allow_multi_user_threads, +OMPI_DECLSPEC int mca_topo_base_find_available (bool *allow_multi_user_threads, bool *have_hidden_threads); - int mca_topo_base_init_comm (struct ompi_communicator_t *comm); +OMPI_DECLSPEC int mca_topo_base_init_comm (struct ompi_communicator_t *comm); - int mca_topo_base_get_param (struct ompi_communicator_t *comm, int keyval); +OMPI_DECLSPEC int mca_topo_base_get_param (struct ompi_communicator_t *comm, int keyval); /* * All the glue functions which we will provide to the users by @@ -42,12 +42,12 @@ extern "C" { * components. But they can implement these glue functions if * they want. */ - int mca_topo_base_cart_coords (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_cart_coords (struct ompi_communicator_t *comm, int rank, int maxdims, int *coords); - int mca_topo_base_cart_create (mca_topo_base_comm_t *topo_data, +OMPI_DECLSPEC int mca_topo_base_cart_create (mca_topo_base_comm_t *topo_data, int *proc_count, ompi_proc_t **proc_pointers, int *new_rank, @@ -56,30 +56,30 @@ extern "C" { int *periods, bool reorder); - int mca_topo_base_cartdim_get (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_cartdim_get (struct ompi_communicator_t *comm, int *ndims); - int mca_topo_base_cart_get (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_cart_get (struct ompi_communicator_t *comm, int maxdims, int *dims, int *periods, int *coords); - int mca_topo_base_cart_rank (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_cart_rank (struct ompi_communicator_t *comm, int *coords, int *rank); - int mca_topo_base_cart_shift (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_cart_shift (struct ompi_communicator_t *comm, int direction, int disp, int *rank_source, int *rank_dest); - int mca_topo_base_cart_sub (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_cart_sub (struct ompi_communicator_t *comm, int *remain_dims, struct ompi_communicator_t **new_comm); - int mca_topo_base_graph_create (mca_topo_base_comm_t *topo_data, +OMPI_DECLSPEC int mca_topo_base_graph_create (mca_topo_base_comm_t *topo_data, int *proc_count, ompi_proc_t **proc_pointers, int *new_rank, @@ -88,22 +88,22 @@ extern "C" { int *edges, bool reorder); - int mca_topo_base_graphdims_get (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_graphdims_get (struct ompi_communicator_t *comm, int *nodes, int *nedges); - int mca_topo_base_graph_get (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_graph_get (struct ompi_communicator_t *comm, int maxindex, int maxedges, int *index, int *edges); - int mca_topo_base_graph_neighbors (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_graph_neighbors (struct ompi_communicator_t *comm, int rank, int maxneighbors, int *neighbors); - int mca_topo_base_graph_neighbors_count (struct ompi_communicator_t *comm, +OMPI_DECLSPEC int mca_topo_base_graph_neighbors_count (struct ompi_communicator_t *comm, int rank, int *nneighbors); @@ -111,14 +111,14 @@ extern "C" { /* * Globals */ -extern int mca_topo_base_output; -extern int mca_topo_base_param; +OMPI_DECLSPEC extern int mca_topo_base_output; +OMPI_DECLSPEC extern int mca_topo_base_param; -extern ompi_list_t mca_topo_base_components_available; -extern ompi_list_t mca_topo_base_components_opened; +OMPI_DECLSPEC extern ompi_list_t mca_topo_base_components_available; +OMPI_DECLSPEC extern ompi_list_t mca_topo_base_components_opened; -extern bool mca_topo_base_components_opened_valid; -extern bool mca_topo_base_components_available_valid; +OMPI_DECLSPEC extern bool mca_topo_base_components_opened_valid; +OMPI_DECLSPEC extern bool mca_topo_base_components_available_valid; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mca/topo/base/topo_base_open.c b/src/mca/topo/base/topo_base_open.c index a684a2ec49..1ee3bf9b49 100644 --- a/src/mca/topo/base/topo_base_open.c +++ b/src/mca/topo/base/topo_base_open.c @@ -1,8 +1,8 @@ /* * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include "util/output.h" @@ -16,7 +16,11 @@ * statements and the definition of an array of pointers to each component's * public mca_base_component_t struct. */ +#ifdef WIN32 + const mca_base_component_t *mca_topo_base_static_components[] = {NULL}; +#else #include "mca/topo/base/static-components.h" +#endif /* * Global variables diff --git a/src/mca/topo/unity/src/topo_unity.h b/src/mca/topo/unity/src/topo_unity.h index b7cb41a181..af5dcef746 100644 --- a/src/mca/topo/unity/src/topo_unity.h +++ b/src/mca/topo/unity/src/topo_unity.h @@ -20,7 +20,8 @@ * version information and the four functions (see below) which * are needed for this module to function with the MCA framework */ -extern const struct mca_topo_base_module_1_0_0_t mca_topo_unity_module; +OMPI_COMP_EXPORT extern const struct mca_topo_base_module_1_0_0_t mca_topo_unity_module; + /* * ****************************************************************** diff --git a/src/mpi/c/bindings.h b/src/mpi/c/bindings.h index 71ba7d1321..e39476fc7f 100644 --- a/src/mpi/c/bindings.h +++ b/src/mpi/c/bindings.h @@ -19,7 +19,7 @@ extern "C" { /* This variable is actually in src/mpi/runtime/ompi_mpi_init.c, but it is used by every MPI function. */ -extern bool ompi_mpi_param_check; +OMPI_DECLSPEC extern bool ompi_mpi_param_check; /* These macros have to be used to check the corectness of the datatype depending on the * operations that we have to do with them. They can be used on all functions, not only diff --git a/src/mpi/c/comm_compare.c b/src/mpi/c/comm_compare.c index 01d308e4a4..4d196ceb7a 100644 --- a/src/mpi/c/comm_compare.c +++ b/src/mpi/c/comm_compare.c @@ -23,14 +23,14 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { /* local variables */ ompi_communicator_t *comp1, *comp2; - ompi_group_t *grp1, *grp2; + ompi_group_t *group1, *group2; int size1, size2, rsize1, rsize2; int lresult, rresult=MPI_CONGRUENT; - int sameranks = 1; - int sameorder = 1; + int sameranks=1; + int sameorder=1; int i, j; int found = 0; - + if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); @@ -70,10 +70,10 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { /* Compare local groups */ /* we need to check whether the communicators contain the same processes and in the same order */ - grp1 = (ompi_group_t *)comp1->c_local_group; - grp2 = (ompi_group_t *)comp2->c_local_group; + group1 = (ompi_group_t *)comp1->c_local_group; + group2 = (ompi_group_t *)comp2->c_local_group; for ( i = 0; i < size1; i++ ) { - if ( grp1->grp_proc_pointers[i] != grp2->grp_proc_pointers[i]) { + if ( group1->grp_proc_pointers[i] != group2->grp_proc_pointers[i]) { sameorder = 0; break; } @@ -82,7 +82,7 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { for ( i = 0; i < size1; i++ ) { found = 0; for ( j = 0; j < size2; j++ ) { - if ( grp1->grp_proc_pointers[i] == grp2->grp_proc_pointers[j]) { + if ( group1->grp_proc_pointers[i] == group2->grp_proc_pointers[j]) { found = 1; break; } @@ -107,10 +107,10 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { the same processes and in the same order */ sameranks = sameorder = 1; - grp1 = (ompi_group_t *)comp1->c_remote_group; - grp2 = (ompi_group_t *)comp2->c_remote_group; + group1 = (ompi_group_t *)comp1->c_remote_group; + group2 = (ompi_group_t *)comp2->c_remote_group; for ( i = 0; i < rsize1; i++ ) { - if ( grp1->grp_proc_pointers[i] != grp2->grp_proc_pointers[i]) { + if ( group1->grp_proc_pointers[i] != group2->grp_proc_pointers[i]) { sameorder = 0; break; } @@ -119,7 +119,7 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { for ( i = 0; i < rsize1; i++ ) { found = 0; for ( j = 0; j < rsize2; j++ ) { - if ( grp1->grp_proc_pointers[i] == grp2->grp_proc_pointers[j]) { + if ( group1->grp_proc_pointers[i] == group2->grp_proc_pointers[j]) { found = 1; break; } diff --git a/src/mpi/cxx/constants.h b/src/mpi/cxx/constants.h index e9c9d8bf2a..12eae38b4b 100644 --- a/src/mpi/cxx/constants.h +++ b/src/mpi/cxx/constants.h @@ -8,207 +8,207 @@ extern "C" { #endif // return codes -extern const int SUCCESS; -extern const int ERR_BUFFER; -extern const int ERR_COUNT; -extern const int ERR_TYPE; -extern const int ERR_TAG ; -extern const int ERR_COMM; -extern const int ERR_RANK; -extern const int ERR_REQUEST; -extern const int ERR_ROOT; -extern const int ERR_GROUP; -extern const int ERR_OP; -extern const int ERR_TOPOLOGY; -extern const int ERR_DIMS; -extern const int ERR_ARG; -extern const int ERR_UNKNOWN; -extern const int ERR_TRUNCATE; -extern const int ERR_OTHER; -extern const int ERR_INTERN; -extern const int ERR_PENDING; -extern const int ERR_IN_STATUS; -extern const int ERR_LASTCODE; +OMPI_DECLSPEC extern const int SUCCESS; +OMPI_DECLSPEC extern const int ERR_BUFFER; +OMPI_DECLSPEC extern const int ERR_COUNT; +OMPI_DECLSPEC extern const int ERR_TYPE; +OMPI_DECLSPEC extern const int ERR_TAG ; +OMPI_DECLSPEC extern const int ERR_COMM; +OMPI_DECLSPEC extern const int ERR_RANK; +OMPI_DECLSPEC extern const int ERR_REQUEST; +OMPI_DECLSPEC extern const int ERR_ROOT; +OMPI_DECLSPEC extern const int ERR_GROUP; +OMPI_DECLSPEC extern const int ERR_OP; +OMPI_DECLSPEC extern const int ERR_TOPOLOGY; +OMPI_DECLSPEC extern const int ERR_DIMS; +OMPI_DECLSPEC extern const int ERR_ARG; +OMPI_DECLSPEC extern const int ERR_UNKNOWN; +OMPI_DECLSPEC extern const int ERR_TRUNCATE; +OMPI_DECLSPEC extern const int ERR_OTHER; +OMPI_DECLSPEC extern const int ERR_INTERN; +OMPI_DECLSPEC extern const int ERR_PENDING; +OMPI_DECLSPEC extern const int ERR_IN_STATUS; +OMPI_DECLSPEC extern const int ERR_LASTCODE; -extern const int ERR_BASE; -extern const int ERR_INFO_VALUE; -extern const int ERR_INFO_KEY; -extern const int ERR_INFO_NOKEY; -extern const int ERR_KEYVAL; -extern const int ERR_NAME; -extern const int ERR_NO_MEM; -extern const int ERR_SERVICE; -extern const int ERR_SPAWN; -extern const int ERR_WIN; +OMPI_DECLSPEC extern const int ERR_BASE; +OMPI_DECLSPEC extern const int ERR_INFO_VALUE; +OMPI_DECLSPEC extern const int ERR_INFO_KEY; +OMPI_DECLSPEC extern const int ERR_INFO_NOKEY; +OMPI_DECLSPEC extern const int ERR_KEYVAL; +OMPI_DECLSPEC extern const int ERR_NAME; +OMPI_DECLSPEC extern const int ERR_NO_MEM; +OMPI_DECLSPEC extern const int ERR_SERVICE; +OMPI_DECLSPEC extern const int ERR_SPAWN; +OMPI_DECLSPEC extern const int ERR_WIN; // assorted constants -extern const void* BOTTOM; -extern const int PROC_NULL; -extern const int ANY_SOURCE; -extern const int ANY_TAG; -extern const int UNDEFINED; -extern const int BSEND_OVERHEAD; -extern const int KEYVAL_INVALID; +OMPI_DECLSPEC extern const void* BOTTOM; +OMPI_DECLSPEC extern const int PROC_NULL; +OMPI_DECLSPEC extern const int ANY_SOURCE; +OMPI_DECLSPEC extern const int ANY_TAG; +OMPI_DECLSPEC extern const int UNDEFINED; +OMPI_DECLSPEC extern const int BSEND_OVERHEAD; +OMPI_DECLSPEC extern const int KEYVAL_INVALID; // error-handling specifiers -extern const Errhandler ERRORS_ARE_FATAL; -extern const Errhandler ERRORS_RETURN; -extern const Errhandler ERRORS_THROW_EXCEPTIONS; +OMPI_DECLSPEC extern const Errhandler ERRORS_ARE_FATAL; +OMPI_DECLSPEC extern const Errhandler ERRORS_RETURN; +OMPI_DECLSPEC extern const Errhandler ERRORS_THROW_EXCEPTIONS; // maximum sizes for strings -extern const int MAX_PROCESSOR_NAME; -extern const int MAX_ERROR_STRING; -extern const int MAX_INFO_KEY; -extern const int MAX_INFO_VAL; -extern const int MAX_PORT_NAME; -extern const int MAX_OBJECT_NAME; +OMPI_DECLSPEC extern const int MAX_PROCESSOR_NAME; +OMPI_DECLSPEC extern const int MAX_ERROR_STRING; +OMPI_DECLSPEC extern const int MAX_INFO_KEY; +OMPI_DECLSPEC extern const int MAX_INFO_VAL; +OMPI_DECLSPEC extern const int MAX_PORT_NAME; +OMPI_DECLSPEC extern const int MAX_OBJECT_NAME; // elementary datatypes (C / C++) -extern const Datatype CHAR; -extern const Datatype SHORT; -extern const Datatype INT; -extern const Datatype LONG; -extern const Datatype SIGNED_CHAR; -extern const Datatype UNSIGNED_CHAR; -extern const Datatype UNSIGNED_SHORT; -extern const Datatype UNSIGNED; -extern const Datatype UNSIGNED_LONG; -extern const Datatype FLOAT; -extern const Datatype DOUBLE; -extern const Datatype LONG_DOUBLE; -extern const Datatype BYTE; -extern const Datatype PACKED; -extern const Datatype WCHAR; +OMPI_DECLSPEC extern const Datatype CHAR; +OMPI_DECLSPEC extern const Datatype SHORT; +OMPI_DECLSPEC extern const Datatype INT; +OMPI_DECLSPEC extern const Datatype LONG; +OMPI_DECLSPEC extern const Datatype SIGNED_CHAR; +OMPI_DECLSPEC extern const Datatype UNSIGNED_CHAR; +OMPI_DECLSPEC extern const Datatype UNSIGNED_SHORT; +OMPI_DECLSPEC extern const Datatype UNSIGNED; +OMPI_DECLSPEC extern const Datatype UNSIGNED_LONG; +OMPI_DECLSPEC extern const Datatype FLOAT; +OMPI_DECLSPEC extern const Datatype DOUBLE; +OMPI_DECLSPEC extern const Datatype LONG_DOUBLE; +OMPI_DECLSPEC extern const Datatype BYTE; +OMPI_DECLSPEC extern const Datatype PACKED; +OMPI_DECLSPEC extern const Datatype WCHAR; // datatypes for reductions functions (C / C++) -extern const Datatype FLOAT_INT; -extern const Datatype DOUBLE_INT; -extern const Datatype LONG_INT; -extern const Datatype TWOINT; -extern const Datatype SHORT_INT; -extern const Datatype LONG_DOUBLE_INT; +OMPI_DECLSPEC extern const Datatype FLOAT_INT; +OMPI_DECLSPEC extern const Datatype DOUBLE_INT; +OMPI_DECLSPEC extern const Datatype LONG_INT; +OMPI_DECLSPEC extern const Datatype TWOINT; +OMPI_DECLSPEC extern const Datatype SHORT_INT; +OMPI_DECLSPEC extern const Datatype LONG_DOUBLE_INT; // elementary datatype (Fortran) -extern const Datatype INTEGER; -extern const Datatype REAL; -extern const Datatype DOUBLE_PRECISION; -extern const Datatype F_COMPLEX; -extern const Datatype LOGICAL; -extern const Datatype CHARACTER; +OMPI_DECLSPEC extern const Datatype INTEGER; +OMPI_DECLSPEC extern const Datatype REAL; +OMPI_DECLSPEC extern const Datatype DOUBLE_PRECISION; +OMPI_DECLSPEC extern const Datatype F_COMPLEX; +OMPI_DECLSPEC extern const Datatype LOGICAL; +OMPI_DECLSPEC extern const Datatype CHARACTER; // datatype for reduction functions (Fortran) -extern const Datatype TWOREAL; -extern const Datatype TWODOUBLE_PRECISION; -extern const Datatype TWOINTEGER; +OMPI_DECLSPEC extern const Datatype TWOREAL; +OMPI_DECLSPEC extern const Datatype TWODOUBLE_PRECISION; +OMPI_DECLSPEC extern const Datatype TWOINTEGER; // optional datatypes (Fortran) -extern const Datatype INTEGER1; -extern const Datatype INTEGER2; -extern const Datatype INTEGER4; -extern const Datatype REAL2; -extern const Datatype REAL4; -extern const Datatype REAL8; +OMPI_DECLSPEC extern const Datatype INTEGER1; +OMPI_DECLSPEC extern const Datatype INTEGER2; +OMPI_DECLSPEC extern const Datatype INTEGER4; +OMPI_DECLSPEC extern const Datatype REAL2; +OMPI_DECLSPEC extern const Datatype REAL4; +OMPI_DECLSPEC extern const Datatype REAL8; // optional datatype (C / C++) -extern const Datatype LONG_LONG; -extern const Datatype UNSIGNED_LONG_LONG; +OMPI_DECLSPEC extern const Datatype LONG_LONG; +OMPI_DECLSPEC extern const Datatype UNSIGNED_LONG_LONG; // c++ types -extern const Datatype BOOL; -extern const Datatype COMPLEX; -extern const Datatype DOUBLE_COMPLEX; -extern const Datatype LONG_DOUBLE_COMPLEX; +OMPI_DECLSPEC extern const Datatype BOOL; +OMPI_DECLSPEC extern const Datatype COMPLEX; +OMPI_DECLSPEC extern const Datatype DOUBLE_COMPLEX; +OMPI_DECLSPEC extern const Datatype LONG_DOUBLE_COMPLEX; // special datatypes for contstruction of derived datatypes -extern const Datatype UB; -extern const Datatype LB; +OMPI_DECLSPEC extern const Datatype UB; +OMPI_DECLSPEC extern const Datatype LB; // datatype decoding constants -extern const int COMBINER_NAMED; -extern const int COMBINER_DUP; -extern const int COMBINER_CONTIGUOUS; -extern const int COMBINER_VECTOR; -extern const int COMBINER_HVECTOR_INTEGER; -extern const int COMBINER_HVECTOR; -extern const int COMBINER_INDEXED; -extern const int COMBINER_HINDEXED_INTEGER; -extern const int COMBINER_HINDEXED; -extern const int COMBINER_INDEXED_BLOCK; -extern const int COMBINER_STRUCT_INTEGER; -extern const int COMBINER_STRUCT; -extern const int COMBINER_SUBARRAY; -extern const int COMBINER_DARRAY; -extern const int COMBINER_F90_REAL; -extern const int COMBINER_F90_COMPLEX; -extern const int COMBINER_F90_INTEGER; -extern const int COMBINER_RESIZED; +OMPI_DECLSPEC extern const int COMBINER_NAMED; +OMPI_DECLSPEC extern const int COMBINER_DUP; +OMPI_DECLSPEC extern const int COMBINER_CONTIGUOUS; +OMPI_DECLSPEC extern const int COMBINER_VECTOR; +OMPI_DECLSPEC extern const int COMBINER_HVECTOR_INTEGER; +OMPI_DECLSPEC extern const int COMBINER_HVECTOR; +OMPI_DECLSPEC extern const int COMBINER_INDEXED; +OMPI_DECLSPEC extern const int COMBINER_HINDEXED_INTEGER; +OMPI_DECLSPEC extern const int COMBINER_HINDEXED; +OMPI_DECLSPEC extern const int COMBINER_INDEXED_BLOCK; +OMPI_DECLSPEC extern const int COMBINER_STRUCT_INTEGER; +OMPI_DECLSPEC extern const int COMBINER_STRUCT; +OMPI_DECLSPEC extern const int COMBINER_SUBARRAY; +OMPI_DECLSPEC extern const int COMBINER_DARRAY; +OMPI_DECLSPEC extern const int COMBINER_F90_REAL; +OMPI_DECLSPEC extern const int COMBINER_F90_COMPLEX; +OMPI_DECLSPEC extern const int COMBINER_F90_INTEGER; +OMPI_DECLSPEC extern const int COMBINER_RESIZED; // thread constants -extern const int THREAD_SINGLE; -extern const int THREAD_FUNNELED; -extern const int THREAD_SERIALIZED; -extern const int THREAD_MULTIPLE; +OMPI_DECLSPEC extern const int THREAD_SINGLE; +OMPI_DECLSPEC extern const int THREAD_FUNNELED; +OMPI_DECLSPEC extern const int THREAD_SERIALIZED; +OMPI_DECLSPEC extern const int THREAD_MULTIPLE; // reserved communicators // JGS these can not be const because Set_errhandler is not const -extern Intracomm COMM_WORLD; -extern Intracomm COMM_SELF; +OMPI_DECLSPEC extern Intracomm COMM_WORLD; +OMPI_DECLSPEC extern Intracomm COMM_SELF; // results of communicator and group comparisons -extern const int IDENT; -extern const int CONGRUENT; -extern const int SIMILAR; -extern const int UNEQUAL; +OMPI_DECLSPEC extern const int IDENT; +OMPI_DECLSPEC extern const int CONGRUENT; +OMPI_DECLSPEC extern const int SIMILAR; +OMPI_DECLSPEC extern const int UNEQUAL; // environmental inquiry keys -extern const int TAG_UB; -extern const int IO; -extern const int HOST; -extern const int WTIME_IS_GLOBAL; -extern const int UNIVERSE_SIZE; -extern const int APPNUM; -extern const int WIN_BASE; -extern const int WIN_SIZE; -extern const int WIN_DISP_UNIT; +OMPI_DECLSPEC extern const int TAG_UB; +OMPI_DECLSPEC extern const int IO; +OMPI_DECLSPEC extern const int HOST; +OMPI_DECLSPEC extern const int WTIME_IS_GLOBAL; +OMPI_DECLSPEC extern const int UNIVERSE_SIZE; +OMPI_DECLSPEC extern const int APPNUM; +OMPI_DECLSPEC extern const int WIN_BASE; +OMPI_DECLSPEC extern const int WIN_SIZE; +OMPI_DECLSPEC extern const int WIN_DISP_UNIT; // collective operations -extern const Op MAX; -extern const Op MIN; -extern const Op SUM; -extern const Op PROD; -extern const Op MAXLOC; -extern const Op MINLOC; -extern const Op BAND; -extern const Op BOR; -extern const Op BXOR; -extern const Op LAND; -extern const Op LOR; -extern const Op LXOR; -extern const Op REPLACE; +OMPI_DECLSPEC extern const Op MAX; +OMPI_DECLSPEC extern const Op MIN; +OMPI_DECLSPEC extern const Op SUM; +OMPI_DECLSPEC extern const Op PROD; +OMPI_DECLSPEC extern const Op MAXLOC; +OMPI_DECLSPEC extern const Op MINLOC; +OMPI_DECLSPEC extern const Op BAND; +OMPI_DECLSPEC extern const Op BOR; +OMPI_DECLSPEC extern const Op BXOR; +OMPI_DECLSPEC extern const Op LAND; +OMPI_DECLSPEC extern const Op LOR; +OMPI_DECLSPEC extern const Op LXOR; +OMPI_DECLSPEC extern const Op REPLACE; // null handles -extern const Group GROUP_NULL; -extern const Win WIN_NULL; -extern const Info INFO_NULL; -//extern const Comm COMM_NULL; -//extern const MPI_Comm COMM_NULL; -extern Comm_Null COMM_NULL; -extern const Datatype DATATYPE_NULL; -extern Request REQUEST_NULL; -extern const Op OP_NULL; -extern const Errhandler ERRHANDLER_NULL; +OMPI_DECLSPEC extern const Group GROUP_NULL; +OMPI_DECLSPEC extern const Win WIN_NULL; +OMPI_DECLSPEC extern const Info INFO_NULL; +//OMPI_DECLSPEC extern const Comm COMM_NULL; +//OMPI_DECLSPEC extern const MPI_Comm COMM_NULL; +OMPI_DECLSPEC extern Comm_Null COMM_NULL; +OMPI_DECLSPEC extern const Datatype DATATYPE_NULL; +OMPI_DECLSPEC extern Request REQUEST_NULL; +OMPI_DECLSPEC extern const Op OP_NULL; +OMPI_DECLSPEC extern const Errhandler ERRHANDLER_NULL; // constants specifying empty or ignored input -extern const char** ARGV_NULL; -extern const char*** ARGVS_NULL; +OMPI_DECLSPEC extern const char** ARGV_NULL; +OMPI_DECLSPEC extern const char*** ARGVS_NULL; // empty group -extern const Group GROUP_EMPTY; +OMPI_DECLSPEC extern const Group GROUP_EMPTY; // topologies -extern const int GRAPH; -extern const int CART; +OMPI_DECLSPEC extern const int GRAPH; +OMPI_DECLSPEC extern const int CART; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/mpi/cxx/mpicxx.h b/src/mpi/cxx/mpicxx.h index 6bce552f15..982f926e81 100644 --- a/src/mpi/cxx/mpicxx.h +++ b/src/mpi/cxx/mpicxx.h @@ -59,7 +59,7 @@ ompi_mpi_cxx_delete_attr_intercept(MPI_Comm comm, int keyval, namespace MPI { #if ! OMPI_HAVE_CXX_EXCEPTION_SUPPORT - extern int mpi_errno; + OMPI_DECLSPEC extern int mpi_errno; #endif class Comm_Null; diff --git a/src/mpi/f77/constants.h b/src/mpi/f77/constants.h index 2c9287eb11..5183f08b2b 100644 --- a/src/mpi/f77/constants.h +++ b/src/mpi/f77/constants.h @@ -68,10 +68,10 @@ typedef struct { double bogus[2]; } ompi_fortran_common_t; */ #define DECL(upper_case, lower_case, single_u, double_u) \ -extern ompi_fortran_common_t upper_case; \ -extern ompi_fortran_common_t lower_case; \ -extern ompi_fortran_common_t single_u; \ -extern ompi_fortran_common_t double_u +OMPI_DECLSPEC extern ompi_fortran_common_t upper_case; \ +OMPI_DECLSPEC extern ompi_fortran_common_t lower_case; \ +OMPI_DECLSPEC extern ompi_fortran_common_t single_u; \ +OMPI_DECLSPEC extern ompi_fortran_common_t double_u DECL(MPI_FORTRAN_BOTTOM, mpi_fortran_bottom, mpi_fortran_bottom_, mpi_fortran_bottom__); diff --git a/src/mpi/runtime/mpiruntime.h b/src/mpi/runtime/mpiruntime.h index fcc8f0822b..e33f06946b 100644 --- a/src/mpi/runtime/mpiruntime.h +++ b/src/mpi/runtime/mpiruntime.h @@ -21,16 +21,16 @@ extern "C" { */ /** Is mpi initialized? */ -extern bool ompi_mpi_initialized; +OMPI_DECLSPEC extern bool ompi_mpi_initialized; /** Has mpi been finalized? */ -extern bool ompi_mpi_finalized; +OMPI_DECLSPEC extern bool ompi_mpi_finalized; /** Do we have multiple threads? */ -extern bool ompi_mpi_thread_multiple; +OMPI_DECLSPEC extern bool ompi_mpi_thread_multiple; /** Thread level requested to \c MPI_Init_thread() */ -extern int ompi_mpi_thread_requested; +OMPI_DECLSPEC extern int ompi_mpi_thread_requested; /** Thread level provided by Open MPI */ -extern int ompi_mpi_thread_provided; +OMPI_DECLSPEC extern int ompi_mpi_thread_provided; diff --git a/src/mpi/runtime/params.h b/src/mpi/runtime/params.h index 09063c3c90..e749e6d604 100644 --- a/src/mpi/runtime/params.h +++ b/src/mpi/runtime/params.h @@ -28,7 +28,7 @@ extern "C" { * Hence, the MPI_PARAM_CHECK macro will either be "0", "1", or * "ompi_mpi_param_check". */ -extern bool ompi_mpi_param_check; +OMPI_DECLSPEC extern bool ompi_mpi_param_check; /** * Whether or not to check for MPI handle leaks during MPI_FINALIZE. @@ -38,7 +38,7 @@ extern bool ompi_mpi_param_check; * This is good debugging for user applications to find out if they * are inadvertantly orphaning MPI handles. */ -extern bool ompi_debug_show_handle_leaks; +OMPI_DECLSPEC extern bool ompi_debug_show_handle_leaks; /** * Whether or not to actually free MPI handles when their @@ -49,7 +49,7 @@ extern bool ompi_debug_show_handle_leaks; * This is good debugging for user applications to find out if they * are inadvertantly using MPI handles after they have been freed. */ -extern bool ompi_debug_no_free_handles; +OMPI_DECLSPEC extern bool ompi_debug_no_free_handles; /** diff --git a/src/op/op.h b/src/op/op.h index 4e3267387c..d0f5fbc39d 100644 --- a/src/op/op.h +++ b/src/op/op.h @@ -216,83 +216,83 @@ typedef struct ompi_op_t ompi_op_t; * extra lookup, and that lookup is way cheaper than the function call * to invoke the reduction operation, it seemed like the best idea. */ -extern int ompi_op_ddt_map[DT_MAX_PREDEFINED]; +OMPI_DECLSPEC extern int ompi_op_ddt_map[DT_MAX_PREDEFINED]; /** * Global variable for MPI_OP_NULL */ -extern ompi_op_t ompi_mpi_op_null; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_null; /** * Global variable for MPI_MAX */ -extern ompi_op_t ompi_mpi_op_max; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_max; /** * Global variable for MPI_MIN */ -extern ompi_op_t ompi_mpi_op_min; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_min; /** * Global variable for MPI_SUM */ -extern ompi_op_t ompi_mpi_op_sum; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_sum; /** * Global variable for MPI_PROD */ -extern ompi_op_t ompi_mpi_op_prod; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_prod; /** * Global variable for MPI_LAND */ -extern ompi_op_t ompi_mpi_op_land; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_land; /** * Global variable for MPI_BAND */ -extern ompi_op_t ompi_mpi_op_band; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_band; /** * Global variable for MPI_LOR */ -extern ompi_op_t ompi_mpi_op_lor; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_lor; /** * Global variable for MPI_BOR */ -extern ompi_op_t ompi_mpi_op_bor; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_bor; /** * Global variable for MPI_LXOR */ -extern ompi_op_t ompi_mpi_op_lxor; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_lxor; /** * Global variable for MPI_BXOR */ -extern ompi_op_t ompi_mpi_op_bxor; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_bxor; /** * Global variable for MPI_MAXLOC */ -extern ompi_op_t ompi_mpi_op_maxloc; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_maxloc; /** * Global variable for MPI_MINLOC */ -extern ompi_op_t ompi_mpi_op_minloc; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_minloc; /** * Global variable for MPI_REPLACE */ -extern ompi_op_t ompi_mpi_op_replace; +OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_replace; /** * Table for Fortran <-> C op handle conversion */ -extern ompi_pointer_array_t *ompi_op_f_to_c_table; +OMPI_DECLSPEC extern ompi_pointer_array_t *ompi_op_f_to_c_table; #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/proc/proc.h b/src/proc/proc.h index e405779af5..e722d8216b 100644 --- a/src/proc/proc.h +++ b/src/proc/proc.h @@ -14,8 +14,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern ompi_class_t ompi_proc_t_class; - +OMPI_DECLSPEC extern ompi_class_t ompi_proc_t_class; struct ompi_proc_t { ompi_list_item_t super; /* allow proc to be placed on a list */ @@ -59,7 +58,7 @@ ompi_proc_t** ompi_proc_self(size_t* size); */ static inline ompi_proc_t* ompi_proc_local(void) { - extern ompi_proc_t* ompi_proc_local_proc; + OMPI_DECLSPEC extern ompi_proc_t* ompi_proc_local_proc; return ompi_proc_local_proc; } diff --git a/src/request/grequest.h b/src/request/grequest.h index db69cd8492..7f9f523a89 100644 --- a/src/request/grequest.h +++ b/src/request/grequest.h @@ -11,7 +11,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -OBJ_CLASS_DECLARATION(ompi_grequest_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_grequest_t); struct ompi_grequest_t { @@ -28,7 +28,7 @@ typedef struct ompi_grequest_t ompi_grequest_t; * Start a generalized request. */ -int ompi_grequest_start( +OMPI_DECLSPEC int ompi_grequest_start( MPI_Grequest_query_function *gquery, MPI_Grequest_free_function *gfree, MPI_Grequest_cancel_function *gcancel, @@ -38,10 +38,9 @@ int ompi_grequest_start( /* * Mark a generalized request as complete. */ -int ompi_grequest_complete(ompi_grequest_t*); +OMPI_DECLSPEC int ompi_grequest_complete(ompi_grequest_t*); #if defined(c_plusplus) || defined(__cplusplus) } #endif #endif - diff --git a/src/request/request.h b/src/request/request.h index b39985cb15..87a7c90130 100644 --- a/src/request/request.h +++ b/src/request/request.h @@ -23,7 +23,7 @@ extern "C" { /** * Request class */ -OBJ_CLASS_DECLARATION(ompi_request_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_request_t); /** * Enum inidicating the type of the request @@ -122,12 +122,12 @@ typedef struct ompi_request_t ompi_request_t; /** * Globals used for tracking requests and request completion. */ -extern ompi_pointer_array_t ompi_request_f_to_c_table; -extern volatile int ompi_request_waiting; -extern ompi_mutex_t ompi_request_lock; -extern ompi_condition_t ompi_request_cond; -extern int ompi_request_poll_iterations; -extern ompi_request_t ompi_request_null; +OMPI_DECLSPEC extern ompi_pointer_array_t ompi_request_f_to_c_table; +OMPI_DECLSPEC extern volatile int ompi_request_waiting; +OMPI_DECLSPEC extern ompi_mutex_t ompi_request_lock; +OMPI_DECLSPEC extern ompi_condition_t ompi_request_cond; +OMPI_DECLSPEC extern int ompi_request_poll_iterations; +OMPI_DECLSPEC extern ompi_request_t ompi_request_null; @@ -135,13 +135,13 @@ extern ompi_request_t ompi_request_null; * Initialize the MPI_Request subsystem; invoked during MPI_INIT. */ -int ompi_request_init(void); +OMPI_DECLSPEC int ompi_request_init(void); /** * Shut down the MPI_Request subsystem; invoked during MPI_FINALIZE. */ -int ompi_request_finalize(void); +OMPI_DECLSPEC int ompi_request_finalize(void); /** @@ -161,7 +161,7 @@ static inline int ompi_request_cancel(ompi_request_t* request) * wake any thread pending on the request. */ -int ompi_request_complete(ompi_request_t* request); +OMPI_DECLSPEC int ompi_request_complete(ompi_request_t* request); /** * Free a request. @@ -188,7 +188,7 @@ static inline int ompi_request_free(ompi_request_t** request) * request handle at index set to NULL. */ -int ompi_request_test( +OMPI_DECLSPEC int ompi_request_test( size_t count, ompi_request_t ** requests, int *index, @@ -211,7 +211,7 @@ int ompi_request_test( * have completed. */ -int ompi_request_test_all( +OMPI_DECLSPEC int ompi_request_test_all( size_t count, ompi_request_t ** requests, int *completed, @@ -293,7 +293,7 @@ static inline int ompi_request_wait( * */ -int ompi_request_wait_any( +OMPI_DECLSPEC int ompi_request_wait_any( size_t count, ompi_request_t ** requests, int *index, @@ -309,7 +309,7 @@ int ompi_request_wait_any( * */ -int ompi_request_wait_all( +OMPI_DECLSPEC int ompi_request_wait_all( size_t count, ompi_request_t ** requests, ompi_status_public_t * statuses); diff --git a/src/runtime/ompi_progress.h b/src/runtime/ompi_progress.h index 315a8dda25..a00f550213 100644 --- a/src/runtime/ompi_progress.h +++ b/src/runtime/ompi_progress.h @@ -3,7 +3,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -extern void ompi_progress(void); +OMPI_DECLSPEC extern void ompi_progress(void); #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/src/runtime/ompi_rte_wait.c b/src/runtime/ompi_rte_wait.c index 481525898d..a8551879a5 100644 --- a/src/runtime/ompi_rte_wait.c +++ b/src/runtime/ompi_rte_wait.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include #ifdef HAVE_SYS_TIME_H @@ -163,6 +163,7 @@ ompi_rte_wait_finalize(void) pid_t ompi_rte_waitpid(pid_t wpid, int *status, int options) { +#ifndef WIN32 pending_pids_item_t *pending = NULL; blk_waitpid_data_t *data = NULL; ompi_mutex_t *cond_mutex; @@ -245,12 +246,18 @@ ompi_rte_waitpid(pid_t wpid, int *status, int options) cleanup: OMPI_THREAD_UNLOCK(&mutex); return ret; +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } int ompi_rte_wait_cb(pid_t wpid, ompi_rte_wait_fn_t callback, void *data) { +#ifndef WIN32 int ret; if (wpid <= 0) return OMPI_ERR_NOT_IMPLEMENTED; @@ -263,12 +270,18 @@ ompi_rte_wait_cb(pid_t wpid, ompi_rte_wait_fn_t callback, void *data) OMPI_THREAD_UNLOCK(&mutex); return ret; +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } void ompi_rte_wait_signal_callback(int fd, short event, void *arg) { +#ifndef WIN32 struct ompi_event *signal = (struct ompi_event*) arg; if (SIGCHLD != OMPI_EVENT_SIGNAL(signal)) return; @@ -276,6 +289,11 @@ ompi_rte_wait_signal_callback(int fd, short event, void *arg) OMPI_THREAD_LOCK(&mutex); do_waitall(0); OMPI_THREAD_UNLOCK(&mutex); +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } @@ -290,11 +308,17 @@ ompi_rte_wait_signal_callback(int fd, short event, void *arg) static void blk_waitpid_cb(pid_t wpid, int status, void *data) { +#ifndef WIN32 blk_waitpid_data_t *wp_data = (blk_waitpid_data_t*) data; wp_data->status = status; wp_data->done = 1; ompi_condition_broadcast(wp_data->cond); +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } @@ -302,6 +326,7 @@ blk_waitpid_cb(pid_t wpid, int status, void *data) static pending_pids_item_t * find_pending_pid(pid_t pid, bool create) { +#ifndef WIN32 ompi_list_item_t *item; pending_pids_item_t *pending; @@ -326,6 +351,11 @@ find_pending_pid(pid_t pid, bool create) } return NULL; +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } @@ -333,6 +363,7 @@ find_pending_pid(pid_t pid, bool create) static registered_cb_item_t * find_waiting_cb(pid_t pid, bool create) { +#ifndef WIN32 ompi_list_item_t *item = NULL; registered_cb_item_t *reg_cb = NULL; @@ -358,12 +389,18 @@ find_waiting_cb(pid_t pid, bool create) } return NULL; +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } static void do_waitall(int options) { +#ifndef WIN32 pid_t ret; int status; pending_pids_item_t *pending; @@ -384,23 +421,35 @@ do_waitall(int options) if (NULL == reg_cb) continue; trigger_callback(reg_cb, pending); } +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } static void trigger_callback(registered_cb_item_t *cb, pending_pids_item_t *pending) { +#ifndef WIN32 assert(cb->pid == pending->pid); cb->callback(cb->pid, pending->status, cb->data); ompi_list_remove_item(&pending_pids, (ompi_list_item_t*) pending); ompi_list_remove_item(®istered_cb, (ompi_list_item_t*) cb); +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } static int register_callback(pid_t pid, ompi_rte_wait_fn_t callback, void *data) { +#ifndef WIN32 registered_cb_item_t *reg_cb; pending_pids_item_t *pending; @@ -420,12 +469,18 @@ register_callback(pid_t pid, ompi_rte_wait_fn_t callback, void *data) } return OMPI_SUCCESS; +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } static void register_sig_event(void) { +#ifndef WIN32 OMPI_THREAD_LOCK(&ev_reg_mutex); if (true == ev_reg_complete) goto cleanup; @@ -449,4 +504,9 @@ register_sig_event(void) cleanup: OMPI_THREAD_UNLOCK(&ev_reg_mutex); +#else + printf ("function not implemented in windows yet: + file %s, line %d\n", __FILE__, __LINE__); + abort(); +#endif } diff --git a/src/runtime/ompi_vm_register.c b/src/runtime/ompi_vm_register.c index 636167ba10..bad5b76a39 100644 --- a/src/runtime/ompi_vm_register.c +++ b/src/runtime/ompi_vm_register.c @@ -3,8 +3,8 @@ */ /** @file **/ -#include "ompi_config.h" +#include "ompi_config.h" #include #include @@ -35,17 +35,17 @@ int ompi_vm_register(void) if (OMPI_SUCCESS != ompi_pack_string(buffer, ompi_system_info.nodename)) { ret_code = OMPI_ERROR; - goto ERROR; + goto error; } if (OMPI_SUCCESS != ompi_pack(buffer, ompi_rte_get_self(), 1, OMPI_NAME)) { ret_code = OMPI_ERROR; - goto ERROR; + goto error; } if (OMPI_SUCCESS != ompi_pack_string(buffer, mca_oob_get_contact_info())) { ret_code = OMPI_ERROR; - goto ERROR; + goto error; } if (0 == strncmp(ompi_system_info.sysname, "Darwin", strlen("Darwin"))) { @@ -59,7 +59,7 @@ int ompi_vm_register(void) if (OMPI_SUCCESS != ompi_pack(buffer, &num, 1, OMPI_INT32)) { ret_code = OMPI_ERROR; - goto ERROR; + goto error; } keys[0] = ompi_name_server.get_proc_name_string(ompi_rte_get_self()); @@ -67,7 +67,7 @@ int ompi_vm_register(void) ret_code = ompi_registry.put(OMPI_REGISTRY_XAND, "ompi-vm", keys, buffer, sizeof(buffer)); - ERROR: + error: ompi_buffer_free(buffer); return ret_code; } diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 7442e0d802..89ef40f4a1 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -56,7 +56,7 @@ extern "C" { /* globals used by RTE - instanced in ompi_rte_init.c */ - extern int ompi_rte_debug_flag; + OMPI_DECLSPEC extern int ompi_rte_debug_flag; /* Define the info structure underlying the Open MPI universe system * instanced in ompi_rte_init.c */ @@ -79,7 +79,7 @@ extern "C" { }; typedef struct ompi_universe_t ompi_universe_t; - extern ompi_universe_t ompi_universe_info; +OMPI_DECLSPEC extern ompi_universe_t ompi_universe_info; /** * Initialize the Open MPI support code @@ -92,7 +92,7 @@ extern "C" { * This function should be called before \code ompi_rte_init, if * \code ompi_rte_init is to be called. */ - int ompi_init(int argc, char* argv[]); +OMPI_DECLSPEC int ompi_init(int argc, char* argv[]); /** * Finalize the Open MPI support code @@ -102,7 +102,7 @@ extern "C" { * be called after \code ompi_rte_finalize, if \code * ompi_rte_finalize is called. */ - int ompi_finalize(void); +OMPI_DECLSPEC int ompi_finalize(void); /** * Abort the current application with a pretty-print error message @@ -111,7 +111,7 @@ extern "C" { * printing an error message if possible. Error message should be * specified using the standard \code printf() format. */ - int ompi_abort(int status, char *fmt, ...); +OMPI_DECLSPEC int ompi_abort(int status, char *fmt, ...); /** @@ -123,13 +123,13 @@ extern "C" { * be called by every application using the RTE interface, including * MPI applications and mpirun. */ - int ompi_rte_init(ompi_cmd_line_t *cmd_line, bool *allow_multi_user_threads, bool *have_hidden_threads); +OMPI_DECLSPEC int ompi_rte_init(ompi_cmd_line_t *cmd_line, bool *allow_multi_user_threads, bool *have_hidden_threads); /** * Finalize the Open MPI run time environment * */ - int ompi_rte_finalize(void); +OMPI_DECLSPEC int ompi_rte_finalize(void); /** @@ -163,7 +163,7 @@ extern "C" { * If no available pcm components are capable * of meeting criteria, \c NULL is returned. */ - ompi_rte_spawn_handle_t* ompi_rte_get_spawn_handle(int criteria, +OMPI_DECLSPEC ompi_rte_spawn_handle_t* ompi_rte_get_spawn_handle(int criteria, bool have_threads); @@ -208,7 +208,7 @@ extern "C" { * ompi_rte_allocate_resources can be called again, but * without nodes = 0, procs = 0. */ - ompi_list_t* ompi_rte_allocate_resources(ompi_rte_spawn_handle_t* handle, +OMPI_DECLSPEC ompi_list_t* ompi_rte_allocate_resources(ompi_rte_spawn_handle_t* handle, mca_ns_base_jobid_t jobid, int nodes, int procs); @@ -223,7 +223,7 @@ extern "C" { * * @param handle (IN) Handle from \c ompi_rte_get_spawn_handle */ - int ompi_rte_spawn_procs(ompi_rte_spawn_handle_t* handle, +OMPI_DECLSPEC int ompi_rte_spawn_procs(ompi_rte_spawn_handle_t* handle, mca_ns_base_jobid_t jobid, ompi_list_t *schedule_list); @@ -233,7 +233,7 @@ extern "C" { * * @return my name */ - ompi_process_name_t* ompi_rte_get_self(void); +OMPI_DECLSPEC ompi_process_name_t* ompi_rte_get_self(void); /** @@ -256,35 +256,35 @@ extern "C" { * not properly loaded. * */ - int ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers); +OMPI_DECLSPEC int ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers); /** * "Hold" until all procs registered, or timeout occurs */ - int ompi_rte_monitor_procs_registered(void); +OMPI_DECLSPEC int ompi_rte_monitor_procs_registered(void); /** * "Hold" until all procs unregistered - no timeout. */ - int ompi_rte_monitor_procs_unregistered(void); +OMPI_DECLSPEC int ompi_rte_monitor_procs_unregistered(void); /** * Callback function for all procs registered */ - void ompi_rte_all_procs_registered(ompi_registry_notify_message_t* match, void* cbdata); +OMPI_DECLSPEC void ompi_rte_all_procs_registered(ompi_registry_notify_message_t* match, void* cbdata); /** * Callback function for all procs unregistered */ - void ompi_rte_all_procs_unregistered(ompi_registry_notify_message_t* match, void* cbdata); +OMPI_DECLSPEC void ompi_rte_all_procs_unregistered(ompi_registry_notify_message_t* match, void* cbdata); /** * Remove process registration. */ - int ompi_rte_unregister(void); +OMPI_DECLSPEC int ompi_rte_unregister(void); /** * Kill a specific process in this cell @@ -296,7 +296,7 @@ extern "C" { * future compatibility. Will be used to specify how to kill * processes (0 will be same as a "kill " */ - int ompi_rte_kill_proc(ompi_process_name_t *name, int flags); +OMPI_DECLSPEC int ompi_rte_kill_proc(ompi_process_name_t *name, int flags); /** @@ -311,7 +311,7 @@ extern "C" { * future compatibility. Will be used to specify how to kill * processes (0 will be same as a "kill " */ - int ompi_rte_kill_job(mca_ns_base_jobid_t jobid, int flags); +OMPI_DECLSPEC int ompi_rte_kill_job(mca_ns_base_jobid_t jobid, int flags); /** @@ -324,7 +324,7 @@ extern "C" { * @param nodes (IN) Nodelist from associated allocate_resource call. * All associated memory will be freed as appropriate. */ - int ompi_rte_deallocate_resources(ompi_rte_spawn_handle_t *handle, +OMPI_DECLSPEC int ompi_rte_deallocate_resources(ompi_rte_spawn_handle_t *handle, mca_ns_base_jobid_t jobid, ompi_list_t *nodelist); @@ -337,7 +337,7 @@ extern "C" { * @param cmd_line Pointer to an ompi_cmd_line_t object * @retval None */ - void ompi_rte_cmd_line_setup(ompi_cmd_line_t *cmd_line); +OMPI_DECLSPEC void ompi_rte_cmd_line_setup(ompi_cmd_line_t *cmd_line); /** @@ -349,7 +349,7 @@ extern "C" { * @param cmd_line Command line to be parsed. * @retval None */ - void ompi_rte_parse_cmd_line(ompi_cmd_line_t *cmd_line); +OMPI_DECLSPEC void ompi_rte_parse_cmd_line(ompi_cmd_line_t *cmd_line); /** * Parse the rte command line for daemon-specific options @@ -360,7 +360,7 @@ extern "C" { * @param cmd_line Command line to be parsed. * @retval None */ - void ompi_rte_parse_daemon_cmd_line(ompi_cmd_line_t *cmd_line); +OMPI_DECLSPEC void ompi_rte_parse_daemon_cmd_line(ompi_cmd_line_t *cmd_line); /** * Check for universe existence @@ -382,7 +382,7 @@ extern "C" { * @retval OMPI_CONNECTION_REFUSED Universe found and contact made, but * universe refused to allow connection. */ - int ompi_rte_universe_exists(void); +OMPI_DECLSPEC int ompi_rte_universe_exists(void); /** * Parse the RTE environmental variables @@ -395,13 +395,13 @@ extern "C" { * * @retval None */ - void ompi_rte_parse_environ(void); +OMPI_DECLSPEC void ompi_rte_parse_environ(void); /** * Register a daemon on the virtual machine segment. */ - int ompi_vm_register(void); +OMPI_DECLSPEC int ompi_vm_register(void); #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/runtime/runtime_types.h b/src/runtime/runtime_types.h index 5380f98a14..32731f2379 100644 --- a/src/runtime/runtime_types.h +++ b/src/runtime/runtime_types.h @@ -44,7 +44,7 @@ struct ompi_rte_spawn_handle_t { /** shorten ompi_rte_spawn_handle_t declarations */ typedef struct ompi_rte_spawn_handle_t ompi_rte_spawn_handle_t; /** create the required instance information */ -OBJ_CLASS_DECLARATION(ompi_rte_spawn_handle_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rte_spawn_handle_t); /** @@ -86,7 +86,7 @@ struct ompi_rte_node_schedule_t { /** shorten ompi_rte_node_schedule_t declarations */ typedef struct ompi_rte_node_schedule_t ompi_rte_node_schedule_t; /** create the required instance information */ -OBJ_CLASS_DECLARATION(ompi_rte_node_schedule_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rte_node_schedule_t); /** @@ -102,7 +102,7 @@ struct ompi_rte_node_allocation_data_t { /** shorten ompi_rte_node_allocation_data_t declarations */ typedef struct ompi_rte_node_allocation_data_t ompi_rte_node_allocation_data_t; /** create the required instance information */ -OBJ_CLASS_DECLARATION(ompi_rte_node_allocation_data_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rte_node_allocation_data_t); /** @@ -146,7 +146,7 @@ struct ompi_rte_node_allocation_t { /** shorten ompi_rte_allocation_t declarations */ typedef struct ompi_rte_node_allocation_t ompi_rte_node_allocation_t; /** create the required instance information */ -OBJ_CLASS_DECLARATION(ompi_rte_node_allocation_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rte_node_allocation_t); /** @@ -168,7 +168,7 @@ struct ompi_rte_valuepair_t { /** shorten ompi_rte_valuepair_t declarations */ typedef struct ompi_rte_valuepair_t ompi_rte_valuepair_t; /** create the required instance information */ -OBJ_CLASS_DECLARATION(ompi_rte_valuepair_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rte_valuepair_t); /** diff --git a/src/threads/condition_pthread.h b/src/threads/condition_pthread.h index ee46151047..0e047e77d4 100644 --- a/src/threads/condition_pthread.h +++ b/src/threads/condition_pthread.h @@ -18,7 +18,7 @@ struct ompi_condition_t { }; typedef struct ompi_condition_t ompi_condition_t; -OBJ_CLASS_DECLARATION(ompi_condition_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_condition_t); static inline int ompi_condition_wait(ompi_condition_t *c, ompi_mutex_t *m) diff --git a/src/threads/condition_spinlock.h b/src/threads/condition_spinlock.h index 83842699ef..bf8211dcb7 100644 --- a/src/threads/condition_spinlock.h +++ b/src/threads/condition_spinlock.h @@ -22,7 +22,7 @@ struct ompi_condition_t { }; typedef struct ompi_condition_t ompi_condition_t; -OBJ_CLASS_DECLARATION(ompi_condition_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_condition_t); static inline int ompi_condition_wait(ompi_condition_t *c, ompi_mutex_t *m) diff --git a/src/threads/mutex.c b/src/threads/mutex.c index 18ba3e003d..53a8e26218 100644 --- a/src/threads/mutex.c +++ b/src/threads/mutex.c @@ -12,7 +12,7 @@ bool ompi_uses_threads = (bool) OMPI_HAVE_THREADS; -#ifdef __WINDOWS__ +#ifdef WIN32 #include diff --git a/src/threads/mutex.h b/src/threads/mutex.h index 4e7091fe56..54d3efd407 100644 --- a/src/threads/mutex.h +++ b/src/threads/mutex.h @@ -5,9 +5,7 @@ #ifndef OMPI_MUTEX_H #define OMPI_MUTEX_H 1 -#ifdef HAVE_CONFIG_H #include "ompi_config.h" -#endif #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif @@ -18,6 +16,10 @@ extern "C" { * * Functions for locking of critical sections. */ +/* + * declaring this here so that CL does not complain + */ +OMPI_DECLSPEC extern bool ompi_uses_threads; /** * Opaque mutex object @@ -113,7 +115,6 @@ static inline void ompi_mutex_atomic_unlock(ompi_mutex_t *mutex); */ static inline bool ompi_using_threads(void) { - extern bool ompi_uses_threads; return ompi_uses_threads; } @@ -136,7 +137,6 @@ static inline bool ompi_using_threads(void) */ static inline bool ompi_set_using_threads(bool have) { - extern bool ompi_uses_threads; #if OMPI_HAVE_THREADS ompi_uses_threads = have; #else @@ -260,8 +260,7 @@ static inline bool ompi_set_using_threads(bool have) } #endif -#ifdef __WINDOWS__ -#error Windows code is untested +#ifdef WIN32 #include "mutex_windows.h" #else #include "mutex_unix.h" diff --git a/src/threads/mutex_unix.h b/src/threads/mutex_unix.h index 4c1cccdae6..cfd61f06a4 100644 --- a/src/threads/mutex_unix.h +++ b/src/threads/mutex_unix.h @@ -37,7 +37,7 @@ struct ompi_mutex_t { ompi_lock_t m_lock_atomic; }; -OBJ_CLASS_DECLARATION(ompi_mutex_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_mutex_t); #if OMPI_HAVE_ATOMIC && OMPI_HAVE_POSIX_THREADS diff --git a/src/threads/mutex_windows.h b/src/threads/mutex_windows.h index 3314cd4f4d..83bdf5b479 100644 --- a/src/threads/mutex_windows.h +++ b/src/threads/mutex_windows.h @@ -15,11 +15,8 @@ * On Windows, base everything on InterlockedExchange(). */ -#error Windows code is untested - -#include - #include "class/ompi_object.h" +#include "include/sys/atomic.h" #if defined(c_plusplus) || defined(__cplusplus) extern "C" { @@ -29,7 +26,7 @@ struct ompi_mutex_t { volatile LONG m_lock; }; -OBJ_CLASS_DECLARATION(ompi_mutex_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_mutex_t); static inline int ompi_mutex_trylock(ompi_mutex_t *m) diff --git a/src/threads/thread.h b/src/threads/thread.h index 27d4cb9084..0e79caba70 100644 --- a/src/threads/thread.h +++ b/src/threads/thread.h @@ -5,7 +5,7 @@ #ifndef OMPI_THREAD_H #define OMPI_THREAD_H 1 -#ifdef __WINDOWS__ +#ifdef WIN32 #include #elif OMPI_HAVE_POSIX_THREADS #ifdef HAVE_PTHREAD_H @@ -24,7 +24,7 @@ typedef void *(*ompi_thread_fn_t) (ompi_object_t *); struct ompi_thread_t { ompi_object_t super; ompi_thread_fn_t t_run; -#ifdef __WINDOWS__ +#ifdef WIN32 HANDLE t_handle; #elif OMPI_HAVE_POSIX_THREADS pthread_t t_handle; @@ -34,7 +34,7 @@ struct ompi_thread_t { typedef struct ompi_thread_t ompi_thread_t; -OBJ_CLASS_DECLARATION(ompi_thread_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_thread_t); int ompi_thread_start(ompi_thread_t *); diff --git a/src/util/argv.h b/src/util/argv.h index 00209e7307..e26e45b2d7 100644 --- a/src/util/argv.h +++ b/src/util/argv.h @@ -11,7 +11,7 @@ #ifndef OMPI_ARGV_H #define OMPI_ARGV_H - +#include "ompi_config.h" #include "include/types.h" #if defined(c_plusplus) || defined(__cplusplus) @@ -46,7 +46,7 @@ extern "C" { * value into the argv array; there is no need to keep the original * string (i.e., the arg parameter) after invoking this function. */ - int ompi_argv_append(int *argc, char ***argv, const char *arg); +OMPI_DECLSPEC int ompi_argv_append(int *argc, char ***argv, const char *arg); /** * Free a NULL-terminated argv array. @@ -61,7 +61,7 @@ extern "C" { * not safe to invoke this function with a non-NULL-terminated argv * array. */ - void ompi_argv_free(char **argv); +OMPI_DECLSPEC void ompi_argv_free(char **argv); /** * Split a string into a NULL-terminated argv array. @@ -77,7 +77,7 @@ extern "C" { * argument (i.e., it can be freed after calling this function * without invalidating the output argv). */ - char **ompi_argv_split(const char *src_string, int delimiter); +OMPI_DECLSPEC char **ompi_argv_split(const char *src_string, int delimiter); /** * Return the length of a NULL-terminated argv array. @@ -89,7 +89,7 @@ extern "C" { * * The argv array must be NULL-terminated. */ - int ompi_argv_count(char **argv); +OMPI_DECLSPEC int ompi_argv_count(char **argv); /** * Join all the elements of an argv array into a single @@ -107,7 +107,7 @@ extern "C" { * * It is the callers responsibility to free the returned string. */ - char *ompi_argv_join(char **argv, int delimiter); +OMPI_DECLSPEC char *ompi_argv_join(char **argv, int delimiter); /** * Return the number of bytes consumed by an argv array. @@ -118,7 +118,7 @@ extern "C" { * array. This includes the number of bytes used by each of the * strings as well as the pointers used in the argv array. */ - size_t ompi_argv_len(char **argv); +OMPI_DECLSPEC size_t ompi_argv_len(char **argv); /** * Copy a NULL-terminated argv array. @@ -132,7 +132,7 @@ extern "C" { * Specifically, the output argv will be an array of the same length * as the input argv, and strcmp(argv_in[i], argv_out[i]) will be 0. */ - char **ompi_argv_copy(char **argv); +OMPI_DECLSPEC char **ompi_argv_copy(char **argv); /** * Delete one or more tokens from the middle of an argv. @@ -158,7 +158,7 @@ extern "C" { * free()ed (it is assumed that the argv "owns" the memory that * the pointer points to). */ - int ompi_argv_delete(char **argv, int start, int num_to_delete); +OMPI_DECLSPEC int ompi_argv_delete(char **argv, int start, int num_to_delete); /** * Insert one argv array into the middle of another @@ -181,7 +181,7 @@ extern "C" { * source points to are strdup'ed into the new locations in * target). */ - int ompi_argv_insert(char ***target, int start, char **source); +OMPI_DECLSPEC int ompi_argv_insert(char ***target, int start, char **source); #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/src/util/bufpack.c b/src/util/bufpack.c index 3bfa867ffa..1b9500dce5 100644 --- a/src/util/bufpack.c +++ b/src/util/bufpack.c @@ -58,7 +58,7 @@ typedef struct ompi_buffer_internal_t { } ompi_buffer_internal_t; /* formalise the declaration */ -OBJ_CLASS_DECLARATION (ompi_buffer_internal_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION (ompi_buffer_internal_t); /* some internal functions */ diff --git a/src/util/bufpack.h b/src/util/bufpack.h index ad7384dd92..d82c77c15c 100644 --- a/src/util/bufpack.h +++ b/src/util/bufpack.h @@ -18,6 +18,7 @@ #ifndef _OMPI_PACK_H_ #define _OMPI_PACK_H_ +#include "ompi_config.h" /* * Other constants @@ -61,7 +62,7 @@ extern "C" { * */ - int ompi_buffer_init (ompi_buffer_t *buffer, size_t reqinitsize); +OMPI_DECLSPEC int ompi_buffer_init (ompi_buffer_t *buffer, size_t reqinitsize); /** @@ -84,7 +85,7 @@ extern "C" { * */ - int ompi_buffer_init_preallocated (ompi_buffer_t *buffer, void *usermemory, size_t usermemorylen); +OMPI_DECLSPEC int ompi_buffer_init_preallocated (ompi_buffer_t *buffer, void *usermemory, size_t usermemorylen); /** * This function gets the size of packed data in a ompi_buffer @@ -97,7 +98,7 @@ extern "C" { * */ - int ompi_buffer_size (ompi_buffer_t buffer, size_t *size); +OMPI_DECLSPEC int ompi_buffer_size (ompi_buffer_t buffer, size_t *size); /** * This function gets the base/data/from ptrs of data in an ompi_buffer @@ -112,7 +113,7 @@ extern "C" { * */ - int ompi_buffer_get_ptrs (ompi_buffer_t buffer, +OMPI_DECLSPEC int ompi_buffer_get_ptrs (ompi_buffer_t buffer, void** baseptr, void** dataptr, void** fromptr); @@ -123,7 +124,7 @@ extern "C" { * */ - int ompi_buffer_get(ompi_buffer_t buffer, void** base, int* size); +OMPI_DECLSPEC int ompi_buffer_get(ompi_buffer_t buffer, void** base, int* size); /** * This function frees a given buffer @@ -136,7 +137,7 @@ extern "C" { * */ - int ompi_buffer_free (ompi_buffer_t buffer); +OMPI_DECLSPEC int ompi_buffer_free (ompi_buffer_t buffer); @@ -154,7 +155,7 @@ extern "C" { * @retval OMPI_SUCCESS * @retval OMPI_ERROR */ - int ompi_pack(ompi_buffer_t buffer, void * src, size_t n, ompi_pack_type_t type); +OMPI_DECLSPEC int ompi_pack(ompi_buffer_t buffer, void * src, size_t n, ompi_pack_type_t type); /** * This function unpacks the passed data according to the type enum. @@ -167,7 +168,7 @@ extern "C" { * @retval OMPI_SUCCESS * @retval OMPI_ERROR */ - int ompi_unpack(ompi_buffer_t buffer, void * dest, size_t n, ompi_pack_type_t type); +OMPI_DECLSPEC int ompi_unpack(ompi_buffer_t buffer, void * dest, size_t n, ompi_pack_type_t type); /* @@ -181,7 +182,7 @@ extern "C" { * */ - int ompi_pack_string (ompi_buffer_t buffer, char *str); +OMPI_DECLSPEC int ompi_pack_string (ompi_buffer_t buffer, char *str); /** * This function unpacks a string from the buffer. This routine ALLOCATES memory @@ -198,7 +199,7 @@ extern "C" { * @retval OMPI_ERROR * */ - int ompi_unpack_string(ompi_buffer_t buffer, char ** str); +OMPI_DECLSPEC int ompi_unpack_string(ompi_buffer_t buffer, char ** str); diff --git a/src/util/cmd_line.h b/src/util/cmd_line.h index f2b04c12d6..c7471ba346 100644 --- a/src/util/cmd_line.h +++ b/src/util/cmd_line.h @@ -149,7 +149,7 @@ typedef struct ompi_cmd_line_t ompi_cmd_line_t; * destructor for ompi_cmd_line_t handles will free all memory * associated with the handle. */ -OBJ_CLASS_DECLARATION(ompi_cmd_line_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_cmd_line_t); @@ -161,7 +161,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * ompi_cmd_line_make_opt3(cmd, short_name, NULL, long_name, * num_params, desc). */ - int ompi_cmd_line_make_opt(ompi_cmd_line_t *cmd, char short_name, +OMPI_DECLSPEC int ompi_cmd_line_make_opt(ompi_cmd_line_t *cmd, char short_name, const char *long_name, int num_params, const char *desc); @@ -193,7 +193,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * used to generate the output from ompi_cmd_line_get_usage_msg(). * */ - int ompi_cmd_line_make_opt3(ompi_cmd_line_t *cmd, char short_name, +OMPI_DECLSPEC int ompi_cmd_line_make_opt3(ompi_cmd_line_t *cmd, char short_name, const char *sd_name, const char *long_name, int num_params, const char *desc); /** @@ -247,7 +247,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * Invoking this function multiple times on different sets of argv * tokens is safe, but will erase any previous parsing results. */ - int ompi_cmd_line_parse(ompi_cmd_line_t *cmd, bool ignore_unknown, +OMPI_DECLSPEC int ompi_cmd_line_parse(ompi_cmd_line_t *cmd, bool ignore_unknown, int argc, char **argv); /** @@ -271,7 +271,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * * The returned string must be freed by the caller. */ - char *ompi_cmd_line_get_usage_msg(ompi_cmd_line_t *cmd); +OMPI_DECLSPEC char *ompi_cmd_line_get_usage_msg(ompi_cmd_line_t *cmd); /** * Test if a given option was taken on the parsed command line. * @@ -291,7 +291,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * (either by its short or long name) during token parsing. * Otherwise, it will return false. */ - bool ompi_cmd_line_is_taken(ompi_cmd_line_t *cmd, const char *opt); +OMPI_DECLSPEC bool ompi_cmd_line_is_taken(ompi_cmd_line_t *cmd, const char *opt); /** * Return the number of arguments parsed on a OMPI command line handle. @@ -304,7 +304,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * Arguments are added to the handle via the ompi_cmd_line_parse() * function. */ - int ompi_cmd_line_get_argc(ompi_cmd_line_t *cmd); +OMPI_DECLSPEC int ompi_cmd_line_get_argc(ompi_cmd_line_t *cmd); /** * Return a string argument parsed on a OMPI command line handle. @@ -323,7 +323,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * What is returned is a pointer to the actual string that is on * the handle; it should not be modified or freed. */ - char *ompi_cmd_line_get_argv(ompi_cmd_line_t *cmd, int index); +OMPI_DECLSPEC char *ompi_cmd_line_get_argv(ompi_cmd_line_t *cmd, int index); /** * Return the number of instances of an option found during parsing. @@ -345,7 +345,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * either the option was not specified as part of the OMPI command line * handle, or ompi_cmd_line_parse() was not invoked on this handle. */ - int ompi_cmd_line_get_ninsts(ompi_cmd_line_t *cmd, const char *opt); +OMPI_DECLSPEC int ompi_cmd_line_get_ninsts(ompi_cmd_line_t *cmd, const char *opt); /** * Return a specific parameter for a specific instance of a option @@ -374,7 +374,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * The returned string should \em not be modified or freed by the * caller. */ - char *ompi_cmd_line_get_param(ompi_cmd_line_t *cmd, const char *opt, +OMPI_DECLSPEC char *ompi_cmd_line_get_param(ompi_cmd_line_t *cmd, const char *opt, int instance_num, int param_num); /** @@ -404,7 +404,7 @@ OBJ_CLASS_DECLARATION(ompi_cmd_line_t); * of the tail parameters, and must be freed (likely with a call * to ompi_argv_free()) by the caller. */ - int ompi_cmd_line_get_tail(ompi_cmd_line_t *cmd, int *tailc, +OMPI_DECLSPEC int ompi_cmd_line_get_tail(ompi_cmd_line_t *cmd, int *tailc, char ***tailv); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/util/daemon_init.c b/src/util/daemon_init.c index 8bc498ec26..f6eb177cff 100644 --- a/src/util/daemon_init.c +++ b/src/util/daemon_init.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #ifdef HAVE_SYS_TYPES_H #include #endif @@ -19,6 +19,12 @@ int ompi_daemon_init(char *working_dir) { +#ifndef WIN32 + /* 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; if ((pid = fork()) < 0) { @@ -34,6 +40,9 @@ int ompi_daemon_init(char *working_dir) } umask(0); /* clear file mode creation mask */ - return OMPI_SUCCESS; +#else + printf ("This function has not been implemented in windows yet, file %s line %d\n", __FILE__, __LINE__); + abort(); +#endif } diff --git a/src/util/daemon_init.h b/src/util/daemon_init.h index b9914384f2..b83d97113d 100644 --- a/src/util/daemon_init.h +++ b/src/util/daemon_init.h @@ -18,4 +18,4 @@ * @retval OMPI_SUCCESS Indicates that the conversion was successful * @retval OMPI_ERROR Indicates that the conversion was not successful - a fork could not be completed. */ -int ompi_daemon_init(char *working_dir); +OMPI_DECLSPEC int ompi_daemon_init(char *working_dir); diff --git a/src/util/few.c b/src/util/few.c index 77f841d987..fad3fcc2fc 100644 --- a/src/util/few.c +++ b/src/util/few.c @@ -2,8 +2,8 @@ * $HEADER$ */ -#include "ompi_config.h" +#include "ompi_config.h" #include #include #ifdef HAVE_SYS_WAIT_H @@ -19,6 +19,7 @@ int ompi_few(char *argv[], int *status) { +#ifndef WIN32 pid_t pid, ret; if ((pid = fork()) < 0) { @@ -59,4 +60,43 @@ int ompi_few(char *argv[], int *status) /* Return the status to the caller */ return OMPI_SUCCESS; +#else + + /* Welcome to windows land. This is apparently a simple fork() exec() + procedure and hence should not be too difficult to implement */ + HANDLE new_process; + STARTUPINFO si; + PROCESS_INFORMATION pi; + DWORD process_stat; + + /* it does seem as if the environment is getting propogated, so I + will follow the same procedure in my code */ + + /* ANJU: Have to implement signal handling */ + + ZeroMemory (&si, sizeof(si)); + ZeroMemory (&pi, sizeof(pi)); + + GetStartupInfo (&si); + if (!CreateProcess (argv[0], + argv, + NULL, + NULL, + TRUE, + 0, + NULL, + NULL, + &si, + &pi)){ + /* actual error can be got by simply calling GetLastError() */ + return OMPI_ERROR; + } + + /* wait for child to die */ + WaitForSingleObject(pi.hProcess, INFINITE); + GetExitCodeProcess(pi.hProcess, &process_stat); + + SetLastError(process_stat); + return OMPI_SUCCESS; +#endif } diff --git a/src/util/few.h b/src/util/few.h index f4ce5ca831..0949a6c805 100644 --- a/src/util/few.h +++ b/src/util/few.h @@ -4,6 +4,7 @@ #ifndef OMPI_FEW_H #define OMPI_FEW_H +#include "ompi_config.h" #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif @@ -38,7 +39,7 @@ extern "C" { * safe in a multi-threaded environment in which a handler * for \c SIGCHLD has been registered. */ -int ompi_few(char *argv[], int *status); +OMPI_DECLSPEC int ompi_few(char *argv[], int *status); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/util/if.c b/src/util/if.c index afe1b1baab..8c83a7a3a1 100644 --- a/src/util/if.c +++ b/src/util/if.c @@ -44,10 +44,17 @@ struct ompi_if_t { ompi_list_item_t super; char if_name[IF_NAMESIZE]; int if_index; +#ifndef WIN32 int if_flags; +#else + u_long if_flags; +#endif int if_speed; struct sockaddr_in if_addr; struct sockaddr_in if_mask; +#ifdef WIN32 + struct sockaddr_in if_bcast; +#endif uint32_t if_bandwidth; }; typedef struct ompi_if_t ompi_if_t; @@ -62,6 +69,7 @@ static ompi_list_t ompi_if_list; static int ompi_ifinit(void) { +#ifndef WIN32 char buff[1024]; char *ptr; struct ifconf ifconf; @@ -161,6 +169,116 @@ static int ompi_ifinit(void) ompi_list_append(&ompi_if_list, (ompi_list_item_t*)intf_ptr); } close(sd); + +#else /* WIN32 implementation begins */ + + /* + 1. check if the interface info list is already populated. If so, return + 2. get the interface information which is required using WSAIoctl + 3. construct ompi_if_list and populate it with the list of interfaces we have + CAVEAT: Does not support the following options which are supported in SIOCGIFCONF + - kernel table index + - interface name + */ + + #define MAX_INTERFACES 10 /* Anju: for now assume there are no more than this */ + int ret; + WSADATA win_sock_data; + SOCKET sd; + INTERFACE_INFO if_list[MAX_INTERFACES]; + int num_interfaces; + unsigned long num_bytes_returned; + int i; + SOCKADDR_IN *sock_address; + unsigned int interface_counter = 0; + ompi_if_t intf; + ompi_if_t *intf_ptr; + + /* return if this has been done before */ + if (0 > ompi_list_get_size(&ompi_if_list)) { + return OMPI_SUCCESS; + } + + /* else initialise the use of Winsock2.DLL */ + if (WSAStartup (MAKEWORD (2, 2), &win_sock_data) != 0) { + ompi_output(0, "ompi_ifinit: WSAStartup failed with errno=%d\n",WSAGetLastError()); + return OMPI_ERROR; + } + + /* create a socket */ + sd = WSASocket (AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, 0); + if (sd == SOCKET_ERROR) { + ompi_output(0, "ompi_ifinit: WSASocket failed with errno=%d\n",WSAGetLastError()); + return OMPI_ERROR; + } + + /* get the information about the interfaces */ + if (SOCKET_ERROR == WSAIoctl (sd, + SIO_GET_INTERFACE_LIST, + NULL, + 0, + &if_list, + sizeof (if_list), + &num_bytes_returned, + 0, + 0)) { + ompi_output(0, "ompi_ifinit: WSAIoctl failed with errno=%d\n",WSAGetLastError()); + return OMPI_ERROR; + } + + /* create and populate ompi_if_list */ + OBJ_CONSTRUCT (&ompi_if_list, ompi_list_t); + + + /* loop through all the interfaces and create the list */ + num_interfaces = num_bytes_returned / sizeof (INTERFACE_INFO); + for (i = 0; i < num_interfaces; ++i) { + /* do all this only if the interface is up */ + if (if_list[i].iiFlags & IFF_UP) { + + OBJ_CONSTRUCT (&intf, ompi_list_item_t); + + /* fill in the interface address */ + memcpy (&intf.if_addr, &(if_list[i].iiAddress), sizeof(intf.if_addr)); + + /* fill in the netmask information */ + memcpy (&intf.if_mask, &(if_list[i].iiNetmask), sizeof(intf.if_mask)); + + /* fill in the bcast address */ + memcpy (&intf.if_bcast, &(if_list[i].iiBroadcastAddress), sizeof(intf.if_bcast)); + + /* fill in the flags */ + intf.if_flags = if_list[i].iiFlags; + + /* fill in the index in the table */ + intf.if_index = ompi_list_get_size(&ompi_if_list)+1; + + /* generate the interface name on your own .... + loopback: lo + Rest: eth0, eth1, ..... */ + + if (if_list[i].iiFlags & IFF_LOOPBACK) { + sprintf (intf.if_name, "lo"); + } else { + sprintf (intf.if_name, "eth%u", interface_counter++); + } + + /* copy all this into a persistent form and store it in the list */ + intf_ptr = malloc(sizeof(ompi_if_t)); + if (NULL == intf_ptr) { + ompi_output (0,"ompi_ifinit: Unable to malloc %d bytes",sizeof(ompi_list_t)); + return OMPI_ERR_OUT_OF_RESOURCE; + } + + memcpy (intf_ptr, &intf, sizeof(intf)); + ompi_list_append(&ompi_if_list, (ompi_list_item_t *)intf_ptr); + } + } + + /* this takes care of the cleanup for us :-D */ + WSACleanup (); + +#endif return OMPI_SUCCESS; } @@ -220,13 +338,22 @@ int ompi_ifnametoindex(const char* if_name) int ompi_ifaddrtoname(const char* if_addr, char* if_name, int length) { ompi_if_t* intf; - in_addr_t inaddr = inet_addr(if_addr); - int rc = ompi_ifinit(); +#ifndef WIN32 + in_addr_t inaddr; +#else + unsigned long inaddr; +#endif + int rc; + struct hostent *h; + + inaddr = inet_addr(if_addr); + + rc = ompi_ifinit(); if(rc != OMPI_SUCCESS) return rc; if(inaddr == INADDR_ANY) { - struct hostent *h = gethostbyname(if_addr); + h = gethostbyname(if_addr); if(h == 0) { ompi_output(0,"ompi_ifaddrtoname: unable to resolve %s\n", if_addr); return OMPI_ERROR; @@ -376,4 +503,3 @@ int ompi_ifindextoname(int if_index, char* if_name, int length) } return OMPI_ERROR; } - diff --git a/src/util/if.h b/src/util/if.h index 3f82a39f2a..a2407fb1ec 100644 --- a/src/util/if.h +++ b/src/util/if.h @@ -6,6 +6,7 @@ #ifndef _OMPI_IF_UTIL_ #define _OMPI_IF_UTIL_ +#include "ompi_config.h" #ifdef HAVE_SYS_TYPES_H #include #endif @@ -20,7 +21,7 @@ * @param if_addr (OUT) Interface address buffer * @param size (IN) Interface address buffer size */ -int ompi_ifnametoaddr(const char* if_name, struct sockaddr*, int); +OMPI_DECLSPEC int ompi_ifnametoaddr(const char* if_name, struct sockaddr*, int); /** * Lookup an interface by address and return its name. @@ -29,7 +30,7 @@ int ompi_ifnametoaddr(const char* if_name, struct sockaddr*, int); * @param if_addr (OUT) Interface name buffer * @param size (IN) Interface name buffer size */ -int ompi_ifaddrtoname(const char* if_addr, char* if_name, int); +OMPI_DECLSPEC int ompi_ifaddrtoname(const char* if_addr, char* if_name, int); /** * Lookup an interface by name and return its kernel index. @@ -37,17 +38,17 @@ int ompi_ifaddrtoname(const char* if_addr, char* if_name, int); * @param if_name (IN) Interface name * @return Interface index */ -int ompi_ifnametoindex(const char* if_name); +OMPI_DECLSPEC int ompi_ifnametoindex(const char* if_name); /** * Returns the number of available interfaces. */ -int ompi_ifcount(void); +OMPI_DECLSPEC int ompi_ifcount(void); /** * Returns the index of the first available interface. */ -int ompi_ifbegin(void); +OMPI_DECLSPEC int ompi_ifbegin(void); /** * Lookup the current position in the interface list by @@ -56,7 +57,7 @@ int ompi_ifbegin(void); * @param if_index Returns the next available index from the * current position. */ -int ompi_ifnext(int if_index); +OMPI_DECLSPEC int ompi_ifnext(int if_index); /** * Lookup an interface by index and return its name. @@ -65,7 +66,7 @@ int ompi_ifnext(int if_index); * @param if_name (OUT) Interface name buffer * @param size (IN) Interface name buffer size */ -int ompi_ifindextoname(int if_index, char* if_name, int); +OMPI_DECLSPEC int ompi_ifindextoname(int if_index, char* if_name, int); /** * Lookup an interface by index and return its primary address . @@ -74,7 +75,7 @@ int ompi_ifindextoname(int if_index, char* if_name, int); * @param if_name (OUT) Interface address buffer * @param size (IN) Interface address buffer size */ -int ompi_ifindextoaddr(int if_index, struct sockaddr*, int); +OMPI_DECLSPEC int ompi_ifindextoaddr(int if_index, struct sockaddr*, int); /** * Lookup an interface by index and return its network mask. @@ -83,7 +84,7 @@ int ompi_ifindextoaddr(int if_index, struct sockaddr*, int); * @param if_name (OUT) Interface address buffer * @param size (IN) Interface address buffer size */ -int ompi_ifindextomask(int if_index, struct sockaddr*, int); +OMPI_DECLSPEC int ompi_ifindextomask(int if_index, struct sockaddr*, int); #endif diff --git a/src/util/malloc.h b/src/util/malloc.h index f09dfdfed2..5cd423e644 100644 --- a/src/util/malloc.h +++ b/src/util/malloc.h @@ -7,6 +7,7 @@ #ifndef OMPI_MALLOC_H #define OMPI_MALLOC_H +#include "ompi_config.h" #include /* @@ -37,7 +38,7 @@ extern "C" { * This function is invoked as part of ompi_finalize() to shut down the * output stream for malloc debug messages. */ - void ompi_malloc_init(void); +void ompi_malloc_init(void); /** * Initialize malloc debug output. @@ -53,7 +54,7 @@ extern "C" { * malloc debug level set by ompi_malloc_debug() -- will be displayed * unless this function is invoked first. */ - void ompi_malloc_finalize(void); +void ompi_malloc_finalize(void); /** * \internal @@ -68,7 +69,7 @@ extern "C" { * This function is only used when --enable-mem-debug was specified to * configure (or by default if you're building in a SVN checkout). */ - void *ompi_malloc(size_t size, char *file, int line); +void *ompi_malloc(size_t size, char *file, int line); /** * \internal @@ -84,7 +85,7 @@ extern "C" { * This function is only used when --enable-mem-debug was specified to * configure (or by default if you're building in a SVN checkout). */ - void *ompi_calloc(size_t nmembers, size_t size, char *file, int line); +void *ompi_calloc(size_t nmembers, size_t size, char *file, int line); /** * \internal @@ -100,7 +101,7 @@ extern "C" { * This function is only used when --enable-mem-debug was specified to * configure (or by default if you're building in a SVN checkout). */ - void *ompi_realloc(void *ptr, size_t size, char *file, int line); +void *ompi_realloc(void *ptr, size_t size, char *file, int line); /** * \internal @@ -116,13 +117,13 @@ extern "C" { * to configure (or by default if you're building in a SVN * checkout). */ - void ompi_free(void *addr, char *file, int line); +void ompi_free(void *addr, char *file, int line); #if defined(c_plusplus) || defined(__cplusplus) } #endif -extern int ompi_malloc_debug_level; -extern int ompi_malloc_output; +OMPI_DECLSPEC extern int ompi_malloc_debug_level; +OMPI_DECLSPEC extern int ompi_malloc_output; static inline void ompi_malloc_debug(int level); diff --git a/src/util/numtostr.c b/src/util/numtostr.c index 0bb43978ae..8c0b17a3ec 100644 --- a/src/util/numtostr.c +++ b/src/util/numtostr.c @@ -4,7 +4,7 @@ #include "ompi_config.h" #include "util/numtostr.h" - +#include "util/printf.h" #include #include diff --git a/src/util/numtostr.h b/src/util/numtostr.h index d8a05a07b0..2f2a0e1213 100644 --- a/src/util/numtostr.h +++ b/src/util/numtostr.h @@ -8,6 +8,7 @@ #ifndef OMPI_NUMTOSTR_UTIL #define OMPI_NUMTOSTR_UTIL +#include "ompi_config.h" /** * Convert a long integer to a char* string. The returned buffer is * allocated by calling malloc() and must be freed by the caller. @@ -15,7 +16,7 @@ * @param num (IN) Input number * @return String containing number (NULL on failure) */ -char* ompi_ltostr(long num); +OMPI_DECLSPEC char* ompi_ltostr(long num); /** @@ -25,6 +26,6 @@ char* ompi_ltostr(long num); * @param num (IN) Input number * @return String containing number (NULL on failure) */ -char* ompi_dtostr(double num); +OMPI_DECLSPEC char* ompi_dtostr(double num); #endif /* OMPI_NUMTOSTR_UTIL */ diff --git a/src/util/os_create_dirpath.h b/src/util/os_create_dirpath.h index 29d38ce000..8781f46173 100644 --- a/src/util/os_create_dirpath.h +++ b/src/util/os_create_dirpath.h @@ -23,11 +23,17 @@ * be done. **/ +#ifndef OMPI_OS_CREATE_DIRPATH_H +#define OMPI_SHOW_HELP_H + +#include "ompi_config.h" #include #ifdef HAVE_SYS_TYPES_H #include #endif +#ifdef HAVE_SYS_STAT_H #include +#endif /** * @param path A pointer to a string that contains the path name to be built. @@ -39,4 +45,6 @@ * specified access permissions. */ -int ompi_os_create_dirpath(const char *path, const mode_t mode); +OMPI_DECLSPEC int ompi_os_create_dirpath(const char *path, const mode_t mode); + +#endif diff --git a/src/util/os_path.h b/src/util/os_path.h index 46acf35778..b13db58c76 100644 --- a/src/util/os_path.h +++ b/src/util/os_path.h @@ -24,6 +24,7 @@ * */ +#include "ompi_config.h" #include #include @@ -42,4 +43,4 @@ * appropriate to the local operating system. The path_name string has been malloc'd * and therefore the user is responsible for free'ing the field. */ -char *ompi_os_path(bool relative, ...); +OMPI_DECLSPEC char *ompi_os_path(bool relative, ...); diff --git a/src/util/output.c b/src/util/output.c index b457664d32..f5a576de29 100644 --- a/src/util/output.c +++ b/src/util/output.c @@ -24,7 +24,6 @@ #include "util/proc_info.h" #include "threads/mutex.h" - /* * Private data */ @@ -65,8 +64,11 @@ struct output_desc_t { bool ldi_syslog; int ldi_syslog_priority; +#ifndef WIN32 char *ldi_syslog_ident; - +#else + HANDLE ldi_syslog_ident; +#endif char *ldi_prefix; int ldi_prefix_len; @@ -236,9 +238,13 @@ void ompi_output_close(int output_id) break; } } +#ifndef WIN32 if (i >= OMPI_OUTPUT_MAX_STREAMS && syslog_opened) { closelog(); } +#else + DeregisterEventSource(info[output_id].ldi_syslog_ident); +#endif /* Somewhat of a hack to free up the temp_str */ @@ -359,14 +365,21 @@ static int do_open(int output_id, ompi_output_stream_t *lds) info[i].ldi_verbose_level = lds->lds_verbose_level; info[i].ldi_syslog = lds->lds_want_syslog; +#ifndef WIN32 if (lds->lds_want_syslog) { if (NULL != lds->lds_syslog_ident) { info[i].ldi_syslog_ident = strdup(lds->lds_syslog_ident); - openlog(lds->lds_syslog_ident, LOG_PID, LOG_USER); + openlog(lds->lds_syslog_ident, LOG_PID, LOG_USER); } else { info[i].ldi_syslog_ident = NULL; openlog("ompi", LOG_PID, LOG_USER); } +#else + if (NULL == (info[i].ldi_syslog_ident = RegisterEventSource(NULL, TEXT("To be determined: OMPI")))) { + /* handle the error */ + return OMPI_ERROR; + } +#endif syslog_opened = true; info[i].ldi_syslog_priority = lds->lds_syslog_priority; } @@ -435,8 +448,10 @@ static int open_file(int i) /* Make the file be close-on-exec to prevent child inheritance problems */ - +#ifndef WIN32 + /* ANJU: Need to find out the equivalent in windows */ fcntl(info[i].ldi_fd, F_SETFD, 1); +#endif free(filename); } @@ -476,10 +491,12 @@ static void free_descriptor(int output_id) } ldi->ldi_file_suffix = NULL; +#ifndef WIN32 if (NULL != ldi->ldi_syslog_ident) { free(ldi->ldi_syslog_ident); } ldi->ldi_syslog_ident = NULL; +#endif } } @@ -545,7 +562,9 @@ static void output(int output_id, char *format, va_list arglist) /* Syslog output */ if (ldi->ldi_syslog) { +#ifndef WIN32 syslog(ldi->ldi_syslog_priority, str); +#endif } /* stdout output */ diff --git a/src/util/output.h b/src/util/output.h index 5971397ea1..abedbe3bb8 100644 --- a/src/util/output.h +++ b/src/util/output.h @@ -203,7 +203,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * By definition, the default verbose stream has a handle ID of 0, * and has a verbose level of 0. */ - bool ompi_output_init(void); +OMPI_DECLSPEC bool ompi_output_init(void); /** * Shut down the output stream system. @@ -211,7 +211,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * Shut down the output stream system, including the default verbose * stream. */ - void ompi_output_finalize(void); +OMPI_DECLSPEC void ompi_output_finalize(void); /** * Opens an output stream. @@ -235,7 +235,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * when open_open() / ompi_output() is directed to send output to a * file but the process session directory does not yet exist. */ - int ompi_output_open(ompi_output_stream_t *lds); +OMPI_DECLSPEC int ompi_output_open(ompi_output_stream_t *lds); /** * Re-opens / redirects an output stream. @@ -249,7 +249,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * passed is invalid, this call is effectively the same as opening a * new stream with a specific stream handle. */ - int ompi_output_reopen(int output_id, ompi_output_stream_t *lds); +OMPI_DECLSPEC int ompi_output_reopen(int output_id, ompi_output_stream_t *lds); /** * Enables and disables output streams. @@ -268,7 +268,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * to the stream via OMPI_OUTPUT() or ompi_output() until the output * is re-enabled. */ - bool ompi_output_switch(int output_id, bool enable); +OMPI_DECLSPEC bool ompi_output_switch(int output_id, bool enable); /** * \internal @@ -279,7 +279,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * typically only invoked after a restart (i.e., in a new process) * where output streams need to be re-initialized. */ - void ompi_output_reopen_all(void); +OMPI_DECLSPEC void ompi_output_reopen_all(void); /** * Close an output stream. @@ -291,7 +291,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * re-used; it is possible that after a stream is closed, if another * stream is opened, it will get the same handle value. */ - void ompi_output_close(int output_id); +OMPI_DECLSPEC void ompi_output_close(int output_id); /** * Main function to send output to a stream. @@ -318,7 +318,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * created, ompi_output() will automatically create the file and * writing to it. */ - void ompi_output(int output_id, char *format, ...); +OMPI_DECLSPEC void ompi_output(int output_id, char *format, ...); /** * Send output to a stream only if the passed verbosity level is @@ -348,7 +348,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * * @see ompi_output_set_verbosity() */ - void ompi_output_verbose(int verbose_level, int output_id, +OMPI_DECLSPEC void ompi_output_verbose(int verbose_level, int output_id, char *format, ...); /** @@ -360,7 +360,7 @@ typedef struct ompi_output_stream_t ompi_output_stream_t; * This function sets the verbosity level on a given stream. It * will be used for all future invocations of ompi_output_verbose(). */ - void ompi_output_set_verbosity(int output_id, int level); +OMPI_DECLSPEC void ompi_output_set_verbosity(int output_id, int level); #if OMPI_ENABLE_DEBUG /** diff --git a/src/util/path.h b/src/util/path.h index 1ff1bc8e2e..1102875bce 100644 --- a/src/util/path.h +++ b/src/util/path.h @@ -5,14 +5,15 @@ #ifndef OMPI_PATH_H #define OMPI_PATH_H +#include "ompi_config.h" #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif -char *ompi_path_find (char *fname, char **pathv, int mode); -char *ompi_path_env_find (char *fname, int mode); -char *ompi_path_findv (char *fname, char **pathv, int mode, char **envv); -char *ompi_path_env_findv (char *fname, int mode, char **envv, char *wrkdir); +OMPI_DECLSPEC char *ompi_path_find (char *fname, char **pathv, int mode); +OMPI_DECLSPEC char *ompi_path_env_find (char *fname, int mode); +OMPI_DECLSPEC char *ompi_path_findv (char *fname, char **pathv, int mode, char **envv); +OMPI_DECLSPEC char *ompi_path_env_findv (char *fname, int mode, char **envv, char *wrkdir); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/util/pow2.h b/src/util/pow2.h index 0f15c46219..3a092789b1 100644 --- a/src/util/pow2.h +++ b/src/util/pow2.h @@ -4,6 +4,8 @@ #ifndef OMPI_POW2_H #define OMPI_POW2_H + +#include "ompi_config.h" /** * This routine takes in an interger, and returns the nearest @@ -14,6 +16,6 @@ * @returnvalue power of 2 integer same or greater than the input * parameter. */ -int ompi_round_up_to_nearest_pow2(int input_integer); +OMPI_DECLSPEC int ompi_round_up_to_nearest_pow2(int input_integer); #endif /* OMPI_POW2_H */ diff --git a/src/util/printf.h b/src/util/printf.h index ced1de9d4e..01f612ad4e 100644 --- a/src/util/printf.h +++ b/src/util/printf.h @@ -40,7 +40,7 @@ extern "C" { * * THIS IS A PORTABILITY FEATURE: USE snprintf() in CODE. */ -int ompi_snprintf(char *str, size_t size, const char *fmt, ...); +OMPI_DECLSPEC int ompi_snprintf(char *str, size_t size, const char *fmt, ...); /** @@ -65,8 +65,7 @@ int ompi_snprintf(char *str, size_t size, const char *fmt, ...); * * THIS IS A PORTABILITY FEATURE: USE vsnprintf() in CODE. */ -int ompi_vsnprintf(char *str, size_t size, const char *fmt, va_list ap); - +OMPI_DECLSPEC int ompi_vsnprintf(char *str, size_t size, const char *fmt, va_list ap); /** * Allocates and writes to a string under the control of a format @@ -87,7 +86,7 @@ int ompi_vsnprintf(char *str, size_t size, const char *fmt, va_list ap); * * THIS IS A PORTABILITY FEATURE: USE asprintf() in CODE. */ -int ompi_asprintf(char **ptr, const char *fmt, ...); +OMPI_DECLSPEC int ompi_asprintf(char **ptr, const char *fmt, ...); /** @@ -111,7 +110,7 @@ int ompi_asprintf(char **ptr, const char *fmt, ...); * * THIS IS A PORTABILITY FEATURE: USE vasprintf() in CODE. */ -int ompi_vasprintf(char **ptr, const char *fmt, va_list ap); +OMPI_DECLSPEC int ompi_vasprintf(char **ptr, const char *fmt, va_list ap); #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/util/proc_info.h b/src/util/proc_info.h index ab43cec455..dc06ee2319 100644 --- a/src/util/proc_info.h +++ b/src/util/proc_info.h @@ -9,7 +9,10 @@ * */ +#ifndef OMPI_PROC_INFO_H +#define OMPI_PROC_INFO_H +#include "ompi_config.h" #ifdef HAVE_SYS_TYPES_H #include #endif @@ -71,7 +74,7 @@ typedef struct ompi_proc_info_t ompi_proc_info_t; * which will be initialized to \c false, but should be set to \c true * before calling \c ompi_rte_info() if the caller is a seed daemon. */ -extern ompi_proc_info_t ompi_process_info; +OMPI_DECLSPEC extern ompi_proc_info_t ompi_process_info; /** @@ -88,8 +91,10 @@ extern ompi_proc_info_t ompi_process_info; * @retval OMPI_ERROR Failed to initialize one or more fields. */ -int ompi_proc_info(void); +OMPI_DECLSPEC int ompi_proc_info(void); #if defined(c_plusplus) || defined(__cplusplus) } #endif + +#endif diff --git a/src/util/session_dir.c b/src/util/session_dir.c index 3a7717d43b..3cfeb633d9 100644 --- a/src/util/session_dir.c +++ b/src/util/session_dir.c @@ -15,7 +15,7 @@ #include #include #include -#ifdef HAVE_LIBGEN_H +#ifdef HAVE_LIBGEN_H #include #endif #ifdef HAVE_SYS_PARAM_H @@ -33,7 +33,7 @@ #include #endif -/* +/* #ifdef HAVE_SYS_SOCKET_H #include #endif @@ -44,7 +44,7 @@ #include #endif #include -#ifdef HAVE_DIRENT_H +#ifdef HAVE_DIRENT_H #include #endif @@ -74,14 +74,24 @@ static void ompi_dir_empty(char *pathname); static bool ompi_is_empty(char *pathname); + #define OMPI_DEFAULT_TMPDIR "tmp" static int ompi_check_dir(bool create, char *directory) { +#ifndef WIN32 struct stat buf; mode_t my_mode = S_IRWXU; /* at the least, I need to be able to do anything */ +#else + struct __stat64 buf; + mode_t my_mode = _S_IREAD | _S_IWRITE | _S_IEXEC; +#endif +#ifndef WIN32 if (0 == stat(directory, &buf)) { /* exists - check access */ +#else + if (0 == _stat64(directory, &buf)) { /* exist -- check */ +#endif if ((buf.st_mode & my_mode) == my_mode) { /* okay, I can work here */ return(OMPI_SUCCESS); } @@ -389,6 +399,7 @@ ompi_session_dir_finalize() static void ompi_dir_empty(char *pathname) { +#ifndef WIN32 DIR *dp; struct dirent *ep; char *filenm; @@ -412,10 +423,40 @@ ompi_dir_empty(char *pathname) closedir(dp); } } +#else + bool empty = false; + HANDLE file; + WIN32_FIND_DATA file_data; + TCHAR *file_name; + + if (NULL != pathname) { + if (INVALID_HANDLE_VALUE == (file = FindFirstFile(pathname, &file_data))) { + return; + } else while (!empty) { + if ((0 != strcmp(file_data.cFileName, ".")) && + (0 != strcmp(file_data.cFileName, "..")) && + (!(file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) && + (0 != strncmp(file_data.cFileName,"output-", strlen("output-"))) && + (0 != strcmp(file_data.cFileName,"universe-setup.txt-"))) { + /*remove the file */ + file_name = ompi_os_path(false, pathname, file_data.cFileName, NULL); + DeleteFile(file_name); + } + if (!FindNextFile(pathname, &file_data)) { + if (ERROR_NO_MORE_FILES == GetLastError()) { + empty = true; + } + } + } + FindClose(&file_data); + } +#endif } +/* tests if the directory is empty */ static bool ompi_is_empty(char *pathname) { +#ifndef WIN32 DIR *dp; struct dirent *ep; @@ -434,5 +475,31 @@ static bool ompi_is_empty(char *pathname) return false; } return false; +#else + /* ANJU: check this logic again PLEASE */ + bool empty = true; + HANDLE file; + WIN32_FIND_DATA file_data; + + if (NULL != pathname) { + if (!(INVALID_HANDLE_VALUE == (file = FindFirstFile(pathname, &file_data)))) { + while(empty) { + if ((0 != strcmp(file_data.cFileName, ".")) && + (0 != strcmp(file_data.cFileName, ".."))) { + if (!FindNextFile(pathname, &file_data)) { + if (ERROR_NO_MORE_FILES == GetLastError()) { + empty = true; + } else { + empty = false; + } + } else { + empty = false; + } + } + } /* end while */ + } /* endif */ + } /* end outer if */ + return empty; +#endif /* ifndef WIN32 */ } diff --git a/src/util/session_dir.h b/src/util/session_dir.h index 7cf6387c57..a0545e8440 100644 --- a/src/util/session_dir.h +++ b/src/util/session_dir.h @@ -70,6 +70,7 @@ * proc_info structure will be updated. If proc_info is false, * */ +#include "ompi_config.h" /** @param create A boolean variable that indicates whether or not to * create the specified directory. If set to "false", @@ -109,7 +110,7 @@ * @retval OMPI_ERROR The directory cannot be found (if create is * "false") or created (if create is "true"). */ -int ompi_session_dir(bool create, char *prefix, char *user, char *hostid, +OMPI_DECLSPEC int ompi_session_dir(bool create, char *prefix, char *user, char *hostid, char *batchid, char *universe, char *job, char *vpid); @@ -128,4 +129,4 @@ int ompi_session_dir(bool create, char *prefix, char *user, char *hostid, * @retval OMPI_ERROR If something prevents the tree from being * properly cleaned up. */ -int ompi_session_dir_finalize(void); +OMPI_DECLSPEC int ompi_session_dir_finalize(void); diff --git a/src/util/show_help.h b/src/util/show_help.h index dd729592d0..8b4c91966f 100644 --- a/src/util/show_help.h +++ b/src/util/show_help.h @@ -99,7 +99,7 @@ extern "C" { * based on the topic, and displays it. If want_error_header is * true, a header and footer of asterisks are also displayed. */ - int ompi_show_help(const char *filename, const char *topic, +OMPI_DECLSPEC int ompi_show_help(const char *filename, const char *topic, bool want_error_header, ...); /** @@ -111,7 +111,7 @@ extern "C" { * flex parser since we may not hit the <> rule and call this * function automatically. */ - int ompi_show_help_finish_parsing(void); +OMPI_DECLSPEC int ompi_show_help_finish_parsing(void); #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/src/util/strncpy.h b/src/util/strncpy.h index 3e793101f6..1b108cae8c 100644 --- a/src/util/strncpy.h +++ b/src/util/strncpy.h @@ -5,6 +5,7 @@ #ifndef OMPI_STRNCPY_H #define OMPI_STRNCPY_H +#include "ompi_config.h" #ifdef HAVE_SYS_TYPES_H #include #endif @@ -18,6 +19,6 @@ #define strncpy ompi_strncpy -char *ompi_strncpy(char *dest, const char *src, size_t len); +OMPI_DECLSPEC char *ompi_strncpy(char *dest, const char *src, size_t len); #endif /* OMPI_STRNCPY_H */ diff --git a/src/util/sys_info.c b/src/util/sys_info.c index e2fefbd1a6..d76d76a173 100644 --- a/src/util/sys_info.c +++ b/src/util/sys_info.c @@ -37,10 +37,19 @@ ompi_sys_info_t ompi_system_info = { int ompi_sys_info(void) { struct utsname sys_info; - char *path_name, sep[2]; - struct passwd *pwdent; + char *path_name; - if (ompi_system_info.init) { +#ifndef WIN32 + struct passwd *pwdent; + char sep[2]; +#else + #define INFO_BUF_SIZE 32768 + TCHAR info_buf[INFO_BUF_SIZE]; + DWORD info_buf_length = INFO_BUF_SIZE; + char sep[] = "\\0"; +#endif + + if (ompi_system_info.init) { return OMPI_SUCCESS; } @@ -74,6 +83,7 @@ int ompi_sys_info(void) ompi_system_info.machine = strdup(sys_info.machine); } +#ifndef WIN32 if (NULL != (path_name = getcwd(NULL, 0))) { if (strlen(path_name) > 1) { sep[0] = path_name[strlen(path_name)-strlen(basename(path_name))-1]; @@ -84,13 +94,28 @@ int ompi_sys_info(void) sep[1] = '\0'; ompi_system_info.path_sep = strdup(sep); } +#else + /* we can hardcode windows path seperator to be "\" */ + ompi_system_info.path_sep = strdup(sep); +#endif - /* get the name of the user */ - if ((pwdent = getpwuid(getuid())) != 0) { - ompi_system_info.user = strdup(pwdent->pw_name); + + + + /* get the name of the user */ +#ifndef WIN32 + if ((pwdent = getpwuid(getuid())) != 0) { + ompi_system_info.user = strdup(pwdent->pw_name); } else { - ompi_system_info.user = strdup("unknown"); + ompi_system_info.user = strdup("unknown"); } +#else + if (!GetUserName(info_buf, &info_buf_length)) { + ompi_system_info.user = strdup("unknown"); + } else { + ompi_system_info.user = strdup(info_buf); + } +#endif /* set the init flag */ ompi_system_info.init = true; /* only indicates that we have been through here once - still have to test for NULL values */ diff --git a/src/util/sys_info.h b/src/util/sys_info.h index ada4be63ab..57ea3b39e8 100644 --- a/src/util/sys_info.h +++ b/src/util/sys_info.h @@ -10,6 +10,7 @@ * */ +#include "ompi_config.h" #ifdef HAVE_SYS_UTSNAME_H #include @@ -54,7 +55,7 @@ struct ompi_sys_info_t { }; typedef struct ompi_sys_info_t ompi_sys_info_t; -extern ompi_sys_info_t ompi_system_info; +OMPI_DECLSPEC extern ompi_sys_info_t ompi_system_info; /** @@ -70,4 +71,4 @@ extern ompi_sys_info_t ompi_system_info; * @retval OMPI_SUCCESS If values are successfully determined. * @retval OMPI_ERROR If the system does not provide the requested information. */ -int ompi_sys_info(void); +OMPI_DECLSPEC int ompi_sys_info(void); diff --git a/src/util/universe_setup_file_io.h b/src/util/universe_setup_file_io.h index 903c94d3ff..a5c17a85e6 100644 --- a/src/util/universe_setup_file_io.h +++ b/src/util/universe_setup_file_io.h @@ -11,8 +11,8 @@ #include "ompi_config.h" -int ompi_write_universe_setup_file(char *filename); +OMPI_DECLSPEC int ompi_write_universe_setup_file(char *filename); -int ompi_read_universe_setup_file(char *filename); +OMPI_DECLSPEC int ompi_read_universe_setup_file(char *filename); #endif diff --git a/src/util/varargs.h b/src/util/varargs.h new file mode 100644 index 0000000000..c645aea4d5 --- /dev/null +++ b/src/util/varargs.h @@ -0,0 +1,25 @@ +/* + $HEADER$ + */ + +#ifndef OMPI_VAR_ARGS_H +#define OMPI_VAR_ARGS_H + +/* To include the right thing for va_list, va_start, va_end and friends */ +/* Windows and __STDC__ and other c++ compilers require stdarg.h else varargs */ + +#if (defined(__STDC__) && __STDC__) || defined(__cplusplus) || defined(c_plusplus) || defined(WIN32) +#include +#include +#else +#include +#endif + + +#if (defined(__STDC__) && __STDC__) || defined(__cplusplus) || defined(c_plusplus) || defined(WIN32) +#define VA_START(list, v) va_start(list, v); +#else +#define VA_START(list,v) va_start(list); +#endif + +#endif /* OMPI_VARARGS_H */ diff --git a/src/win/win.h b/src/win/win.h index a190bcf25e..5fb225fce8 100644 --- a/src/win/win.h +++ b/src/win/win.h @@ -36,7 +36,7 @@ struct ompi_win_t { }; typedef struct ompi_win_t ompi_win_t; -OBJ_CLASS_DECLARATION(ompi_win_t); +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_win_t); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/src/win32/generated_include/config.h b/src/win32/generated_include/config.h new file mode 100644 index 0000000000..44e95e50c2 --- /dev/null +++ b/src/win32/generated_include/config.h @@ -0,0 +1,196 @@ +/* config.h. Generated by configure. */ +/* config-h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `argz_append' function. */ +/* #undef HAVE_ARGZ_APPEND */ + +/* Define to 1 if you have the `argz_create_sep' function. */ +/* #undef HAVE_ARGZ_CREATE_SEP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARGZ_H */ + +/* Define to 1 if you have the `argz_insert' function. */ +/* #undef HAVE_ARGZ_INSERT */ + +/* Define to 1 if you have the `argz_next' function. */ +/* #undef HAVE_ARGZ_NEXT */ + +/* Define to 1 if you have the `argz_stringify' function. */ +/* #undef HAVE_ARGZ_STRINGIFY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `bcopy' function. */ +/* #undef HAVE_BCOPY */ + +/* Define to 1 if you have the `closedir' function. */ +/* #undef HAVE_CLOSEDIR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_DIRENT_H */ + +/* Define if you have the GNU dld library. */ +/* #undef HAVE_DLD */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLD_H */ + +/* Define to 1 if you have the `dlerror' function. */ +/* #undef HAVE_DLERROR */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DL_H */ + +/* Define if you have the _dyld_func_lookup function. */ +/* #undef HAVE_DYLD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if the system has the type `error_t'. */ +/* #undef HAVE_ERROR_T */ + +/* Define to 1 if you have the `index' function. */ +/* #undef HAVE_INDEX */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define if you have the libdl library or equivalent. */ +/* #undef HAVE_LIBDL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_O_DYLD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the `opendir' function. */ +/* #undef HAVE_OPENDIR */ + +/* Define if libtool can extract symbol lists from object files. */ +#define HAVE_PRELOADED_SYMBOLS 1 + +/* Define to 1 if you have the `readdir' function. */ +/* #undef HAVE_READDIR */ + +/* Define to 1 if you have the `rindex' function. */ +/* #undef HAVE_RINDEX */ + +/* Define if you have the shl_load function. */ +/* #undef HAVE_SHL_LOAD */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strcmp' function. */ +#define HAVE_STRCMP 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_DL_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define if the OS needs help to load dependent libraries for dlopen(). */ +#define LTDL_DLOPEN_DEPLIBS 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LTDL_OBJDIR ".libs/" + +/* Define to the name of the environment variable that determines the dynamic + library search path. */ +#define LTDL_SHLIBPATH_VAR "PATH" + +/* Define to the extension used for shared libraries, say, ".so". */ +#define LTDL_SHLIB_EXT ".dll" + +/* Define to the system default library search path. */ +#define LTDL_SYSSEARCHPATH "/lib:/usr/lib" + +/* Define if dlsym() requires a leading underscore in symbol names. */ +/* #undef NEED_USCORE */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-libtool@gnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libltdl" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libltdl 1.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libltdl" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to a type to use for `error_t' if it is not otherwise available. */ +#define error_t int + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#define inline __inline +#endif diff --git a/src/win32/generated_include/libltdl/ltdl.h b/src/win32/generated_include/libltdl/ltdl.h new file mode 100644 index 0000000000..a1d48f34d7 --- /dev/null +++ b/src/win32/generated_include/libltdl/ltdl.h @@ -0,0 +1,366 @@ +/* ltdl.h -- generic dlopen functions + Copyright (C) 1998-2000 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU libtool, you may include it under the same +distribution terms that you use for the rest of that program. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA +*/ + +/* Only include this header file once. */ +#ifndef LTDL_H +#define LTDL_H 1 + +#include /* for size_t declaration */ + + +/* --- MACROS FOR PORTABILITY --- */ + + +/* Saves on those hard to debug '\0' typos.... */ +#define LT_EOS_CHAR '\0' + +/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, + so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at + the end of C declarations. */ +#ifdef __cplusplus +#define LT_BEGIN_C_DECLS extern "C" { +#define LT_END_C_DECLS } +#else +#define LT_BEGIN_C_DECLS /* empty */ +#define LT_END_C_DECLS /* empty */ +#endif + +LT_BEGIN_C_DECLS + + +/* LT_PARAMS is a macro used to wrap function prototypes, so that compilers + that don't understand ANSI C prototypes still work, and ANSI C + compilers can issue warnings about type mismatches. */ +#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus) +#define LT_PARAMS(protos) protos +#define lt_ptr void* +#else +#define LT_PARAMS(protos) () +#define lt_ptr char* +#endif + +/* LT_STMT_START/END are used to create macros which expand to a + a single compound statement in a portable way. */ +#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) +#define LT_STMT_START (void)( +#define LT_STMT_END ) +#else +#if (defined (sun) || defined (__sun__)) +#define LT_STMT_START if (1) +#define LT_STMT_END else (void)0 +#else +#define LT_STMT_START do +#define LT_STMT_END while (0) +#endif +#endif + +/* LT_CONC creates a new concatenated symbol for the compiler + in a portable way. */ +#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) +#define LT_CONC(s,t) s##t +#else +#define LT_CONC(s,t) s/**/t +#endif + +/* LT_STRLEN can be used safely on NULL pointers. */ +#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) + + + +/* --- WINDOWS SUPPORT --- */ + + +/* Canonicalise Windows and Cygwin recognition macros. */ +#ifdef __CYGWIN32__ +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ +#endif +#endif +#if defined(_WIN32) || defined(WIN32) +#ifndef __WINDOWS__ +#ifdef _WIN32 +#define __WINDOWS__ _WIN32 +#else +#ifdef WIN32 +#define __WINDOWS__ WIN32 +#endif +#endif +#endif +#endif + + +#ifdef __WINDOWS__ +#ifndef __CYGWIN__ +/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory + separator when it is set. */ +#define LT_DIRSEP_CHAR '\\' +#define LT_PATHSEP_CHAR ';' +#endif +#endif +#ifndef LT_PATHSEP_CHAR +#define LT_PATHSEP_CHAR ':' +#endif + +/* DLL building support on win32 hosts; mostly to workaround their + ridiculous implementation of data symbol exporting. */ +#ifndef LT_SCOPE +#ifdef __WINDOWS__ +#ifdef DLL_EXPORT /* defined by libtool (if required) */ +#define LT_SCOPE __declspec(dllexport) +#endif +#ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */ +#define LT_SCOPE extern __declspec(dllimport) +#endif +#endif +#ifndef LT_SCOPE /* static linking or !__WINDOWS__ */ +#define LT_SCOPE extern +#endif +#endif + + +#if defined(_MSC_VER) /* Visual Studio */ +#define R_OK 4 +#endif + + + +/* --- DYNAMIC MODULE LOADING API --- */ + + +typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */ + +/* Initialisation and finalisation functions for libltdl. */ +LT_SCOPE int lt_dlinit LT_PARAMS((void)); +LT_SCOPE int lt_dlexit LT_PARAMS((void)); + +/* Module search path manipulation. */ +LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char *search_dir)); +LT_SCOPE int lt_dlinsertsearchdir LT_PARAMS((const char *before, + const char *search_dir)); +LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char *search_path)); +LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void)); +LT_SCOPE int lt_dlforeachfile LT_PARAMS(( + const char *search_path, + int (*func) (const char *filename, lt_ptr data), + lt_ptr data)); + +/* Portable libltdl versions of the system dlopen() API. */ +LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char *filename)); +LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename)); +LT_SCOPE lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle, + const char *name)); +LT_SCOPE const char *lt_dlerror LT_PARAMS((void)); +LT_SCOPE int lt_dlclose LT_PARAMS((lt_dlhandle handle)); + +/* Module residency management. */ +LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle)); +LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle)); + + + + +/* --- MUTEX LOCKING --- */ + + +typedef void lt_dlmutex_lock LT_PARAMS((void)); +typedef void lt_dlmutex_unlock LT_PARAMS((void)); +typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg)); +typedef const char *lt_dlmutex_geterror LT_PARAMS((void)); + +LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock, + lt_dlmutex_unlock *unlock, + lt_dlmutex_seterror *seterror, + lt_dlmutex_geterror *geterror)); + + + + +/* --- MEMORY HANDLING --- */ + + +/* By default, the realloc function pointer is set to our internal + realloc implementation which iself uses lt_dlmalloc and lt_dlfree. + libltdl relies on a featureful realloc, but if you are sure yours + has the right semantics then you can assign it directly. Generally, + it is safe to assign just a malloc() and a free() function. */ +LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)); +LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)); +LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)); + + + + +/* --- PRELOADED MODULE SUPPORT --- */ + + +/* A preopened symbol. Arrays of this type comprise the exported + symbols for a dlpreopened module. */ +typedef struct { + const char *name; + lt_ptr address; +} lt_dlsymlist; + +LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded)); +LT_SCOPE int lt_dlpreload_default + LT_PARAMS((const lt_dlsymlist *preloaded)); + +#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \ + extern const lt_dlsymlist lt_preloaded_symbols[]; \ + lt_dlpreload_default(lt_preloaded_symbols); \ + }LT_STMT_END + + + + +/* --- MODULE INFORMATION --- */ + + +/* Read only information pertaining to a loaded module. */ +typedef struct { + char *filename; /* file name */ + char *name; /* module name */ + int ref_count; /* number of times lt_dlopened minus + number of times lt_dlclosed. */ +} lt_dlinfo; + +LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle)); +LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place)); +LT_SCOPE int lt_dlforeach LT_PARAMS(( + int (*func) (lt_dlhandle handle, lt_ptr data), + lt_ptr data)); + +/* Associating user data with loaded modules. */ +typedef unsigned lt_dlcaller_id; + +LT_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void)); +LT_SCOPE lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key, + lt_dlhandle handle, + lt_ptr data)); +LT_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key, + lt_dlhandle handle)); + + + +/* --- USER MODULE LOADER API --- */ + + +typedef struct lt_dlloader lt_dlloader; +typedef lt_ptr lt_user_data; +typedef lt_ptr lt_module; + +/* Function pointer types for creating user defined module loaders. */ +typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data, + const char *filename)); +typedef int lt_module_close LT_PARAMS((lt_user_data loader_data, + lt_module handle)); +typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data, + lt_module handle, + const char *symbol)); +typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data)); + +struct lt_user_dlloader { + const char *sym_prefix; + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place)); +LT_SCOPE lt_dlloader *lt_dlloader_find LT_PARAMS(( + const char *loader_name)); +LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place)); +LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place)); +LT_SCOPE int lt_dlloader_add LT_PARAMS((lt_dlloader *place, + const struct lt_user_dlloader *dlloader, + const char *loader_name)); +LT_SCOPE int lt_dlloader_remove LT_PARAMS(( + const char *loader_name)); + + + +/* --- ERROR MESSAGE HANDLING --- */ + + +/* Defining error strings alongside their symbolic names in a macro in + this way allows us to expand the macro in different contexts with + confidence that the enumeration of symbolic names will map correctly + onto the table of error strings. */ +#define lt_dlerror_table \ + LT_ERROR(UNKNOWN, "unknown error") \ + LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \ + LT_ERROR(INVALID_LOADER, "invalid loader") \ + LT_ERROR(INIT_LOADER, "loader initialization failed") \ + LT_ERROR(REMOVE_LOADER, "loader removal failed") \ + LT_ERROR(FILE_NOT_FOUND, "file not found") \ + LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \ + LT_ERROR(NO_SYMBOLS, "no symbols defined") \ + LT_ERROR(CANNOT_OPEN, "can't open the module") \ + LT_ERROR(CANNOT_CLOSE, "can't close the module") \ + LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \ + LT_ERROR(NO_MEMORY, "not enough memory") \ + LT_ERROR(INVALID_HANDLE, "invalid module handle") \ + LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \ + LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \ + LT_ERROR(SHUTDOWN, "library already shutdown") \ + LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \ + LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \ + LT_ERROR(INVALID_POSITION, "invalid search path insert position") + +/* Enumerate the symbolic error names. */ +enum { +#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), + lt_dlerror_table +#undef LT_ERROR + + LT_ERROR_MAX +}; + +/* These functions are only useful from inside custom module loaders. */ +LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic)); +LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode)); + + + + +/* --- SOURCE COMPATIBILITY WITH OLD LIBLTDL --- */ + + +#ifdef LT_NON_POSIX_NAMESPACE +#define lt_ptr_t lt_ptr +#define lt_module_t lt_module +#define lt_module_open_t lt_module_open +#define lt_module_close_t lt_module_close +#define lt_find_sym_t lt_find_sym +#define lt_dlloader_exit_t lt_dlloader_exit +#define lt_dlloader_t lt_dlloader +#define lt_dlloader_data_t lt_user_data +#endif + +LT_END_C_DECLS + +#endif /* !LTDL_H */ diff --git a/src/win32/generated_include/ompi_config.h b/src/win32/generated_include/ompi_config.h new file mode 100644 index 0000000000..b9189abe4f --- /dev/null +++ b/src/win32/generated_include/ompi_config.h @@ -0,0 +1,533 @@ +/* include/ompi_config.h. Generated by configure. */ +/* include/ompi_config.h.in. Generated from configure.ac by autoheader. */ + +/* -*- c -*- + * + * $HEADER$ + * + * Function: - OS, CPU and compiler dependent configuration + */ + +#ifndef OMPI_CONFIG_H +#define OMPI_CONFIG_H + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_INET_H */ + +/* Define to 1 if you have the `asprintf' function. */ +/* #undef HAVE_ASPRINTF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DIRENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define if your system supports the epoll system calls */ +/* #undef HAVE_EPOLL */ + +/* Define to 1 if you have the `epoll_ctl' function. */ +/* #undef HAVE_EPOLL_CTL */ + +/* Define to 1 if you have the `err' function. */ +/* #undef HAVE_ERR */ + +/* Define to 1 if you have the `gettimeofday' function. */ +/* #undef HAVE_GETTIMEOFDAY */ + +/* Define to 1 if the system has the type `int16_t'. */ +/* #undef HAVE_INT16_T */ + +/* Define to 1 if the system has the type `int32_t'. */ +/* #undef HAVE_INT32_T */ + +/* Define to 1 if the system has the type `int64_t'. */ +/* #undef HAVE_INT64_T */ + +/* Define to 1 if the system has the type `int8_t'. */ +/* #undef HAVE_INT8_T */ + +/* Define to 1 if the system has the type `intptr_t'. */ +#define HAVE_INTPTR_T 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the `kqueue' function. */ +/* #undef HAVE_KQUEUE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_IF_H */ + +/* Define to 1 if you have the `poll' function. */ +/* #undef HAVE_POLL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_POLL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PTHREAD_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PWD_H */ + +/* Define if your system supports POSIX realtime signals */ +/* #undef HAVE_RTSIG */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Define to 1 if you have the `select' function. */ +/* #undef HAVE_SELECT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `sigtimedwait' function. */ +/* #undef HAVE_SIGTIMEDWAIT */ + +/* Define to 1 if you have the `snprintf' function. */ +/* #undef HAVE_SNPRINTF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDBOOL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STROPTS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSLOG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_EPOLL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_EVENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_IPC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_QUEUE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_RESOURCE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SELECT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STATVFS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UTSNAME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Define if TAILQ_FOREACH is defined in */ +/* #undef HAVE_TAILQFOREACH */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TERMIOS_H */ + +/* Define if timeradd is defined in */ +/* #undef HAVE_TIMERADD */ + +/* Define to 1 if the system has the type `uint16_t'. */ +/* #undef HAVE_UINT16_T */ + +/* Define to 1 if the system has the type `uint32_t'. */ +/* #undef HAVE_UINT32_T */ + +/* Define to 1 if the system has the type `uint64_t'. */ +/* #undef HAVE_UINT64_T */ + +/* Define to 1 if the system has the type `uint8_t'. */ +/* #undef HAVE_UINT8_T */ + +/* Define to 1 if the system has the type `uintptr_t'. */ +#define HAVE_UINTPTR_T 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ULIMIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vasprintf' function. */ +/* #undef HAVE_VASPRINTF */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define if kqueue works correctly with pipes */ +/* #undef HAVE_WORKING_KQUEUE */ + +/* Define if realtime signals work on pipes */ +/* #undef HAVE_WORKING_RTSIG */ + +/* C type corresponding to Fortran INTEGER */ +#define MPI_Fint int + +/* Type of MPI_Offset */ +#define MPI_Offset long long + +/* Whether we want to check MPI parameters always, never, or decide at + run-time */ +#define MPI_PARAM_CHECK ompi_mpi_param_check + +/* Alignment of type char */ +#define OMPI_ALIGNMENT_CHAR 1 + +/* Alignment of type double */ +#define OMPI_ALIGNMENT_DOUBLE 8 + +/* Alignment of type float */ +#define OMPI_ALIGNMENT_FLOAT 4 + +/* Alignment of fortran complex */ +#define OMPI_ALIGNMENT_FORTRAN_COMPLEX 0 + +/* Alignment of fortran double complex */ +#define OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX 0 + +/* Alignment of fortran double precision */ +#define OMPI_ALIGNMENT_FORTRAN_DBLPREC 0 + +/* Alignment of fortran integer */ +#define OMPI_ALIGNMENT_FORTRAN_INT 0 + +/* Alignment of fortran logical */ +#define OMPI_ALIGNMENT_FORTRAN_LOGICAL + +/* alignment of fortran real */ +#define OMPI_ALIGNMENT_FORTRAN_REAL 0 + +/* Alignment of type int */ +#define OMPI_ALIGNMENT_INT 4 + +/* Alignment of type long */ +#define OMPI_ALIGNMENT_LONG 4 + +/* Alignment of type long double */ +#define OMPI_ALIGNMENT_LONG_DOUBLE 8 + +/* Alignment of type long long */ +#define OMPI_ALIGNMENT_LONG_LONG 8 + +/* Alignment of type short */ +#define OMPI_ALIGNMENT_SHORT 2 + +/* Alignment of type void * */ +#define OMPI_ALIGNMENT_VOID_P 4 + +/* Alignment of type wchar_t */ +#define OMPI_ALIGNMENT_WCHAR 2 + +/* OMPI architecture string */ +#define OMPI_ARCH "i686-pc-cygwin" + +/* OMPI underlying C compiler */ +#define OMPI_CC "cl" + +/* OMPI underlying C++ compiler */ +#define OMPI_CXX "cl" + +/* Whether we want developer-level debugging code or not */ +#define OMPI_ENABLE_DEBUG 1 + +/* Whether we want the memory profiling or not */ +#define OMPI_ENABLE_MEM_DEBUG 1 + +/* Whether we want the memory profiling or not */ +#define OMPI_ENABLE_MEM_PROFILE 1 + +/* Whether we want MPI profiling or not */ +#define OMPI_ENABLE_MPI_PROFILING 1 + +/* Do we want to use the event library signal handlers */ +#define OMPI_EVENT_USE_SIGNALS 1 + +/* OMPI underlying F77 compiler */ +#define OMPI_F77 "g77" + +/* Whether fortran symbols are all caps or not */ +#define OMPI_F77_CAPS 0 + +/* Whether fortran symbols have a trailing double underscore or not */ +#define OMPI_F77_DOUBLE_UNDERSCORE 0 + +/* Whether fortran symbols have no trailing underscore or not */ +#define OMPI_F77_PLAIN 0 + +/* Whether fortran symbols have a trailing underscore or not */ +#define OMPI_F77_SINGLE_UNDERSCORE 0 + +/* Whether or not we have compiled with C++ exceptions support */ +#define OMPI_HAVE_CXX_EXCEPTION_SUPPORT 0 + +/* Whether we have FORTRAN COMPLEX16 or not */ +#define OMPI_HAVE_FORTRAN_COMPLEX16 0 + +/* Whether we have FORTRAN COMPLEX32 or not */ +#define OMPI_HAVE_FORTRAN_COMPLEX32 0 + +/* Whether we have FORTRAN COMPLEX8 or not */ +#define OMPI_HAVE_FORTRAN_COMPLEX8 0 + +/* Whether we have FORTRAN INTEGER1 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER1 0 + +/* Whether we have FORTRAN INTEGER16 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER16 0 + +/* Whether we have FORTRAN INTEGER2 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER2 0 + +/* Whether we have FORTRAN INTEGER4 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER4 0 + +/* Whether we have FORTRAN INTEGER8 or not */ +#define OMPI_HAVE_FORTRAN_INTEGER8 0 + +/* Whether we have FORTRAN REAL16 or not */ +#define OMPI_HAVE_FORTRAN_REAL16 0 + +/* Whether we have FORTRAN REAL4 or not */ +#define OMPI_HAVE_FORTRAN_REAL4 0 + +/* Whether we have FORTRAN REAL8 or not */ +#define OMPI_HAVE_FORTRAN_REAL8 0 + +/* Do we have POSIX threads */ +#define OMPI_HAVE_POSIX_THREADS 0 + +/* Do we have native Solaris threads */ +#define OMPI_HAVE_SOLARIS_THREADS 0 + +/* Whether we have __va_copy or not */ +#define OMPI_HAVE_UNDERSCORE_VA_COPY 0 + +/* Whether we have va_copy or not */ +#define OMPI_HAVE_VA_COPY 0 + +/* Wehther we have weak symbols or not */ +#define OMPI_HAVE_WEAK_SYMBOLS 0 + +/* Size of fortran complex */ +#define OMPI_SIZEOF_FORTRAN_COMPLEX 0 + +/* Size of fortran double complex */ +#define OMPI_SIZEOF_FORTRAN_DBLCOMPLEX 0 + +/* Size of fortran double precision */ +#define OMPI_SIZEOF_FORTRAN_DBLPREC 8 + +/* Size of fortran integer */ +#define OMPI_SIZEOF_FORTRAN_INT 4 + +/* Size of fortran logical */ +#define OMPI_SIZEOF_FORTRAN_LOGICAL 4 + +/* Size of fortran real */ +#define OMPI_SIZEOF_FORTRAN_REAL 4 + +/* Do threads have different pids (pthreads on linux) */ +/* #undef OMPI_THREADS_HAVE_DIFFERENT_PIDS */ + +/* Whether to use or not */ +#define OMPI_USE_STDBOOL_H 0 + +/* Whether we want MPI cxx support or not */ +#define OMPI_WANT_CXX_BINDINGS 1 + +/* Whether we want the MPI f77 bindings or not */ +#define OMPI_WANT_F77_BINDINGS 0 + +/* Whether to include support for libltdl or not */ +#define OMPI_WANT_LIBLTDL + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* The size of a `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of a `double', as computed by sizeof. */ +#define SIZEOF_DOUBLE 8 + +/* The size of a `float', as computed by sizeof. */ +#define SIZEOF_FLOAT 4 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of a `long double', as computed by sizeof. */ +#define SIZEOF_LONG_DOUBLE 8 + +/* The size of a `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of a `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of a `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +/* #undef TIME_WITH_SYS_TIME */ + +/* Additional CFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_CFLAGS "" + +/* Additional CXXFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_CXXFLAGS "" + +/* Additional FCFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_FCFLAGS "" + +/* Additional FFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_FFLAGS "" + +/* Additional LDFLAGS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_LDFLAGS "" + +/* Additional LIBS to pass through the wrapper compilers */ +#define WRAPPER_EXTRA_LIBS " " + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +/* #undef YYTEXT_POINTER */ + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#define inline __inline +#endif + +/* C type corresponding to Fortran DOUBLE PRECISION */ +#define ompi_fortran_dblprec_t double + +/* C type corresponding to Fortran LOGICAL */ +#define ompi_fortran_integer_t int + +/* C type corresponding to Fortran LOGICAL */ +#define ompi_fortran_logical_t int + +/* C type corresponding to Fortran REAL */ +#define ompi_fortran_real_t float + +/* Define to `int' if does not define. */ +#define pid_t int + +/* Define to equivalent of C99 restrict keyword, or to nothing if this is not + supported. Do not define if restrict is supported directly. */ +#define restrict + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + +/* Define to unsigned int if you dont have it */ +#ifndef WIN32 +#define socklen_t unsigned int +#endif + +/* Define to `unsigned short' if does not define. */ +#define u_int16_t unsigned short + +/* Define to `unsigned int' if does not define. */ +#define u_int32_t unsigned int + +/* Define to `unsigned long long' if does not define. */ +#define u_int64_t unsigned long long + +/* Define to `unsigned char' if does not define. */ +#define u_int8_t unsigned char + +#include "ompi_config_bottom.h" +#endif /* OMPI_CONFIG_H */ + diff --git a/src/win32/generated_source/llm_base_parse_hostfile_lex.c b/src/win32/generated_source/llm_base_parse_hostfile_lex.c new file mode 100644 index 0000000000..97705d16b1 --- /dev/null +++ b/src/win32/generated_source/llm_base_parse_hostfile_lex.c @@ -0,0 +1,1594 @@ +#define yy_create_buffer mca_llm_base_yy_create_buffer +#define yy_delete_buffer mca_llm_base_yy_delete_buffer +#define yy_scan_buffer mca_llm_base_yy_scan_buffer +#define yy_scan_string mca_llm_base_yy_scan_string +#define yy_scan_bytes mca_llm_base_yy_scan_bytes +#define yy_flex_debug mca_llm_base_yy_flex_debug +#define yy_init_buffer mca_llm_base_yy_init_buffer +#define yy_flush_buffer mca_llm_base_yy_flush_buffer +#define yy_load_buffer_state mca_llm_base_yy_load_buffer_state +#define yy_switch_to_buffer mca_llm_base_yy_switch_to_buffer +#define yyin mca_llm_base_yyin +#define yyleng mca_llm_base_yyleng +#define yylex mca_llm_base_yylex +#define yyout mca_llm_base_yyout +#define yyrestart mca_llm_base_yyrestart +#define yytext mca_llm_base_yytext +#define yywrap mca_llm_base_yywrap + +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 9 +#define YY_END_OF_BUFFER 10 +static yyconst short int yy_accept[21] = + { 0, + 7, 7, 10, 8, 3, 1, 8, 7, 4, 7, + 0, 2, 7, 7, 7, 7, 5, 7, 6, 0 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 5, 5, 1, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, + 6, 1, 1, 1, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 1, 1, 1, 1, 5, 1, 5, 5, 7, 5, + + 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, + 9, 10, 5, 5, 5, 11, 12, 5, 5, 5, + 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[13] = + { 0, + 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, + 2, 2 + } ; + +static yyconst short int yy_base[23] = + { 0, + 0, 0, 24, 25, 25, 25, 19, 0, 25, 4, + 18, 25, 0, 9, 8, 11, 0, 7, 0, 25, + 14, 15 + } ; + +static yyconst short int yy_def[23] = + { 0, + 20, 1, 20, 20, 20, 20, 21, 22, 20, 22, + 21, 20, 22, 22, 22, 22, 22, 22, 22, 0, + 20, 20 + } ; + +static yyconst short int yy_nxt[38] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 8, 8, 8, + 8, 8, 14, 15, 11, 11, 13, 19, 18, 17, + 16, 12, 12, 20, 3, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20 + } ; + +static yyconst short int yy_chk[38] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 10, 10, 21, 21, 22, 18, 16, 15, + 14, 11, 7, 3, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "llm_base_parse_hostfile_lex.l" +#define INITIAL 0 +#line 2 "llm_base_parse_hostfile_lex.l" + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "mca/llm/base/llm_base_parse_hostfile_lex.h" + +/* + * local functions + */ +static int mca_llm_base_yyerror(void); +static int mca_llm_base_yywrap(void); + +/* + * global variables + */ +int mca_llm_base_yynewlines=1; +bool mca_llm_base_parse_done = false; +char *mca_llm_base_string = NULL; + +#line 413 "llm_base_parse_hostfile_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; + +#line 23 "llm_base_parse_hostfile_lex.l" + + +#line 567 "llm_base_parse_hostfile_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 21 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 25 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 25 "llm_base_parse_hostfile_lex.l" +{ mca_llm_base_yynewlines++; return MCA_LLM_BASE_NEWLINE; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 27 "llm_base_parse_hostfile_lex.l" +{ mca_llm_base_string = yytext; return MCA_LLM_BASE_QUOTED_STRING; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 29 "llm_base_parse_hostfile_lex.l" +; /* whitespace */ + YY_BREAK +case 4: +YY_RULE_SETUP +#line 31 "llm_base_parse_hostfile_lex.l" +{ return MCA_LLM_BASE_EQUAL; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 33 "llm_base_parse_hostfile_lex.l" +{ mca_llm_base_string = yytext; return MCA_LLM_BASE_COUNT; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 34 "llm_base_parse_hostfile_lex.l" +{ mca_llm_base_string = yytext; return MCA_LLM_BASE_COUNT; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 36 "llm_base_parse_hostfile_lex.l" +{ mca_llm_base_string = yytext; return MCA_LLM_BASE_STRING; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 38 "llm_base_parse_hostfile_lex.l" +{ mca_llm_base_string = yytext; return MCA_LLM_BASE_ERROR; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 40 "llm_base_parse_hostfile_lex.l" +ECHO; + YY_BREAK +#line 695 "llm_base_parse_hostfile_lex.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 21 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 21 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 20); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 40 "llm_base_parse_hostfile_lex.l" + + + +static int mca_llm_base_yyerror(void) +{ + printf("%d: Invalid input (%s)\n", mca_llm_base_yynewlines, yytext); + return MCA_LLM_BASE_ERROR; +} + + +static int mca_llm_base_yywrap(void) +{ + mca_llm_base_parse_done = true; + return 1; +} diff --git a/src/win32/generated_source/ltdl.c b/src/win32/generated_source/ltdl.c new file mode 100644 index 0000000000..7fa587f222 --- /dev/null +++ b/src/win32/generated_source/ltdl.c @@ -0,0 +1,4489 @@ +/* ltdl.c -- system independent dlopen wrapper + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU libtool, you may include it under the same +distribution terms that you use for the rest of that program. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA + +*/ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#if HAVE_UNISTD_H +#include +#endif + +#if HAVE_STDIO_H +#include +#endif + +/* Include the header defining malloc. On K&R C compilers, + that's , on ANSI C and ISO C compilers, that's . */ +#if HAVE_STDLIB_H +#include +#else +#if HAVE_MALLOC_H +#include +#endif +#endif + +#if HAVE_STRING_H +#include +#else +#if HAVE_STRINGS_H +#include +#endif +#endif + +#if HAVE_CTYPE_H +#include +#endif + +#if HAVE_MEMORY_H +#include +#endif + +#if HAVE_ERRNO_H +#include +#endif + + +#ifndef __WINDOWS__ +#ifdef WIN32 +#define __WINDOWS__ +#endif +#endif + + +#undef LT_USE_POSIX_DIRENT +#ifdef HAVE_CLOSEDIR +#ifdef HAVE_OPENDIR +#ifdef HAVE_READDIR +#ifdef HAVE_DIRENT_H +#define LT_USE_POSIX_DIRENT +#endif /* HAVE_DIRENT_H */ +#endif /* HAVE_READDIR */ +#endif /* HAVE_OPENDIR */ +#endif /* HAVE_CLOSEDIR */ + + +#undef LT_USE_WINDOWS_DIRENT_EMULATION +#ifndef LT_USE_POSIX_DIRENT +#ifdef __WINDOWS__ +#define LT_USE_WINDOWS_DIRENT_EMULATION +#endif /* __WINDOWS__ */ +#endif /* LT_USE_POSIX_DIRENT */ + + +#ifdef LT_USE_POSIX_DIRENT +#include +#define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +#else +#ifdef LT_USE_WINDOWS_DIRENT_EMULATION +#define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +#else +#define dirent direct +#define LT_D_NAMLEN(dirent) ((dirent)->d_namlen) +#if HAVE_SYS_NDIR_H +#include +#endif +#if HAVE_SYS_DIR_H +#include +#endif +#if HAVE_NDIR_H +#include +#endif +#endif +#endif + +#if HAVE_ARGZ_H +#include +#endif + +#if HAVE_ASSERT_H +#include +#else +#define assert(arg) ((void) 0) +#endif + +#include "win32/generated_include/libltdl/ltdl.h" + +#if WITH_DMALLOC +#include +#endif + + + + +/* --- WINDOWS SUPPORT --- */ + + +#ifdef DLL_EXPORT +#define LT_GLOBAL_DATA __declspec(dllexport) +#else +#define LT_GLOBAL_DATA +#endif + +/* fopen() mode flags for reading a text file */ +#undef LT_READTEXT_MODE +#ifdef __WINDOWS__ +#define LT_READTEXT_MODE "rt" +#else +#define LT_READTEXT_MODE "r" +#endif + +#ifdef LT_USE_WINDOWS_DIRENT_EMULATION + +#include + +#define dirent lt_dirent +#define DIR lt_DIR + +struct dirent +{ + char d_name[2048]; + int d_namlen; +}; + +typedef struct _DIR +{ + HANDLE hSearch; + WIN32_FIND_DATA Win32FindData; + BOOL firsttime; + struct dirent file_info; +} DIR; + +#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ + + +/* --- MANIFEST CONSTANTS --- */ + + +/* Standard libltdl search path environment variable name */ +#undef LTDL_SEARCHPATH_VAR +#define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" + +/* Standard libtool archive file extension. */ +#undef LTDL_ARCHIVE_EXT +#define LTDL_ARCHIVE_EXT ".la" + +/* max. filename length */ +#ifndef LT_FILENAME_MAX +#define LT_FILENAME_MAX 1024 +#endif + +/* This is the maximum symbol size that won't require malloc/free */ +#undef LT_SYMBOL_LENGTH +#define LT_SYMBOL_LENGTH 128 + +/* This accounts for the _LTX_ separator */ +#undef LT_SYMBOL_OVERHEAD +#define LT_SYMBOL_OVERHEAD 5 + + + + +/* --- MEMORY HANDLING --- */ + + +/* These are the functions used internally. In addition to making + use of the associated function pointers above, they also perform + error handling. */ +static char *lt_estrdup LT_PARAMS((const char *str)); +static lt_ptr lt_emalloc LT_PARAMS((size_t size)); +static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size)); + +/* static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); */ +#define rpl_realloc realloc + +/* These are the pointers that can be changed by the caller: */ +LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)) + = (lt_ptr (*) LT_PARAMS((size_t))) malloc; +LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)) + = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc; +LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) + = (void (*) LT_PARAMS((lt_ptr))) free; + +/* The following macros reduce the amount of typing needed to cast + assigned memory. */ +#if WITH_DMALLOC + +#define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END + +#define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) + +#else + +#define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END + +#define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) + +#endif + +#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ + if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \ + } LT_STMT_END + + +/* --- REPLACEMENT FUNCTIONS --- */ + + +#undef strdup +#define strdup rpl_strdup + +static char *strdup LT_PARAMS((const char *str)); + +static char * +strdup(str) + const char *str; +{ + char *tmp = 0; + + if (str) + { + tmp = LT_DLMALLOC (char, 1+ strlen (str)); + if (tmp) + { + strcpy(tmp, str); + } + } + + return tmp; +} + + +#if ! HAVE_STRCMP + +#undef strcmp +#define strcmp rpl_strcmp + +static int strcmp LT_PARAMS((const char *str1, const char *str2)); + +static int +strcmp (str1, str2) + const char *str1; + const char *str2; +{ + if (str1 == str2) + return 0; + if (str1 == 0) + return -1; + if (str2 == 0) + return 1; + + for (;*str1 && *str2; ++str1, ++str2) + { + if (*str1 != *str2) + break; + } + + return (int)(*str1 - *str2); +} +#endif + + +#if ! HAVE_STRCHR + +#if HAVE_INDEX +#define strchr index +#else +#define strchr rpl_strchr + +static const char *strchr LT_PARAMS((const char *str, int ch)); + +static const char* +strchr(str, ch) + const char *str; + int ch; +{ + const char *p; + + for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p) + /*NOWORK*/; + + return (*p == (char)ch) ? p : 0; +} + +#endif +#endif /* !HAVE_STRCHR */ + + +#if ! HAVE_STRRCHR + +#if HAVE_RINDEX +#define strrchr rindex +#else +#define strrchr rpl_strrchr + +static const char *strrchr LT_PARAMS((const char *str, int ch)); + +static const char* +strrchr(str, ch) + const char *str; + int ch; +{ + const char *p, *q = 0; + + for (p = str; *p != LT_EOS_CHAR; ++p) + { + if (*p == (char) ch) + { + q = p; + } + } + + return q; +} + +#endif +#endif + +/* NOTE: Neither bcopy nor the memcpy implementation below can + reliably handle copying in overlapping areas of memory. Use + memmove (for which there is a fallback implmentation below) + if you need that behaviour. */ +#if ! HAVE_MEMCPY + +#if HAVE_BCOPY +#define memcpy(dest, src, size) bcopy (src, dest, size) +#else +#define memcpy rpl_memcpy + +static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr +memcpy (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + size_t i = 0; + + for (i = 0; i < size; ++i) + { + dest[i] = src[i]; + } + + return dest; +} + +#endif /* !HAVE_BCOPY */ +#endif /* !HAVE_MEMCPY */ + +#if ! HAVE_MEMMOVE +#define memmove rpl_memmove + +static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr +memmove (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + size_t i; + + if (dest < src) + for (i = 0; i < size; ++i) + { + dest[i] = src[i]; + } + else if (dest > src) + for (i = size -1; i >= 0; --i) + { + dest[i] = src[i]; + } + + return dest; +} + +#endif /* !HAVE_MEMMOVE */ + +#ifdef LT_USE_WINDOWS_DIRENT_EMULATION + +static void closedir LT_PARAMS((DIR *entry)); + +static void +closedir(entry) + DIR *entry; +{ + assert(entry != (DIR *) NULL); + FindClose(entry->hSearch); + lt_dlfree((lt_ptr)entry); +} + + +static DIR * opendir LT_PARAMS((const char *path)); + +static DIR* +opendir (path) + const char *path; +{ + char file_specification[LT_FILENAME_MAX]; + DIR *entry; + + assert(path != (char *) NULL); + (void) strncpy(file_specification,path,LT_FILENAME_MAX-1); + (void) strcat(file_specification,"\\"); + entry = LT_DLMALLOC (DIR,sizeof(DIR)); + if (entry != (DIR *) 0) + { + entry->firsttime = TRUE; + entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); + } + if (entry->hSearch == INVALID_HANDLE_VALUE) + { + (void) strcat(file_specification,"\\*.*"); + entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); + if (entry->hSearch == INVALID_HANDLE_VALUE) + { + LT_DLFREE (entry); + return (DIR *) 0; + } + } + return(entry); +} + + +static struct dirent *readdir LT_PARAMS((DIR *entry)); + +static struct dirent *readdir(entry) + DIR *entry; +{ + int + status; + + if (entry == (DIR *) 0) + return((struct dirent *) 0); + if (!entry->firsttime) + { + status = FindNextFile(entry->hSearch,&entry->Win32FindData); + if (status == 0) + return((struct dirent *) 0); + } + entry->firsttime = FALSE; + (void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName, + LT_FILENAME_MAX-1); + entry->file_info.d_namlen = strlen(entry->file_info.d_name); + return(&entry->file_info); +} + +#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ + +/* According to Alexandre Oliva , + ``realloc is not entirely portable'' + In any case we want to use the allocator supplied by the user without + burdening them with an lt_dlrealloc function pointer to maintain. + Instead implement our own version (with known boundary conditions) + using lt_dlmalloc and lt_dlfree. */ + +/* #undef realloc + #define realloc rpl_realloc +*/ +#if 0 + /* You can't (re)define realloc unless you also (re)define malloc. + Right now, this code uses the size of the *destination* to decide + how much to copy. That's not right, but you can't know the size + of the source unless you know enough about, or wrote malloc. So + this code is disabled... */ + +static lt_ptr +realloc (ptr, size) + lt_ptr ptr; + size_t size; +{ + if (size == 0) + { + /* For zero or less bytes, free the original memory */ + if (ptr != 0) + { + lt_dlfree (ptr); + } + + return (lt_ptr) 0; + } + else if (ptr == 0) + { + /* Allow reallocation of a NULL pointer. */ + return lt_dlmalloc (size); + } + else + { + /* Allocate a new block, copy and free the old block. */ + lt_ptr mem = lt_dlmalloc (size); + + if (mem) + { + memcpy (mem, ptr, size); + lt_dlfree (ptr); + } + + /* Note that the contents of PTR are not damaged if there is + insufficient memory to realloc. */ + return mem; + } +} +#endif + + +#if ! HAVE_ARGZ_APPEND +#define argz_append rpl_argz_append + +static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len, + const char *buf, size_t buf_len)); + +static error_t +argz_append (pargz, pargz_len, buf, buf_len) + char **pargz; + size_t *pargz_len; + const char *buf; + size_t buf_len; +{ + size_t argz_len; + char *argz; + + assert (pargz); + assert (pargz_len); + assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); + + /* If nothing needs to be appended, no more work is required. */ + if (buf_len == 0) + return 0; + + /* Ensure there is enough room to append BUF_LEN. */ + argz_len = *pargz_len + buf_len; + argz = LT_DLREALLOC (char, *pargz, argz_len); + if (!argz) + return ENOMEM; + + /* Copy characters from BUF after terminating '\0' in ARGZ. */ + memcpy (argz + *pargz_len, buf, buf_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_APPEND */ + + +#if ! HAVE_ARGZ_CREATE_SEP +#define argz_create_sep rpl_argz_create_sep + +static error_t argz_create_sep LT_PARAMS((const char *str, int delim, + char **pargz, size_t *pargz_len)); + +static error_t +argz_create_sep (str, delim, pargz, pargz_len) + const char *str; + int delim; + char **pargz; + size_t *pargz_len; +{ + size_t argz_len; + char *argz = 0; + + assert (str); + assert (pargz); + assert (pargz_len); + + /* Make a copy of STR, but replacing each occurence of + DELIM with '\0'. */ + argz_len = 1+ LT_STRLEN (str); + if (argz_len) + { + const char *p; + char *q; + + argz = LT_DLMALLOC (char, argz_len); + if (!argz) + return ENOMEM; + + for (p = str, q = argz; *p != LT_EOS_CHAR; ++p) + { + if (*p == delim) + { + /* Ignore leading delimiters, and fold consecutive + delimiters in STR into a single '\0' in ARGZ. */ + if ((q > argz) && (q[-1] != LT_EOS_CHAR)) + *q++ = LT_EOS_CHAR; + else + --argz_len; + } + else + *q++ = *p; + } + /* Copy terminating LT_EOS_CHAR. */ + *q = *p; + } + + /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ + if (!argz_len) + LT_DLFREE (argz); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_CREATE_SEP */ + + +#if ! HAVE_ARGZ_INSERT +#define argz_insert rpl_argz_insert + +static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, + char *before, const char *entry)); + +static error_t +argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + /* No BEFORE address indicates ENTRY should be inserted after the + current last element. */ + if (!before) + return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry)); + + /* This probably indicates a programmer error, but to preserve + semantics, scan back to the start of an entry if BEFORE points + into the middle of it. */ + while ((before > *pargz) && (before[-1] != LT_EOS_CHAR)) + --before; + + { + size_t entry_len = 1+ LT_STRLEN (entry); + size_t argz_len = *pargz_len + entry_len; + size_t offset = before - *pargz; + char *argz = LT_DLREALLOC (char, *pargz, argz_len); + + if (!argz) + return ENOMEM; + + /* Make BEFORE point to the equivalent offset in ARGZ that it + used to have in *PARGZ incase realloc() moved the block. */ + before = argz + offset; + + /* Move the ARGZ entries starting at BEFORE up into the new + space at the end -- making room to copy ENTRY into the + resulting gap. */ + memmove (before + entry_len, before, *pargz_len - offset); + memcpy (before, entry, entry_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + } + + return 0; +} +#endif /* !HAVE_ARGZ_INSERT */ + + +#if ! HAVE_ARGZ_NEXT +#define argz_next rpl_argz_next + +static char *argz_next LT_PARAMS((char *argz, size_t argz_len, + const char *entry)); + +static char * +argz_next (argz, argz_len, entry) + char *argz; + size_t argz_len; + const char *entry; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (entry) + { + /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address + within the ARGZ vector. */ + assert ((!argz && !argz_len) + || ((argz <= entry) && (entry < (argz + argz_len)))); + + /* Move to the char immediately after the terminating + '\0' of ENTRY. */ + entry = 1+ strchr (entry, LT_EOS_CHAR); + + /* Return either the new ENTRY, or else NULL if ARGZ is + exhausted. */ + return (entry >= argz + argz_len) ? 0 : (char *) entry; + } + else + { + /* This should probably be flagged as a programmer error, + since starting an argz_next loop with the iterator set + to ARGZ is safer. To preserve semantics, handle the NULL + case by returning the start of ARGZ (if any). */ + if (argz_len > 0) + return argz; + else + return 0; + } +} +#endif /* !HAVE_ARGZ_NEXT */ + + + +#if ! HAVE_ARGZ_STRINGIFY +#define argz_stringify rpl_argz_stringify + +static void argz_stringify LT_PARAMS((char *argz, size_t argz_len, + int sep)); + +static void +argz_stringify (argz, argz_len, sep) + char *argz; + size_t argz_len; + int sep; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (sep) + { + --argz_len; /* don't stringify the terminating EOS */ + while (--argz_len > 0) + { + if (argz[argz_len] == LT_EOS_CHAR) + argz[argz_len] = sep; + } + } +} +#endif /* !HAVE_ARGZ_STRINGIFY */ + + + + +/* --- TYPE DEFINITIONS -- */ + + +/* This type is used for the array of caller data sets in each handler. */ +typedef struct { + lt_dlcaller_id key; + lt_ptr data; +} lt_caller_data; + + + + +/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ + + +/* Extract the diagnostic strings from the error table macro in the same + order as the enumerated indices in ltdl.h. */ + +static const char *lt_dlerror_strings[] = + { +#define LT_ERROR(name, diagnostic) (diagnostic), + lt_dlerror_table +#undef LT_ERROR + + 0 + }; + +/* This structure is used for the list of registered loaders. */ +struct lt_dlloader { + struct lt_dlloader *next; + const char *loader_name; /* identifying name for each loader */ + const char *sym_prefix; /* prefix for symbols */ + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +struct lt_dlhandle_struct { + struct lt_dlhandle_struct *next; + lt_dlloader *loader; /* dlopening interface */ + lt_dlinfo info; + int depcount; /* number of dependencies */ + lt_dlhandle *deplibs; /* dependencies */ + lt_module module; /* system module handle */ + lt_ptr system; /* system specific data */ + lt_caller_data *caller_data; /* per caller associated data */ + int flags; /* various boolean stats */ +}; + +/* Various boolean flags can be stored in the flags field of an + lt_dlhandle_struct... */ +#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag)) +#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag)) + +#define LT_DLRESIDENT_FLAG (0x01 << 0) +/* ...add more flags here... */ + +#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG) + + +#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)] + +static const char objdir[] = LTDL_OBJDIR; +static const char archive_ext[] = LTDL_ARCHIVE_EXT; +#ifdef LTDL_SHLIB_EXT +static const char shlib_ext[] = LTDL_SHLIB_EXT; +#endif +#ifdef LTDL_SYSSEARCHPATH +static const char sys_search_path[] = LTDL_SYSSEARCHPATH; +#endif + + + + +/* --- MUTEX LOCKING --- */ + + +/* Macros to make it easier to run the lock functions only if they have + been registered. The reason for the complicated lock macro is to + ensure that the stored error message from the last error is not + accidentally erased if the current function doesn't generate an + error of its own. */ +#define LT_DLMUTEX_LOCK() LT_STMT_START { \ + if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ + } LT_STMT_END +#define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ + if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\ + } LT_STMT_END +#define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (*lt_dlmutex_seterror_func) (errormsg); \ + else lt_dllast_error = (errormsg); } LT_STMT_END +#define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (errormsg) = (*lt_dlmutex_geterror_func) (); \ + else (errormsg) = lt_dllast_error; } LT_STMT_END + +/* The mutex functions stored here are global, and are necessarily the + same for all threads that wish to share access to libltdl. */ +static lt_dlmutex_lock *lt_dlmutex_lock_func = 0; +static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0; +static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0; +static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0; +static const char *lt_dllast_error = 0; + + +/* Either set or reset the mutex functions. Either all the arguments must + be valid functions, or else all can be NULL to turn off locking entirely. + The registered functions should be manipulating a static global lock + from the lock() and unlock() callbacks, which needs to be reentrant. */ +int +lt_dlmutex_register (lock, unlock, seterror, geterror) + lt_dlmutex_lock *lock; + lt_dlmutex_unlock *unlock; + lt_dlmutex_seterror *seterror; + lt_dlmutex_geterror *geterror; +{ + lt_dlmutex_unlock *old_unlock = unlock; + int errors = 0; + + /* Lock using the old lock() callback, if any. */ + LT_DLMUTEX_LOCK (); + + if ((lock && unlock && seterror && geterror) + || !(lock || unlock || seterror || geterror)) + { + lt_dlmutex_lock_func = lock; + lt_dlmutex_unlock_func = unlock; + lt_dlmutex_geterror_func = geterror; + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS)); + ++errors; + } + + /* Use the old unlock() callback we saved earlier, if any. Otherwise + record any errors using internal storage. */ + if (old_unlock) + (*old_unlock) (); + + /* Return the number of errors encountered during the execution of + this function. */ + return errors; +} + + + + +/* --- ERROR HANDLING --- */ + + +static const char **user_error_strings = 0; +static int errorcount = LT_ERROR_MAX; + +int +lt_dladderror (diagnostic) + const char *diagnostic; +{ + int errindex = 0; + int result = -1; + const char **temp = (const char **) 0; + + assert (diagnostic); + + LT_DLMUTEX_LOCK (); + + errindex = errorcount - LT_ERROR_MAX; + temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); + if (temp) + { + user_error_strings = temp; + user_error_strings[errindex] = diagnostic; + result = errorcount++; + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +int +lt_dlseterror (errindex) + int errindex; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + if (errindex >= errorcount || errindex < 0) + { + /* Ack! Error setting the error message! */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); + ++errors; + } + else if (errindex < LT_ERROR_MAX) + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]); + } + else + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static lt_ptr +lt_emalloc (size) + size_t size; +{ + lt_ptr mem = lt_dlmalloc (size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static lt_ptr +lt_erealloc (addr, size) + lt_ptr addr; + size_t size; +{ + lt_ptr mem = lt_dlrealloc (addr, size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static char * +lt_estrdup (str) + const char *str; +{ + char *copy = strdup (str); + if (LT_STRLEN (str) && !copy) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return copy; +} + + + + +/* --- DLOPEN() INTERFACE LOADER --- */ + + +#if HAVE_LIBDL + +/* dynamic linking with dlopen/dlsym */ + +#if HAVE_DLFCN_H +#include +#endif + +#if HAVE_SYS_DL_H +#include +#endif + +#ifdef RTLD_GLOBAL +#define LT_GLOBAL RTLD_GLOBAL +#else +#ifdef DL_GLOBAL +#define LT_GLOBAL DL_GLOBAL +#endif +#endif /* !RTLD_GLOBAL */ +#ifndef LT_GLOBAL +#define LT_GLOBAL 0 +#endif /* !LT_GLOBAL */ + +/* We may have to define LT_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_LAZY_OR_NOW +#ifdef RTLD_LAZY +#define LT_LAZY_OR_NOW RTLD_LAZY +#else +#ifdef DL_LAZY +#define LT_LAZY_OR_NOW DL_LAZY +#endif +#endif /* !RTLD_LAZY */ +#endif +#ifndef LT_LAZY_OR_NOW +#ifdef RTLD_NOW +#define LT_LAZY_OR_NOW RTLD_NOW +#else +#ifdef DL_NOW +#define LT_LAZY_OR_NOW DL_NOW +#endif +#endif /* !RTLD_NOW */ +#endif +#ifndef LT_LAZY_OR_NOW +#define LT_LAZY_OR_NOW 0 +#endif /* !LT_LAZY_OR_NOW */ + +#if HAVE_DLERROR +#define DLERROR(arg) dlerror () +#else +#define DLERROR(arg) LT_DLSTRERROR (arg) +#endif + +static lt_module +sys_dl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW); + + if (!module) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN)); + } + + return module; +} + +static int +sys_dl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dlclose (module) != 0) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_dl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dlsym (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dl = + { +#ifdef NEED_USCORE + "_", +#else + 0, +#endif + sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 }; + + +#endif /* HAVE_LIBDL */ + + + +/* --- SHL_LOAD() INTERFACE LOADER --- */ + +#if HAVE_SHL_LOAD + +/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */ + +#ifdef HAVE_DL_H +#include +#endif + +/* some flags are missing on some systems, so we provide + * harmless defaults. + * + * Mandatory: + * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. + * BIND_DEFERRED - Delay code symbol resolution until actual reference. + * + * Optionally: + * BIND_FIRST - Place the library at the head of the symbol search + * order. + * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all + * unsatisfied symbols as fatal. This flag allows + * binding of unsatisfied code symbols to be deferred + * until use. + * [Perl: For certain libraries, like DCE, deferred + * binding often causes run time problems. Adding + * BIND_NONFATAL to BIND_IMMEDIATE still allows + * unresolved references in situations like this.] + * BIND_NOSTART - Do not call the initializer for the shared library + * when the library is loaded, nor on a future call to + * shl_unload(). + * BIND_VERBOSE - Print verbose messages concerning possible + * unsatisfied symbols. + * + * hp9000s700/hp9000s800: + * BIND_RESTRICTED - Restrict symbols visible by the library to those + * present at library load time. + * DYNAMIC_PATH - Allow the loader to dynamically search for the + * library specified by the path argument. + */ + +#ifndef DYNAMIC_PATH +#define DYNAMIC_PATH 0 +#endif +#ifndef BIND_RESTRICTED +#define BIND_RESTRICTED 0 +#endif + +#define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) + +static lt_module +sys_shl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + static shl_t self = (shl_t) 0; + lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); + + /* Since searching for a symbol against a NULL module handle will also + look in everything else that was already loaded and exported with + the -E compiler flag, we always cache a handle saved before any + modules are loaded. */ + if (!self) + { + lt_ptr address; + shl_findsym (&self, "main", TYPE_UNDEFINED, &address); + } + + if (!filename) + { + module = self; + } + else + { + module = shl_load (filename, LT_BIND_FLAGS, 0L); + + if (!module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + } + } + + return module; +} + +static int +sys_shl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (module && (shl_unload ((shl_t) (module)) != 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_shl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + + /* sys_shl_open should never return a NULL module handle */ + if (module == (lt_module) 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + } + else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address)) + { + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + } + + return address; +} + +static struct lt_user_dlloader sys_shl = { + 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 +}; + +#endif /* HAVE_SHL_LOAD */ + + + + +/* --- LOADLIBRARY() INTERFACE LOADER --- */ + +#ifdef __WINDOWS__ + +/* dynamic linking for Win32 */ + +#include + +/* Forward declaration; required to implement handle search below. */ +static lt_dlhandle handles; + +static lt_module +sys_wll_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlhandle cur; + lt_module module = 0; + const char *errormsg = 0; + char *searchname = 0; + char *ext; + char self_name_buf[MAX_PATH]; + + if (!filename) + { + /* Get the name of main module */ + *self_name_buf = 0; + GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf)); + filename = ext = self_name_buf; + } + else + { + ext = strrchr (filename, '.'); + } + + if (ext) + { + /* FILENAME already has an extension. */ + searchname = lt_estrdup (filename); + } + else + { + /* Append a `.' to stop Windows from adding an + implicit `.dll' extension. */ + searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename)); + if (searchname) + sprintf (searchname, "%s.", filename); + } + if (!searchname) + return 0; + +#if __CYGWIN__ + { + char wpath[MAX_PATH]; + cygwin_conv_to_full_win32_path(searchname, wpath); + module = LoadLibrary(wpath); + } +#else + module = LoadLibrary (searchname); +#endif + LT_DLFREE (searchname); + + /* libltdl expects this function to fail if it is unable + to physically load the library. Sadly, LoadLibrary + will search the loaded libraries for a match and return + one of them if the path search load fails. + + We check whether LoadLibrary is returning a handle to + an already loaded module, and simulate failure if we + find one. */ + LT_DLMUTEX_LOCK (); + cur = handles; + while (cur) + { + if (!cur->module) + { + cur = 0; + break; + } + + if (cur->module == module) + { + break; + } + + cur = cur->next; + } + LT_DLMUTEX_UNLOCK (); + + if (cur || !module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + module = 0; + } + + return module; +} + +static int +sys_wll_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (FreeLibrary(module) == 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_wll_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = GetProcAddress (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_wll = { + 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 +}; + +#endif /* __WINDOWS__ */ + + + + +/* --- LOAD_ADD_ON() INTERFACE LOADER --- */ + + +#ifdef __BEOS__ + +/* dynamic linking for BeOS */ + +#include + +static lt_module +sys_bedl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + image_id image = 0; + + if (filename) + { + image = load_add_on (filename); + } + else + { + image_info info; + int32 cookie = 0; + if (get_next_image_info (0, &cookie, &info) == B_OK) + image = load_add_on (info.name); + } + + if (image <= 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + image = 0; + } + + return (lt_module) image; +} + +static int +sys_bedl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (unload_add_on ((image_id) module) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_bedl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + image_id image = (image_id) module; + + if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + address = 0; + } + + return address; +} + +static struct lt_user_dlloader sys_bedl = { + 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 +}; + +#endif /* __BEOS__ */ + + + + +/* --- DLD_LINK() INTERFACE LOADER --- */ + + +#if HAVE_DLD + +/* dynamic linking with dld */ + +#if HAVE_DLD_H +#include +#endif + +static lt_module +sys_dld_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = strdup (filename); + + if (dld_link (filename) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLFREE (module); + module = 0; + } + + return module; +} + +static int +sys_dld_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dld_unlink_by_file ((char*)(module), 1) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + else + { + LT_DLFREE (module); + } + + return errors; +} + +static lt_ptr +sys_dld_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dld_get_func (symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dld = { + 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 +}; + +#endif /* HAVE_DLD */ + +/* --- DYLD() MACOSX/DARWIN INTERFACE LOADER --- */ +#if HAVE_DYLD + + +#if HAVE_MACH_O_DYLD_H +#if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__) +/* Is this correct? Does it still function properly? */ +#define __private_extern__ extern +#endif +#include +#endif +#include + +/* We have to put some stuff here that isn't in older dyld.h files */ +#ifndef ENUM_DYLD_BOOL +#define ENUM_DYLD_BOOL +#undef FALSE +#undef TRUE + enum DYLD_BOOL { + FALSE, + TRUE + }; +#endif +#ifndef LC_REQ_DYLD +#define LC_REQ_DYLD 0x80000000 +#endif +#ifndef LC_LOAD_WEAK_DYLIB +#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) +#endif +static const struct mach_header * (*ltdl_NSAddImage)(const char *image_name, unsigned long options) = 0; +static NSSymbol (*ltdl_NSLookupSymbolInImage)(const struct mach_header *image,const char *symbolName, unsigned long options) = 0; +static enum DYLD_BOOL (*ltdl_NSIsSymbolNameDefinedInImage)(const struct mach_header *image, const char *symbolName) = 0; +static enum DYLD_BOOL (*ltdl_NSMakePrivateModulePublic)(NSModule module) = 0; + +#ifndef NSADDIMAGE_OPTION_NONE +#define NSADDIMAGE_OPTION_NONE 0x0 +#endif +#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR +#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 +#endif +#ifndef NSADDIMAGE_OPTION_WITH_SEARCHING +#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 +#endif +#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED +#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 +#endif +#ifndef NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME +#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR +#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 +#endif + + +static const char * +lt_int_dyld_error(othererror) + char* othererror; +{ +/* return the dyld error string, or the passed in error string if none */ + NSLinkEditErrors ler; + int lerno; + const char *errstr; + const char *file; + NSLinkEditError(&ler,&lerno,&file,&errstr); + if (!errstr || !strlen(errstr)) errstr = othererror; + return errstr; +} + +static const struct mach_header * +lt_int_dyld_get_mach_header_from_nsmodule(module) + NSModule module; +{ +/* There should probably be an apple dyld api for this */ + int i=_dyld_image_count(); + int j; + const char *modname=NSNameOfModule(module); + const struct mach_header *mh=NULL; + if (!modname) return NULL; + for (j = 0; j < i; j++) + { + if (!strcmp(_dyld_get_image_name(j),modname)) + { + mh=_dyld_get_image_header(j); + break; + } + } + return mh; +} + +static const char* lt_int_dyld_lib_install_name(mh) + const struct mach_header *mh; +{ +/* NSAddImage is also used to get the loaded image, but it only works if the lib + is installed, for uninstalled libs we need to check the install_names against + each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a + different lib was loaded as a result +*/ + int j; + struct load_command *lc; + unsigned long offset = sizeof(struct mach_header); + const char* retStr=NULL; + for (j = 0; j < mh->ncmds; j++) + { + lc = (struct load_command*)(((unsigned long)mh) + offset); + if (LC_ID_DYLIB == lc->cmd) + { + retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc); + } + offset += lc->cmdsize; + } + return retStr; +} + +static const struct mach_header * +lt_int_dyld_match_loaded_lib_by_install_name(const char *name) +{ + int i=_dyld_image_count(); + int j; + const struct mach_header *mh=NULL; + const char *id=NULL; + for (j = 0; j < i; j++) + { + id=lt_int_dyld_lib_install_name(_dyld_get_image_header(j)); + if ((id) && (!strcmp(id,name))) + { + mh=_dyld_get_image_header(j); + break; + } + } + return mh; +} + +static NSSymbol +lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh) + const char *symbol; + const struct mach_header *mh; +{ + /* Safe to assume our mh is good */ + int j; + struct load_command *lc; + unsigned long offset = sizeof(struct mach_header); + NSSymbol retSym = 0; + const struct mach_header *mh1; + if ((ltdl_NSLookupSymbolInImage) && NSIsSymbolNameDefined(symbol) ) + { + for (j = 0; j < mh->ncmds; j++) + { + lc = (struct load_command*)(((unsigned long)mh) + offset); + if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) + { + mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc)); + if (!mh1) + { + /* Maybe NSAddImage can find it */ + mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc), + NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED + + NSADDIMAGE_OPTION_WITH_SEARCHING + + NSADDIMAGE_OPTION_RETURN_ON_ERROR ); + } + if (mh1) + { + retSym = ltdl_NSLookupSymbolInImage(mh1, + symbol, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW + | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR + ); + if (retSym) break; + } + } + offset += lc->cmdsize; + } + } + return retSym; +} + +static int +sys_dyld_init() +{ + int retCode = 0; + int err = 0; + if (!_dyld_present()) { + retCode=1; + } + else { + err = _dyld_func_lookup("__dyld_NSAddImage",(unsigned long*)<dl_NSAddImage); + err = _dyld_func_lookup("__dyld_NSLookupSymbolInImage",(unsigned long*)<dl_NSLookupSymbolInImage); + err = _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",(unsigned long*)<dl_NSIsSymbolNameDefinedInImage); + err = _dyld_func_lookup("__dyld_NSMakePrivateModulePublic",(unsigned long*)<dl_NSMakePrivateModulePublic); + } + return retCode; +} + +static lt_module +sys_dyld_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = 0; + NSObjectFileImage ofi = 0; + NSObjectFileImageReturnCode ofirc; + + if (!filename) + return (lt_module)-1; + ofirc = NSCreateObjectFileImageFromFile(filename, &ofi); + switch (ofirc) + { + case NSObjectFileImageSuccess: + module = NSLinkModule(ofi, filename, + NSLINKMODULE_OPTION_RETURN_ON_ERROR + | NSLINKMODULE_OPTION_PRIVATE + | NSLINKMODULE_OPTION_BINDNOW); + NSDestroyObjectFileImage(ofi); + if (module) + ltdl_NSMakePrivateModulePublic(module); + break; + case NSObjectFileImageInappropriateFile: + if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) + { + module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + break; + } + default: + LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); + return 0; + } + if (!module) LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); + return module; +} + +static int +sys_dyld_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int retCode = 0; + int flags = 0; + if (module == (lt_module)-1) return 0; +#ifdef __BIG_ENDIAN__ + if (((struct mach_header *)module)->magic == MH_MAGIC) +#else + if (((struct mach_header *)module)->magic == MH_CIGAM) +#endif + { + LT_DLMUTEX_SETERROR("Can not close a dylib"); + retCode = 1; + } + else + { +#if 1 +/* Currently, if a module contains c++ static destructors and it is unloaded, we + get a segfault in atexit(), due to compiler and dynamic loader differences of + opinion, this works around that. +*/ + if ((const struct section *)NULL != + getsectbynamefromheader(lt_int_dyld_get_mach_header_from_nsmodule(module), + "__DATA","__mod_term_func")) + { + flags += NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; + } +#endif +#ifdef __ppc__ + flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; +#endif + if (!NSUnLinkModule(module,flags)) + { + retCode=1; + LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE))); + } + } + + return retCode; +} + +static lt_ptr +sys_dyld_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + NSSymbol *nssym = 0; + void *unused; + const struct mach_header *mh=NULL; + char saveError[256] = "Symbol not found"; + if (module == (lt_module)-1) + { + _dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused); + return address; + } +#ifdef __BIG_ENDIAN__ + if (((struct mach_header *)module)->magic == MH_MAGIC) +#else + if (((struct mach_header *)module)->magic == MH_CIGAM) +#endif + { + if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) + { + mh=module; + if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol)) + { + nssym = ltdl_NSLookupSymbolInImage((struct mach_header*)module, + symbol, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW + | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR + ); + } + } + + } + else { + nssym = NSLookupSymbolInModule(module, symbol); + } + if (!nssym) + { + strncpy(saveError, lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)), 255); + saveError[255] = 0; + if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module); + nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh); + } + if (!nssym) + { + LT_DLMUTEX_SETERROR (saveError); + return NULL; + } + return NSAddressOfSymbol(nssym); +} + +static struct lt_user_dlloader sys_dyld = + { "_", sys_dyld_open, sys_dyld_close, sys_dyld_sym, 0, 0 }; + + +#endif /* HAVE_DYLD */ + + +/* --- DLPREOPEN() INTERFACE LOADER --- */ + + +/* emulate dynamic linking using preloaded_symbols */ + +typedef struct lt_dlsymlists_t +{ + struct lt_dlsymlists_t *next; + const lt_dlsymlist *syms; +} lt_dlsymlists_t; + +static const lt_dlsymlist *default_preloaded_symbols = 0; +static lt_dlsymlists_t *preloaded_symbols = 0; + +static int +presym_init (loader_data) + lt_user_data loader_data; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + preloaded_symbols = 0; + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static int +presym_free_symlists () +{ + lt_dlsymlists_t *lists; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + lt_dlsymlists_t *tmp = lists; + + lists = lists->next; + LT_DLFREE (tmp); + } + preloaded_symbols = 0; + + LT_DLMUTEX_UNLOCK (); + + return 0; +} + +static int +presym_exit (loader_data) + lt_user_data loader_data; +{ + presym_free_symlists (); + return 0; +} + +static int +presym_add_symlist (preloaded) + const lt_dlsymlist *preloaded; +{ + lt_dlsymlists_t *tmp; + lt_dlsymlists_t *lists; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + if (lists->syms == preloaded) + { + goto done; + } + lists = lists->next; + } + + tmp = LT_EMALLOC (lt_dlsymlists_t, 1); + if (tmp) + { + memset (tmp, 0, sizeof(lt_dlsymlists_t)); + tmp->syms = preloaded; + tmp->next = preloaded_symbols; + preloaded_symbols = tmp; + } + else + { + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static lt_module +presym_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlsymlists_t *lists; + lt_module module = (lt_module) 0; + + LT_DLMUTEX_LOCK (); + lists = preloaded_symbols; + + if (!lists) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS)); + goto done; + } + + /* Can't use NULL as the reflective symbol header, as NULL is + used to mark the end of the entire symbol list. Self-dlpreopened + symbols follow this magic number, chosen to be an unlikely + clash with a real module name. */ + if (!filename) + { + filename = "@PROGRAM@"; + } + + while (lists) + { + const lt_dlsymlist *syms = lists->syms; + + while (syms->name) + { + if (!syms->address && strcmp(syms->name, filename) == 0) + { + module = (lt_module) syms; + goto done; + } + ++syms; + } + + lists = lists->next; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + + done: + LT_DLMUTEX_UNLOCK (); + return module; +} + +static int +presym_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + /* Just to silence gcc -Wall */ + module = 0; + return 0; +} + +static lt_ptr +presym_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_dlsymlist *syms = (lt_dlsymlist*) module; + + ++syms; + while (syms->address) + { + if (strcmp(syms->name, symbol) == 0) + { + return syms->address; + } + + ++syms; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + + return 0; +} + +static struct lt_user_dlloader presym = { + 0, presym_open, presym_close, presym_sym, presym_exit, 0 +}; + + + + + +/* --- DYNAMIC MODULE LOADING --- */ + + +/* The type of a function used at each iteration of foreach_dirinpath(). */ +typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + +static int foreach_dirinpath LT_PARAMS((const char *search_path, + const char *base_name, + foreach_callback_func *func, + lt_ptr data1, lt_ptr data2)); + +static int find_file_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + + +static int canonicalize_path LT_PARAMS((const char *path, + char **pcanonical)); +static int argzize_path LT_PARAMS((const char *path, + char **pargz, + size_t *pargz_len)); +static FILE *find_file LT_PARAMS((const char *search_path, + const char *base_name, + char **pdir)); +static lt_dlhandle *find_handle LT_PARAMS((const char *search_path, + const char *base_name, + lt_dlhandle *handle)); +static int find_module LT_PARAMS((lt_dlhandle *handle, + const char *dir, + const char *libdir, + const char *dlname, + const char *old_name, + int installed)); +static int free_vars LT_PARAMS((char *dlname, char *oldname, + char *libdir, char *deplibs)); +static int load_deplibs LT_PARAMS((lt_dlhandle handle, + char *deplibs)); +static int trim LT_PARAMS((char **dest, + const char *str)); +static int try_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int unload_deplibs LT_PARAMS((lt_dlhandle handle)); +static int lt_argz_insert LT_PARAMS((char **pargz, + size_t *pargz_len, + char *before, + const char *entry)); +static int lt_argz_insertinorder LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *entry)); +static int lt_argz_insertdir LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *dirnam, + struct dirent *dp)); +static int lt_dlpath_insertdir LT_PARAMS((char **ppath, + char *before, + const char *dir)); +static int list_files_by_dir LT_PARAMS((const char *dirnam, + char **pargz, + size_t *pargz_len)); +static int file_not_found LT_PARAMS((void)); + +static char *user_search_path= 0; +static lt_dlloader *loaders = 0; +static lt_dlhandle handles = 0; +static int initialized = 0; + +/* Initialize libltdl. */ +int +lt_dlinit () +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* Initialize only at first call. */ + if (++initialized == 1) + { + handles = 0; + user_search_path = 0; /* empty search path */ + +#if HAVE_LIBDL + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen"); +#endif +#if HAVE_SHL_LOAD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen"); +#endif +#ifdef __WINDOWS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen"); +#endif +#ifdef __BEOS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen"); +#endif +#if HAVE_DLD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld"); +#endif +#if HAVE_DYLD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld"); + errors += sys_dyld_init(); +#endif + errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload"); + + if (presym_init (presym.dlloader_data)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER)); + ++errors; + } + else if (errors != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED)); + ++errors; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlpreload (preloaded) + const lt_dlsymlist *preloaded; +{ + int errors = 0; + + if (preloaded) + { + errors = presym_add_symlist (preloaded); + } + else + { + presym_free_symlists(); + + LT_DLMUTEX_LOCK (); + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlpreload_default (preloaded) + const lt_dlsymlist *preloaded; +{ + LT_DLMUTEX_LOCK (); + default_preloaded_symbols = preloaded; + LT_DLMUTEX_UNLOCK (); + return 0; +} + +int +lt_dlexit () +{ + /* shut down libltdl */ + lt_dlloader *loader; + int errors = 0; + + LT_DLMUTEX_LOCK (); + loader = loaders; + + if (!initialized) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN)); + ++errors; + goto done; + } + + /* shut down only at last call. */ + if (--initialized == 0) + { + int level; + + while (handles && LT_DLIS_RESIDENT (handles)) + { + handles = handles->next; + } + + /* close all modules */ + for (level = 1; handles; ++level) + { + lt_dlhandle cur = handles; + int saw_nonresident = 0; + + while (cur) + { + lt_dlhandle tmp = cur; + cur = cur->next; + if (!LT_DLIS_RESIDENT (tmp)) + saw_nonresident = 1; + if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) + { + if (lt_dlclose (tmp)) + { + ++errors; + } + } + } + /* done if only resident modules are left */ + if (!saw_nonresident) + break; + } + + /* close all loaders */ + while (loader) + { + lt_dlloader *next = loader->next; + lt_user_data data = loader->dlloader_data; + if (loader->dlloader_exit && loader->dlloader_exit (data)) + { + ++errors; + } + + LT_DLMEM_REASSIGN (loader, next); + } + loaders = 0; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static int +tryall_dlopen (handle, filename) + lt_dlhandle *handle; + const char *filename; +{ + lt_dlhandle cur; + lt_dlloader *loader; + const char *saved_error; + int errors = 0; + + LT_DLMUTEX_GETERROR (saved_error); + LT_DLMUTEX_LOCK (); + + cur = handles; + loader = loaders; + + /* check whether the module was already opened */ + while (cur) + { + /* try to dlopen the program itself? */ + if (!cur->info.filename && !filename) + { + break; + } + + if (cur->info.filename && filename + && strcmp (cur->info.filename, filename) == 0) + { + break; + } + + cur = cur->next; + } + + if (cur) + { + ++cur->info.ref_count; + *handle = cur; + goto done; + } + + cur = *handle; + if (filename) + { + /* Comment out the check of file permissions using access. + This call seems to always return -1 with error EACCES. + */ + /* We need to catch missing file errors early so that + file_not_found() can detect what happened. + if (access (filename, R_OK) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; + goto done; + } */ + + cur->info.filename = lt_estrdup (filename); + if (!cur->info.filename) + { + ++errors; + goto done; + } + } + else + { + cur->info.filename = 0; + } + + while (loader) + { + lt_user_data data = loader->dlloader_data; + + cur->module = loader->module_open (data, filename); + + if (cur->module != 0) + { + break; + } + loader = loader->next; + } + + if (!loader) + { + LT_DLFREE (cur->info.filename); + ++errors; + goto done; + } + + cur->loader = loader; + LT_DLMUTEX_SETERROR (saved_error); + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static int +tryall_dlopen_module (handle, prefix, dirname, dlname) + lt_dlhandle *handle; + const char *prefix; + const char *dirname; + const char *dlname; +{ + int error = 0; + char *filename = 0; + size_t filename_len = 0; + size_t dirname_len = LT_STRLEN (dirname); + + assert (handle); + assert (dirname); + assert (dlname); +#ifdef LT_DIRSEP_CHAR + /* Only canonicalized names (i.e. with DIRSEP chars already converted) + should make it into this function: */ + assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); +#endif + + if (dirname_len > 0) + if (dirname[dirname_len -1] == '/') + --dirname_len; + filename_len = dirname_len + 1 + LT_STRLEN (dlname); + + /* Allocate memory, and combine DIRNAME and MODULENAME into it. + The PREFIX (if any) is handled below. */ + filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1); + if (!filename) + return 1; + + sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); + + /* Now that we have combined DIRNAME and MODULENAME, if there is + also a PREFIX to contend with, simply recurse with the arguments + shuffled. Otherwise, attempt to open FILENAME as a module. */ + if (prefix) + { + error += tryall_dlopen_module (handle, + (const char *) 0, prefix, filename); + } + else if (tryall_dlopen (handle, filename) != 0) + { + ++error; + } + + LT_DLFREE (filename); + return error; +} + +static int +find_module (handle, dir, libdir, dlname, old_name, installed) + lt_dlhandle *handle; + const char *dir; + const char *libdir; + const char *dlname; + const char *old_name; + int installed; +{ + /* Try to open the old library first; if it was dlpreopened, + we want the preopened version of it, even if a dlopenable + module is available. */ + if (old_name && tryall_dlopen (handle, old_name) == 0) + { + return 0; + } + + /* Try to open the dynamic library. */ + if (dlname) + { + /* try to open the installed module */ + if (installed && libdir) + { + if (tryall_dlopen_module (handle, + (const char *) 0, libdir, dlname) == 0) + return 0; + } + + /* try to open the not-installed module */ + if (!installed) + { + if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0) + return 0; + } + + /* maybe it was moved to another directory */ + { + if (tryall_dlopen_module (handle, + (const char *) 0, dir, dlname) == 0) + return 0; + } + } + + return 1; +} + + +static int +canonicalize_path (path, pcanonical) + const char *path; + char **pcanonical; +{ + char *canonical = 0; + + assert (path && *path); + assert (pcanonical); + + canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path)); + if (!canonical) + return 1; + + { + size_t dest = 0; + size_t src; + for (src = 0; path[src] != LT_EOS_CHAR; ++src) + { + /* Path separators are not copied to the beginning or end of + the destination, or if another separator would follow + immediately. */ + if (path[src] == LT_PATHSEP_CHAR) + { + if ((dest == 0) + || (path[1+ src] == LT_PATHSEP_CHAR) + || (path[1+ src] == LT_EOS_CHAR)) + continue; + } + + /* Anything other than a directory separator is copied verbatim. */ + if ((path[src] != '/') +#ifdef LT_DIRSEP_CHAR + && (path[src] != LT_DIRSEP_CHAR) +#endif + ) + { + canonical[dest++] = path[src]; + } + /* Directory separators are converted and copied only if they are + not at the end of a path -- i.e. before a path separator or + NULL terminator. */ + else if ((path[1+ src] != LT_PATHSEP_CHAR) + && (path[1+ src] != LT_EOS_CHAR) +#ifdef LT_DIRSEP_CHAR + && (path[1+ src] != LT_DIRSEP_CHAR) +#endif + && (path[1+ src] != '/')) + { + canonical[dest++] = '/'; + } + } + + /* Add an end-of-string marker at the end. */ + canonical[dest] = LT_EOS_CHAR; + } + + /* Assign new value. */ + *pcanonical = canonical; + + return 0; +} + +static int +argzize_path (path, pargz, pargz_len) + const char *path; + char **pargz; + size_t *pargz_len; +{ + error_t error; + + assert (path); + assert (pargz); + assert (pargz_len); + + if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + + return 1; + } + + return 0; +} + +/* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element + of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns + non-zero or all elements are exhausted. If BASE_NAME is non-NULL, + it is appended to each SEARCH_PATH element before FUNC is called. */ +static int +foreach_dirinpath (search_path, base_name, func, data1, data2) + const char *search_path; + const char *base_name; + foreach_callback_func *func; + lt_ptr data1; + lt_ptr data2; +{ + int result = 0; + int filenamesize = 0; + size_t lenbase = LT_STRLEN (base_name); + size_t argz_len = 0; + char *argz = 0; + char *filename = 0; + char *canonical = 0; + + LT_DLMUTEX_LOCK (); + + if (!search_path || !*search_path) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + goto cleanup; + } + + if (canonicalize_path (search_path, &canonical) != 0) + goto cleanup; + + if (argzize_path (canonical, &argz, &argz_len) != 0) + goto cleanup; + + { + char *dir_name = 0; + while ((dir_name = argz_next (argz, argz_len, dir_name))) + { + size_t lendir = LT_STRLEN (dir_name); + + if (lendir +1 +lenbase >= filenamesize) + { + LT_DLFREE (filename); + filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */ + filename = LT_EMALLOC (char, filenamesize); + if (!filename) + goto cleanup; + } + + assert (filenamesize > lendir); + strcpy (filename, dir_name); + + if (base_name && *base_name) + { + if (filename[lendir -1] != '/') + filename[lendir++] = '/'; + strcpy (filename +lendir, base_name); + } + + if ((result = (*func) (filename, data1, data2))) + { + break; + } + } + } + + cleanup: + LT_DLFREE (argz); + LT_DLFREE (canonical); + LT_DLFREE (filename); + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +/* If FILEPATH can be opened, store the name of the directory component + in DATA1, and the opened FILE* structure address in DATA2. Otherwise + DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ +static int +find_file_callback (filename, data1, data2) + char *filename; + lt_ptr data1; + lt_ptr data2; +{ + char **pdir = (char **) data1; + FILE **pfile = (FILE **) data2; + int is_done = 0; + + assert (filename && *filename); + assert (pdir); + assert (pfile); + + if ((*pfile = fopen (filename, LT_READTEXT_MODE))) + { + char *dirend = strrchr (filename, '/'); + + if (dirend > filename) + *dirend = LT_EOS_CHAR; + + LT_DLFREE (*pdir); + *pdir = lt_estrdup (filename); + is_done = (*pdir == 0) ? -1 : 1; + } + + return is_done; +} + +static FILE * +find_file (search_path, base_name, pdir) + const char *search_path; + const char *base_name; + char **pdir; +{ + FILE *file = 0; + + foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); + + return file; +} + +static int +find_handle_callback (filename, data, ignored) + char *filename; + lt_ptr data; + lt_ptr ignored; +{ + lt_dlhandle *handle = (lt_dlhandle *) data; + int notfound = access (filename, R_OK); + + /* Bail out if file cannot be read... */ + if (notfound) + return 0; + + /* Try to dlopen the file, but do not continue searching in any + case. */ + if (tryall_dlopen (handle, filename) != 0) + *handle = 0; + + return 1; +} + +/* If HANDLE was found return it, otherwise return 0. If HANDLE was + found but could not be opened, *HANDLE will be set to 0. */ +static lt_dlhandle * +find_handle (search_path, base_name, handle) + const char *search_path; + const char *base_name; + lt_dlhandle *handle; +{ + if (!search_path) + return 0; + + if (!foreach_dirinpath (search_path, base_name, find_handle_callback, + handle, 0)) + return 0; + + return handle; +} + +static int +load_deplibs (handle, deplibs) + lt_dlhandle handle; + char *deplibs; +{ +#if LTDL_DLOPEN_DEPLIBS + char *p, *save_search_path = 0; + int depcount = 0; + int i; + char **names = 0; +#endif + int errors = 0; + + handle->depcount = 0; + +#if LTDL_DLOPEN_DEPLIBS + if (!deplibs) + { + return errors; + } + ++errors; + + LT_DLMUTEX_LOCK (); + if (user_search_path) + { + save_search_path = lt_estrdup (user_search_path); + if (!save_search_path) + goto cleanup; + } + + /* extract search paths and count deplibs */ + p = deplibs; + while (*p) + { + if (!isspace ((int) *p)) + { + char *end = p+1; + while (*end && !isspace((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) + { + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (lt_dladdsearchdir(p+2)) + { + goto cleanup; + } + *end = save; + } + else + { + ++depcount; + } + + p = end; + } + else + { + ++p; + } + } + + /* restore the old search path */ + LT_DLFREE (user_search_path); + user_search_path = save_search_path; + + LT_DLMUTEX_UNLOCK (); + + if (!depcount) + { + errors = 0; + goto cleanup; + } + + names = LT_EMALLOC (char *, depcount * sizeof (char*)); + if (!names) + goto cleanup; + + /* now only extract the actual deplibs */ + depcount = 0; + p = deplibs; + while (*p) + { + if (isspace ((int) *p)) + { + ++p; + } + else + { + char *end = p+1; + while (*end && !isspace ((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) + { + char *name; + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (strncmp(p, "-l", 2) == 0) + { + size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); + name = LT_EMALLOC (char, 1+ name_len); + if (name) + sprintf (name, "lib%s", p+2); + } + else + name = lt_estrdup(p); + + if (!name) + goto cleanup_names; + + names[depcount++] = name; + *end = save; + } + p = end; + } + } + + /* load the deplibs (in reverse order) + At this stage, don't worry if the deplibs do not load correctly, + they may already be statically linked into the loading application + for instance. There will be a more enlightening error message + later on if the loaded module cannot resolve all of its symbols. */ + if (depcount) + { + int j = 0; + + handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount); + if (!handle->deplibs) + goto cleanup; + + for (i = 0; i < depcount; ++i) + { + handle->deplibs[j] = lt_dlopenext(names[depcount-1-i]); + if (handle->deplibs[j]) + { + ++j; + } + } + + handle->depcount = j; /* Number of successfully loaded deplibs */ + errors = 0; + } + + cleanup_names: + for (i = 0; i < depcount; ++i) + { + LT_DLFREE (names[i]); + } + + cleanup: + LT_DLFREE (names); +#endif + + return errors; +} + +static int +unload_deplibs (handle) + lt_dlhandle handle; +{ + int i; + int errors = 0; + + if (handle->depcount) + { + for (i = 0; i < handle->depcount; ++i) + { + if (!LT_DLIS_RESIDENT (handle->deplibs[i])) + { + errors += lt_dlclose (handle->deplibs[i]); + } + } + } + + return errors; +} + +static int +trim (dest, str) + char **dest; + const char *str; +{ + /* remove the leading and trailing "'" from str + and store the result in dest */ + const char *end = strrchr (str, '\''); + size_t len = LT_STRLEN (str); + char *tmp; + + LT_DLFREE (*dest); + + if (len > 3 && str[0] == '\'') + { + tmp = LT_EMALLOC (char, end - str); + if (!tmp) + return 1; + + strncpy(tmp, &str[1], (end - str) - 1); + tmp[len-3] = LT_EOS_CHAR; + *dest = tmp; + } + else + { + *dest = 0; + } + + return 0; +} + +static int +free_vars (dlname, oldname, libdir, deplibs) + char *dlname; + char *oldname; + char *libdir; + char *deplibs; +{ + LT_DLFREE (dlname); + LT_DLFREE (oldname); + LT_DLFREE (libdir); + LT_DLFREE (deplibs); + + return 0; +} + +static int +try_dlopen (phandle, filename) + lt_dlhandle *phandle; + const char *filename; +{ + const char * ext = 0; + const char * saved_error = 0; + char * canonical = 0; + char * base_name = 0; + char * dir = 0; + char * name = 0; + int errors = 0; + lt_dlhandle newhandle; + + assert (phandle); + assert (*phandle == 0); + + LT_DLMUTEX_GETERROR (saved_error); + + /* dlopen self? */ + if (!filename) + { + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + return 1; + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* lt_dlclose()ing yourself is very bad! Disallow it. */ + LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG); + + if (tryall_dlopen (&newhandle, 0) != 0) + { + LT_DLFREE (*phandle); + return 1; + } + + goto register_handle; + } + + assert (filename && *filename); + + /* Doing this immediately allows internal functions to safely + assume only canonicalized paths are passed. */ + if (canonicalize_path (filename, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + /* If the canonical module name is a path (relative or absolute) + then split it into a directory part and a name part. */ + base_name = strrchr (canonical, '/'); + if (base_name) + { + size_t dirlen = (1+ base_name) - canonical; + + dir = LT_EMALLOC (char, 1+ dirlen); + if (!dir) + { + ++errors; + goto cleanup; + } + + strncpy (dir, canonical, dirlen); + dir[dirlen] = LT_EOS_CHAR; + + ++base_name; + } + else + LT_DLMEM_REASSIGN (base_name, canonical); + + assert (base_name && *base_name); + + /* Check whether we are opening a libtool module (.la extension). */ + ext = strrchr (base_name, '.'); + if (ext && strcmp (ext, archive_ext) == 0) + { + /* this seems to be a libtool module */ + FILE * file = 0; + char * dlname = 0; + char * old_name = 0; + char * libdir = 0; + char * deplibs = 0; + char * line = 0; + size_t line_len; + + /* if we can't find the installed flag, it is probably an + installed libtool archive, produced with an old version + of libtool */ + int installed = 1; + + /* extract the module name from the file name */ + name = LT_EMALLOC (char, ext - base_name + 1); + if (!name) + { + ++errors; + goto cleanup; + } + + /* canonicalize the module name */ + { + size_t i; + for (i = 0; i < ext - base_name; ++i) + { + if (isalnum ((int)(base_name[i]))) + { + name[i] = base_name[i]; + } + else + { + name[i] = '_'; + } + } + name[ext - base_name] = LT_EOS_CHAR; + } + + /* Now try to open the .la file. If there is no directory name + component, try to find it first in user_search_path and then other + prescribed paths. Otherwise (or in any case if the module was not + yet found) try opening just the module name as passed. */ + if (!dir) + { + const char *search_path; + + LT_DLMUTEX_LOCK (); + search_path = user_search_path; + if (search_path) + file = find_file (user_search_path, base_name, &dir); + LT_DLMUTEX_UNLOCK (); + + if (!file) + { + search_path = getenv (LTDL_SEARCHPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!file) + { + search_path = getenv (LTDL_SHLIBPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!file && sys_search_path) + { + file = find_file (sys_search_path, base_name, &dir); + } +#endif + } + if (!file) + { + file = fopen (filename, LT_READTEXT_MODE); + } + + /* If we didn't find the file by now, it really isn't there. Set + the status flag, and bail out. */ + if (!file) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; + goto cleanup; + } + + line_len = LT_FILENAME_MAX; + line = LT_EMALLOC (char, line_len); + if (!line) + { + fclose (file); + ++errors; + goto cleanup; + } + + /* read the .la file */ + while (!feof (file)) + { + if (!fgets (line, (int) line_len, file)) + { + break; + } + + /* Handle the case where we occasionally need to read a line + that is longer than the initial buffer size. */ + while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file))) + { + line = LT_DLREALLOC (char, line, line_len *2); + if (!fgets (&line[line_len -1], (int) line_len +1, file)) + { + break; + } + line_len *= 2; + } + + if (line[0] == '\n' || line[0] == '#') + { + continue; + } + +#undef STR_DLNAME +#define STR_DLNAME "dlname=" + if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) + { + errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]); + } + +#undef STR_OLD_LIBRARY +#define STR_OLD_LIBRARY "old_library=" + else if (strncmp (line, STR_OLD_LIBRARY, + sizeof (STR_OLD_LIBRARY) - 1) == 0) + { + errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); + } +#undef STR_LIBDIR +#define STR_LIBDIR "libdir=" + else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) + { + errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]); + } + +#undef STR_DL_DEPLIBS +#define STR_DL_DEPLIBS "dependency_libs=" + else if (strncmp (line, STR_DL_DEPLIBS, + sizeof (STR_DL_DEPLIBS) - 1) == 0) + { + errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); + } + else if (strcmp (line, "installed=yes\n") == 0) + { + installed = 1; + } + else if (strcmp (line, "installed=no\n") == 0) + { + installed = 0; + } + +#undef STR_LIBRARY_NAMES +#define STR_LIBRARY_NAMES "library_names=" + else if (! dlname && strncmp (line, STR_LIBRARY_NAMES, + sizeof (STR_LIBRARY_NAMES) - 1) == 0) + { + char *last_libname; + errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); + if (!errors + && dlname + && (last_libname = strrchr (dlname, ' ')) != 0) + { + last_libname = lt_estrdup (last_libname + 1); + if (!last_libname) + { + ++errors; + goto cleanup; + } + LT_DLMEM_REASSIGN (dlname, last_libname); + } + } + + if (errors) + break; + } + + fclose (file); + LT_DLFREE (line); + + /* allocate the handle */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + ++errors; + + if (errors) + { + free_vars (dlname, old_name, libdir, deplibs); + LT_DLFREE (*phandle); + goto cleanup; + } + + assert (*phandle); + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + if (load_deplibs (*phandle, deplibs) == 0) + { + newhandle = *phandle; + /* find_module may replace newhandle */ + if (find_module (&newhandle, dir, libdir, dlname, old_name, installed)) + { + unload_deplibs (*phandle); + ++errors; + } + } + else + { + ++errors; + } + + free_vars (dlname, old_name, libdir, deplibs); + if (errors) + { + LT_DLFREE (*phandle); + goto cleanup; + } + + if (*phandle != newhandle) + { + unload_deplibs (*phandle); + } + } + else + { + /* not a libtool module */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + { + ++errors; + goto cleanup; + } + + memset (*phandle, 0, sizeof (struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* If the module has no directory name component, try to find it + first in user_search_path and then other prescribed paths. + Otherwise (or in any case if the module was not yet found) try + opening just the module name as passed. */ + if ((dir || (!find_handle (user_search_path, base_name, &newhandle) + && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, + &newhandle) +#ifdef LTDL_SHLIBPATH_VAR + && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name, + &newhandle) +#endif +#ifdef LTDL_SYSSEARCHPATH + && !find_handle (sys_search_path, base_name, &newhandle) +#endif + ))) + { + if (tryall_dlopen (&newhandle, filename) != 0) + { + newhandle = NULL; + } + } + + if (!newhandle) + { + LT_DLFREE (*phandle); + ++errors; + goto cleanup; + } + } + + register_handle: + LT_DLMEM_REASSIGN (*phandle, newhandle); + + if ((*phandle)->info.ref_count == 0) + { + (*phandle)->info.ref_count = 1; + LT_DLMEM_REASSIGN ((*phandle)->info.name, name); + + LT_DLMUTEX_LOCK (); + (*phandle)->next = handles; + handles = *phandle; + LT_DLMUTEX_UNLOCK (); + } + + LT_DLMUTEX_SETERROR (saved_error); + + cleanup: + LT_DLFREE (dir); + LT_DLFREE (name); + LT_DLFREE (canonical); + + return errors; +} + +lt_dlhandle +lt_dlopen (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + + /* Just incase we missed a code path in try_dlopen() that reports + an error, but forgets to reset handle... */ + if (try_dlopen (&handle, filename) != 0) + return 0; + + return handle; +} + +/* If the last error messge store was `FILE_NOT_FOUND', then return + non-zero. */ +static int +file_not_found () +{ + const char *error = 0; + + LT_DLMUTEX_GETERROR (error); + if (error == LT_DLSTRERROR (FILE_NOT_FOUND)) + return 1; + + return 0; +} + +/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to + open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, + and if a file is still not found try again with SHLIB_EXT appended + instead. */ +lt_dlhandle +lt_dlopenext (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + char * tmp = 0; + char * ext = 0; + size_t len; + int errors = 0; + + if (!filename) + { + return lt_dlopen (filename); + } + + assert (filename); + + len = LT_STRLEN (filename); + ext = strrchr (filename, '.'); + + /* If FILENAME already bears a suitable extension, there is no need + to try appending additional extensions. */ + if (ext && ((strcmp (ext, archive_ext) == 0) +#ifdef LTDL_SHLIB_EXT + || (strcmp (ext, shlib_ext) == 0) +#endif + )) + { + return lt_dlopen (filename); + } + + /* First try appending ARCHIVE_EXT. */ + tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1); + if (!tmp) + return 0; + + strcpy (tmp, filename); + strcat (tmp, archive_ext); + errors = try_dlopen (&handle, tmp); + + /* If we found FILENAME, stop searching -- whether we were able to + load the file as a module or not. If the file exists but loading + failed, it is better to return an error message here than to + report FILE_NOT_FOUND when the alternatives (foo.so etc) are not + in the module search path. */ + if (handle || ((errors > 0) && !file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } + +#ifdef LTDL_SHLIB_EXT + /* Try appending SHLIB_EXT. */ + if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) + { + LT_DLFREE (tmp); + tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1); + if (!tmp) + return 0; + + strcpy (tmp, filename); + } + else + { + tmp[len] = LT_EOS_CHAR; + } + + strcat(tmp, shlib_ext); + errors = try_dlopen (&handle, tmp); + + /* As before, if the file was found but loading failed, return now + with the current error message. */ + if (handle || ((errors > 0) && !file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } +#endif + + /* Still here? Then we really did fail to locate any of the file + names we tried. */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + LT_DLFREE (tmp); + return 0; +} + + +static int +lt_argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + error_t error; + + if ((error = argz_insert (pargz, pargz_len, before, entry))) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + return 1; + } + + return 0; +} + +static int +lt_argz_insertinorder (pargz, pargz_len, entry) + char **pargz; + size_t *pargz_len; + const char *entry; +{ + char *before = 0; + + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + if (*pargz) + while ((before = argz_next (*pargz, *pargz_len, before))) + { + int cmp = strcmp (entry, before); + + if (cmp < 0) break; + if (cmp == 0) return 0; /* No duplicates! */ + } + + return lt_argz_insert (pargz, pargz_len, before, entry); +} + +static int +lt_argz_insertdir (pargz, pargz_len, dirnam, dp) + char **pargz; + size_t *pargz_len; + const char *dirnam; + struct dirent *dp; +{ + char *buf = 0; + size_t buf_len = 0; + char *end = 0; + size_t end_offset = 0; + size_t dir_len = 0; + int errors = 0; + + assert (pargz); + assert (pargz_len); + assert (dp); + + dir_len = LT_STRLEN (dirnam); + end = dp->d_name + LT_D_NAMLEN(dp); + + /* Ignore version numbers. */ + { + char *p; + for (p = end; p -1 > dp->d_name; --p) + if (strchr (".0123456789", p[-1]) == 0) + break; + + if (*p == '.') + end = p; + } + + /* Ignore filename extension. */ + { + char *p; + for (p = end -1; p > dp->d_name; --p) + if (*p == '.') + { + end = p; + break; + } + } + + /* Prepend the directory name. */ + end_offset = end - dp->d_name; + buf_len = dir_len + 1+ end_offset; + buf = LT_EMALLOC (char, 1+ buf_len); + if (!buf) + return ++errors; + + assert (buf); + + strcpy (buf, dirnam); + strcat (buf, "/"); + strncat (buf, dp->d_name, end_offset); + buf[buf_len] = LT_EOS_CHAR; + + /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ + if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) + ++errors; + + LT_DLFREE (buf); + + return errors; +} + +static int +list_files_by_dir (dirnam, pargz, pargz_len) + const char *dirnam; + char **pargz; + size_t *pargz_len; +{ + DIR *dirp = 0; + int errors = 0; + + assert (dirnam && *dirnam); + assert (pargz); + assert (pargz_len); + assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); + + dirp = opendir (dirnam); + if (dirp) + { + struct dirent *dp = 0; + + while ((dp = readdir (dirp))) + if (dp->d_name[0] != '.') + if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) + { + ++errors; + break; + } + + closedir (dirp); + } + else + ++errors; + + return errors; +} + + +/* If there are any files in DIRNAME, call the function passed in + DATA1 (with the name of each file and DATA2 as arguments). */ +static int +foreachfile_callback (dirname, data1, data2) + char *dirname; + lt_ptr data1; + lt_ptr data2; +{ + int (*func) LT_PARAMS((const char *filename, lt_ptr data)) + = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1; + + int is_done = 0; + char *argz = 0; + size_t argz_len = 0; + + if (list_files_by_dir (dirname, &argz, &argz_len) != 0) + goto cleanup; + if (!argz) + goto cleanup; + + { + char *filename = 0; + while ((filename = argz_next (argz, argz_len, filename))) + if ((is_done = (*func) (filename, data2))) + break; + } + + cleanup: + LT_DLFREE (argz); + + return is_done; +} + + +/* Call FUNC for each unique extensionless file in SEARCH_PATH, along + with DATA. The filenames passed to FUNC would be suitable for + passing to lt_dlopenext. The extensions are stripped so that + individual modules do not generate several entries (e.g. libfoo.la, + libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, + then the same directories that lt_dlopen would search are examined. */ +int +lt_dlforeachfile (search_path, func, data) + const char *search_path; + int (*func) LT_PARAMS ((const char *filename, lt_ptr data)); + lt_ptr data; +{ + int is_done = 0; + + if (search_path) + { + /* If a specific path was passed, search only the directories + listed in it. */ + is_done = foreach_dirinpath (search_path, 0, + foreachfile_callback, func, data); + } + else + { + /* Otherwise search the default paths. */ + is_done = foreach_dirinpath (user_search_path, 0, + foreachfile_callback, func, data); + if (!is_done) + { + is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0, + foreachfile_callback, func, data); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0, + foreachfile_callback, func, data); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0, + foreachfile_callback, func, data); + } +#endif + } + + return is_done; +} + +int +lt_dlclose (handle) + lt_dlhandle handle; +{ + lt_dlhandle cur, last; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* check whether the handle is valid */ + last = cur = handles; + while (cur && handle != cur) + { + last = cur; + cur = cur->next; + } + + if (!cur) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + goto done; + } + + handle->info.ref_count--; + + /* Note that even with resident modules, we must track the ref_count + correctly incase the user decides to reset the residency flag + later (even though the API makes no provision for that at the + moment). */ + if (handle->info.ref_count <= 0 && !LT_DLIS_RESIDENT (handle)) + { + lt_user_data data = handle->loader->dlloader_data; + + if (handle != handles) + { + last->next = handle->next; + } + else + { + handles = handle->next; + } + + errors += handle->loader->module_close (data, handle->module); + errors += unload_deplibs(handle); + + /* It is up to the callers to free the data itself. */ + LT_DLFREE (handle->caller_data); + + LT_DLFREE (handle->info.filename); + LT_DLFREE (handle->info.name); + LT_DLFREE (handle); + + goto done; + } + + if (LT_DLIS_RESIDENT (handle)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE)); + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_ptr +lt_dlsym (handle, symbol) + lt_dlhandle handle; + const char *symbol; +{ + size_t lensym; + char lsym[LT_SYMBOL_LENGTH]; + char *sym; + lt_ptr address; + lt_user_data data; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + if (!symbol) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + return 0; + } + + lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix) + + LT_STRLEN (handle->info.name); + + if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) + { + sym = lsym; + } + else + { + sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); + if (!sym) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); + return 0; + } + } + + data = handle->loader->dlloader_data; + if (handle->info.name) + { + const char *saved_error; + + LT_DLMUTEX_GETERROR (saved_error); + + /* this is a libtool module */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, handle->info.name); + } + else + { + strcpy(sym, handle->info.name); + } + + strcat(sym, "_LTX_"); + strcat(sym, symbol); + + /* try "modulename_LTX_symbol" */ + address = handle->loader->find_sym (data, handle->module, sym); + if (address) + { + if (sym != lsym) + { + LT_DLFREE (sym); + } + return address; + } + LT_DLMUTEX_SETERROR (saved_error); + } + + /* otherwise try "symbol" */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, symbol); + } + else + { + strcpy(sym, symbol); + } + + address = handle->loader->find_sym (data, handle->module, sym); + if (sym != lsym) + { + LT_DLFREE (sym); + } + + return address; +} + +const char * +lt_dlerror () +{ + const char *error; + + LT_DLMUTEX_GETERROR (error); + LT_DLMUTEX_SETERROR (0); + + return error ? error : NULL; +} + +static int +lt_dlpath_insertdir (ppath, before, dir) + char **ppath; + char *before; + const char *dir; +{ + int errors = 0; + char *canonical = 0; + char *argz = 0; + size_t argz_len = 0; + + assert (ppath); + assert (dir && *dir); + + if (canonicalize_path (dir, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + assert (canonical && *canonical); + + /* If *PPATH is empty, set it to DIR. */ + if (*ppath == 0) + { + assert (!before); /* BEFORE cannot be set without PPATH. */ + assert (dir); /* Without DIR, don't call this function! */ + + *ppath = lt_estrdup (dir); + if (*ppath == 0) + ++errors; + + return errors; + } + + assert (ppath && *ppath); + + if (argzize_path (*ppath, &argz, &argz_len) != 0) + { + ++errors; + goto cleanup; + } + + /* Convert BEFORE into an equivalent offset into ARGZ. This only works + if *PPATH is already canonicalized, and hence does not change length + with respect to ARGZ. We canonicalize each entry as it is added to + the search path, and don't call this function with (uncanonicalized) + user paths, so this is a fair assumption. */ + if (before) + { + assert (*ppath <= before); + assert (before - *ppath <= strlen (*ppath)); + + before = before - *ppath + argz; + } + + if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) + { + ++errors; + goto cleanup; + } + + argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); + LT_DLMEM_REASSIGN (*ppath, argz); + + cleanup: + LT_DLFREE (canonical); + LT_DLFREE (argz); + + return errors; +} + +int +lt_dladdsearchdir (search_dir) + const char *search_dir; +{ + int errors = 0; + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlinsertsearchdir (before, search_dir) + const char *before; + const char *search_dir; +{ + int errors = 0; + + if (before) + { + LT_DLMUTEX_LOCK (); + if ((before < user_search_path) + || (before >= user_search_path + LT_STRLEN (user_search_path))) + { + LT_DLMUTEX_UNLOCK (); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION)); + return 1; + } + LT_DLMUTEX_UNLOCK (); + } + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, + (char *) before, search_dir) != 0) + { + ++errors; + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlsetsearchpath (search_path) + const char *search_path; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + LT_DLFREE (user_search_path); + LT_DLMUTEX_UNLOCK (); + + if (!search_path || !LT_STRLEN (search_path)) + { + return errors; + } + + LT_DLMUTEX_LOCK (); + if (canonicalize_path (search_path, &user_search_path) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +const char * +lt_dlgetsearchpath () +{ + const char *saved_path; + + LT_DLMUTEX_LOCK (); + saved_path = user_search_path; + LT_DLMUTEX_UNLOCK (); + + return saved_path; +} + +int +lt_dlmakeresident (handle) + lt_dlhandle handle; +{ + int errors = 0; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + } + else + { + LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG); + } + + return errors; +} + +int +lt_dlisresident (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return -1; + } + + return LT_DLIS_RESIDENT (handle); +} + + + + +/* --- MODULE INFORMATION --- */ + +const lt_dlinfo * +lt_dlgetinfo (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + return &(handle->info); +} + +lt_dlhandle +lt_dlhandle_next (place) + lt_dlhandle place; +{ + return place ? place->next : handles; +} + +int +lt_dlforeach (func, data) + int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data)); + lt_ptr data; +{ + int errors = 0; + lt_dlhandle cur; + + LT_DLMUTEX_LOCK (); + + cur = handles; + while (cur) + { + lt_dlhandle tmp = cur; + + cur = cur->next; + if ((*func) (tmp, data)) + { + ++errors; + break; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlcaller_id +lt_dlcaller_register () +{ + static lt_dlcaller_id last_caller_id = 0; + int result; + + LT_DLMUTEX_LOCK (); + result = ++last_caller_id; + LT_DLMUTEX_UNLOCK (); + + return result; +} + +lt_ptr +lt_dlcaller_set_data (key, handle, data) + lt_dlcaller_id key; + lt_dlhandle handle; + lt_ptr data; +{ + int n_elements = 0; + lt_ptr stale = (lt_ptr) 0; + int i; + + /* This needs to be locked so that the caller data can be updated + simultaneously by different threads. */ + LT_DLMUTEX_LOCK (); + + if (handle->caller_data) + while (handle->caller_data[n_elements].key) + ++n_elements; + + for (i = 0; i < n_elements; ++i) + { + if (handle->caller_data[i].key == key) + { + stale = handle->caller_data[i].data; + break; + } + } + + /* Ensure that there is enough room in this handle's caller_data + array to accept a new element (and an empty end marker). */ + if (i == n_elements) + { + lt_caller_data *temp + = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements); + + if (!temp) + { + stale = 0; + goto done; + } + + handle->caller_data = temp; + + /* We only need this if we needed to allocate a new caller_data. */ + handle->caller_data[i].key = key; + handle->caller_data[1+ i].key = 0; + } + + handle->caller_data[i].data = data; + + done: + LT_DLMUTEX_UNLOCK (); + + return stale; +} + +lt_ptr +lt_dlcaller_get_data (key, handle) + lt_dlcaller_id key; + lt_dlhandle handle; +{ + lt_ptr result = (lt_ptr) 0; + + /* This needs to be locked so that the caller data isn't updated by + another thread part way through this function. */ + LT_DLMUTEX_LOCK (); + + /* Locate the index of the element with a matching KEY. */ + { + int i; + for (i = 0; handle->caller_data[i].key; ++i) + { + if (handle->caller_data[i].key == key) + { + result = handle->caller_data[i].data; + break; + } + } + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + + + +/* --- USER MODULE LOADER API --- */ + + +int +lt_dlloader_add (place, dlloader, loader_name) + lt_dlloader *place; + const struct lt_user_dlloader *dlloader; + const char *loader_name; +{ + int errors = 0; + lt_dlloader *node = 0, *ptr = 0; + + if ((dlloader == 0) /* diagnose null parameters */ + || (dlloader->module_open == 0) + || (dlloader->module_close == 0) + || (dlloader->find_sym == 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + /* Create a new dlloader node with copies of the user callbacks. */ + node = LT_EMALLOC (lt_dlloader, 1); + if (!node) + return 1; + + node->next = 0; + node->loader_name = loader_name; + node->sym_prefix = dlloader->sym_prefix; + node->dlloader_exit = dlloader->dlloader_exit; + node->module_open = dlloader->module_open; + node->module_close = dlloader->module_close; + node->find_sym = dlloader->find_sym; + node->dlloader_data = dlloader->dlloader_data; + + LT_DLMUTEX_LOCK (); + if (!loaders) + { + /* If there are no loaders, NODE becomes the list! */ + loaders = node; + } + else if (!place) + { + /* If PLACE is not set, add NODE to the end of the + LOADERS list. */ + for (ptr = loaders; ptr->next; ptr = ptr->next) + { + /*NOWORK*/; + } + + ptr->next = node; + } + else if (loaders == place) + { + /* If PLACE is the first loader, NODE goes first. */ + node->next = place; + loaders = node; + } + else + { + /* Find the node immediately preceding PLACE. */ + for (ptr = loaders; ptr->next != place; ptr = ptr->next) + { + /*NOWORK*/; + } + + if (ptr->next != place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + ++errors; + } + else + { + /* Insert NODE between PTR and PLACE. */ + node->next = place; + ptr->next = node; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlloader_remove (loader_name) + const char *loader_name; +{ + lt_dlloader *place = lt_dlloader_find (loader_name); + lt_dlhandle handle; + int errors = 0; + + if (!place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + LT_DLMUTEX_LOCK (); + + /* Fail if there are any open modules which use this loader. */ + for (handle = handles; handle; handle = handle->next) + { + if (handle->loader == place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER)); + ++errors; + goto done; + } + } + + if (place == loaders) + { + /* PLACE is the first loader in the list. */ + loaders = loaders->next; + } + else + { + /* Find the loader before the one being removed. */ + lt_dlloader *prev; + for (prev = loaders; prev->next; prev = prev->next) + { + if (!strcmp (prev->next->loader_name, loader_name)) + { + break; + } + } + + place = prev->next; + prev->next = prev->next->next; + } + + if (place->dlloader_exit) + { + errors = place->dlloader_exit (place->dlloader_data); + } + + LT_DLFREE (place); + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlloader * +lt_dlloader_next (place) + lt_dlloader *place; +{ + lt_dlloader *next; + + LT_DLMUTEX_LOCK (); + next = place ? place->next : loaders; + LT_DLMUTEX_UNLOCK (); + + return next; +} + +const char * +lt_dlloader_name (place) + lt_dlloader *place; +{ + const char *name = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + name = place ? place->loader_name : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return name; +} + +lt_user_data * +lt_dlloader_data (place) + lt_dlloader *place; +{ + lt_user_data *data = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + data = place ? &(place->dlloader_data) : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return data; +} + +lt_dlloader * +lt_dlloader_find (loader_name) + const char *loader_name; +{ + lt_dlloader *place = 0; + + LT_DLMUTEX_LOCK (); + for (place = loaders; place; place = place->next) + { + if (strcmp (place->loader_name, loader_name) == 0) + { + break; + } + } + LT_DLMUTEX_UNLOCK (); + + return place; +} diff --git a/src/win32/generated_source/mca_base_parse_paramfile_lex.c b/src/win32/generated_source/mca_base_parse_paramfile_lex.c new file mode 100644 index 0000000000..dbfc8cd718 --- /dev/null +++ b/src/win32/generated_source/mca_base_parse_paramfile_lex.c @@ -0,0 +1,1651 @@ +#define yy_create_buffer mca_base_yy_create_buffer +#define yy_delete_buffer mca_base_yy_delete_buffer +#define yy_scan_buffer mca_base_yy_scan_buffer +#define yy_scan_string mca_base_yy_scan_string +#define yy_scan_bytes mca_base_yy_scan_bytes +#define yy_flex_debug mca_base_yy_flex_debug +#define yy_init_buffer mca_base_yy_init_buffer +#define yy_flush_buffer mca_base_yy_flush_buffer +#define yy_load_buffer_state mca_base_yy_load_buffer_state +#define yy_switch_to_buffer mca_base_yy_switch_to_buffer +#define yyin mca_base_yyin +#define yyleng mca_base_yyleng +#define yylex mca_base_yylex +#define yyout mca_base_yyout +#define yyrestart mca_base_yyrestart +#define yytext mca_base_yytext +#define yywrap mca_base_yywrap + +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 9 +#define YY_END_OF_BUFFER 10 +static yyconst short int yy_acclist[36] = + { 0, + 10, 8, 9, 4, 8, 9, 1, 9, 8, 9, + 5, 8, 9, 3, 8, 9, 9,16391, 9, 6, + 9, 9,16391, 4, 1, 3, 2, 5, 3,16391, + 8199, 6,16391, 6, 8199 + } ; + +static yyconst short int yy_accept[33] = + { 0, + 1, 1, 1, 1, 1, 2, 4, 7, 9, 11, + 14, 17, 19, 20, 22, 24, 25, 26, 27, 27, + 28, 29, 30, 31, 31, 32, 32, 33, 34, 34, + 36, 36 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 6, 6, 1, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, + 7, 1, 1, 1, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 1, 1, 1, 1, 6, 1, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[8] = + { 0, + 1, 2, 1, 2, 1, 1, 1 + } ; + +static yyconst short int yy_base[35] = + { 0, + 0, 0, 7, 0, 37, 38, 13, 38, 33, 29, + 0, 19, 21, 38, 24, 0, 38, 0, 31, 38, + 13, 0, 26, 0, 38, 0, 38, 0, 0, 38, + 38, 29, 16, 31 + } ; + +static yyconst short int yy_def[35] = + { 0, + 31, 1, 31, 3, 31, 31, 31, 31, 32, 31, + 33, 34, 34, 31, 13, 7, 31, 33, 32, 31, + 31, 33, 34, 23, 31, 13, 31, 15, 15, 31, + 0, 31, 31, 31 + } ; + +static yyconst short int yy_nxt[46] = + { 0, + 6, 7, 8, 7, 9, 10, 11, 12, 13, 14, + 15, 12, 12, 12, 16, 17, 16, 22, 21, 18, + 24, 25, 26, 27, 28, 29, 30, 24, 25, 19, + 19, 23, 23, 20, 21, 20, 31, 5, 31, 31, + 31, 31, 31, 31, 31 + } ; + +static yyconst short int yy_chk[46] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, + 3, 3, 3, 3, 7, 7, 7, 33, 21, 7, + 12, 12, 13, 13, 13, 15, 15, 23, 23, 32, + 32, 34, 34, 19, 10, 9, 5, 31, 31, 31, + 31, 31, 31, 31, 31 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +static int yy_looking_for_trail_begin = 0; +static int yy_full_lp; +static int *yy_full_state; +#define YY_TRAILING_MASK 0x2000 +#define YY_TRAILING_HEAD_MASK 0x4000 +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ +yy_state_ptr = yy_full_state; /* restore orig. state */ \ +yy_current_state = *yy_state_ptr; /* restore curr. state */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "mca_base_parse_paramfile_lex.l" +#define INITIAL 0 +#line 2 "mca_base_parse_paramfile_lex.l" + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "mca/base/mca_base_parse_paramfile_lex.h" + +/* + * local functions + */ +static int finish_parsing(void) ; +static int mca_base_yywrap(void); + +/* + * global variables + */ +int mca_base_yynewlines = 1; +bool mca_base_parse_done = false; +char *mca_base_string = NULL; + +#define yyterminate() \ + return finish_parsing() + +#define VALUE 1 + +#line 444 "mca_base_parse_paramfile_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; + +#line 31 "mca_base_parse_paramfile_lex.l" + + +#line 598 "mca_base_parse_paramfile_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 32 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 38 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + yy_looking_for_trail_begin ) + { + if ( yy_act == yy_looking_for_trail_begin ) + { + yy_looking_for_trail_begin = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; + yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; + } + else + { + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + break; + } + ++yy_lp; + goto find_rule; + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 33 "mca_base_parse_paramfile_lex.l" +{ mca_base_yynewlines++; return MCA_BASE_PARSE_NEWLINE; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 34 "mca_base_parse_paramfile_lex.l" +{ mca_base_yynewlines++; return MCA_BASE_PARSE_NEWLINE; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 36 "mca_base_parse_paramfile_lex.l" +{ BEGIN(VALUE); return MCA_BASE_PARSE_EQUAL; } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 37 "mca_base_parse_paramfile_lex.l" +; /* whitespace */ + YY_BREAK +case 5: +YY_RULE_SETUP +#line 38 "mca_base_parse_paramfile_lex.l" +{ return MCA_BASE_PARSE_SINGLE_WORD; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 40 "mca_base_parse_paramfile_lex.l" +{ BEGIN(INITIAL); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 41 "mca_base_parse_paramfile_lex.l" +{ return MCA_BASE_PARSE_VALUE; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 43 "mca_base_parse_paramfile_lex.l" +{ return MCA_BASE_PARSE_ERROR; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 45 "mca_base_parse_paramfile_lex.l" +ECHO; + YY_BREAK +#line 747 "mca_base_parse_paramfile_lex.c" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(VALUE): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 32 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 32 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 31); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 45 "mca_base_parse_paramfile_lex.l" + + + +/* + * This cleans up at the end of the parse (since, in this case, we + * always parse the entire file) and prevents a memory leak. + */ +static int finish_parsing(void) +{ + if (NULL != YY_CURRENT_BUFFER) { + yy_delete_buffer(YY_CURRENT_BUFFER); +#if defined(YY_CURRENT_BUFFER_LVALUE) + YY_CURRENT_BUFFER_LVALUE = NULL; +#else + YY_CURRENT_BUFFER = NULL; +#endif /* YY_CURRENT_BUFFER_LVALUE */ + } + return YY_NULL; +} + +static int mca_base_yywrap(void) +{ + mca_base_parse_done = true; + return 1; +} diff --git a/src/win32/generated_source/show_help_lex.c b/src/win32/generated_source/show_help_lex.c new file mode 100644 index 0000000000..7040e379ec --- /dev/null +++ b/src/win32/generated_source/show_help_lex.c @@ -0,0 +1,1645 @@ +#define yy_create_buffer ompi_show_help_yy_create_buffer +#define yy_delete_buffer ompi_show_help_yy_delete_buffer +#define yy_scan_buffer ompi_show_help_yy_scan_buffer +#define yy_scan_string ompi_show_help_yy_scan_string +#define yy_scan_bytes ompi_show_help_yy_scan_bytes +#define yy_flex_debug ompi_show_help_yy_flex_debug +#define yy_init_buffer ompi_show_help_yy_init_buffer +#define yy_flush_buffer ompi_show_help_yy_flush_buffer +#define yy_load_buffer_state ompi_show_help_yy_load_buffer_state +#define yy_switch_to_buffer ompi_show_help_yy_switch_to_buffer +#define yyin ompi_show_help_yyin +#define yyleng ompi_show_help_yyleng +#define yylex ompi_show_help_yylex +#define yyout ompi_show_help_yyout +#define yyrestart ompi_show_help_yyrestart +#define yytext ompi_show_help_yytext +#define yywrap ompi_show_help_yywrap + +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef WIN32 +#include "win32/win_compat.h" +#endif + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 5 +#define YY_END_OF_BUFFER 6 +static yyconst short int yy_acclist[18] = + { 0, + 6, 5, 4, 5, 5, 5, 5, 3, 5, 4, + 1, 4, 3,16386, 8194, 4,16386 + } ; + +static yyconst short int yy_accept[25] = + { 0, + 1, 1, 1, 1, 1, 2, 3, 5, 6, 7, + 8, 10, 10, 11, 11, 13, 13, 13, 14, 15, + 15, 17, 18, 18 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 5, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[6] = + { 0, + 1, 1, 1, 1, 1 + } ; + +static yyconst short int yy_base[31] = + { 0, + 0, 3, 28, 27, 28, 25, 31, 24, 23, 22, + 31, 21, 31, 20, 31, 7, 19, 31, 11, 15, + 31, 0, 31, 18, 17, 14, 13, 10, 9, 0 + } ; + +static yyconst short int yy_def[31] = + { 0, + 24, 23, 25, 25, 23, 26, 23, 27, 28, 29, + 23, 26, 23, 27, 23, 28, 29, 23, 30, 30, + 23, 20, 0, 23, 23, 23, 23, 23, 23, 23 + } ; + +static yyconst short int yy_nxt[37] = + { 0, + 20, 7, 8, 6, 7, 8, 9, 6, 13, 17, + 16, 19, 21, 14, 12, 22, 21, 10, 6, 22, + 18, 15, 13, 18, 13, 15, 13, 23, 11, 11, + 5, 23, 23, 23, 23, 23 + } ; + +static yyconst short int yy_chk[37] = + { 0, + 30, 1, 1, 2, 2, 2, 2, 2, 16, 29, + 28, 16, 19, 27, 26, 19, 20, 25, 24, 20, + 17, 14, 12, 10, 9, 8, 6, 5, 4, 3, + 23, 23, 23, 23, 23, 23 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +static int yy_looking_for_trail_begin = 0; +static int yy_full_lp; +static int *yy_full_state; +#define YY_TRAILING_MASK 0x2000 +#define YY_TRAILING_HEAD_MASK 0x4000 +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ +yy_state_ptr = yy_full_state; /* restore orig. state */ \ +yy_current_state = *yy_state_ptr; /* restore curr. state */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "show_help_lex.l" +#define INITIAL 0 +#line 2 "show_help_lex.l" + +#include "ompi_config.h" + +#include + +#if HAVE_UNISTD_H +#include +#endif + +#include "util/show_help_lex.h" + +/* + * public functions + */ +int ompi_show_help_finish_parsing(void); + + +/* + * local functions + */ +static int ompi_show_help_yywrap(void); + +/* + * global variables + */ +int ompi_show_help_yynewlines = 1; +bool ompi_show_help_parse_done = false; +char *ompi_show_help_string = NULL; + +#define yyterminate() \ + return ompi_show_help_finish_parsing() + +#define CHOMP 1 + +#line 444 "show_help_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; + +#line 38 "show_help_lex.l" + + +#line 601 "show_help_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 24 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 31 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + yy_looking_for_trail_begin ) + { + if ( yy_act == yy_looking_for_trail_begin ) + { + yy_looking_for_trail_begin = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; + yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; + } + else + { + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + break; + } + ++yy_lp; + goto find_rule; + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 40 "show_help_lex.l" +; /* comment line */ + YY_BREAK +case 2: +YY_RULE_SETUP +#line 42 "show_help_lex.l" +{ BEGIN(CHOMP); return OMPI_SHOW_HELP_PARSE_TOPIC; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 44 "show_help_lex.l" +{ BEGIN(INITIAL); } + YY_BREAK +case 4: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 46 "show_help_lex.l" +{ BEGIN(CHOMP); return OMPI_SHOW_HELP_PARSE_MESSAGE; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 48 "show_help_lex.l" +ECHO; + YY_BREAK +#line 734 "show_help_lex.c" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(CHOMP): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 24 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 24 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 23); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 48 "show_help_lex.l" + + + +/* + * This cleans up at the end of the parse (since, in this case, we + * always parse the entire file) and prevents a memory leak. + */ +int ompi_show_help_finish_parsing(void) +{ + if (NULL != YY_CURRENT_BUFFER) { + yy_delete_buffer(YY_CURRENT_BUFFER); +#if defined(YY_CURRENT_BUFFER_LVALUE) + YY_CURRENT_BUFFER_LVALUE = NULL; +#else + YY_CURRENT_BUFFER = NULL; +#endif /* YY_CURRENT_BUFFER_LVALUE */ + } + return YY_NULL; +} + +static int ompi_show_help_yywrap(void) +{ + ompi_show_help_parse_done = true; + return 1; +} diff --git a/src/win32/ompi_misc.h b/src/win32/ompi_misc.h new file mode 100644 index 0000000000..49bffb4727 --- /dev/null +++ b/src/win32/ompi_misc.h @@ -0,0 +1,40 @@ +/* +$HEADER$ +*/ + +#ifndef OMPI_MISC_H +#define OMPI_MISC_H + +#define _SC_PAGESIZE 0 + +static __inline int setenv (const char *name, const char *value, int rewrite) { + + /* just push it back to the windows thingy */ + int ret = SetEnvironmentVariable (name, value); + return (0 != ret)? 1: 0; +} + +static __inline unsigned int sleep(unsigned int seconds) { + + /* microsoft sleep is in milliseconds. Note: interrupt beaviour has + not yet been handled */ + Sleep(seconds * 100); + return 0; +} + +/* this function can currently ONLY return the page size. for it to + do the entire sysconf range it needs to beb extended */ +static __inline size_t sysconf(int option) { + + SYSTEM_INFO sys_info; + + GetSystemInfo(&sys_info); + if (_SC_PAGESIZE == option){ + return (size_t)sys_info.dwPageSize; + } + else { + abort(); + } +} + +#endif /* OMPI_MISC_H */ diff --git a/src/win32/ompi_time.h b/src/win32/ompi_time.h index 1523985d6e..1065dfe393 100644 --- a/src/win32/ompi_time.h +++ b/src/win32/ompi_time.h @@ -6,9 +6,9 @@ $HEADER$ #define OMPI_TIME_H #ifdef WIN32 -# define WIN32_LEAN_AND_MEAN -# include -# undef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#include +#undef WIN32_LEAN_AND_MEAN #endif #define DST_NONE 0 /* not on dst */ @@ -23,64 +23,92 @@ $HEADER$ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; -# define TIMESPEC_TO_TIMEVAL(tv, ts) \ +#define TIMESPEC_TO_TIMEVAL(tv, ts) \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; /* some more utility functions */ /* Operations on timevals. */ +#ifndef timerclear #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 +#endif + +#ifndef timerisset #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#endif + +#ifndef timercmp #define timercmp(tvp, uvp, cmp) \ -(((tvp)->tv_sec == (uvp)->tv_sec) ? \ -((tvp)->tv_usec cmp (uvp)->tv_usec) : \ -((tvp)->tv_sec cmp (uvp)->tv_sec)) + (((tvp)->tv_sec == (uvp)->tv_sec) ? \ + ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ + ((tvp)->tv_sec cmp (uvp)->tv_sec)) +#endif + +#ifndef timeradd #define timeradd(tvp, uvp, vvp) \ -do { \ -(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ -(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ -if ((vvp)->tv_usec >= 1000000) { \ -(vvp)->tv_sec++; \ -(vvp)->tv_usec -= 1000000; \ -} \ -} while (0) + do { \ + (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ + if ((vvp)->tv_usec >= 1000000) { \ + (vvp)->tv_sec++; \ + (vvp)->tv_usec -= 1000000; \ + } \ + } while (0) +#endif + +#ifndef timersub #define timersub(tvp, uvp, vvp) \ -do { \ -(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ -(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ -if ((vvp)->tv_usec < 0) { \ -(vvp)->tv_sec--; \ -(vvp)->tv_usec += 1000000; \ -} \ -} while (0) + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) +#endif /* Operations on timespecs. */ -#define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0 -#define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec) -#define timespeccmp(tsp, usp, cmp) \ -(((tsp)->tv_sec == (usp)->tv_sec) ? \ -((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ -((tsp)->tv_sec cmp (usp)->tv_sec)) -#define timespecadd(tsp, usp, vsp) \ -do { \ -(vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \ -(vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ -if ((vsp)->tv_nsec >= 1000000000L) { \ -(vsp)->tv_sec++; \ -(vsp)->tv_nsec -= 1000000000L; \ -} \ -} while (0) -#define timespecsub(tsp, usp, vsp) \ -do { \ -(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ -(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ -if ((vsp)->tv_nsec < 0) { \ -(vsp)->tv_sec--; \ -(vsp)->tv_nsec += 1000000000L; \ -} \ -} while (0) +#ifndef timespecclear +#define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0 +#endif + +#ifndef timespecisset +#define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec) +#endif + +#ifndef timespeccmp +#define timespeccmp(tsp, usp, cmp) \ + (((tsp)->tv_sec == (usp)->tv_sec) ? \ + ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ + ((tsp)->tv_sec cmp (usp)->tv_sec)) +#endif + +#ifndef timespecadd +#define timespecadd(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ + if ((vsp)->tv_nsec >= 1000000000L) { \ + (vsp)->tv_sec++; \ + (vsp)->tv_nsec -= 1000000000L; \ + } \ + } while (0) +#endif + +#ifndef timespecsub +#define timespecsub(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ + if ((vsp)->tv_nsec < 0) { \ + (vsp)->tv_sec--; \ + (vsp)->tv_nsec += 1000000000L; \ + } \ + } while (0) +#endif /* * Names of the interval timers, and structure diff --git a/src/win32/ompi_util.h b/src/win32/ompi_util.h index f9b12a8114..022b7d359f 100644 --- a/src/win32/ompi_util.h +++ b/src/win32/ompi_util.h @@ -27,11 +27,6 @@ static __inline char *basename(char *path) { return NULL; } -static __inline int strcasecmp(char *s1, char *s2) { - - return strncasecmp (s1, s2, strlen(s1)); -} - static __inline int strncasecmp (char *s1, char *s2, int n) { int ret; @@ -46,5 +41,11 @@ static __inline int strncasecmp (char *s1, char *s2, int n) { return ret; } + +static __inline int strcasecmp(char *s1, char *s2) { + + return strncasecmp (s1, s2, (int)strlen(s1)); +} + #endif diff --git a/src/win32/win_compat.h b/src/win32/win_compat.h index 8eb6e1e8e3..0619880295 100644 --- a/src/win32/win_compat.h +++ b/src/win32/win_compat.h @@ -11,8 +11,9 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN -# include +#include #undef WIN32_LEAN_AND_MEAN +#endif /* other utility header files */ #include @@ -33,17 +34,25 @@ #include "win32/ompi_time.h" #include "win32/ompi_utsname.h" #include "win32/ompi_util.h" +#include "win32/ompi_misc.h" #define MAXPATHLEN MAX_PATH #define MAXHOSTNAMELEN MAX_PATH typedef unsigned short mode_t; -typedef unsigned long size_t; typedef long ssize_t; -#define OMPI_WINDOWS /* Anju: some random #defines which I know offhand, but need to configure it */ #define OMPI_ALIGNMENT_CXX_BOOL OMPI_ALIGNMENT_INT #define SIZEOF_BOOL SIZEOF_INT #define __func__ __FUNCTION__ - + +#ifdef OMPI_BUILDING_LIBRARY +#define OMPI_DECLSPEC __declspec(dllexport) +#else +#define OMPI_DECLSPEC __declspec(dllimport) +#endif +#define OMPI_COMP_EXPORT __declspec(dllexport) +#define OMPI_WINDOWS +#define UINT32_MAX _UI32_MAX + #endif /* compat */ diff --git a/vcproj/bootproxy/bootproxy.vcproj b/vcproj/bootproxy/bootproxy.vcproj new file mode 100755 index 0000000000..dfd9bce4a5 --- /dev/null +++ b/vcproj/bootproxy/bootproxy.vcproj @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/console/console.vcproj b/vcproj/console/console.vcproj new file mode 100755 index 0000000000..1bd05ad25a --- /dev/null +++ b/vcproj/console/console.vcproj @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/mpic++/mpic++.vcproj b/vcproj/mpic++/mpic++.vcproj new file mode 100755 index 0000000000..eef37e73e1 --- /dev/null +++ b/vcproj/mpic++/mpic++.vcproj @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/mpiexec/mpiexec.vcproj b/vcproj/mpiexec/mpiexec.vcproj new file mode 100755 index 0000000000..2af2fc1948 --- /dev/null +++ b/vcproj/mpiexec/mpiexec.vcproj @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/mpif77/mpif77.vcproj b/vcproj/mpif77/mpif77.vcproj new file mode 100755 index 0000000000..3d7ecceead --- /dev/null +++ b/vcproj/mpif77/mpif77.vcproj @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/mpif90/mpif90.vcproj b/vcproj/mpif90/mpif90.vcproj new file mode 100755 index 0000000000..57cd0b1ee6 --- /dev/null +++ b/vcproj/mpif90/mpif90.vcproj @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/mpirun/mpirun.vcproj b/vcproj/mpirun/mpirun.vcproj new file mode 100755 index 0000000000..4ec2cad28a --- /dev/null +++ b/vcproj/mpirun/mpirun.vcproj @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/ompi/ompi.sln b/vcproj/ompi/ompi.sln new file mode 100755 index 0000000000..e08a9f7bfa --- /dev/null +++ b/vcproj/ompi/ompi.sln @@ -0,0 +1,98 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ompi", "ompi.vcproj", "{238533E7-2436-41CC-A421-714EE5618358}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ompi_info", "..\ompi_info\ompi_info.vcproj", "{D5F390E0-27B2-4263-ABD0-8491779E0241}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpirun", "..\mpirun\mpirun.vcproj", "{730DDDE1-2DD6-4F12-863F-830E738E66DE}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpiexec", "..\mpiexec\mpiexec.vcproj", "{F3CEDF64-5654-422D-BDE7-5FDD0E260378}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpicc", "..\wrappers\wrappers.vcproj", "{25FE01B5-434E-47AF-B1F5-27FCE66AC9F6}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpic++", "..\mpic++\mpic++.vcproj", "{0CA568F8-FEC1-4443-8B38-F0CC68CDE438}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpif77", "..\mpif77\mpif77.vcproj", "{548BE921-9BCF-4BBC-98A0-9036AA933047}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpif90", "..\mpif90\mpif90.vcproj", "{C174443B-D59D-4CDD-AADF-B517D0318CB3}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bootproxy", "..\bootproxy\bootproxy.vcproj", "{E861C550-215E-4071-9846-27D392FFC8B2}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "console", "..\console\console.vcproj", "{7424D14E-7523-4BC7-A4A8-5509C2F51D01}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ompid", "..\ompid\ompid.vcproj", "{D6F8183F-75BE-4F15-86E9-CC6C96E0B44B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openmpi", "..\openmpi\openmpi.vcproj", "{00041BD4-5225-4A91-9FD1-CF0F2B32AB4C}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {238533E7-2436-41CC-A421-714EE5618358}.Debug.ActiveCfg = Debug|Win32 + {238533E7-2436-41CC-A421-714EE5618358}.Debug.Build.0 = Debug|Win32 + {238533E7-2436-41CC-A421-714EE5618358}.Release.ActiveCfg = Release|Win32 + {238533E7-2436-41CC-A421-714EE5618358}.Release.Build.0 = Release|Win32 + {D5F390E0-27B2-4263-ABD0-8491779E0241}.Debug.ActiveCfg = Debug|Win32 + {D5F390E0-27B2-4263-ABD0-8491779E0241}.Release.ActiveCfg = Release|Win32 + {D5F390E0-27B2-4263-ABD0-8491779E0241}.Release.Build.0 = Release|Win32 + {730DDDE1-2DD6-4F12-863F-830E738E66DE}.Debug.ActiveCfg = Debug|Win32 + {730DDDE1-2DD6-4F12-863F-830E738E66DE}.Release.ActiveCfg = Release|Win32 + {730DDDE1-2DD6-4F12-863F-830E738E66DE}.Release.Build.0 = Release|Win32 + {F3CEDF64-5654-422D-BDE7-5FDD0E260378}.Debug.ActiveCfg = Debug|Win32 + {F3CEDF64-5654-422D-BDE7-5FDD0E260378}.Release.ActiveCfg = Release|Win32 + {F3CEDF64-5654-422D-BDE7-5FDD0E260378}.Release.Build.0 = Release|Win32 + {25FE01B5-434E-47AF-B1F5-27FCE66AC9F6}.Debug.ActiveCfg = Debug|Win32 + {25FE01B5-434E-47AF-B1F5-27FCE66AC9F6}.Release.ActiveCfg = Release|Win32 + {25FE01B5-434E-47AF-B1F5-27FCE66AC9F6}.Release.Build.0 = Release|Win32 + {0CA568F8-FEC1-4443-8B38-F0CC68CDE438}.Debug.ActiveCfg = Debug|Win32 + {0CA568F8-FEC1-4443-8B38-F0CC68CDE438}.Release.ActiveCfg = Release|Win32 + {0CA568F8-FEC1-4443-8B38-F0CC68CDE438}.Release.Build.0 = Release|Win32 + {548BE921-9BCF-4BBC-98A0-9036AA933047}.Debug.ActiveCfg = Debug|Win32 + {548BE921-9BCF-4BBC-98A0-9036AA933047}.Release.ActiveCfg = Release|Win32 + {548BE921-9BCF-4BBC-98A0-9036AA933047}.Release.Build.0 = Release|Win32 + {C174443B-D59D-4CDD-AADF-B517D0318CB3}.Debug.ActiveCfg = Debug|Win32 + {C174443B-D59D-4CDD-AADF-B517D0318CB3}.Release.ActiveCfg = Release|Win32 + {C174443B-D59D-4CDD-AADF-B517D0318CB3}.Release.Build.0 = Release|Win32 + {E861C550-215E-4071-9846-27D392FFC8B2}.Debug.ActiveCfg = Debug|Win32 + {E861C550-215E-4071-9846-27D392FFC8B2}.Release.ActiveCfg = Release|Win32 + {E861C550-215E-4071-9846-27D392FFC8B2}.Release.Build.0 = Release|Win32 + {7424D14E-7523-4BC7-A4A8-5509C2F51D01}.Debug.ActiveCfg = Debug|Win32 + {7424D14E-7523-4BC7-A4A8-5509C2F51D01}.Release.ActiveCfg = Release|Win32 + {7424D14E-7523-4BC7-A4A8-5509C2F51D01}.Release.Build.0 = Release|Win32 + {D6F8183F-75BE-4F15-86E9-CC6C96E0B44B}.Debug.ActiveCfg = Debug|Win32 + {D6F8183F-75BE-4F15-86E9-CC6C96E0B44B}.Release.ActiveCfg = Release|Win32 + {D6F8183F-75BE-4F15-86E9-CC6C96E0B44B}.Release.Build.0 = Release|Win32 + {00041BD4-5225-4A91-9FD1-CF0F2B32AB4C}.Debug.ActiveCfg = Debug|Win32 + {00041BD4-5225-4A91-9FD1-CF0F2B32AB4C}.Release.ActiveCfg = Release|Win32 + {00041BD4-5225-4A91-9FD1-CF0F2B32AB4C}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/vcproj/ompi/ompi.vcproj b/vcproj/ompi/ompi.vcproj new file mode 100755 index 0000000000..ce94f015ab --- /dev/null +++ b/vcproj/ompi/ompi.vcproj @@ -0,0 +1,2415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/ompi_info/ompi_info.vcproj b/vcproj/ompi_info/ompi_info.vcproj new file mode 100755 index 0000000000..f044e3adcf --- /dev/null +++ b/vcproj/ompi_info/ompi_info.vcproj @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/ompid/ompid.vcproj b/vcproj/ompid/ompid.vcproj new file mode 100755 index 0000000000..45fc7f8841 --- /dev/null +++ b/vcproj/ompid/ompid.vcproj @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/openmpi/openmpi.vcproj b/vcproj/openmpi/openmpi.vcproj new file mode 100755 index 0000000000..455d526372 --- /dev/null +++ b/vcproj/openmpi/openmpi.vcproj @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/wrappers/wrappers.vcproj b/vcproj/wrappers/wrappers.vcproj new file mode 100755 index 0000000000..b06f154203 --- /dev/null +++ b/vcproj/wrappers/wrappers.vcproj @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win_examples/export/hello.c b/win_examples/export/hello.c new file mode 100644 index 0000000000..473cdc5985 --- /dev/null +++ b/win_examples/export/hello.c @@ -0,0 +1,15 @@ +#include "hello.h" +#include + +int hello(void); +int hell(void); + +hello_t anju = {hello, hell}; +bool aaa = true; + +static int hello(void) { + return printf("Hello World\n"); +} +static int hell(void) { + return printf("Hell with you World\n"); +} diff --git a/win_examples/export/hello.h b/win_examples/export/hello.h new file mode 100644 index 0000000000..2078c72ce1 --- /dev/null +++ b/win_examples/export/hello.h @@ -0,0 +1,35 @@ +#ifndef HELLO_H +#define HELLO_H + +#if !(defined(__cplusplus) || defined(c_plusplus)) +typedef enum {false, true} bool; +#endif + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +typedef int (*one_fn)(void); +typedef int (*two_fn)(void); + + +struct hello_t { + one_fn i; + two_fn j; +}; +typedef struct hello_t hello_t; + + +#ifdef EXPORTING + __declspec(dllexport) extern hello_t anju; + __declspec(dllexport) extern bool aaa; +#else + __declspec(dllimport) extern hello_t anju; + __declspec(dllimport) extern bool aaa; +#endif + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /*HELLO_H*/ diff --git a/win_examples/export/main.c b/win_examples/export/main.c new file mode 100644 index 0000000000..3903e7f2d6 --- /dev/null +++ b/win_examples/export/main.c @@ -0,0 +1,14 @@ +#include "hello.h" +#include + +struct new_anju { + hello_t *hell; +} ; +struct new_anju boo = {&anju}; + +int main() { + + boo.hell->i(); + boo.hell->j(); + return 0; +} diff --git a/win_examples/export/makefile b/win_examples/export/makefile new file mode 100644 index 0000000000..5631e6c3b5 --- /dev/null +++ b/win_examples/export/makefile @@ -0,0 +1,10 @@ +all: hello main + +hello: hello.c hello.h + cl /TC /LD /DEXPORTING hello.c + +main: main.cpp + cl main.cpp hello.lib + +clean: + rm -Rf *.obj *.lib *.dll *.exp *.i *.exe diff --git a/win_examples/windows_make/component.c b/win_examples/windows_make/component.c new file mode 100644 index 0000000000..7a697e385a --- /dev/null +++ b/win_examples/windows_make/component.c @@ -0,0 +1,29 @@ +#include + +#include "component.h" + +static struct module *component_query(int i); +static void module_query(int i); + + +/* This is the component struct, and is exported */ +//__declspec(dllexport) +__declspec(dllexport) struct component component_instance = { + component_query +}; + +/* This is the module struct, and is static */ +static struct module module_instance = { + module_query +}; + +static struct module *component_query(int i) +{ + printf("this is the component query: I got value %d\n", i); + return &module_instance; +} + +static void module_query(int i) +{ + printf("this is the module query: I got value %d\n", i); +} diff --git a/win_examples/windows_make/component.h b/win_examples/windows_make/component.h new file mode 100644 index 0000000000..427d79c4a2 --- /dev/null +++ b/win_examples/windows_make/component.h @@ -0,0 +1,19 @@ +#ifndef COMPONENT_H +#define COMPONENT_H + +struct component; +struct module; + +typedef struct module *(*component_query_fn_t)(int i); + +struct component { + component_query_fn_t component_query_fn; +}; + +typedef void (*module_query_fn_t)(int i); + +struct module { + module_query_fn_t module_query_fn; +}; + +#endif diff --git a/win_examples/windows_make/loading.c b/win_examples/windows_make/loading.c new file mode 100644 index 0000000000..87025bd8ad --- /dev/null +++ b/win_examples/windows_make/loading.c @@ -0,0 +1,36 @@ +/* Prabhanjan Kambadur: Open Systems Lab + Example documenting the usage of functions from a dynamic library in windows + September 24 2004 */ + +#include +#include +#include "component.h" + +void main(void) +{ + HINSTANCE hinstLib; + struct component *component; + struct module *module; + + /* Get a handle to the DLL */ + + hinstLib = LoadLibrary("component"); + + /* If the handle is valid, try to get the function address */ + + if (hinstLib != NULL) { + component = (struct component *) GetProcAddress(hinstLib, + "component_instance"); + + /* If the function address is valid, call the function */ + + if (NULL != component) { + module = component->component_query_fn(37); + module->module_query_fn(17); + } else { + printf("Was not able to find component_instance\n"); + } + } else { + printf("Was not able to LoadLibrary\n"); + } +} diff --git a/win_examples/windows_make/makefile b/win_examples/windows_make/makefile new file mode 100644 index 0000000000..5eed6993b9 --- /dev/null +++ b/win_examples/windows_make/makefile @@ -0,0 +1,10 @@ +all: dll load + +dll: component.c component.h + cl /LD component.c + +load: loading.c component.h + cl loading.c + +clean: + rm -Rf *.dll *.obj core* *.lib *.exp *.exe