First pass of lam -> ompi conversion
This commit was SVN r1191.
Этот коммит содержится в:
родитель
9e64700ce9
Коммит
563ac2a338
4
Doxyfile
4
Doxyfile
@ -17,7 +17,7 @@
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# by quotes) that should identify the project.
|
||||
|
||||
PROJECT_NAME = LAM/MPI
|
||||
PROJECT_NAME = OMPI/MPI
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
@ -396,7 +396,7 @@ EXCLUDE_SYMLINKS = YES
|
||||
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
||||
# certain files from those directories.
|
||||
|
||||
EXCLUDE_PATTERNS = static-modules.h *config*.h lam_stdint.h ltdl.h
|
||||
EXCLUDE_PATTERNS = static-modules.h *config*.h ompi_stdint.h ltdl.h
|
||||
|
||||
# The EXAMPLE_PATH tag can be used to specify one or more files or
|
||||
# directories that contain example code fragments that are included (see
|
||||
|
14
HACKING
14
HACKING
@ -1,7 +1,7 @@
|
||||
Overview
|
||||
========
|
||||
|
||||
This file is here for those who are building/exploring LAM/MPI in its
|
||||
This file is here for those who are building/exploring OMPI/MPI in its
|
||||
source code form, most likely through a developer's tree (i.e., a CVS
|
||||
checkout).
|
||||
|
||||
@ -9,7 +9,7 @@ checkout).
|
||||
Use of GNU Autoconf, Automake, and Libtool
|
||||
==========================================
|
||||
|
||||
If you are building LAM/MPI from a developer's tree, you must first
|
||||
If you are building OMPI/MPI from a developer's tree, you must first
|
||||
use fairly recent versions of the GNU tools Autoconf, Automake, and
|
||||
Libtool. As of this writing, you need at least Autoconf v2.58,
|
||||
Automake v1.6, and Libtool 1.5. You can check what versions you have
|
||||
@ -79,9 +79,9 @@ following advice:
|
||||
Autoconf and Automake build and install very quickly; Libtool will
|
||||
take a minute or two.
|
||||
|
||||
5. You can now run LAM's top-level "autogen.sh" script. This script
|
||||
5. You can now run OMPI's top-level "autogen.sh" script. This script
|
||||
will invoke the GNU Autoconf, Automake, and Libtool commands in the
|
||||
proper order and setup to run LAM's top-level "configure" script.
|
||||
proper order and setup to run OMPI's top-level "configure" script.
|
||||
|
||||
Running autogen.sh typically takes several minutes. It's not very
|
||||
exciting to watch. :-)
|
||||
@ -89,14 +89,14 @@ following advice:
|
||||
5a. You generally need to run autogen.sh whenever the file
|
||||
"configure.ac" changes, or any files in the config/ directory
|
||||
change (the config/ directory is where a lot of "include" files
|
||||
for LAM's configure script live).
|
||||
for OMPI's configure script live).
|
||||
|
||||
5b. You do *NOT* need to re-run autogen.sh if you modify a
|
||||
Makefile.am.
|
||||
|
||||
5c. Note that "autogen.sh" automatically traverses the entire LAM
|
||||
5c. Note that "autogen.sh" automatically traverses the entire OMPI
|
||||
tree, running the GNU tools in all MCA modules. This is not
|
||||
always necessary. As you become more familiar with the LAM
|
||||
always necessary. As you become more familiar with the OMPI
|
||||
sources, you will come to understand the when you only need to
|
||||
re-generate the top-level configure script, and when you need
|
||||
to re-generate *all* configure scripts (it's complicated -- not
|
||||
|
8
INSTALL
8
INSTALL
@ -10,18 +10,18 @@ mpicc your-code.c
|
||||
|
||||
In order to run the program, you need to set some envs (use export for bash etc)
|
||||
|
||||
setenv MCA_common_lam_cofs_job_handle pcm-cofs-job-handle
|
||||
setenv MCA_common_lam_cofs_comm_dir "/tmp/COFS"
|
||||
setenv MCA_common_ompi_cofs_job_handle pcm-cofs-job-handle
|
||||
setenv MCA_common_ompi_cofs_comm_dir "/tmp/COFS"
|
||||
setenv MCA_OOB_BASE_VPID 0
|
||||
setenv MCA_REGISTRY_BASE_VPID 0
|
||||
|
||||
|
||||
Then if you need to run say N nodes you need to set
|
||||
setenv MCA_common_lam_cofs_num_procs N
|
||||
setenv MCA_common_ompi_cofs_num_procs N
|
||||
|
||||
Then in the shell for each you would set
|
||||
|
||||
setenv MCA_common_lam_cofs_my_vpid MYRANK
|
||||
setenv MCA_common_ompi_cofs_my_vpid MYRANK
|
||||
|
||||
where MYRANK is 0 in one, 1 in the next etc
|
||||
|
||||
|
38
acinclude.m4
38
acinclude.m4
@ -5,7 +5,7 @@ dnl
|
||||
|
||||
|
||||
#
|
||||
# LAM/MPI-specific tests
|
||||
# OMPI/MPI-specific tests
|
||||
#
|
||||
|
||||
sinclude(config/c_get_alignment.m4)
|
||||
@ -20,25 +20,25 @@ sinclude(config/f77_find_ext_symbol_convention.m4)
|
||||
sinclude(config/f77_get_alignment.m4)
|
||||
sinclude(config/f77_get_sizeof.m4)
|
||||
|
||||
sinclude(config/lam_case_sensitive_fs_setup.m4)
|
||||
sinclude(config/lam_check_optflags.m4)
|
||||
sinclude(config/lam_config_subdir.m4)
|
||||
sinclude(config/lam_config_subdir_args.m4)
|
||||
sinclude(config/lam_configure_options.m4)
|
||||
sinclude(config/lam_functions.m4)
|
||||
sinclude(config/lam_get_version.m4)
|
||||
sinclude(config/lam_get_libtool_linker_flags.m4)
|
||||
sinclude(config/lam_mca.m4)
|
||||
sinclude(config/lam_setup_cc.m4)
|
||||
sinclude(config/lam_setup_cxx.m4)
|
||||
sinclude(config/lam_setup_f77.m4)
|
||||
sinclude(config/lam_setup_f90.m4)
|
||||
sinclude(config/lam_setup_libevent.m4)
|
||||
sinclude(config/ompi_case_sensitive_fs_setup.m4)
|
||||
sinclude(config/ompi_check_optflags.m4)
|
||||
sinclude(config/ompi_config_subdir.m4)
|
||||
sinclude(config/ompi_config_subdir_args.m4)
|
||||
sinclude(config/ompi_configure_options.m4)
|
||||
sinclude(config/ompi_functions.m4)
|
||||
sinclude(config/ompi_get_version.m4)
|
||||
sinclude(config/ompi_get_libtool_linker_flags.m4)
|
||||
sinclude(config/ompi_mca.m4)
|
||||
sinclude(config/ompi_setup_cc.m4)
|
||||
sinclude(config/ompi_setup_cxx.m4)
|
||||
sinclude(config/ompi_setup_f77.m4)
|
||||
sinclude(config/ompi_setup_f90.m4)
|
||||
sinclude(config/ompi_setup_libevent.m4)
|
||||
|
||||
sinclude(config/lam_check_pthread_pids.m4)
|
||||
sinclude(config/lam_config_pthreads.m4)
|
||||
sinclude(config/lam_config_solaris_threads.m4)
|
||||
sinclude(config/lam_config_threads.m4)
|
||||
sinclude(config/ompi_check_pthread_pids.m4)
|
||||
sinclude(config/ompi_config_pthreads.m4)
|
||||
sinclude(config/ompi_config_solaris_threads.m4)
|
||||
sinclude(config/ompi_config_threads.m4)
|
||||
|
||||
#
|
||||
# The config/mca_no_configure_modules.m4 file is generated by autogen.sh
|
||||
|
142
autogen.sh
142
autogen.sh
@ -2,7 +2,7 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
# This script is run on developer copies of LAM/MPI -- *not*
|
||||
# This script is run on developer copies of OMPI/MPI -- *not*
|
||||
# distribution tarballs.
|
||||
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
lam_aclocal_search="aclocal"
|
||||
lam_autoheader_search="autoheader"
|
||||
lam_autoconf_search="autoconf"
|
||||
lam_libtoolize_search="libtoolize glibtoolize"
|
||||
lam_automake_search="automake"
|
||||
ompi_aclocal_search="aclocal"
|
||||
ompi_autoheader_search="autoheader"
|
||||
ompi_autoconf_search="autoconf"
|
||||
ompi_libtoolize_search="libtoolize glibtoolize"
|
||||
ompi_automake_search="automake"
|
||||
|
||||
lam_automake_version="1.7"
|
||||
lam_autoconf_version="2.58"
|
||||
lam_libtool_version="1.5"
|
||||
ompi_automake_version="1.7"
|
||||
ompi_autoconf_version="2.58"
|
||||
ompi_libtool_version="1.5"
|
||||
|
||||
|
||||
##############################################################################
|
||||
@ -29,16 +29,16 @@ lam_libtool_version="1.5"
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
lam_aclocal_version="$lam_automake_version"
|
||||
lam_autoheader_version="$lam_autoconf_version"
|
||||
lam_libtoolize_version="$lam_libtool_version"
|
||||
ompi_aclocal_version="$ompi_automake_version"
|
||||
ompi_autoheader_version="$ompi_autoconf_version"
|
||||
ompi_libtoolize_version="$ompi_libtool_version"
|
||||
|
||||
# program names to execute
|
||||
lam_aclocal=""
|
||||
lam_autoheader=""
|
||||
lam_autoconf=""
|
||||
lam_libtoolize=""
|
||||
lam_automake=""
|
||||
ompi_aclocal=""
|
||||
ompi_autoheader=""
|
||||
ompi_autoconf=""
|
||||
ompi_libtoolize=""
|
||||
ompi_automake=""
|
||||
|
||||
mca_no_configure_modules_file="config/mca_no_configure_modules.m4"
|
||||
mca_no_config_list_file="mca_no_config_list"
|
||||
@ -123,9 +123,9 @@ find_app() {
|
||||
local min_version="99.99.99"
|
||||
local found=0
|
||||
|
||||
eval "min_version=\"\$lam_${app_name}_version\""
|
||||
eval "min_version=\"\$ompi_${app_name}_version\""
|
||||
|
||||
eval "search_path=\"\$lam_${app_name}_search\""
|
||||
eval "search_path=\"\$ompi_${app_name}_search\""
|
||||
for i in $search_path ; do
|
||||
version="`${i} --version 2>&1`"
|
||||
if test "$?" != 0 ; then
|
||||
@ -136,7 +136,7 @@ find_app() {
|
||||
version="`echo $version | cut -f1 -d' '`"
|
||||
|
||||
if check_version $min_version $version ; then
|
||||
eval "lam_${app_name}=\"${i}\""
|
||||
eval "ompi_${app_name}=\"${i}\""
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
@ -150,9 +150,9 @@ I am gonna abort. :-(
|
||||
Please make sure you are using at least the following versions of the
|
||||
GNU tools:
|
||||
|
||||
GNU Autoconf $lam_autoconf_version
|
||||
GNU Automake $lam_automake_version
|
||||
GNU Libtool $lam_libtool_version
|
||||
GNU Autoconf $ompi_autoconf_version
|
||||
GNU Automake $ompi_automake_version
|
||||
GNU Libtool $ompi_libtool_version
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
@ -190,9 +190,9 @@ This *MAY* be caused by an older version of one of the required
|
||||
packages. Please make sure you are using at least the following
|
||||
versions:
|
||||
|
||||
GNU Autoconf $lam_autoconf_version
|
||||
GNU Automake $lam_automake_version
|
||||
GNU Libtool $lam_libtool_version
|
||||
GNU Autoconf $ompi_autoconf_version
|
||||
GNU Automake $ompi_automake_version
|
||||
GNU Libtool $ompi_libtool_version
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
EOF
|
||||
@ -259,7 +259,7 @@ find_and_delete() {
|
||||
#
|
||||
# INPUT:
|
||||
# - directory to run in
|
||||
# - LAM top directory
|
||||
# - OMPI top directory
|
||||
#
|
||||
# OUTPUT:
|
||||
# none
|
||||
@ -273,20 +273,20 @@ find_and_delete() {
|
||||
##############################################################################
|
||||
run_gnu_tools() {
|
||||
rgt_dir="$1"
|
||||
rgt_lam_topdir="$2"
|
||||
rgt_ompi_topdir="$2"
|
||||
|
||||
# Sanity check to ensure that there's a configure.in or
|
||||
# configure.ac file here, or if there's a configure.params
|
||||
# file and we need to run make_configure.pl.
|
||||
|
||||
if test -f configure.params -a -f configure.stub -a \
|
||||
-x "$rgt_lam_topdir/config/mca_make_configure.pl"; then
|
||||
-x "$rgt_ompi_topdir/config/mca_make_configure.pl"; then
|
||||
cat <<EOF
|
||||
*** Found configure.stub
|
||||
*** Running mca_make_configure.pl
|
||||
EOF
|
||||
"$rgt_lam_topdir/config/mca_make_configure.pl" \
|
||||
--lamdir "$rgt_lam_topdir" \
|
||||
"$rgt_ompi_topdir/config/mca_make_configure.pl" \
|
||||
--ompidir "$rgt_ompi_topdir" \
|
||||
--moduledir "`pwd`"
|
||||
if test "$?" != "0"; then
|
||||
echo "*** autogen.sh failed to complete!"
|
||||
@ -325,22 +325,22 @@ EOF
|
||||
|
||||
echo "*** Running GNU tools"
|
||||
|
||||
run_and_check $lam_aclocal
|
||||
run_and_check $ompi_aclocal
|
||||
if test "`grep AC_CONFIG_HEADER $file`" != "" -o \
|
||||
"`grep AM_CONFIG_HEADER $file`" != ""; then
|
||||
run_and_check $lam_autoheader
|
||||
run_and_check $ompi_autoheader
|
||||
fi
|
||||
run_and_check $lam_autoconf
|
||||
run_and_check $ompi_autoconf
|
||||
|
||||
# We only need the libltdl stuff for the top-level
|
||||
# configure, not any of the MCA modules.
|
||||
|
||||
if test -f include/mpi.h; then
|
||||
rm -rf libltdl src/libltdl src/ltdl.h
|
||||
run_and_check $lam_libtoolize --automake --copy --ltdl
|
||||
run_and_check $ompi_libtoolize --automake --copy --ltdl
|
||||
mv libltdl src
|
||||
|
||||
echo "Adjusting libltdl for LAM :-("
|
||||
echo "Adjusting libltdl for OMPI :-("
|
||||
|
||||
echo " -- patching for argz bugfix in libtool 1.5"
|
||||
cd src/libltdl
|
||||
@ -363,14 +363,14 @@ EOF
|
||||
fi
|
||||
cd ../..
|
||||
echo " -- patching configure for broken -c/-o compiler test"
|
||||
sed -e 's/chmod -w \./#LAM\/MPI FIX: chmod -w ./' \
|
||||
sed -e 's/chmod -w \./#OMPI\/MPI FIX: chmod -w ./' \
|
||||
configure > configure.new
|
||||
mv configure.new configure
|
||||
chmod a+x configure
|
||||
else
|
||||
run_and_check $lam_libtoolize --automake --copy
|
||||
run_and_check $ompi_libtoolize --automake --copy
|
||||
fi
|
||||
run_and_check $lam_automake --foreign -a --copy --include-deps
|
||||
run_and_check $ompi_automake --foreign -a --copy --include-deps
|
||||
}
|
||||
|
||||
|
||||
@ -385,19 +385,19 @@ EOF
|
||||
#
|
||||
# INPUT:
|
||||
# - directory to run in
|
||||
# - LAM top directory
|
||||
# - OMPI top directory
|
||||
#
|
||||
# OUTPUT:
|
||||
# none
|
||||
#
|
||||
# SIDE EFFECTS:
|
||||
# - skips directories with .lam_no_gnu .lam_ignore
|
||||
# - skips directories with .ompi_no_gnu .ompi_ignore
|
||||
# - uses provided autogen.sh if available
|
||||
#
|
||||
##############################################################################
|
||||
process_dir() {
|
||||
pd_dir="$1"
|
||||
pd_lam_topdir="$2"
|
||||
pd_ompi_topdir="$2"
|
||||
pd_cur_dir="`pwd`"
|
||||
|
||||
if test -d "$pd_dir"; then
|
||||
@ -405,17 +405,17 @@ process_dir() {
|
||||
|
||||
# See if the package doesn't want us to set it up
|
||||
|
||||
if test -f .lam_no_gnu; then
|
||||
if test -f .ompi_no_gnu; then
|
||||
cat <<EOF
|
||||
|
||||
*** Found .lam_no_gnu file -- skipping GNU setup in:
|
||||
*** Found .ompi_no_gnu file -- skipping GNU setup in:
|
||||
*** `pwd`
|
||||
|
||||
EOF
|
||||
elif test -f .lam_ignore; then
|
||||
elif test -f .ompi_ignore; then
|
||||
cat <<EOF
|
||||
|
||||
*** Found .lam_ignore file -- skipping entire tree:
|
||||
*** Found .ompi_ignore file -- skipping entire tree:
|
||||
*** `pwd`
|
||||
|
||||
EOF
|
||||
@ -437,7 +437,7 @@ EOF
|
||||
*** `pwd`
|
||||
|
||||
EOF
|
||||
run_gnu_tools "$pd_dir" "$pd_lam_topdir"
|
||||
run_gnu_tools "$pd_dir" "$pd_ompi_topdir"
|
||||
|
||||
elif test -f configure.params -a -f configure.stub; then
|
||||
cat <<EOF
|
||||
@ -446,7 +446,7 @@ EOF
|
||||
*** `pwd`
|
||||
|
||||
EOF
|
||||
run_gnu_tools "$pd_dir" "$pd_lam_topdir"
|
||||
run_gnu_tools "$pd_dir" "$pd_ompi_topdir"
|
||||
|
||||
elif test -f configure.params; then
|
||||
cat <<EOF
|
||||
@ -465,7 +465,7 @@ EOF
|
||||
pd_module_name="`basename $pd_dir`"
|
||||
pd_module_type="`dirname $pd_dir`"
|
||||
pd_module_type="`basename $pd_module_type`"
|
||||
pd_get_ver="../../../../config/lam_get_version.sh"
|
||||
pd_get_ver="../../../../config/ompi_get_version.sh"
|
||||
pd_ver_file="`grep PARAM_VERSION_FILE configure.params`"
|
||||
if test -z "$pd_ver_file"; then
|
||||
pd_ver_file="VERSION"
|
||||
@ -475,8 +475,8 @@ EOF
|
||||
|
||||
# Write out to two files (they're merged at the end)
|
||||
|
||||
pd_list_file="$pd_lam_topdir/$mca_no_config_list_file"
|
||||
pd_amc_file="$pd_lam_topdir/$mca_no_config_amc_file"
|
||||
pd_list_file="$pd_ompi_topdir/$mca_no_config_list_file"
|
||||
pd_amc_file="$pd_ompi_topdir/$mca_no_config_amc_file"
|
||||
|
||||
cat >> $pd_list_file <<EOF
|
||||
dnl ----------------------------------------------------------------
|
||||
@ -519,29 +519,29 @@ dnl argument. So we have to figure it out here.
|
||||
|
||||
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_MAJOR_VERSION,
|
||||
$pd_ver_major,
|
||||
[Major LAM MCA $pd_module_type $pd_module_name version])
|
||||
[Major OMPI MCA $pd_module_type $pd_module_name version])
|
||||
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_MINOR_VERSION,
|
||||
$pd_ver_minor,
|
||||
[Minor LAM MCA $pd_module_type $pd_module_name version])
|
||||
[Minor OMPI MCA $pd_module_type $pd_module_name version])
|
||||
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_RELEASE_VERSION,
|
||||
$pd_ver_release,
|
||||
[Release LAM MCA $pd_module_type $pd_module_name version])
|
||||
[Release OMPI MCA $pd_module_type $pd_module_name version])
|
||||
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_ALPHA_VERSION,
|
||||
$pd_ver_alpha,
|
||||
[Alpha LAM MCA $pd_module_type $pd_module_name version])
|
||||
[Alpha OMPI MCA $pd_module_type $pd_module_name version])
|
||||
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_BETA_VERSION,
|
||||
$pd_ver_beta,
|
||||
[Beta LAM MCA $pd_module_type $pd_module_name version])
|
||||
[Beta OMPI MCA $pd_module_type $pd_module_name version])
|
||||
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_SVN_VERSION,
|
||||
$pd_ver_svn,
|
||||
[SVN LAM MCA $pd_module_type $pd_module_name version])
|
||||
[SVN OMPI MCA $pd_module_type $pd_module_name version])
|
||||
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_FULL_VERSION,
|
||||
"$pd_ver_full",
|
||||
[Full LAM MCA $pd_module_type $pd_module_name version])
|
||||
[Full OMPI MCA $pd_module_type $pd_module_name version])
|
||||
|
||||
EOF
|
||||
cat >> $pd_amc_file <<EOF
|
||||
AM_CONDITIONAL(LAM_BUILD_${pd_module_type}_${pd_module_name}_LOADABLE_MODULE,
|
||||
AM_CONDITIONAL(OMPI_BUILD_${pd_module_type}_${pd_module_name}_LOADABLE_MODULE,
|
||||
test "\$BUILD_${pd_module_type}_${pd_module_name}_LOADABLE_MODULE" = "1")
|
||||
|
||||
EOF
|
||||
@ -566,13 +566,13 @@ EOF
|
||||
|
||||
cd "$pd_cur_dir"
|
||||
fi
|
||||
unset pd_dir pd_lam_topdir pd_cur_dir pd_module_type
|
||||
unset pd_dir pd_ompi_topdir pd_cur_dir pd_module_type
|
||||
}
|
||||
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# run_global - run the config in the top LAM dir and all MCA modules
|
||||
# run_global - run the config in the top OMPI dir and all MCA modules
|
||||
#
|
||||
# INPUT:
|
||||
# none
|
||||
@ -673,11 +673,11 @@ echo "[Checking] command line parameters"
|
||||
# just in this current directory.
|
||||
|
||||
want_local=no
|
||||
lamdir=
|
||||
ompidir=
|
||||
for arg in $*; do
|
||||
case $arg in
|
||||
-l) want_local=yes ;;
|
||||
-lamdir|--lamdir|-lam|--lam) lamdir="$1" ;;
|
||||
-ompidir|--ompidir|-ompi|--ompi) ompidir="$1" ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
@ -689,7 +689,7 @@ echo "[Checking] prerequisites"
|
||||
if test ! -d .svn ; then
|
||||
cat <<EOF
|
||||
|
||||
This doesn't look like a developer copy of LAM/MPI. You probably do not
|
||||
This doesn't look like a developer copy of OMPI/MPI. You probably do not
|
||||
want to run autogen.sh - it is normally not needed for a release source
|
||||
tree. Giving you 5 seconds to reconsider and kill me.
|
||||
|
||||
@ -697,21 +697,21 @@ EOF
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
# figure out if we're at the top level of the LAM tree, a module's
|
||||
# figure out if we're at the top level of the OMPI tree, a module's
|
||||
# top-level directory, or somewhere else.
|
||||
if test -f VERSION -a -f configure.ac -a -f include/mpi.h ; then
|
||||
# Top level of LAM tree
|
||||
lamdir="`pwd`"
|
||||
# Top level of OMPI tree
|
||||
ompidir="`pwd`"
|
||||
elif test -f configure.in -o -f configure.ac -o -f configure.params ; then
|
||||
# Top level of a module directory
|
||||
want_local=yes
|
||||
if test -z "$lamdir"; then
|
||||
lamdir="../../../.."
|
||||
if test -z "$ompidir"; then
|
||||
ompidir="../../../.."
|
||||
fi
|
||||
else
|
||||
cat <<EOF
|
||||
|
||||
You must run this script from either the top level of the LAM
|
||||
You must run this script from either the top level of the OMPI
|
||||
directory tree or the top-level of an MCA module directory tree.
|
||||
|
||||
EOF
|
||||
@ -727,7 +727,7 @@ find_app "automake"
|
||||
|
||||
# do the work
|
||||
if test "$want_local" = "yes"; then
|
||||
process_dir . $lamdir
|
||||
process_dir . $ompidir
|
||||
else
|
||||
run_global
|
||||
fi
|
||||
|
@ -15,21 +15,21 @@ EXTRA_DIST = \
|
||||
f77_find_ext_symbol_convention.m4 \
|
||||
f77_get_alignment.m4 \
|
||||
f77_get_sizeof.m4 \
|
||||
lam_case_sensitive_fs_setup.m4 \
|
||||
lam_check_optflags.m4 \
|
||||
lam_check_pthread_pids.m4 \
|
||||
lam_config_subdir.m4 \
|
||||
lam_config_subdir_args.m4 \
|
||||
lam_config_pthreads.m4 \
|
||||
lam_config_solaris_threads.m4 \
|
||||
lam_config_threads.m4 \
|
||||
lam_configure_options.m4 \
|
||||
lam_functions.m4 \
|
||||
lam_get_version.m4 \
|
||||
lam_get_version.sh \
|
||||
lam_mca.m4 \
|
||||
lam_setup_cc.m4 \
|
||||
lam_setup_cxx.m4 \
|
||||
lam_setup_f77.m4 \
|
||||
lam_setup_f90.m4 \
|
||||
ompi_case_sensitive_fs_setup.m4 \
|
||||
ompi_check_optflags.m4 \
|
||||
ompi_check_pthread_pids.m4 \
|
||||
ompi_config_subdir.m4 \
|
||||
ompi_config_subdir_args.m4 \
|
||||
ompi_config_pthreads.m4 \
|
||||
ompi_config_solaris_threads.m4 \
|
||||
ompi_config_threads.m4 \
|
||||
ompi_configure_options.m4 \
|
||||
ompi_functions.m4 \
|
||||
ompi_get_version.m4 \
|
||||
ompi_get_version.sh \
|
||||
ompi_mca.m4 \
|
||||
ompi_setup_cc.m4 \
|
||||
ompi_setup_cxx.m4 \
|
||||
ompi_setup_f77.m4 \
|
||||
ompi_setup_f90.m4 \
|
||||
mca_no_configure_modules.m4
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_C_GET_ALIGNMENT],[
|
||||
AC_DEFUN([OMPI_C_GET_ALIGNMENT],[
|
||||
# Determine datatype alignment.
|
||||
# First arg is type, 2nd arg is config var to define.
|
||||
AC_MSG_CHECKING([alignment of $1])
|
||||
@ -22,17 +22,17 @@ int main(int argc, char* argv[])
|
||||
diff = ((char *)&p->x) - ((char *)&p->c);
|
||||
fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
|
||||
return 0;
|
||||
}],[lam_ac_align=`cat conftestval`],[lam_ac_align=-1],[lam_ac_align=-1])
|
||||
}],[ompi_ac_align=`cat conftestval`],[ompi_ac_align=-1],[ompi_ac_align=-1])
|
||||
|
||||
if test "`expr $lam_ac_align \<= 0`" = "1"; then
|
||||
if test "`expr $ompi_ac_align \<= 0`" = "1"; then
|
||||
AC_MSG_WARN([*** Problem running configure test!])
|
||||
AC_MSG_WARN([*** See config.log for details.])
|
||||
AC_MSG_ERROR([*** Cannot continue.])
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$lam_ac_align])
|
||||
AC_DEFINE_UNQUOTED($2, $lam_ac_align, [Alignment of type $1])
|
||||
eval "$2=$lam_ac_align"
|
||||
unset lam_ac_align
|
||||
AC_MSG_RESULT([$ompi_ac_align])
|
||||
AC_DEFINE_UNQUOTED($2, $ompi_ac_align, [Alignment of type $1])
|
||||
eval "$2=$ompi_ac_align"
|
||||
unset ompi_ac_align
|
||||
|
||||
/bin/rm -f conftest*])dnl
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
define([LAM_C_WEAK_SYMBOLS],[
|
||||
define([OMPI_C_WEAK_SYMBOLS],[
|
||||
#
|
||||
# Arguments: None
|
||||
#
|
||||
@ -11,7 +11,7 @@ define([LAM_C_WEAK_SYMBOLS],[
|
||||
#
|
||||
# Check to see if the C compiler can handle weak symbols
|
||||
#
|
||||
# Sets LAM_C_WEAK_SYMBOLS=1 if the C compiler has support for weak
|
||||
# Sets OMPI_C_WEAK_SYMBOLS=1 if the C compiler has support for weak
|
||||
# symbols.
|
||||
#
|
||||
|
||||
@ -22,13 +22,13 @@ int real(int i);
|
||||
int real(int i) { return i; }
|
||||
int main(int argc, char* argv[]) {
|
||||
return fake(3);
|
||||
}]]), lam_happy=1, lam_happy=0)
|
||||
if test "$lam_happy" = "1"; then
|
||||
}]]), ompi_happy=1, ompi_happy=0)
|
||||
if test "$ompi_happy" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
LAM_C_HAVE_WEAK_SYMBOLS=1
|
||||
OMPI_C_HAVE_WEAK_SYMBOLS=1
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
LAM_C_HAVE_WEAK_SYMBOLS=0
|
||||
OMPI_C_HAVE_WEAK_SYMBOLS=0
|
||||
fi
|
||||
|
||||
unset lam_happy])dnl
|
||||
unset ompi_happy])dnl
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
define([LAM_CXX_FIND_EXCEPTION_FLAGS],[
|
||||
define([OMPI_CXX_FIND_EXCEPTION_FLAGS],[
|
||||
#
|
||||
# Arguments: none
|
||||
#
|
||||
@ -13,7 +13,7 @@ define([LAM_CXX_FIND_EXCEPTION_FLAGS],[
|
||||
# CXXFLAGS undisturbed.
|
||||
# Provides --with-exflags command line argument for configure as well.
|
||||
#
|
||||
# Sets LAM_CXX_EXCEPTION_CXXFLAGS and LAM_CXX_EXCEPTION_LDFLAGS as
|
||||
# Sets OMPI_CXX_EXCEPTION_CXXFLAGS and OMPI_CXX_EXCEPTION_LDFLAGS as
|
||||
# appropriate.
|
||||
# Must call AC_SUBST manually
|
||||
#
|
||||
@ -23,18 +23,18 @@ define([LAM_CXX_FIND_EXCEPTION_FLAGS],[
|
||||
AC_ARG_WITH(exflags,
|
||||
AC_HELP_STRING([--with-exflags],
|
||||
[Specify flags necessary to enable C++ exceptions]),
|
||||
lam_force_exflags="$withval")
|
||||
ompi_force_exflags="$withval")
|
||||
|
||||
lam_CXXFLAGS_SAVE="$CXXFLAGS"
|
||||
ompi_CXXFLAGS_SAVE="$CXXFLAGS"
|
||||
AC_MSG_CHECKING([for compiler exception flags])
|
||||
|
||||
# See which flags to use
|
||||
|
||||
if test "$lam_force_exflags" != ""; then
|
||||
if test "$ompi_force_exflags" != ""; then
|
||||
|
||||
# If the user supplied flags, use those
|
||||
|
||||
lam_exflags="$lam_force_exflags"
|
||||
ompi_exflags="$ompi_force_exflags"
|
||||
elif test "$GXX" = "yes"; then
|
||||
|
||||
# g++ has changed their flags a few times. Sigh.
|
||||
@ -43,15 +43,15 @@ elif test "$GXX" = "yes"; then
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), lam_happy=1, lam_happy=0)
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), ompi_happy=1, ompi_happy=0)
|
||||
|
||||
if test "$lam_happy" = "1"; then
|
||||
lam_exflags="-fexceptions";
|
||||
if test "$ompi_happy" = "1"; then
|
||||
ompi_exflags="-fexceptions";
|
||||
else
|
||||
CXXFLAGS="$CXXFLAGS_SAVE -fhandle-exceptions"
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), lam_happy=1, lam_happy=0)
|
||||
if test "$lam_happy" = "1"; then
|
||||
lam_exflags="-fhandle-exceptions";
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), ompi_happy=1, ompi_happy=0)
|
||||
if test "$ompi_happy" = "1"; then
|
||||
ompi_exflags="-fhandle-exceptions";
|
||||
fi
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
@ -59,21 +59,21 @@ elif test "`basename $CXX`" = "KCC"; then
|
||||
|
||||
# KCC flags
|
||||
|
||||
lam_exflags="--exceptions"
|
||||
ompi_exflags="--exceptions"
|
||||
fi
|
||||
CXXFLAGS="$lam_CXXFLAGS_SAVE"
|
||||
CXXFLAGS="$ompi_CXXFLAGS_SAVE"
|
||||
|
||||
# Save the result
|
||||
|
||||
LAM_CXX_EXCEPTIONS_CXXFLAGS="$lam_exflags"
|
||||
LAM_CXX_EXCEPTIONS_LDFLAGS="$lam_exflags"
|
||||
if test "$lam_exflags" = ""; then
|
||||
OMPI_CXX_EXCEPTIONS_CXXFLAGS="$ompi_exflags"
|
||||
OMPI_CXX_EXCEPTIONS_LDFLAGS="$ompi_exflags"
|
||||
if test "$ompi_exflags" = ""; then
|
||||
AC_MSG_RESULT([none necessary])
|
||||
else
|
||||
AC_MSG_RESULT([$lam_exflags])
|
||||
AC_MSG_RESULT([$ompi_exflags])
|
||||
fi
|
||||
|
||||
# Clean up
|
||||
|
||||
unset lam_force_exflags lam_CXXFLAGS_SAVE lam_exflags lam_happy])dnl
|
||||
unset ompi_force_exflags ompi_CXXFLAGS_SAVE ompi_exflags ompi_happy])dnl
|
||||
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
define(LAM_CXX_FIND_TEMPLATE_PARAMETERS,[
|
||||
define(OMPI_CXX_FIND_TEMPLATE_PARAMETERS,[
|
||||
#
|
||||
# Arguments: none
|
||||
#
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
define([LAM_CXX_FIND_TEMPLATE_REPOSITORY],[
|
||||
define([OMPI_CXX_FIND_TEMPLATE_REPOSITORY],[
|
||||
#
|
||||
# Arguments: None
|
||||
#
|
||||
@ -12,7 +12,7 @@ define([LAM_CXX_FIND_TEMPLATE_REPOSITORY],[
|
||||
# See if the compiler makes template repository directories
|
||||
# Warning: this is a really screwy example! -JMS
|
||||
#
|
||||
# Sets LAM_CXX_TEMPLATE_REPOSITORY to the template repository, or blank.
|
||||
# Sets OMPI_CXX_TEMPLATE_REPOSITORY to the template repository, or blank.
|
||||
# Must call AC_SUBST manually
|
||||
#
|
||||
|
||||
@ -74,7 +74,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
EOF
|
||||
|
||||
lam_template_failed=
|
||||
ompi_template_failed=
|
||||
echo configure:__oline__: $CXX $CXXFLAGS -c conftest1.C >&5
|
||||
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
|
||||
if test ! -f conftest1.o ; then
|
||||
@ -83,7 +83,7 @@ if test ! -f conftest1.o ; then
|
||||
cat conftest1.C >&5
|
||||
echo configure:__oline__: here is conftest.h: >&5
|
||||
cat conftest.h >&5
|
||||
lam_template_failed=1
|
||||
ompi_template_failed=1
|
||||
else
|
||||
echo configure:__oline__: $CXX $CXXFLAGS -c conftest2.C >&5
|
||||
$CXX $CXXFLAGS -c conftest2.C >&5 2>&5
|
||||
@ -96,43 +96,43 @@ else
|
||||
else
|
||||
rm -rf conftest*
|
||||
|
||||
for lam_file in `ls`
|
||||
for ompi_file in `ls`
|
||||
do
|
||||
if test "$lam_file" != "." -a "$lam_file" != ".."; then
|
||||
if test "$ompi_file" != "." -a "$ompi_file" != ".."; then
|
||||
# Is it a directory?
|
||||
if test -d "$lam_file"; then
|
||||
lam_template_dir="$lam_file $lam_template_dir"
|
||||
if test -d "$ompi_file"; then
|
||||
ompi_template_dir="$ompi_file $ompi_template_dir"
|
||||
|
||||
# Or is it a file?
|
||||
else
|
||||
name="`echo $lam_file | cut -d. -f1`"
|
||||
name="`echo $ompi_file | cut -d. -f1`"
|
||||
|
||||
temp_mask=
|
||||
if test "$name" = "main" -o "$name" = "other"; then
|
||||
temp_mask="`echo $lam_file | cut -d. -f2`"
|
||||
if test "$lam_template_filemask" = ""; then
|
||||
lam_template_filemask="$temp_mask";
|
||||
elif test "`echo $lam_template_filemask | grep $temp_mask`" = ""; then
|
||||
lam_template_filemask="$lam_template_filemask $temp_mask"
|
||||
temp_mask="`echo $ompi_file | cut -d. -f2`"
|
||||
if test "$ompi_template_filemask" = ""; then
|
||||
ompi_template_filemask="$temp_mask";
|
||||
elif test "`echo $ompi_template_filemask | grep $temp_mask`" = ""; then
|
||||
ompi_template_filemask="$ompi_template_filemask $temp_mask"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if test "$lam_template_filemask" != ""; then
|
||||
if test "$ompi_template_filemask" != ""; then
|
||||
temp_mask=
|
||||
for mask in $lam_template_filemask
|
||||
for mask in $ompi_template_filemask
|
||||
do
|
||||
temp_mask="*.$mask $temp_mask"
|
||||
done
|
||||
lam_template_filemask=$temp_mask
|
||||
ompi_template_filemask=$temp_mask
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
LAM_CXX_TEMPLATE_REPOSITORY="$lam_template_dir $lam_template_filemask"
|
||||
OMPI_CXX_TEMPLATE_REPOSITORY="$ompi_template_dir $ompi_template_filemask"
|
||||
|
||||
if test "`echo $LAM_CXX_TEMPLATE_REPOSITORY`" != ""; then
|
||||
AC_MSG_RESULT([$LAM_CXX_TEMPLATE_REPOSITORY])
|
||||
if test "`echo $OMPI_CXX_TEMPLATE_REPOSITORY`" != ""; then
|
||||
AC_MSG_RESULT([$OMPI_CXX_TEMPLATE_REPOSITORY])
|
||||
else
|
||||
AC_MSG_RESULT([not used])
|
||||
fi
|
||||
@ -140,4 +140,4 @@ cd ..
|
||||
rm -rf conf_tmp_$$
|
||||
|
||||
# Clean up
|
||||
unset lam_file lam_template_failed lam_template_dir])dnl
|
||||
unset ompi_file ompi_template_failed ompi_template_dir])dnl
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
define([LAM_CXX_HAVE_EXCEPTIONS],[
|
||||
define([OMPI_CXX_HAVE_EXCEPTIONS],[
|
||||
#
|
||||
# Arguments: None
|
||||
#
|
||||
@ -11,15 +11,15 @@ define([LAM_CXX_HAVE_EXCEPTIONS],[
|
||||
#
|
||||
# Check to see if the C++ compiler can handle exceptions
|
||||
#
|
||||
# Sets LAM_CXX_EXCEPTIONS to 1 if compiler has exceptions, 0 if not
|
||||
# Sets OMPI_CXX_EXCEPTIONS to 1 if compiler has exceptions, 0 if not
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([for throw/catch])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i=1; throw(i);]]),
|
||||
LAM_CXX_EXCEPTIONS=1, LAM_CXX_EXCPTIONS=0)
|
||||
if test "$LAM_CXX_EXCEPTIONS" = "1"; then
|
||||
OMPI_CXX_EXCEPTIONS=1, OMPI_CXX_EXCPTIONS=0)
|
||||
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
|
@ -6,14 +6,14 @@
|
||||
set srcdir="`pwd`"
|
||||
set distdir="$srcdir/$1"
|
||||
set verfile="$srcdir/VERSION"
|
||||
set verscript="config/lam_get_version.sh"
|
||||
set verscript="config/ompi_get_version.sh"
|
||||
|
||||
set LAM_VERSION="`sh $verscript $verfile --full`"
|
||||
set LAM_MAJOR_VERSION="`sh $verscript $verfile --major`"
|
||||
set LAM_MINOR_VERSION="`sh $verscript $verfile --minor`"
|
||||
set LAM_RELEASE_VERSION="`sh $verscript $verfile --release`"
|
||||
set LAM_ALPHA_VERSION="`sh $verscript $verfile --alpha`"
|
||||
set LAM_BETA_VERSION="`sh $verscript $verfile --beta`"
|
||||
set OMPI_VERSION="`sh $verscript $verfile --full`"
|
||||
set OMPI_MAJOR_VERSION="`sh $verscript $verfile --major`"
|
||||
set OMPI_MINOR_VERSION="`sh $verscript $verfile --minor`"
|
||||
set OMPI_RELEASE_VERSION="`sh $verscript $verfile --release`"
|
||||
set OMPI_ALPHA_VERSION="`sh $verscript $verfile --alpha`"
|
||||
set OMPI_BETA_VERSION="`sh $verscript $verfile --beta`"
|
||||
|
||||
if ("$distdir" == "") then
|
||||
echo "Must supply relative distdir as argv[1] -- aborting"
|
||||
@ -23,7 +23,7 @@ endif
|
||||
set start=`date`
|
||||
cat <<EOF
|
||||
|
||||
Creating LAM/MPI distribution
|
||||
Creating OMPI/MPI distribution
|
||||
In directory: `pwd`
|
||||
Started: $start
|
||||
|
||||
@ -91,7 +91,7 @@ end
|
||||
# JMS don't have man pages yet -- this is a straight copy from LAM7
|
||||
#
|
||||
|
||||
set ver="$LAM_VERSION"
|
||||
set ver="$OMPI_VERSION"
|
||||
#echo "*** Updating version date/number in man pages"
|
||||
#rm -f manfiles
|
||||
#find man -type f | grep -v Makefile > manfiles
|
||||
@ -158,7 +158,7 @@ echo "*** Updating version number in $files..."
|
||||
foreach file ($files)
|
||||
echo " - Setting $file"
|
||||
if (-f $file) then
|
||||
sed -e "s/LAMVERSION/$ver/g" $file > bar
|
||||
sed -e "s/OMPI_VERSION/$ver/g" $file > bar
|
||||
mv -f bar $file
|
||||
endif
|
||||
end
|
||||
@ -168,7 +168,7 @@ end
|
||||
#
|
||||
|
||||
cat <<EOF
|
||||
*** LAM/MPI version $ver distribution created
|
||||
*** OMPI/MPI version $ver distribution created
|
||||
|
||||
Started: $start
|
||||
Ended: `date`
|
||||
|
@ -3,13 +3,13 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
define(LAM_F77_FIND_EXT_SYMBOL_CONVENTION,[
|
||||
define(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION,[
|
||||
AC_MSG_CHECKING($1 external symbol convention)
|
||||
|
||||
lam_fortran_double_underscore=0
|
||||
lam_fortran_single_underscore=0
|
||||
lam_fortran_caps=0
|
||||
lam_fortran_plain=0
|
||||
ompi_fortran_double_underscore=0
|
||||
ompi_fortran_single_underscore=0
|
||||
ompi_fortran_caps=0
|
||||
ompi_fortran_plain=0
|
||||
|
||||
cat > conftestf.f <<EOF
|
||||
subroutine FOO_bar(a)
|
||||
@ -25,14 +25,14 @@ else
|
||||
nm conftestf.o | grep foo_bar__ > /dev/null 2>&1
|
||||
if test $? = "0"; then
|
||||
AC_MSG_RESULT([double underscore])
|
||||
lam_fortran_double_underscore=1
|
||||
lam_ac_doubleunder=y
|
||||
ompi_fortran_double_underscore=1
|
||||
ompi_ac_doubleunder=y
|
||||
else
|
||||
nm conftestf.o | grep foo_bar_ > /dev/null 2>&1
|
||||
if test $? = "0"; then
|
||||
AC_MSG_RESULT([single underscore])
|
||||
lam_fortran_single_underscore=1
|
||||
lam_ac_singleunder=y
|
||||
ompi_fortran_single_underscore=1
|
||||
ompi_ac_singleunder=y
|
||||
else
|
||||
# We may get into trouble here if we start accepting mixed
|
||||
# case compilers -- we may need to have caps underscore,
|
||||
@ -41,20 +41,20 @@ else
|
||||
nm conftestf.o | grep FOO_bar > /dev/null 2>&1
|
||||
if test $? = "0"; then
|
||||
AC_MSG_RESULT([mixed case, so FORTRANCAPS])
|
||||
lam_fortran_caps=1
|
||||
lam_ac_caps=y
|
||||
ompi_fortran_caps=1
|
||||
ompi_ac_caps=y
|
||||
else
|
||||
nm conftestf.o | grep foo_bar > /dev/null 2>&1
|
||||
if test $? = "0"; then
|
||||
AC_MSG_RESULT([no underscore])
|
||||
lam_fortran_plain=1
|
||||
lam_ac_nounder=y
|
||||
ompi_fortran_plain=1
|
||||
ompi_ac_nounder=y
|
||||
else
|
||||
nm conftestf.o | grep FOO_BAR > /dev/null 2>&1
|
||||
if test $? = "0"; then
|
||||
AC_MSG_RESULT([all upper case])
|
||||
lam_fortran_caps=1
|
||||
lam_ac_caps=y
|
||||
ompi_fortran_caps=1
|
||||
ompi_ac_caps=y
|
||||
else
|
||||
AC_MSG_WARN([*** Could not find name of subroutine foo_bar])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
@ -65,14 +65,14 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(LAM_F77_DOUBLE_UNDERSCORE,
|
||||
$lam_fortran_double_underscore,
|
||||
AC_DEFINE_UNQUOTED(OMPI_F77_DOUBLE_UNDERSCORE,
|
||||
$ompi_fortran_double_underscore,
|
||||
[Whether fortran symbols have a trailing double underscore or not])
|
||||
AC_DEFINE_UNQUOTED(LAM_F77_SINGLE_UNDERSCORE, $lam_fortran_single_underscore,
|
||||
AC_DEFINE_UNQUOTED(OMPI_F77_SINGLE_UNDERSCORE, $ompi_fortran_single_underscore,
|
||||
[Whether fortran symbols have a trailing underscore or not])
|
||||
AC_DEFINE_UNQUOTED(LAM_F77_CAPS, $lam_fortran_caps,
|
||||
AC_DEFINE_UNQUOTED(OMPI_F77_CAPS, $ompi_fortran_caps,
|
||||
[Whether fortran symbols are all caps or not])
|
||||
AC_DEFINE_UNQUOTED(LAM_F77_PLAIN, $lam_fortran_plain,
|
||||
AC_DEFINE_UNQUOTED(OMPI_F77_PLAIN, $ompi_fortran_plain,
|
||||
[Whether fortran symbols have no trailing underscore or not])
|
||||
|
||||
/bin/rm -f conftestf.f conftestf.o])dnl
|
||||
|
@ -3,19 +3,19 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_F77_GET_ALIGNMENT],[
|
||||
AC_DEFUN([OMPI_F77_GET_ALIGNMENT],[
|
||||
# Determine FORTRAN datatype size.
|
||||
# First arg is type, 2nd arg is config var to define.
|
||||
AC_MSG_CHECKING(alignment of FORTRAN $1)
|
||||
lam_ac_align_fn=
|
||||
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
|
||||
lam_ac_align_fn=align_
|
||||
ompi_ac_align_fn=
|
||||
if test "x$ompi_ac_doubleunder" = xy || test "x$ompi_ac_singleunder" = xy; then
|
||||
ompi_ac_align_fn=align_
|
||||
else
|
||||
if test "x$lam_ac_nounder" = xy; then
|
||||
lam_ac_align_fn=align
|
||||
if test "x$ompi_ac_nounder" = xy; then
|
||||
ompi_ac_align_fn=align
|
||||
else
|
||||
if test "x$lam_ac_caps" = xy; then
|
||||
lam_ac_align_fn=ALIGN
|
||||
if test "x$ompi_ac_caps" = xy; then
|
||||
ompi_ac_align_fn=ALIGN
|
||||
else
|
||||
AC_MSG_WARN([*** FORTRAN external naming convention undefined])
|
||||
AC_MSG_ERROR([*** Cannot continue.])
|
||||
@ -42,9 +42,9 @@ EOF
|
||||
#
|
||||
|
||||
if test -f conftest.h; then
|
||||
lam_conftest_h="#include \"conftest.h\""
|
||||
ompi_conftest_h="#include \"conftest.h\""
|
||||
else
|
||||
lam_conftest_h=""
|
||||
ompi_conftest_h=""
|
||||
fi
|
||||
cat > conftest.c <<EOF
|
||||
#include <stdio.h>
|
||||
@ -54,7 +54,7 @@ $conftest
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void $lam_ac_align_fn(char *w, char *x, char *y, char *z)
|
||||
void $ompi_ac_align_fn(char *w, char *x, char *y, char *z)
|
||||
{ unsigned long aw, ax, ay, az;
|
||||
FILE *f=fopen("conftestval", "w");
|
||||
if (!f) exit(1);
|
||||
@ -80,36 +80,36 @@ EOF
|
||||
# module files.
|
||||
#
|
||||
|
||||
LAM_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
||||
LAM_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
||||
LAM_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
||||
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
||||
OMPI_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
||||
OMPI_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
||||
[HAPPY=0]),
|
||||
[HAPPY=0])
|
||||
|
||||
if test "$HAPPY" = "1" -a -f conftestval; then
|
||||
lam_ac_align=`cat conftestval`
|
||||
AC_MSG_RESULT([$lam_ac_align])
|
||||
ompi_ac_align=`cat conftestval`
|
||||
AC_MSG_RESULT([$ompi_ac_align])
|
||||
if test -n "$2"; then
|
||||
eval "$2=$lam_ac_align"
|
||||
eval "$2=$ompi_ac_align"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([unknown])
|
||||
|
||||
LAM_LOG_MSG([here is the C program:], 1)
|
||||
LAM_LOG_FILE([conftest.c])
|
||||
OMPI_LOG_MSG([here is the C program:], 1)
|
||||
OMPI_LOG_FILE([conftest.c])
|
||||
if test -f conftest.h; then
|
||||
LAM_LOG_MSG([here is contest.h:], 1)
|
||||
LAM_LOG_FILE([conftest.h])
|
||||
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||
OMPI_LOG_FILE([conftest.h])
|
||||
fi
|
||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
||||
LAM_LOG_FILE([conftestf.f])
|
||||
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||
OMPI_LOG_FILE([conftestf.f])
|
||||
|
||||
AC_MSG_WARN([*** Problem running configure test!])
|
||||
AC_MSG_WARN([*** See config.log for details.])
|
||||
AC_MSG_ERROR([*** Cannot continue.])
|
||||
fi
|
||||
str="$2=$lam_ac_align"
|
||||
str="$2=$ompi_ac_align"
|
||||
eval $str
|
||||
|
||||
unset lam_ac_align HAPPY lam_conftest_h
|
||||
unset ompi_ac_align HAPPY ompi_conftest_h
|
||||
/bin/rm -f conftest*])dnl
|
||||
|
@ -3,19 +3,19 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_F77_GET_SIZEOF],[
|
||||
AC_DEFUN([OMPI_F77_GET_SIZEOF],[
|
||||
# Determine FORTRAN datatype size.
|
||||
# First arg is type, 2nd arg is config var to define.
|
||||
AC_MSG_CHECKING([size of FORTRAN $1])
|
||||
lam_ac_size_fn=
|
||||
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
|
||||
lam_ac_size_fn=size_
|
||||
ompi_ac_size_fn=
|
||||
if test "x$ompi_ac_doubleunder" = xy || test "x$ompi_ac_singleunder" = xy; then
|
||||
ompi_ac_size_fn=size_
|
||||
else
|
||||
if test "x$lam_ac_nounder" = xy; then
|
||||
lam_ac_size_fn=size
|
||||
if test "x$ompi_ac_nounder" = xy; then
|
||||
ompi_ac_size_fn=size
|
||||
else
|
||||
if test "x$lam_ac_caps" = xy; then
|
||||
lam_ac_size_fn=SIZE
|
||||
if test "x$ompi_ac_caps" = xy; then
|
||||
ompi_ac_size_fn=SIZE
|
||||
else
|
||||
AC_MSG_WARN([*** FORTRAN external naming convention undefined])
|
||||
AC_MSG_ERROR([*** Cannot continue.])
|
||||
@ -45,19 +45,19 @@ EOF
|
||||
#
|
||||
|
||||
if test -f conftest.h; then
|
||||
lam_conftest_h="#include \"conftest.h\""
|
||||
ompi_conftest_h="#include \"conftest.h\""
|
||||
else
|
||||
lam_conftest_h=""
|
||||
ompi_conftest_h=""
|
||||
fi
|
||||
cat > conftest.c <<EOF
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
$lam_conftest_h
|
||||
$ompi_conftest_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void $lam_ac_size_fn(char *a, char *b)
|
||||
void $ompi_ac_size_fn(char *a, char *b)
|
||||
{
|
||||
int diff = (int) (b - a);
|
||||
FILE *f=fopen("conftestval", "w");
|
||||
@ -74,35 +74,35 @@ EOF
|
||||
# module files.
|
||||
#
|
||||
|
||||
LAM_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
||||
LAM_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
||||
LAM_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
||||
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
||||
OMPI_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
||||
OMPI_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
||||
[HAPPY=0]),
|
||||
[HAPPY=0])
|
||||
|
||||
lam_ac_fortsize=-1
|
||||
ompi_ac_fortsize=-1
|
||||
if test "$HAPPY" = "1" -a -f conftestval; then
|
||||
lam_ac_fortsize=`cat conftestval`
|
||||
AC_MSG_RESULT([$lam_ac_fortsize])
|
||||
eval "$2=$lam_ac_fortsize"
|
||||
ompi_ac_fortsize=`cat conftestval`
|
||||
AC_MSG_RESULT([$ompi_ac_fortsize])
|
||||
eval "$2=$ompi_ac_fortsize"
|
||||
else
|
||||
AC_MSG_RESULT([unknown])
|
||||
|
||||
LAM_LOG_MSG([here is the C program:], 1)
|
||||
LAM_LOG_FILE([conftest.c])
|
||||
OMPI_LOG_MSG([here is the C program:], 1)
|
||||
OMPI_LOG_FILE([conftest.c])
|
||||
if test -f conftest.h; then
|
||||
LAM_LOG_MSG([here is contest.h:], 1)
|
||||
LAM_LOG_FILE([conftest.h])
|
||||
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||
OMPI_LOG_FILE([conftest.h])
|
||||
fi
|
||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
||||
LAM_LOG_FILE([conftestf.f])
|
||||
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||
OMPI_LOG_FILE([conftestf.f])
|
||||
|
||||
AC_MSG_WARN([*** Problem running configure test!])
|
||||
AC_MSG_WARN([*** See config.log for details.])
|
||||
AC_MSG_ERROR([*** Cannot continue.])
|
||||
fi
|
||||
str="$2=$lam_ac_fortsize"
|
||||
str="$2=$ompi_ac_fortsize"
|
||||
eval $str
|
||||
|
||||
unset lam_ac_fortsize HAPPY lam_conftest_h
|
||||
unset ompi_ac_fortsize HAPPY ompi_conftest_h
|
||||
/bin/rm -f conftest*])dnl
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_CASE_SENSITIVE_FS_SETUP],[
|
||||
AC_DEFUN([OMPI_CASE_SENSITIVE_FS_SETUP],[
|
||||
#
|
||||
# Arguments: none
|
||||
#
|
||||
@ -50,29 +50,29 @@ AC_ARG_WITH(cs_fs,
|
||||
[Destination FS is case sensitive (default: set to value of the build FS's case sensitivity)]))
|
||||
|
||||
if test "$with_cs_fs" = "yes"; then
|
||||
LAM_WANT_CS_FS=1
|
||||
OMPI_WANT_CS_FS=1
|
||||
elif test -z "$with_cs_fs"; then
|
||||
LAM_WANT_CS_FS=$have_cs_fs
|
||||
OMPI_WANT_CS_FS=$have_cs_fs
|
||||
else
|
||||
LAM_WANT_CS_FS=0
|
||||
OMPI_WANT_CS_FS=0
|
||||
fi
|
||||
|
||||
if test "$LAM_WANT_CS_FS" = "1"; then
|
||||
if test "$OMPI_WANT_CS_FS" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(CASE_SENSITIVE_FS, test "$LAM_WANT_CS_FS" = "1")
|
||||
AM_CONDITIONAL(CASE_SENSITIVE_FS, test "$OMPI_WANT_CS_FS" = "1")
|
||||
|
||||
if test "$LAM_WANT_CS_FS" = "0"; then
|
||||
if test "$OMPI_WANT_CS_FS" = "0"; then
|
||||
cat <<EOF
|
||||
|
||||
*******************************************************************************
|
||||
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
|
||||
*******************************************************************************
|
||||
|
||||
Because LAM/MPI is being installed on a non-case sensitive file system, the
|
||||
Because OMPI/MPI is being installed on a non-case sensitive file system, the
|
||||
C++ wrapper compiler will be named mpic++ instead of the traditional mpiCC.
|
||||
|
||||
Please update any makefiles appropriately.
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_CHECK_OPTFLAGS],[
|
||||
AC_DEFUN([OMPI_CHECK_OPTFLAGS],[
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
|
@ -2,20 +2,20 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
define(LAM_CHECK_PTHREAD_PIDS,[
|
||||
define(OMPI_CHECK_PTHREAD_PIDS,[
|
||||
#
|
||||
# Arguments: none
|
||||
#
|
||||
# Dependencies: None
|
||||
#
|
||||
# Sets:
|
||||
# LAM_THREADS_HAVE_DIFFERENT_PIDS (variable)
|
||||
# OMPI_THREADS_HAVE_DIFFERENT_PIDS (variable)
|
||||
#
|
||||
# Test for Linux-like threads in the system. We will need to handle things like
|
||||
# getpid() differently in the case of a Linux-like threads model.
|
||||
#
|
||||
|
||||
AH_TEMPLATE([LAM_THREADS_HAVE_DIFFERENT_PIDS],
|
||||
AH_TEMPLATE([OMPI_THREADS_HAVE_DIFFERENT_PIDS],
|
||||
[Do threads have different pids (pthreads on linux)])
|
||||
|
||||
AC_MSG_CHECKING([if threads have different pids (pthreads on linux)])
|
||||
@ -47,15 +47,15 @@ void *checkpid(void *arg) {
|
||||
ret = 1;
|
||||
pthread_exit((void *) ret);
|
||||
}],
|
||||
[MSG=no LAM_THREADS_HAVE_DIFFERENT_PIDS=0],
|
||||
[MSG=yes LAM_THREADS_HAVE_DIFFERENT_PIDS=1])
|
||||
[MSG=no OMPI_THREADS_HAVE_DIFFERENT_PIDS=0],
|
||||
[MSG=yes OMPI_THREADS_HAVE_DIFFERENT_PIDS=1])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_save"
|
||||
LDFLAGS="$LDFLAGS_save"
|
||||
LIBS="$LIBS_save"
|
||||
|
||||
AC_MSG_RESULT([$MSG])
|
||||
AC_DEFINE_UNQUOTED(LAM_THREADS_HAVE_DIFFERENT_PIDS, $LAM_THREADS_HAVE_DIFFERENT_PIDS)
|
||||
AC_DEFINE_UNQUOTED(OMPI_THREADS_HAVE_DIFFERENT_PIDS, $OMPI_THREADS_HAVE_DIFFERENT_PIDS)
|
||||
|
||||
#
|
||||
# if pthreads is not available, then the system does not have an insane threads
|
||||
|
@ -1,20 +1,20 @@
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
dnl LAM_CONFIG_POSIX_THREADS()
|
||||
dnl OMPI_CONFIG_POSIX_THREADS()
|
||||
dnl
|
||||
dnl Configure posix threads, setting the following variables (but
|
||||
dnl not calling AC_SUBST on them).
|
||||
|
||||
# ********************************************************************
|
||||
#
|
||||
# Internal macros - do not call from outside LAM_CONFIG_POSIX_THREADS
|
||||
# Internal macros - do not call from outside OMPI_CONFIG_POSIX_THREADS
|
||||
#
|
||||
# ********************************************************************
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_PTHREAD_TRY_LINK], [
|
||||
# BEGIN: LAM_INTL_PTHREAD_TRY_LINK
|
||||
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK], [
|
||||
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK
|
||||
#
|
||||
# Make sure that we can run a small application in C or C++, which
|
||||
# ever is the current language. Do make sure that C or C++ is the
|
||||
@ -24,12 +24,12 @@ AC_DEFUN([LAM_INTL_PTHREAD_TRY_LINK], [
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
||||
[$1], [$2])
|
||||
# END: LAM_INTL_PTHREAD_TRY_LINK
|
||||
# END: OMPI_INTL_PTHREAD_TRY_LINK
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_PTHREAD_TRY_LINK_F77], [
|
||||
# BEGIN: LAM_INTL_PTHREAD_TRY_LINK_F77
|
||||
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK_F77], [
|
||||
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK_F77
|
||||
#
|
||||
# Make sure that we can run a small application in Fortran, with
|
||||
# pthreads living in a C object file
|
||||
@ -44,20 +44,20 @@ EOF
|
||||
|
||||
# C module
|
||||
if test -f conftest.h; then
|
||||
lam_conftest_h="#include \"conftest.h\""
|
||||
ompi_conftest_h="#include \"conftest.h\""
|
||||
else
|
||||
lam_conftest_h=""
|
||||
ompi_conftest_h=""
|
||||
fi
|
||||
cat > conftest.c <<EOF
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
$lam_conftest_h
|
||||
$ompi_conftest_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void lam_pthread()
|
||||
void ompi_pthread()
|
||||
{
|
||||
pthread_t th;
|
||||
pthread_join(th, 0);
|
||||
@ -72,9 +72,9 @@ void lam_pthread()
|
||||
EOF
|
||||
|
||||
# Try the compile
|
||||
LAM_LOG_COMMAND(
|
||||
OMPI_LOG_COMMAND(
|
||||
[$CC $CFLAGS -I. -c conftest.c],
|
||||
LAM_LOG_COMMAND(
|
||||
OMPI_LOG_COMMAND(
|
||||
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LIBS],
|
||||
[HAPPY=1],
|
||||
[HAPPY=0]),
|
||||
@ -83,20 +83,20 @@ LAM_LOG_COMMAND(
|
||||
if test "$HAPPY" = "1"; then
|
||||
$1
|
||||
else
|
||||
LAM_LOG_MSG([here is the C program:], 1)
|
||||
LAM_LOG_FILE([conftest.c])
|
||||
OMPI_LOG_MSG([here is the C program:], 1)
|
||||
OMPI_LOG_FILE([conftest.c])
|
||||
if test -f conftest.h; then
|
||||
LAM_LOG_MSG([here is contest.h:], 1)
|
||||
LAM_LOG_FILE([conftest.h])
|
||||
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||
OMPI_LOG_FILE([conftest.h])
|
||||
fi
|
||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
||||
LAM_LOG_FILE([conftestf.f])
|
||||
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||
OMPI_LOG_FILE([conftestf.f])
|
||||
$2
|
||||
fi
|
||||
|
||||
unset HAPPY lam_conftest_h
|
||||
unset HAPPY ompi_conftest_h
|
||||
/bin/rm -f conftest*
|
||||
# END: LAM_INTL_PTHREAD_TRY_LINK_F77
|
||||
# END: OMPI_INTL_PTHREAD_TRY_LINK_F77
|
||||
])dnl
|
||||
|
||||
|
||||
@ -105,11 +105,11 @@ unset HAPPY lam_conftest_h
|
||||
# Try to compile thread support without any special flags
|
||||
#
|
||||
# ********************************************************************
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN_C], [
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_C], [
|
||||
#
|
||||
# C compiler
|
||||
#
|
||||
if test "$lam_pthread_c_success" = "0"; then
|
||||
if test "$ompi_pthread_c_success" = "0"; then
|
||||
AC_MSG_CHECKING([if C compiler and POSIX threads work as is])
|
||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||
run_this_test=1
|
||||
@ -138,10 +138,10 @@ if test "$lam_pthread_c_success" = "0"; then
|
||||
|
||||
if test "$run_this_test" = "1" ; then
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_c_success=1,
|
||||
lam_pthread_c_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
|
||||
ompi_pthread_c_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$lam_pthread_c_success" = "1"; then
|
||||
if test "$ompi_pthread_c_success" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
PTHREAD_CPPFLAGS=
|
||||
@ -153,11 +153,11 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN_CXX], [
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_CXX], [
|
||||
#
|
||||
# C++ compiler
|
||||
#
|
||||
if test "$lam_pthread_cxx_success" = "0"; then
|
||||
if test "$ompi_pthread_cxx_success" = "0"; then
|
||||
AC_MSG_CHECKING([if C++ compiler and POSIX threads work as is])
|
||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||
run_this_test=1
|
||||
@ -186,10 +186,10 @@ if test "$lam_pthread_cxx_success" = "0"; then
|
||||
|
||||
if test "$run_this_test" = "1" ; then
|
||||
AC_LANG_PUSH(C++)
|
||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
||||
lam_pthread_cxx_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||
ompi_pthread_cxx_success=0)
|
||||
AC_LANG_POP(C++)
|
||||
if test "$lam_pthread_cxx_success" = "1"; then
|
||||
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
PTHREAD_CXXCPPFLAGS=
|
||||
@ -201,11 +201,11 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN_FC], [
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_FC], [
|
||||
#
|
||||
# Fortran compiler
|
||||
#
|
||||
if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
|
||||
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
|
||||
AC_MSG_CHECKING([if F77 compiler and POSIX threads work as is])
|
||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||
run_this_test=1
|
||||
@ -223,10 +223,10 @@ if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
|
||||
|
||||
if test "$run_this_test" = "1" ; then
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
||||
lam_pthread_f77_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||
ompi_pthread_f77_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$lam_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
@ -236,8 +236,8 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN], [
|
||||
# BEGIN: LAM_INTL_POSIX_THREADS_PLAIN
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN], [
|
||||
# BEGIN: OMPI_INTL_POSIX_THREADS_PLAIN
|
||||
#
|
||||
# Check if can compile without any special flags
|
||||
# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in
|
||||
@ -248,18 +248,18 @@ AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN], [
|
||||
|
||||
# Only run C++ and Fortran if those compilers already configured
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[LAM_INTL_POSIX_THREADS_PLAIN_C],
|
||||
[lam_pthread_c_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_PLAIN_C],
|
||||
[ompi_pthread_c_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[LAM_INTL_POSIX_THREADS_PLAIN_CXX],
|
||||
[lam_pthread_cxx_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_PLAIN_CXX],
|
||||
[ompi_pthread_cxx_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
[LAM_INTL_POSIX_THREADS_PLAIN_FC],
|
||||
[lam_pthread_f77_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_PLAIN_FC],
|
||||
[ompi_pthread_f77_success=1])
|
||||
|
||||
# End: LAM_INTL_POSIX_THREADS_PLAIN
|
||||
# End: OMPI_INTL_POSIX_THREADS_PLAIN
|
||||
])dnl
|
||||
|
||||
|
||||
@ -268,19 +268,19 @@ AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
# Try to compile thread support with special compiler flags
|
||||
#
|
||||
# ********************************************************************
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_C], [
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_C], [
|
||||
#
|
||||
# C compiler
|
||||
#
|
||||
if test "$lam_pthread_c_success" = "0"; then
|
||||
if test "$ompi_pthread_c_success" = "0"; then
|
||||
for pf in $pflags; do
|
||||
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pf])
|
||||
CFLAGS="$orig_CFLAGS $pf"
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_c_success=1,
|
||||
lam_pthread_c_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
|
||||
ompi_pthread_c_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$lam_pthread_c_success" = "1"; then
|
||||
if test "$ompi_pthread_c_success" = "1"; then
|
||||
PTHREAD_CFLAGS="$pf"
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
@ -294,19 +294,19 @@ fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX], [
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX], [
|
||||
#
|
||||
# C++ compiler
|
||||
#
|
||||
if test "$lam_pthread_cxx_success" = "0"; then
|
||||
if test "$ompi_pthread_cxx_success" = "0"; then
|
||||
for pf in $pflags; do
|
||||
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $pf])
|
||||
CXXFLAGS="$orig_CXXFLAGS $pf"
|
||||
AC_LANG_PUSH(C++)
|
||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
||||
lam_pthread_cxx_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||
ompi_pthread_cxx_success=0)
|
||||
AC_LANG_POP(C++)
|
||||
if test "$lam_pthread_cxx_success" = "1"; then
|
||||
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||
PTHREAD_CXXFLAGS="$pf"
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
@ -320,19 +320,19 @@ fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC], [
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC], [
|
||||
#
|
||||
# Fortran compiler
|
||||
#
|
||||
if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
|
||||
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
|
||||
for pf in $pflags; do
|
||||
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pf])
|
||||
FFLAGS="$orig_FFLAGS $pf"
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
||||
lam_pthread_f77_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||
ompi_pthread_f77_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$lam_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
PTHREAD_FFLAGS="$pf"
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
@ -346,8 +346,8 @@ fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS],[
|
||||
# Begin: LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS],[
|
||||
# Begin: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||
#
|
||||
# If above didn't work, try some super-special compiler flags
|
||||
# that get evaluated to the "right" things.
|
||||
@ -366,18 +366,18 @@ pflags="-Kthread -kthread -pthread -pthreads -mt -mthreads"
|
||||
|
||||
# Only run C++ and Fortran if those compilers already configured
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_C],
|
||||
[lam_pthread_c_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_C],
|
||||
[ompi_pthread_c_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
|
||||
[lam_pthread_cxx_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
|
||||
[ompi_pthread_cxx_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
[LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
|
||||
[lam_pthread_f77_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
|
||||
[ompi_pthread_f77_success=1])
|
||||
|
||||
# End: LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||
# End: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||
])dnl
|
||||
|
||||
|
||||
@ -386,11 +386,11 @@ AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
# Try to compile thread support with extra libs
|
||||
#
|
||||
# ********************************************************************
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS_C],[
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_C],[
|
||||
#
|
||||
# C compiler
|
||||
#
|
||||
if test "$lam_pthread_c_success" = "0"; then
|
||||
if test "$ompi_pthread_c_success" = "0"; then
|
||||
for pl in $plibs; do
|
||||
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pl])
|
||||
case "${host_cpu}-${host-_os}" in
|
||||
@ -409,10 +409,10 @@ if test "$lam_pthread_c_success" = "0"; then
|
||||
esac
|
||||
LIBS="$orig_LIBS $pl"
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_c_success=1,
|
||||
lam_pthread_c_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
|
||||
ompi_pthread_c_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$lam_pthread_c_success" = "1"; then
|
||||
if test "$ompi_pthread_c_success" = "1"; then
|
||||
PTHREAD_LIBS="$pl"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
@ -426,12 +426,12 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS_CXX],[
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_CXX],[
|
||||
#
|
||||
# C++ compiler
|
||||
#
|
||||
if test "$lam_pthread_cxx_success" = "0"; then
|
||||
if test ! "$lam_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
|
||||
if test "$ompi_pthread_cxx_success" = "0"; then
|
||||
if test ! "$ompi_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
|
||||
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $PTHREAD_LIBS])
|
||||
case "${host_cpu}-${host-_os}" in
|
||||
*-aix* | *-freebsd*)
|
||||
@ -449,10 +449,10 @@ if test "$lam_pthread_cxx_success" = "0"; then
|
||||
esac
|
||||
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
||||
AC_LANG_PUSH(C++)
|
||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
||||
lam_pthread_cxx_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||
ompi_pthread_cxx_success=0)
|
||||
AC_LANG_POP(C++)
|
||||
if test "$lam_pthread_cxx_success" = "1"; then
|
||||
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||
PTHREAD_LIBS="$pl"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
@ -479,10 +479,10 @@ if test "$lam_pthread_cxx_success" = "0"; then
|
||||
esac
|
||||
LIBS="$orig_LIBS $pl"
|
||||
AC_LANG_PUSH(C++)
|
||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
||||
lam_pthread_cxx_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||
ompi_pthread_cxx_success=0)
|
||||
AC_LANG_POP(C++)
|
||||
if test "$lam_pthread_cxx_success" = "1"; then
|
||||
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||
PTHREAD_LIBS="$pl"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
@ -496,20 +496,20 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS_FC],[
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_FC],[
|
||||
#
|
||||
# Fortran compiler
|
||||
#
|
||||
if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
|
||||
if test ! "$lam_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
|
||||
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
|
||||
if test ! "$ompi_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
|
||||
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $PTHREAD_LIBS])
|
||||
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
||||
lam_pthread_f77_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||
ompi_pthread_f77_success=0)
|
||||
AC_LANG_POP(C)
|
||||
LIBS="$orig_LIBS"
|
||||
if test "$lam_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
@ -520,11 +520,11 @@ if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
|
||||
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pl])
|
||||
LIBS="$orig_LIBS $pl"
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
||||
lam_pthread_f77_success=0)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||
ompi_pthread_f77_success=0)
|
||||
AC_LANG_POP(C)
|
||||
LIBS="$orig_LIBS"
|
||||
if test "$lam_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
PTHREAD_LIBS="$pl"
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
@ -537,8 +537,8 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS],[
|
||||
# Begin: LAM_INTL_POSIX_THREADS_LIBS
|
||||
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS],[
|
||||
# Begin: OMPI_INTL_POSIX_THREADS_LIBS
|
||||
#
|
||||
# if we can't find a super-special compiler flags, try some libraries.
|
||||
# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in case. Some
|
||||
@ -552,18 +552,18 @@ plibs="-lpthreads -llthread -lpthread"
|
||||
|
||||
# Only run C++ and Fortran if those compilers already configured
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[LAM_INTL_POSIX_THREADS_LIBS_C],
|
||||
[lam_pthread_c_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_LIBS_C],
|
||||
[ompi_pthread_c_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[LAM_INTL_POSIX_THREADS_LIBS_CXX],
|
||||
[lam_pthread_cxx_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_LIBS_CXX],
|
||||
[ompi_pthread_cxx_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
[LAM_INTL_POSIX_THREADS_LIBS_FC],
|
||||
[lam_pthread_f77_success=1])
|
||||
[OMPI_INTL_POSIX_THREADS_LIBS_FC],
|
||||
[ompi_pthread_f77_success=1])
|
||||
|
||||
# End: LAM_INTL_POSIX_THREADS_LIBS]
|
||||
# End: OMPI_INTL_POSIX_THREADS_LIBS]
|
||||
)dnl
|
||||
|
||||
|
||||
@ -572,10 +572,10 @@ AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
# External macro (aka, the real thing)
|
||||
#
|
||||
#********************************************************************
|
||||
AC_DEFUN([LAM_CONFIG_POSIX_THREADS],[
|
||||
lam_pthread_c_success=0
|
||||
lam_pthread_f77_success=0
|
||||
lam_pthread_cxx_success=0
|
||||
AC_DEFUN([OMPI_CONFIG_POSIX_THREADS],[
|
||||
ompi_pthread_c_success=0
|
||||
ompi_pthread_f77_success=0
|
||||
ompi_pthread_cxx_success=0
|
||||
|
||||
orig_CFLAGS="$CFLAGS"
|
||||
orig_FFLAGS="$FFLAGS"
|
||||
@ -594,13 +594,13 @@ PTHREAD_LDFLAGS=
|
||||
PTHREAD_LIBS=
|
||||
|
||||
# Try with the basics, mam.
|
||||
LAM_INTL_POSIX_THREADS_PLAIN
|
||||
OMPI_INTL_POSIX_THREADS_PLAIN
|
||||
|
||||
# Try the super-special compiler flags.
|
||||
LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||
OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||
|
||||
# Try the normal linking methods (that's no fun)
|
||||
LAM_INTL_POSIX_THREADS_LIBS
|
||||
OMPI_INTL_POSIX_THREADS_LIBS
|
||||
|
||||
CFLAGS="$orig_CFLAGS"
|
||||
FFLAGS="$orig_FFLAGS"
|
||||
@ -610,13 +610,13 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
||||
LDFLAGS="$orig_LDFLAGS"
|
||||
LIBS="$orig_LIBS"
|
||||
|
||||
if test "$LAM_WANT_F77_BINDINGS" != "1"; then
|
||||
lam_pthread_f77_success=1
|
||||
if test "$OMPI_WANT_F77_BINDINGS" != "1"; then
|
||||
ompi_pthread_f77_success=1
|
||||
fi
|
||||
|
||||
if test "$lam_pthread_c_success" = "1" -a \
|
||||
"$lam_pthread_cxx_success" = "1" -a \
|
||||
"$lam_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_c_success" = "1" -a \
|
||||
"$ompi_pthread_cxx_success" = "1" -a \
|
||||
"$ompi_pthread_f77_success" = "1"; then
|
||||
internal_useless=1
|
||||
$1
|
||||
else
|
||||
@ -624,6 +624,6 @@ else
|
||||
$2
|
||||
fi
|
||||
|
||||
unset lam_pthread_c_success lam_pthread_f77_success lam_pthread_cxx_success
|
||||
unset ompi_pthread_c_success ompi_pthread_f77_success ompi_pthread_cxx_success
|
||||
unset internal_useless
|
||||
])dnl
|
||||
|
@ -1,17 +1,17 @@
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
dnl LAM_CONFIG_SOLARIS_THREADS()
|
||||
dnl OMPI_CONFIG_SOLARIS_THREADS()
|
||||
dnl
|
||||
|
||||
# ********************************************************************
|
||||
#
|
||||
# Internal macros - do not call from outside LAM_CONFIG_SOLARIS_THREADS
|
||||
# Internal macros - do not call from outside OMPI_CONFIG_SOLARIS_THREADS
|
||||
#
|
||||
# ********************************************************************
|
||||
|
||||
AC_DEFUN([LAM_INTL_SOLARIS_TRY_LINK], [
|
||||
# BEGIN: LAM_INTL_SOLARIS_TRY_LINK
|
||||
AC_DEFUN([OMPI_INTL_SOLARIS_TRY_LINK], [
|
||||
# BEGIN: OMPI_INTL_SOLARIS_TRY_LINK
|
||||
#
|
||||
# Make sure that we can run a small application in C or C++, which
|
||||
# ever is the current language. Do make sure that C or C++ is the
|
||||
@ -20,12 +20,12 @@ AC_DEFUN([LAM_INTL_SOLARIS_TRY_LINK], [
|
||||
[thread_t th; thr_join(th, 0, 0);
|
||||
thr_create(0,0,0,0,0,0); ],
|
||||
[$1], [$2])
|
||||
# END: LAM_INTL_SOLARIS_TRY_LINK
|
||||
# END: OMPI_INTL_SOLARIS_TRY_LINK
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_SOLARIS_TRY_LINK_F77], [
|
||||
# BEGIN: LAM_INTL_SOLARIS_TRY_LINK_F77
|
||||
AC_DEFUN([OMPI_INTL_SOLARIS_TRY_LINK_F77], [
|
||||
# BEGIN: OMPI_INTL_SOLARIS_TRY_LINK_F77
|
||||
#
|
||||
# Make sure that we can run a small application in Fortran, with
|
||||
# pthreads living in a C object file
|
||||
@ -40,20 +40,20 @@ EOF
|
||||
|
||||
# C module
|
||||
if test -f conftest.h; then
|
||||
lam_conftest_h="#include \"conftest.h\""
|
||||
ompi_conftest_h="#include \"conftest.h\""
|
||||
else
|
||||
lam_conftest_h=""
|
||||
ompi_conftest_h=""
|
||||
fi
|
||||
cat > conftest.c <<EOF
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <thread.h>
|
||||
$lam_conftest_h
|
||||
$ompi_conftest_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void lam_pthread()
|
||||
void ompi_pthread()
|
||||
{
|
||||
thread_t th;
|
||||
thr_join(th, 0, 0);
|
||||
@ -65,9 +65,9 @@ void lam_pthread()
|
||||
EOF
|
||||
|
||||
# Try the compile
|
||||
LAM_LOG_COMMAND(
|
||||
OMPI_LOG_COMMAND(
|
||||
[$CC $CFLAGS -I. -c conftest.c],
|
||||
LAM_LOG_COMMAND(
|
||||
OMPI_LOG_COMMAND(
|
||||
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LIBS],
|
||||
[HAPPY=1],
|
||||
[HAPPY=0]),
|
||||
@ -76,24 +76,24 @@ LAM_LOG_COMMAND(
|
||||
if test "$HAPPY" = "1"; then
|
||||
$1
|
||||
else
|
||||
LAM_LOG_MSG([here is the C program:], 1)
|
||||
LAM_LOG_FILE([conftest.c])
|
||||
OMPI_LOG_MSG([here is the C program:], 1)
|
||||
OMPI_LOG_FILE([conftest.c])
|
||||
if test -f conftest.h; then
|
||||
LAM_LOG_MSG([here is contest.h:], 1)
|
||||
LAM_LOG_FILE([conftest.h])
|
||||
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||
OMPI_LOG_FILE([conftest.h])
|
||||
fi
|
||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
||||
LAM_LOG_FILE([conftestf.f])
|
||||
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||
OMPI_LOG_FILE([conftestf.f])
|
||||
$2
|
||||
fi
|
||||
|
||||
unset HAPPY lam_conftest_h
|
||||
unset HAPPY ompi_conftest_h
|
||||
/bin/rm -f conftest*
|
||||
# END: LAM_INTL_SOLARIS_TRY_LINK_F77
|
||||
# END: OMPI_INTL_SOLARIS_TRY_LINK_F77
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS_C], [
|
||||
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_C], [
|
||||
if test "$BASECC" = "cc"; then
|
||||
STHREAD_CFLAGS="-mt"
|
||||
style="Workshop/Forte"
|
||||
@ -108,10 +108,10 @@ CPPFLAGS="$STHREAD_CPPFLAGS $CPPFLAGS_orig"
|
||||
LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
|
||||
LIBS="$STHREAD_LIBS $LIBS_orig"
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_SOLARIS_TRY_LINK(lam_sthread_c_success=1,
|
||||
lam_sthread_c_success=0)
|
||||
OMPI_INTL_SOLARIS_TRY_LINK(ompi_sthread_c_success=1,
|
||||
ompi_sthread_c_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$lam_sthread_c_success" = "1"; then
|
||||
if test "$ompi_sthread_c_success" = "1"; then
|
||||
AC_MSG_RESULT([yes - $style])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
@ -119,7 +119,7 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS_CXX], [
|
||||
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_CXX], [
|
||||
if test "$BASECXX" = "CC"; then
|
||||
STHREAD_CXXFLAGS="-mt"
|
||||
style="Workshop/Forte"
|
||||
@ -137,10 +137,10 @@ LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
|
||||
LIBS="$STHREAD_LIBS $LIBS_orig"
|
||||
AC_MSG_CHECKING([if C++ compiler and Solaris threads work])
|
||||
AC_LANG_PUSH(C++)
|
||||
LAM_INTL_SOLARIS_TRY_LINK(lam_sthread_cxx_success=1,
|
||||
lam_sthread_cxx_success=0)
|
||||
OMPI_INTL_SOLARIS_TRY_LINK(ompi_sthread_cxx_success=1,
|
||||
ompi_sthread_cxx_success=0)
|
||||
AC_LANG_POP(C++)
|
||||
if test "$lam_sthread_cxx_success" = "1"; then
|
||||
if test "$ompi_sthread_cxx_success" = "1"; then
|
||||
AC_MSG_RESULT([yes - $style])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
@ -148,8 +148,8 @@ fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS_FC], [
|
||||
if test "$LAM_WANT_F77_BINDINGS" = "1"; then
|
||||
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_FC], [
|
||||
if test "$OMPI_WANT_F77_BINDINGS" = "1"; then
|
||||
if test "$BASEFC" = "f77"; then
|
||||
STHREAD_FFLAGS="-mt"
|
||||
style="Workshop/Forte"
|
||||
@ -164,24 +164,24 @@ if test "$LAM_WANT_F77_BINDINGS" = "1"; then
|
||||
LIBS="$STHREAD_LIBS $LIBS_orig"
|
||||
AC_MSG_CHECKING([if F77 compiler and Solaris threads work])
|
||||
AC_LANG_PUSH(C)
|
||||
LAM_INTL_SOLARIS_TRY_LINK_F77(lam_sthread_f77_success=1,
|
||||
lam_sthread_f77_success=0)
|
||||
OMPI_INTL_SOLARIS_TRY_LINK_F77(ompi_sthread_f77_success=1,
|
||||
ompi_sthread_f77_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$lam_sthread_f77_success" = "1"; then
|
||||
if test "$ompi_sthread_f77_success" = "1"; then
|
||||
AC_MSG_RESULT([yes - $style])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
else
|
||||
lam_sthread_f77_success=1
|
||||
ompi_sthread_f77_success=1
|
||||
fi
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS],[
|
||||
lam_sthread_c_success=0
|
||||
lam_sthread_f77_success=0
|
||||
lam_sthread_cxx_success=0
|
||||
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS],[
|
||||
ompi_sthread_c_success=0
|
||||
ompi_sthread_f77_success=0
|
||||
ompi_sthread_cxx_success=0
|
||||
|
||||
orig_CFLAGS="$CFLAGS"
|
||||
orig_FFLAGS="$FFLAGS"
|
||||
@ -201,16 +201,16 @@ STHREAD_LIBS=
|
||||
|
||||
# Only run C++ and Fortran if those compilers already configured
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[LAM_CONFIG_SOLARIS_THREADS_C],
|
||||
[lam_sthread_c_success=1])
|
||||
[OMPI_CONFIG_SOLARIS_THREADS_C],
|
||||
[ompi_sthread_c_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[LAM_CONFIG_SOLARIS_THREADS_CXX],
|
||||
[lam_sthread_cxx_success=1])
|
||||
[OMPI_CONFIG_SOLARIS_THREADS_CXX],
|
||||
[ompi_sthread_cxx_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
[LAM_CONFIG_SOLARIS_THREADS_FC],
|
||||
[lam_sthread_f77_success=1])
|
||||
[OMPI_CONFIG_SOLARIS_THREADS_FC],
|
||||
[ompi_sthread_f77_success=1])
|
||||
|
||||
CFLAGS="$orig_CFLAGS"
|
||||
FFLAGS="$orig_FFLAGS"
|
||||
@ -220,9 +220,9 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
||||
LDFLAGS="$orig_LDFLAGS"
|
||||
LIBS="$orig_LIBS"
|
||||
|
||||
if test "$lam_sthread_c_success" = "1" -a \
|
||||
"$lam_sthread_cxx_success" = "1" -a \
|
||||
"$lam_sthread_f77_success" = "1"; then
|
||||
if test "$ompi_sthread_c_success" = "1" -a \
|
||||
"$ompi_sthread_cxx_success" = "1" -a \
|
||||
"$ompi_sthread_f77_success" = "1"; then
|
||||
internal_useless=1
|
||||
$1
|
||||
else
|
||||
@ -230,7 +230,7 @@ else
|
||||
$2
|
||||
fi
|
||||
|
||||
unset lam_sthread_c_success lam_sthread_f77_success lam_sthread_cxx_success
|
||||
unset ompi_sthread_c_success ompi_sthread_f77_success ompi_sthread_cxx_success
|
||||
unset internal_useless
|
||||
])dnl
|
||||
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_CONFIG_SUBDIR],[
|
||||
AC_DEFUN([OMPI_CONFIG_SUBDIR],[
|
||||
#
|
||||
# Invoke configure in a specific subdirectory.
|
||||
#
|
||||
@ -22,7 +22,7 @@ subdir_failure="$4"
|
||||
#
|
||||
|
||||
if test "$subdir_dir" != ":" -a -d $srcdir/$subdir_dir; then
|
||||
AC_MSG_NOTICE([LAM configuring in $subdir_dir])
|
||||
AC_MSG_NOTICE([OMPI configuring in $subdir_dir])
|
||||
|
||||
#
|
||||
# Gotta check where srcdir is for VPATH builds. If srcdir is not
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_CONFIG_SUBDIR_ARGS],[
|
||||
AC_DEFUN([OMPI_CONFIG_SUBDIR_ARGS],[
|
||||
#
|
||||
# Invoke configure in subdirectories.
|
||||
#
|
||||
|
@ -2,7 +2,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_CONFIG_THREADS],[
|
||||
AC_DEFUN([OMPI_CONFIG_THREADS],[
|
||||
#
|
||||
# Arguments: none
|
||||
#
|
||||
@ -15,15 +15,15 @@ AC_DEFUN([LAM_CONFIG_THREADS],[
|
||||
#
|
||||
|
||||
# create templates
|
||||
AH_TEMPLATE([LAM_HAVE_SOLARIS_THREADS],
|
||||
AH_TEMPLATE([OMPI_HAVE_SOLARIS_THREADS],
|
||||
[Do we have native Solaris threads])
|
||||
AH_TEMPLATE([LAM_HAVE_POSIX_THREADS],
|
||||
AH_TEMPLATE([OMPI_HAVE_POSIX_THREADS],
|
||||
[Do we have POSIX threads])
|
||||
|
||||
#
|
||||
# Check for thread types - add your type here...
|
||||
#
|
||||
LAM_CONFIG_POSIX_THREADS(HAVE_POSIX_THREADS=1, HAVE_POSIX_THREADS=0)
|
||||
OMPI_CONFIG_POSIX_THREADS(HAVE_POSIX_THREADS=1, HAVE_POSIX_THREADS=0)
|
||||
AC_MSG_CHECKING([for working POSIX threads package])
|
||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -32,7 +32,7 @@ else
|
||||
fi
|
||||
export HAVE_POSIX_THREADS
|
||||
|
||||
LAM_CONFIG_SOLARIS_THREADS(HAVE_SOLARIS_THREADS=1, HAVE_SOLARIS_THREADS=0)
|
||||
OMPI_CONFIG_SOLARIS_THREADS(HAVE_SOLARIS_THREADS=1, HAVE_SOLARIS_THREADS=0)
|
||||
AC_MSG_CHECKING([for working Solaris threads package])
|
||||
if test "$HAVE_SOLARIS_THREADS" = "1" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -103,9 +103,9 @@ AC_MSG_RESULT($THREAD_TYPE)
|
||||
# Blah - this should be made better, but I don't know how...
|
||||
#
|
||||
if test "$THREAD_TYPE" = "solaris"; then
|
||||
AC_DEFINE(LAM_HAVE_SOLARIS_THREADS, 1)
|
||||
AC_DEFINE(LAM_HAVE_POSIX_THREADS, 0)
|
||||
AC_DEFINE(LAM_THREADS_HAVE_DIFFERENT_PIDS, 0)
|
||||
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 1)
|
||||
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
|
||||
AC_DEFINE(OMPI_THREADS_HAVE_DIFFERENT_PIDS, 0)
|
||||
|
||||
THREAD_CFLAGS="$STHREAD_CFLAGS"
|
||||
THREAD_FFLAGS="$STHREAD_FFLAGS"
|
||||
@ -115,8 +115,8 @@ if test "$THREAD_TYPE" = "solaris"; then
|
||||
THREAD_LDFLAGS="$STHREAD_LDFLAGS"
|
||||
THREAD_LIBS="$STHREAD_LIBS"
|
||||
elif test "$THREAD_TYPE" = "posix"; then
|
||||
AC_DEFINE(LAM_HAVE_SOLARIS_THREADS, 0)
|
||||
AC_DEFINE(LAM_HAVE_POSIX_THREADS, 1)
|
||||
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
|
||||
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 1)
|
||||
|
||||
THREAD_CFLAGS="$PTHREAD_CFLAGS"
|
||||
THREAD_FFLAGS="$PTHREAD_FFLAGS"
|
||||
@ -126,10 +126,10 @@ elif test "$THREAD_TYPE" = "posix"; then
|
||||
THREAD_LDFLAGS="$PTHREAD_LDFLAGS"
|
||||
THREAD_LIBS="$PTHREAD_LIBS"
|
||||
|
||||
LAM_CHECK_PTHREAD_PIDS
|
||||
OMPI_CHECK_PTHREAD_PIDS
|
||||
elif test "$THREAD_TYPE" = "none"; then
|
||||
AC_DEFINE(LAM_HAVE_SOLARIS_THREADS, 0)
|
||||
AC_DEFINE(LAM_HAVE_POSIX_THREADS, 0)
|
||||
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
|
||||
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
|
||||
|
||||
TRHEAD_CFLAGS=
|
||||
THREAD_FFLAGS=
|
||||
@ -143,14 +143,14 @@ else
|
||||
|
||||
************************************************************************
|
||||
|
||||
LAM/MPI was unable to find threading support on your system. In the
|
||||
near future, the LAM development team is considering requiring
|
||||
threading support for proper LAM execution. This is in part because
|
||||
OMPI/MPI was unable to find threading support on your system. In the
|
||||
near future, the OMPI development team is considering requiring
|
||||
threading support for proper OMPI execution. This is in part because
|
||||
we are not aware of any users that do not have thread support - so we
|
||||
need you to e-mail us at lam@lam-mpi.org and let us know about this
|
||||
need you to e-mail us at ompi@ompi-mpi.org and let us know about this
|
||||
problem.
|
||||
|
||||
To build this version of LAM/MPI without thread support, re-run
|
||||
To build this version of OMPI/MPI without thread support, re-run
|
||||
configure with the '--without-threads' option.
|
||||
|
||||
************************************************************************
|
||||
|
@ -3,8 +3,8 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_CONFIGURE_OPTIONS],[
|
||||
lam_show_subtitle "Configuration options"
|
||||
AC_DEFUN([OMPI_CONFIGURE_OPTIONS],[
|
||||
ompi_show_subtitle "Configuration options"
|
||||
|
||||
#
|
||||
# Memory debugging
|
||||
@ -27,7 +27,7 @@ if test "$WANT_MEM_DEBUG" = "0" -a -z "$enable_mem_zero" -a -d .svn; then
|
||||
echo "--> developer override: enable mem profiling by default"
|
||||
fi
|
||||
#################### Early development override ####################
|
||||
AC_DEFINE_UNQUOTED(LAM_ENABLE_MEM_DEBUG, $WANT_MEM_DEBUG,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ENABLE_MEM_DEBUG, $WANT_MEM_DEBUG,
|
||||
[Whether we want the memory profiling or not])
|
||||
|
||||
#
|
||||
@ -51,7 +51,7 @@ if test "$WANT_MEM_PROFILE" = "0" -a -z "$enable_mem_zero" -a -d .svn; then
|
||||
echo "--> developer override: enable mem profiling by default"
|
||||
fi
|
||||
#################### Early development override ####################
|
||||
AC_DEFINE_UNQUOTED(LAM_ENABLE_MEM_PROFILE, $WANT_MEM_PROFILE,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ENABLE_MEM_PROFILE, $WANT_MEM_PROFILE,
|
||||
[Whether we want the memory profiling or not])
|
||||
|
||||
#
|
||||
@ -101,7 +101,7 @@ if test "$WANT_DEBUG" = "0"; then
|
||||
CFLAGS="-DNDEBUG $CFLAGS"
|
||||
CXXFLAGS="-DNDEBUG $CFLAGS"
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(LAM_ENABLE_DEBUG, $WANT_DEBUG,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ENABLE_DEBUG, $WANT_DEBUG,
|
||||
[Whether we want developer-level debugging code or not])
|
||||
|
||||
|
||||
@ -115,10 +115,10 @@ AC_ARG_ENABLE(f77,
|
||||
[enable f77 MPI bindings (default: enabled)]))
|
||||
if test "$enable_f77" != "no"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
LAM_WANT_F77_BINDINGS=1
|
||||
OMPI_WANT_F77_BINDINGS=1
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
LAM_WANT_F77_BINDINGS=0
|
||||
OMPI_WANT_F77_BINDINGS=0
|
||||
fi
|
||||
|
||||
|
||||
@ -132,10 +132,10 @@ AC_ARG_ENABLE(f90,
|
||||
[enable f90 MPI bindings (default: enabled)]))
|
||||
if test "$enable_f90" != "no"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
LAM_WANT_F90_BINDINGS=1
|
||||
OMPI_WANT_F90_BINDINGS=1
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
LAM_WANT_F90_BINDINGS=0
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
fi
|
||||
|
||||
|
||||
@ -180,7 +180,7 @@ AC_MSG_CHECKING([if want run-time MPI parameter checking])
|
||||
AC_ARG_ENABLE(mpi-param-check,
|
||||
AC_HELP_STRING([--with-mpi-param-check],
|
||||
[behavior of MPI function parameter checking. Valid values are: always, never, runtime (default: runtime)]))
|
||||
mpi_param_check=lam_mpi_param_check
|
||||
mpi_param_check=ompi_mpi_param_check
|
||||
if test "$with_mpi_param_check" = "no" -o \
|
||||
"$with_mpi_param_check" = "never"; then
|
||||
mpi_param_check=0
|
||||
@ -203,10 +203,10 @@ AC_DEFINE_UNQUOTED(MPI_PARAM_CHECK, $mpi_param_check,
|
||||
|
||||
|
||||
#
|
||||
# Do we want to install all of LAM's header files?
|
||||
# Do we want to install all of OMPI's header files?
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([if want to install LAM header files])
|
||||
AC_MSG_CHECKING([if want to install OMPI header files])
|
||||
AC_ARG_WITH(devel-headers,
|
||||
AC_HELP_STRING([--with-devel-headers],
|
||||
[normal MPI users/applications do not need this (mpi.h and mpif.h are ALWAYS installed). Developer headers are only necessary for MCA module authors (default: disabled).]))
|
||||
@ -223,7 +223,7 @@ AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1)
|
||||
# ...?
|
||||
|
||||
# amorphous, seem-to-be-good-idea options
|
||||
# --with-lam=maintainer_options
|
||||
# --with-ompi=maintainer_options
|
||||
# --with-mca-*
|
||||
# ...?
|
||||
|
||||
@ -232,7 +232,7 @@ AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1)
|
||||
#
|
||||
AC_MSG_CHECKING(if want deprecated executable names)
|
||||
AC_ARG_ENABLE(deprecated-executable-names,
|
||||
AC_HELP_STRING([--enable-deprecated-executable-names], [make sym links to deprecated LAM executables (e.g., hcc, hcp, hf77, wipe) (default: disabled)]))
|
||||
AC_HELP_STRING([--enable-deprecated-executable-names], [make sym links to deprecated OMPI executables (e.g., hcc, hcp, hf77, wipe) (default: disabled)]))
|
||||
if test "$enable_deprecated_executable_names" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
WANT_DEN=1
|
||||
|
@ -3,13 +3,13 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_CONFIGURE_SETUP],[
|
||||
AC_DEFUN([OMPI_CONFIGURE_SETUP],[
|
||||
|
||||
# Some helper script functions. Unfortunately, we cannot use $1 kinds
|
||||
# of arugments here because of the m4 substitution. So we have to set
|
||||
# special variable names before invoking the function. :-\
|
||||
|
||||
lam_show_title() {
|
||||
ompi_show_title() {
|
||||
cat <<EOF
|
||||
|
||||
============================================================================
|
||||
@ -19,7 +19,7 @@ EOF
|
||||
}
|
||||
|
||||
|
||||
lam_show_subtitle() {
|
||||
ompi_show_subtitle() {
|
||||
cat <<EOF
|
||||
|
||||
*** ${1}
|
||||
@ -29,29 +29,29 @@ EOF
|
||||
# Save some stats about this build
|
||||
#
|
||||
|
||||
LAM_CONFIGURE_USER="`whoami`"
|
||||
LAM_CONFIGURE_HOST="`hostname | head -n 1`"
|
||||
LAM_CONFIGURE_DATE="`date`"
|
||||
OMPI_CONFIGURE_USER="`whoami`"
|
||||
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
|
||||
OMPI_CONFIGURE_DATE="`date`"
|
||||
|
||||
#
|
||||
# Save these details so that they can be used in laminfo later
|
||||
# Save these details so that they can be used in ompi_info later
|
||||
#
|
||||
AC_SUBST(LAM_CONFIGURE_USER)
|
||||
AC_SUBST(LAM_CONFIGURE_HOST)
|
||||
AC_SUBST(LAM_CONFIGURE_DATE)])dnl
|
||||
AC_SUBST(OMPI_CONFIGURE_USER)
|
||||
AC_SUBST(OMPI_CONFIGURE_HOST)
|
||||
AC_SUBST(OMPI_CONFIGURE_DATE)])dnl
|
||||
|
||||
dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
|
||||
AC_DEFUN([LAM_BASIC_SETUP],[
|
||||
AC_DEFUN([OMPI_BASIC_SETUP],[
|
||||
#
|
||||
# Save some stats about this build
|
||||
#
|
||||
|
||||
LAM_CONFIGURE_USER="`whoami`"
|
||||
LAM_CONFIGURE_HOST="`hostname | head -n 1`"
|
||||
LAM_CONFIGURE_DATE="`date`"
|
||||
OMPI_CONFIGURE_USER="`whoami`"
|
||||
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
|
||||
OMPI_CONFIGURE_DATE="`date`"
|
||||
|
||||
#
|
||||
# Make automake clean emacs ~ files for "make clean"
|
||||
@ -61,26 +61,26 @@ CLEANFILES="*~ .\#*"
|
||||
AC_SUBST(CLEANFILES)
|
||||
|
||||
#
|
||||
# This is useful later (laminfo, and therefore mpiexec)
|
||||
# This is useful later (ompi_info, and therefore mpiexec)
|
||||
#
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_DEFINE_UNQUOTED(LAM_ARCH, "$host", [LAM architecture string])
|
||||
AC_DEFINE_UNQUOTED(OMPI_ARCH, "$host", [OMPI architecture string])
|
||||
|
||||
#
|
||||
# See if we can find an old installation of LAM to overwrite
|
||||
# See if we can find an old installation of OMPI to overwrite
|
||||
#
|
||||
|
||||
# Stupid autoconf 2.54 has a bug in AC_PREFIX_PROGRAM -- if lamclean
|
||||
# Stupid autoconf 2.54 has a bug in AC_PREFIX_PROGRAM -- if ompi_clean
|
||||
# is not found in the path and the user did not specify --prefix,
|
||||
# we'll get a $prefix of "."
|
||||
|
||||
lam_prefix_save="$prefix"
|
||||
AC_PREFIX_PROGRAM(lamclean)
|
||||
ompi_prefix_save="$prefix"
|
||||
AC_PREFIX_PROGRAM(ompi_clean)
|
||||
if test "$prefix" = "."; then
|
||||
prefix="$lam_prefix_save"
|
||||
prefix="$ompi_prefix_save"
|
||||
fi
|
||||
unset lam_prefix_save
|
||||
unset ompi_prefix_save
|
||||
|
||||
#
|
||||
# Basic sanity checking; we can't install to a relative path
|
||||
@ -107,9 +107,9 @@ esac
|
||||
AC_ARG_ENABLE(dist,
|
||||
AC_HELP_STRING([--enable-dist],
|
||||
[guarantee that that the "dist" make target will be functional, although may not guarantee that any other make target will be functional.]),
|
||||
LAM_WANT_DIST=yes, LAM_WANT_DIST=no)
|
||||
OMPI_WANT_DIST=yes, OMPI_WANT_DIST=no)
|
||||
|
||||
if test "$LAM_WANT_DIST" = "yes"; then
|
||||
if test "$OMPI_WANT_DIST" = "yes"; then
|
||||
AC_MSG_WARN([Configuring in 'make dist' mode])
|
||||
AC_MSG_WARN([Most make targets may be non-functional!])
|
||||
fi])dnl
|
||||
@ -118,7 +118,7 @@ dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
|
||||
AC_DEFUN([LAM_LOG_MSG],[
|
||||
AC_DEFUN([OMPI_LOG_MSG],[
|
||||
# 1 is the message
|
||||
# 2 is whether to put a prefix or not
|
||||
if test -n "$2"; then
|
||||
@ -131,7 +131,7 @@ dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
|
||||
AC_DEFUN([LAM_LOG_FILE],[
|
||||
AC_DEFUN([OMPI_LOG_FILE],[
|
||||
# 1 is the filename
|
||||
if test -n "$1" -a -f "$1"; then
|
||||
cat $1 >&5
|
||||
@ -141,19 +141,19 @@ dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
|
||||
AC_DEFUN([LAM_LOG_COMMAND],[
|
||||
AC_DEFUN([OMPI_LOG_COMMAND],[
|
||||
# 1 is the command
|
||||
# 2 is actions to do if success
|
||||
# 3 is actions to do if fail
|
||||
echo "configure:__oline__: $1" >&5
|
||||
$1 1>&5 2>&1
|
||||
lam_status=$?
|
||||
LAM_LOG_MSG([\$? = $lam_status], 1)
|
||||
if test "$lam_status" = "0"; then
|
||||
unset lam_status
|
||||
ompi_status=$?
|
||||
OMPI_LOG_MSG([\$? = $ompi_status], 1)
|
||||
if test "$ompi_status" = "0"; then
|
||||
unset ompi_status
|
||||
$2
|
||||
else
|
||||
unset lam_status
|
||||
unset ompi_status
|
||||
$3
|
||||
fi])dnl
|
||||
|
||||
@ -161,73 +161,73 @@ dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
dnl #######################################################################
|
||||
|
||||
AC_DEFUN([LAM_UNIQ],[
|
||||
AC_DEFUN([OMPI_UNIQ],[
|
||||
# 1 is the variable name to be uniq-ized
|
||||
lam_name=$1
|
||||
ompi_name=$1
|
||||
|
||||
# Go through each item in the variable and only keep the unique ones
|
||||
|
||||
lam_count=0
|
||||
ompi_count=0
|
||||
for val in ${$1}; do
|
||||
lam_done=0
|
||||
lam_i=1
|
||||
lam_found=0
|
||||
ompi_done=0
|
||||
ompi_i=1
|
||||
ompi_found=0
|
||||
|
||||
# Loop over every token we've seen so far
|
||||
|
||||
lam_done="`expr $lam_i \> $lam_count`"
|
||||
while test "$lam_found" = "0" -a "$lam_done" = "0"; do
|
||||
ompi_done="`expr $ompi_i \> $ompi_count`"
|
||||
while test "$ompi_found" = "0" -a "$ompi_done" = "0"; do
|
||||
|
||||
# Have we seen this token already? Prefix the comparison with
|
||||
# "x" so that "-Lfoo" values won't be cause an error.
|
||||
|
||||
lam_eval="expr x$val = x\$lam_array_$lam_i"
|
||||
lam_found=`eval $lam_eval`
|
||||
ompi_eval="expr x$val = x\$ompi_array_$ompi_i"
|
||||
ompi_found=`eval $ompi_eval`
|
||||
|
||||
# Check the ending condition
|
||||
|
||||
lam_done="`expr $lam_i \>= $lam_count`"
|
||||
ompi_done="`expr $ompi_i \>= $ompi_count`"
|
||||
|
||||
# Increment the counter
|
||||
|
||||
lam_i="`expr $lam_i + 1`"
|
||||
ompi_i="`expr $ompi_i + 1`"
|
||||
done
|
||||
|
||||
# If we didn't find the token, add it to the "array"
|
||||
|
||||
if test "$lam_found" = "0"; then
|
||||
lam_eval="lam_array_$lam_i=$val"
|
||||
eval $lam_eval
|
||||
lam_count="`expr $lam_count + 1`"
|
||||
if test "$ompi_found" = "0"; then
|
||||
ompi_eval="ompi_array_$ompi_i=$val"
|
||||
eval $ompi_eval
|
||||
ompi_count="`expr $ompi_count + 1`"
|
||||
else
|
||||
lam_i="`expr $lam_i - 1`"
|
||||
ompi_i="`expr $ompi_i - 1`"
|
||||
fi
|
||||
done
|
||||
|
||||
# Take all the items in the "array" and assemble them back into a
|
||||
# single variable
|
||||
|
||||
lam_i=1
|
||||
lam_done="`expr $lam_i \> $lam_count`"
|
||||
lam_newval=
|
||||
while test "$lam_done" = "0"; do
|
||||
lam_eval="lam_newval=\"$lam_newval \$lam_array_$lam_i\""
|
||||
eval $lam_eval
|
||||
ompi_i=1
|
||||
ompi_done="`expr $ompi_i \> $ompi_count`"
|
||||
ompi_newval=
|
||||
while test "$ompi_done" = "0"; do
|
||||
ompi_eval="ompi_newval=\"$ompi_newval \$ompi_array_$ompi_i\""
|
||||
eval $ompi_eval
|
||||
|
||||
lam_eval="unset lam_array_$lam_i"
|
||||
eval $lam_eval
|
||||
ompi_eval="unset ompi_array_$ompi_i"
|
||||
eval $ompi_eval
|
||||
|
||||
lam_done="`expr $lam_i \>= $lam_count`"
|
||||
lam_i="`expr $lam_i + 1`"
|
||||
ompi_done="`expr $ompi_i \>= $ompi_count`"
|
||||
ompi_i="`expr $ompi_i + 1`"
|
||||
done
|
||||
|
||||
# Done; do the assignment
|
||||
|
||||
lam_newval="`echo $lam_newval`"
|
||||
lam_eval="$lam_name=\"$lam_newval\""
|
||||
eval $lam_eval
|
||||
ompi_newval="`echo $ompi_newval`"
|
||||
ompi_eval="$ompi_name=\"$ompi_newval\""
|
||||
eval $ompi_eval
|
||||
|
||||
# Clean up
|
||||
|
||||
unset lam_name lam_i lam_done lam_newval lam_eval lam_count])dnl
|
||||
unset ompi_name ompi_i ompi_done ompi_newval ompi_eval ompi_count])dnl
|
||||
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER
|
||||
denl
|
||||
|
||||
AC_DEFUN([LAM_CHECK_LINKER_FLAGS],[
|
||||
AC_DEFUN([OMPI_CHECK_LINKER_FLAGS],[
|
||||
#
|
||||
# libtool has been created by this point
|
||||
# Try to see if it will add any additional flags for dependant libraries
|
||||
@ -32,14 +32,14 @@ cat > foo.c <<EOF
|
||||
int foo(void) { return 0; }
|
||||
EOF
|
||||
|
||||
lam_check_linker_flags_work() {
|
||||
LAM_LOG_MSG([$cmd], [yes])
|
||||
ompi_check_linker_flags_work() {
|
||||
OMPI_LOG_MSG([$cmd], [yes])
|
||||
eval $cmd >&5 2>&5
|
||||
if test -n "[$]1"; then
|
||||
output="`eval $cmd 2>/dev/null`"
|
||||
fi
|
||||
status="$?"
|
||||
LAM_LOG_MSG([\$? = $status], [yes])
|
||||
OMPI_LOG_MSG([\$? = $status], [yes])
|
||||
if test "$status" != "0"; then
|
||||
AC_MSG_RESULT([libtool error!])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
@ -51,16 +51,16 @@ lam_check_linker_flags_work() {
|
||||
#
|
||||
|
||||
cmd="$libtool --mode=compile $CC $CFLAGS foo.c -c -o foo.o"
|
||||
lam_check_linker_flags_work
|
||||
ompi_check_linker_flags_work
|
||||
cmd="$libtool --mode=link $CC $CFLAGS foo.lo $LDFLAGS $LIBS -o libfoo.la"
|
||||
lam_check_linker_flags_work
|
||||
ompi_check_linker_flags_work
|
||||
|
||||
#
|
||||
# Now fake linking to it and capture the output from libtool
|
||||
#
|
||||
|
||||
cmd="$libtool --dry-run --mode=link $CC bar.lo libfoo.la -o bar $extra_flags"
|
||||
lam_check_linker_flags_work yes
|
||||
ompi_check_linker_flags_work yes
|
||||
|
||||
eval "set $output"
|
||||
extra_ldflags=
|
||||
|
@ -3,14 +3,14 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_GET_VERSION],[
|
||||
AC_DEFUN([OMPI_GET_VERSION],[
|
||||
gv_glv_dir="$1"
|
||||
gv_ver_file="$2"
|
||||
gv_prefix="$3"
|
||||
|
||||
# Find the get_lam_version program
|
||||
# Find the get_ompi_version program
|
||||
|
||||
gv_prog="sh $gv_glv_dir/lam_get_version.sh $gv_ver_file"
|
||||
gv_prog="sh $gv_glv_dir/ompi_get_version.sh $gv_ver_file"
|
||||
|
||||
dnl quote eval to suppress macro expansion with non-GNU m4
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
# Since we do this in multiple places, it's worth putting in a
|
||||
# separate shell script. Very primitive script to get the version
|
||||
# number of LAM into a coherent variable. Can query for any of the
|
||||
# number of OMPI into a coherent variable. Can query for any of the
|
||||
# individual parts of the version number, too.
|
||||
#
|
||||
|
||||
@ -14,33 +14,33 @@ option="$2"
|
||||
if test "$srcfile" = ""; then
|
||||
option="--help"
|
||||
else
|
||||
LAM_MAJOR_VERSION="`cat $srcfile | grep major | cut -d= -f2`"
|
||||
LAM_MINOR_VERSION="`cat $srcfile | grep minor | cut -d= -f2`"
|
||||
LAM_RELEASE_VERSION="`cat $srcfile | grep release | cut -d= -f2`"
|
||||
LAM_ALPHA_VERSION="`cat $srcfile | grep alpha | cut -d= -f2`"
|
||||
LAM_BETA_VERSION="`cat $srcfile | grep beta | cut -d= -f2`"
|
||||
LAM_SVN_VERSION="`cat $srcfile | grep svn | cut -d= -f2`"
|
||||
if test "$LAM_RELEASE_VERSION" != "0" -a "$LAM_RELEASE_VERSION" != ""; then
|
||||
LAM_VERSION="$LAM_MAJOR_VERSION.$LAM_MINOR_VERSION.$LAM_RELEASE_VERSION"
|
||||
OMPI_MAJOR_VERSION="`cat $srcfile | grep major | cut -d= -f2`"
|
||||
OMPI_MINOR_VERSION="`cat $srcfile | grep minor | cut -d= -f2`"
|
||||
OMPI_RELEASE_VERSION="`cat $srcfile | grep release | cut -d= -f2`"
|
||||
OMPI_ALPHA_VERSION="`cat $srcfile | grep alpha | cut -d= -f2`"
|
||||
OMPI_BETA_VERSION="`cat $srcfile | grep beta | cut -d= -f2`"
|
||||
OMPI_SVN_VERSION="`cat $srcfile | grep svn | cut -d= -f2`"
|
||||
if test "$OMPI_RELEASE_VERSION" != "0" -a "$OMPI_RELEASE_VERSION" != ""; then
|
||||
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION.$OMPI_RELEASE_VERSION"
|
||||
else
|
||||
LAM_VERSION="$LAM_MAJOR_VERSION.$LAM_MINOR_VERSION"
|
||||
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION"
|
||||
fi
|
||||
|
||||
if test "`expr $LAM_ALPHA_VERSION \> 0`" = "1"; then
|
||||
LAM_VERSION="${LAM_VERSION}a$LAM_ALPHA_VERSION"
|
||||
elif test "`expr $LAM_BETA_VERSION \> 0`" = "1"; then
|
||||
LAM_VERSION="${LAM_VERSION}b$LAM_BETA_VERSION"
|
||||
if test "`expr $OMPI_ALPHA_VERSION \> 0`" = "1"; then
|
||||
OMPI_VERSION="${OMPI_VERSION}a$OMPI_ALPHA_VERSION"
|
||||
elif test "`expr $OMPI_BETA_VERSION \> 0`" = "1"; then
|
||||
OMPI_VERSION="${OMPI_VERSION}b$OMPI_BETA_VERSION"
|
||||
fi
|
||||
|
||||
if test "$LAM_SVN_VERSION" = "1"; then
|
||||
LAM_VERSION="${LAM_VERSION}svn"
|
||||
elif test "`expr $LAM_SVN_VERSION \> 0`" = "1"; then
|
||||
if test "$OMPI_SVN_VERSION" = "1"; then
|
||||
OMPI_VERSION="${OMPI_VERSION}svn"
|
||||
elif test "`expr $OMPI_SVN_VERSION \> 0`" = "1"; then
|
||||
if test -d .svn; then
|
||||
ver="r`svn info . | grep Revision | cut -d\ -f 2`"
|
||||
else
|
||||
ver="svn`date '+%m%d%Y'`"
|
||||
fi
|
||||
LAM_VERSION="${LAM_VERSION}$ver"
|
||||
OMPI_VERSION="${OMPI_VERSION}$ver"
|
||||
fi
|
||||
|
||||
if test "$option" = ""; then
|
||||
@ -50,28 +50,28 @@ fi
|
||||
|
||||
case "$option" in
|
||||
--full|-v|--version)
|
||||
echo $LAM_VERSION
|
||||
echo $OMPI_VERSION
|
||||
;;
|
||||
--major)
|
||||
echo $LAM_MAJOR_VERSION
|
||||
echo $OMPI_MAJOR_VERSION
|
||||
;;
|
||||
--minor)
|
||||
echo $LAM_MINOR_VERSION
|
||||
echo $OMPI_MINOR_VERSION
|
||||
;;
|
||||
--release)
|
||||
echo $LAM_RELEASE_VERSION
|
||||
echo $OMPI_RELEASE_VERSION
|
||||
;;
|
||||
--alpha)
|
||||
echo $LAM_ALPHA_VERSION
|
||||
echo $OMPI_ALPHA_VERSION
|
||||
;;
|
||||
--beta)
|
||||
echo $LAM_BETA_VERSION
|
||||
echo $OMPI_BETA_VERSION
|
||||
;;
|
||||
--svn)
|
||||
echo $LAM_SVN_VERSION
|
||||
echo $OMPI_SVN_VERSION
|
||||
;;
|
||||
--all)
|
||||
echo ${LAM_VERSION}:${LAM_MAJOR_VERSION}:${LAM_MINOR_VERSION}:${LAM_RELEASE_VERSION}:${LAM_ALPHA_VERSION}:${LAM_BETA_VERSION}:${LAM_SVN_VERSION}
|
||||
echo ${OMPI_VERSION}:${OMPI_MAJOR_VERSION}:${OMPI_MINOR_VERSION}:${OMPI_RELEASE_VERSION}:${OMPI_ALPHA_VERSION}:${OMPI_BETA_VERSION}:${OMPI_SVN_VERSION}
|
||||
;;
|
||||
-h|--help)
|
||||
cat <<EOF
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_MCA],[
|
||||
AC_DEFUN([OMPI_MCA],[
|
||||
|
||||
# Find which modules should be built as run-time loadable modules
|
||||
# Acceptable combinations:
|
||||
@ -17,7 +17,7 @@ AC_DEFUN([LAM_MCA],[
|
||||
AC_MSG_CHECKING([which modules should be run-time loadable])
|
||||
AC_ARG_WITH(modules,
|
||||
AC_HELP_STRING([--with-modules=LIST],
|
||||
[comma-separated list of types and/or type-module pairs of modules that will be built as run-time loadable modules (as opposed to statically linked in LAM/MPI (if supported on this platform). This directly implies "--enable-shared=LIST and --disable-static=LIST".]))
|
||||
[comma-separated list of types and/or type-module pairs of modules that will be built as run-time loadable modules (as opposed to statically linked in OMPI/MPI (if supported on this platform). This directly implies "--enable-shared=LIST and --disable-static=LIST".]))
|
||||
|
||||
if test "$with_modules" = "" -o "$with_modules" = "no"; then
|
||||
LOADABLE_MODULE_all=0
|
||||
@ -97,14 +97,14 @@ for type in $found_types; do
|
||||
$outfile.all $outfile.static $outfile.dynamic
|
||||
|
||||
# Manual conversion of $type to its generic name (e.g., crmpi->cr,
|
||||
# crlam->cr).
|
||||
# crompi->cr).
|
||||
# JMS Fix this
|
||||
|
||||
case "$type" in
|
||||
crmpi)
|
||||
generic_type="cr"
|
||||
;;
|
||||
crlam)
|
||||
crompi)
|
||||
generic_type="cr"
|
||||
;;
|
||||
*)
|
||||
@ -120,8 +120,8 @@ for type in $found_types; do
|
||||
for module in $found_modules; do
|
||||
m=`basename "$module"`
|
||||
|
||||
if test -d $srcdir/$module -a ! -f $srcdir/$module/.lam_ignore; then
|
||||
lam_show_subtitle "MCA module $type:$m (no configure script)"
|
||||
if test -d $srcdir/$module -a ! -f $srcdir/$module/.ompi_ignore; then
|
||||
ompi_show_subtitle "MCA module $type:$m (no configure script)"
|
||||
|
||||
# Remove any possible sym link in the mca-dynamic tree
|
||||
|
||||
@ -157,8 +157,8 @@ for type in $found_types; do
|
||||
HAPPY=0
|
||||
m="`basename $module`"
|
||||
if test -d $module -a -x $module/configure -a \
|
||||
! -f $module/.lam_ignore; then
|
||||
lam_show_subtitle "MCA module $type:$m (need to configure)"
|
||||
! -f $module/.ompi_ignore; then
|
||||
ompi_show_subtitle "MCA module $type:$m (need to configure)"
|
||||
|
||||
# We found one!
|
||||
|
||||
@ -170,8 +170,8 @@ for type in $found_types; do
|
||||
|
||||
# Configure the module subdirectory
|
||||
|
||||
LAM_CONFIG_SUBDIR([src/mca/$type/$m],
|
||||
[$lam_subdir_args],
|
||||
OMPI_CONFIG_SUBDIR([src/mca/$type/$m],
|
||||
[$ompi_subdir_args],
|
||||
[HAPPY=1], [HAPPY=0])
|
||||
fi
|
||||
|
||||
@ -226,9 +226,9 @@ unset foo type m modules structs outfile outdir total_dir file \
|
||||
|
||||
# Grumble. It seems that AC_SUBST and AC_DEFINE don't let you
|
||||
# substitue on a variable name that contains a variable (e.g.,
|
||||
# LAM_MCA_$type_SUBDIRS). So we have to do this manually. :-(
|
||||
# OMPI_MCA_$type_SUBDIRS). So we have to do this manually. :-(
|
||||
|
||||
# LAM types
|
||||
# OMPI types
|
||||
|
||||
AC_SUBST(MCA_oob_ALL_SUBDIRS)
|
||||
AC_SUBST(MCA_oob_STATIC_SUBDIRS)
|
||||
@ -329,7 +329,7 @@ if test "$HAPPY" = "1"; then
|
||||
compile_mode="dynamic"
|
||||
echo $m >> $outfile.dynamic
|
||||
ls -l "src/mca/dynamic/$type/$m"
|
||||
$LN_S "$LAM_TOP_BUILDDIR/src/mca/$type/$m" \
|
||||
$LN_S "$OMPI_TOP_BUILDDIR/src/mca/$type/$m" \
|
||||
"src/mca/dynamic/$type/$m"
|
||||
ls -l "src/mca/dynamic/$type/$m"
|
||||
else
|
||||
@ -362,7 +362,7 @@ if test "$HAPPY" = "1"; then
|
||||
|
||||
# Now check for the rest of the tags
|
||||
|
||||
for scope in LIBLAM LIBMPI WRAPPER; do
|
||||
for scope in LIBOMPI LIBMPI WRAPPER; do
|
||||
for flags in CFLAGS CXXFLAGS FFLAGS LDFLAGS LIBS; do
|
||||
var="${scope}_EXTRA_${flags}"
|
||||
line="`grep $var= $infile | cut -d= -f2-`"
|
||||
|
@ -3,12 +3,12 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_SETUP_CC],[
|
||||
AC_DEFUN([OMPI_SETUP_CC],[
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
|
||||
lam_show_subtitle "C compiler and preprocessor"
|
||||
ompi_show_subtitle "C compiler and preprocessor"
|
||||
|
||||
# $%@#!@#% AIX!! This has to be called before anything invokes the C
|
||||
# compiler.
|
||||
@ -19,25 +19,25 @@ dnl AC_AIX
|
||||
# Check for the compiler
|
||||
#
|
||||
|
||||
lam_cflags_save="$CFLAGS"
|
||||
ompi_cflags_save="$CFLAGS"
|
||||
AC_PROG_CC
|
||||
BASECC="`basename $CC`"
|
||||
CFLAGS="$lam_cflags_save"
|
||||
AC_DEFINE_UNQUOTED(LAM_CC, "$CC", [LAM underlying C compiler])
|
||||
CFLAGS="$ompi_cflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CC, "$CC", [OMPI underlying C compiler])
|
||||
|
||||
# When building LAM, we need this everywhere
|
||||
# When building OMPI, we need this everywhere
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DLAM_BUILDING=1"
|
||||
CPPFLAGS="$CPPFLAGS -DOMPI_BUILDING=1"
|
||||
|
||||
# Do we want debugging?
|
||||
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
CFLAGS="$CFLAGS -g"
|
||||
LAM_UNIQ(CFLAGS)
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([-g has been added to CFLAGS (--enable-debug)])
|
||||
fi
|
||||
|
||||
LAM_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
||||
if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
add="-Wall -Wundef -Wno-long-long"
|
||||
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
||||
@ -52,7 +52,7 @@ if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
add="$add -Werror-implicit-function-declaration "
|
||||
|
||||
CFLAGS="$CFLAGS $add"
|
||||
LAM_UNIQ(CFLAGS)
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CFLAGS (developer copy)])
|
||||
unset add
|
||||
fi
|
||||
@ -64,7 +64,7 @@ if test "$GCC" = "yes"; then
|
||||
add=
|
||||
AC_TRY_COMPILE([], [], add=" -finline-functions")
|
||||
CFLAGS="$CFLAGS_orig$add"
|
||||
LAM_UNIQ(CFLAGS)
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
||||
unset add
|
||||
fi
|
||||
@ -82,10 +82,10 @@ else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
|
||||
LAM_CHECK_OPTFLAGS("$LAM_CFLAGS_BEFORE_PICKY")
|
||||
LAM_CFLAGS_BEFORE_PICKY="$co_result"
|
||||
OMPI_CHECK_OPTFLAGS("$OMPI_CFLAGS_BEFORE_PICKY")
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$co_result"
|
||||
|
||||
AC_MSG_CHECKING([for C optimization flags])
|
||||
LAM_CHECK_OPTFLAGS("$CFLAGS")
|
||||
OMPI_CHECK_OPTFLAGS("$CFLAGS")
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CFLAGS="$co_result"])
|
||||
|
@ -3,29 +3,29 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_SETUP_CXX],[
|
||||
AC_DEFUN([OMPI_SETUP_CXX],[
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
|
||||
lam_show_subtitle "C++ compiler and preprocessor"
|
||||
ompi_show_subtitle "C++ compiler and preprocessor"
|
||||
|
||||
lam_cxxflags_save="$CXXFLAGS"
|
||||
ompi_cxxflags_save="$CXXFLAGS"
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
BASECXX="`basename $CXX`"
|
||||
CXXFLAGS="$lam_cxxflags_save"
|
||||
AC_DEFINE_UNQUOTED(LAM_CXX, "$CXX", [LAM underlying C++ compiler])
|
||||
CXXFLAGS="$ompi_cxxflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
|
||||
|
||||
# Do we want debugging?
|
||||
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
CXXFLAGS="$CXXFLAGS -g"
|
||||
LAM_UNIQ(CXXFLAGS)
|
||||
OMPI_UNIQ(CXXFLAGS)
|
||||
AC_MSG_WARN([-g has been added to CXXFLAGS (--enable-debug)])
|
||||
fi
|
||||
|
||||
LAM_CXXFLAGS_BEFORE_PICKY="$CXXFLAGS"
|
||||
OMPI_CXXFLAGS_BEFORE_PICKY="$CXXFLAGS"
|
||||
if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
add="-g -Wall -Wundef -Wno-long-long"
|
||||
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
||||
@ -39,7 +39,7 @@ if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
CXXFLAGS="$CXXFLAGS $add"
|
||||
LAM_UNIQ(CXXFLAGS)
|
||||
OMPI_UNIQ(CXXFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CXXFLAGS (developer copy)])
|
||||
unset add
|
||||
fi
|
||||
@ -51,7 +51,7 @@ if test "$GCC" = "yes"; then
|
||||
add=
|
||||
AC_TRY_COMPILE([], [], add=" -finline-functions")
|
||||
CXXFLAGS="$CXXFLAGS_orig$add"
|
||||
LAM_UNIQ(CXXFLAGS)
|
||||
OMPI_UNIQ(CXXFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CXXFLAGS])
|
||||
unset add
|
||||
fi
|
||||
@ -74,30 +74,30 @@ AC_MSG_CHECKING([if want C++ exception handling])
|
||||
AC_MSG_RESULT([$ENABLE_CXX_EXCEPTIONS])
|
||||
if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
||||
# config/cxx_have_exceptions.m4
|
||||
LAM_CXX_HAVE_EXCEPTIONS
|
||||
OMPI_CXX_HAVE_EXCEPTIONS
|
||||
# config/cxx_find_exception_flags.m4
|
||||
LAM_CXX_FIND_EXCEPTION_FLAGS
|
||||
if test "$LAM_CXX_EXCEPTIONS" = "1"; then
|
||||
OMPI_CXX_FIND_EXCEPTION_FLAGS
|
||||
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
|
||||
HAVE_CXX_EXCEPTIONS=1
|
||||
CFLAGS="$CFLAGS $LAM_CXX_EXCEPTIONS_CFLAGS"
|
||||
FFLAGS="$FFLAGS $LAM_CXX_EXCEPTIONS_FFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $LAM_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
LDFLAGS="$LDFLAGS $LAM_CXX_EXCEPTIONS_LDFLAGS"
|
||||
CFLAGS="$CFLAGS $OMPI_CXX_EXCEPTIONS_CFLAGS"
|
||||
FFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_FFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
LDFLAGS="$LDFLAGS $OMPI_CXX_EXCEPTIONS_LDFLAGS"
|
||||
|
||||
WRAPPER_EXTRA_CFLAGS="$LAM_CXX_EXCEPTIONS_CFLAGS"
|
||||
WRAPPER_EXTRA_FFLAGS="$LAM_CXX_EXCEPTIONS_FFLAGS"
|
||||
WRAPPER_EXTRA_CXXFLAGS="$LAM_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
WRAPPER_EXTRA_CFLAGS="$OMPI_CXX_EXCEPTIONS_CFLAGS"
|
||||
WRAPPER_EXTRA_FFLAGS="$OMPI_CXX_EXCEPTIONS_FFLAGS"
|
||||
WRAPPER_EXTRA_CXXFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
fi
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(LAM_HAVE_CXX_EXCEPTION_SUPPORT, $HAVE_CXX_EXCEPTIONS,
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_CXX_EXCEPTION_SUPPORT, $HAVE_CXX_EXCEPTIONS,
|
||||
[Whether or not we have compiled with C++ exceptions support])
|
||||
|
||||
# Find some more characteristics of the C++ compiler
|
||||
|
||||
# config/cxx_find_template_repository.m4
|
||||
LAM_CXX_FIND_TEMPLATE_REPOSITORY
|
||||
OMPI_CXX_FIND_TEMPLATE_REPOSITORY
|
||||
# config/cxx_find_template_parameters.m4
|
||||
LAM_CXX_FIND_TEMPLATE_PARAMETERS
|
||||
OMPI_CXX_FIND_TEMPLATE_PARAMETERS
|
||||
|
||||
# If we are on HP-UX, ensure that we're using aCC
|
||||
case "$host" in
|
||||
@ -111,15 +111,15 @@ case "$host" in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Same rationale for g++ as with gcc in LAM_SETUP_CC.
|
||||
# Same rationale for g++ as with gcc in OMPI_SETUP_CC.
|
||||
|
||||
if test "$GXX" = yes; then
|
||||
OPTFLAGS="-O3"
|
||||
else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
# config/lam_check_optflags.m4
|
||||
LAM_CHECK_OPTFLAGS("$CXXFLAGS")
|
||||
# config/ompi_check_optflags.m4
|
||||
OMPI_CHECK_OPTFLAGS("$CXXFLAGS")
|
||||
AC_MSG_CHECKING([for C++ optimization flags])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CXXFLAGS="$co_result"
|
||||
|
@ -5,57 +5,57 @@ dnl
|
||||
dnl sets:
|
||||
dnl F77 : full pathname to compiler
|
||||
dnl BASEF77 : compiler name (no path)
|
||||
dnl LAM_WANT_F77_BINDINGS : (actually set by lam_configure_options, may be
|
||||
dnl OMPI_WANT_F77_BINDINGS : (actually set by ompi_configure_options, may be
|
||||
dnl redefined here)
|
||||
dnl FC : Same as F77. Side effect of AC_PROG_FC. Should
|
||||
dnl not be used
|
||||
dnl defines:
|
||||
dnl LAM_F77 : same as F77
|
||||
dnl LAM_WANT_F77_BINDINGS :
|
||||
dnl OMPI_F77 : same as F77
|
||||
dnl OMPI_WANT_F77_BINDINGS :
|
||||
dnl am_conditional:
|
||||
dnl LAM_WANT_F77_BINDINGS :
|
||||
dnl OMPI_WANT_F77_BINDINGS :
|
||||
|
||||
AC_DEFUN([LAM_SETUP_F77],[
|
||||
AC_DEFUN([OMPI_SETUP_F77],[
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
|
||||
lam_show_subtitle "Fortran 77 compiler"
|
||||
ompi_show_subtitle "Fortran 77 compiler"
|
||||
|
||||
#
|
||||
# Check for the compiler
|
||||
#
|
||||
# Note that we don't actually *use* the fortran compiler to build
|
||||
# anything in LAM; it's only used here in configure to find out
|
||||
# anything in OMPI; it's only used here in configure to find out
|
||||
# symbol conventions, type sizes, etc. We also pass it down to
|
||||
# the wrapper compiler mpif77.
|
||||
#
|
||||
# Always run this test, even if fortran isn't wanted so that F77 has
|
||||
# value for the Fint tests
|
||||
#
|
||||
lam_fflags_save="$FFLAGS"
|
||||
ompi_fflags_save="$FFLAGS"
|
||||
AC_PROG_F77
|
||||
FFLAGS="$lam_fflags_save"
|
||||
FFLAGS="$ompi_fflags_save"
|
||||
if test -z "$F77"; then
|
||||
AC_MSG_WARN([*** Fortran 77 bindings disabled (could not find compiler)])
|
||||
LAM_WANT_F77_BINDINGS=0
|
||||
LAM_F77="none"
|
||||
OMPI_WANT_F77_BINDINGS=0
|
||||
OMPI_F77="none"
|
||||
BASEF77="none"
|
||||
else
|
||||
if test "$LAM_WANT_F77_BINDINGS" = "0" ; then
|
||||
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
|
||||
AC_MSG_WARN([*** Fortran 77 bindings disabled by user])
|
||||
LAM_WANT_F77_BINDINGS=0
|
||||
LAM_F77="$F77"
|
||||
BASEF77="`basename $LAM_F77`"
|
||||
OMPI_WANT_F77_BINDINGS=0
|
||||
OMPI_F77="$F77"
|
||||
BASEF77="`basename $OMPI_F77`"
|
||||
else
|
||||
LAM_WANT_F77_BINDINGS=1
|
||||
LAM_F77="$F77"
|
||||
BASEF77="`basename $LAM_F77`"
|
||||
OMPI_WANT_F77_BINDINGS=1
|
||||
OMPI_F77="$F77"
|
||||
BASEF77="`basename $OMPI_F77`"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(LAM_WANT_F77_BINDINGS, $LAM_WANT_F77_BINDINGS,
|
||||
AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS,
|
||||
[Whether we want the MPI f77 bindings or not])
|
||||
AC_DEFINE_UNQUOTED(LAM_F77, "$LAM_F77", [LAM underlying F77 compiler])
|
||||
AM_CONDITIONAL(LAM_WANT_F77_BINDINGS, test "$LAM_WANT_F77_BINDINGS" = "1")
|
||||
AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])
|
||||
AM_CONDITIONAL(OMPI_WANT_F77_BINDINGS, test "$OMPI_WANT_F77_BINDINGS" = "1")
|
||||
])
|
||||
|
@ -2,37 +2,37 @@ dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
dnl LAM_SETUP_F90
|
||||
dnl OMPI_SETUP_F90
|
||||
dnl
|
||||
dnl sets:
|
||||
dnl F90 : full pathname to compiler
|
||||
dnl BASEF90 : compiler name (no path)
|
||||
dnl LAM_WANT_F90_BINDINGS : (actually set by lam_configure_options, may be
|
||||
dnl OMPI_WANT_F90_BINDINGS : (actually set by ompi_configure_options, may be
|
||||
dnl redefined here)
|
||||
dnl FC : Same as F90. Side effect of AC_PROG_FC. Should
|
||||
dnl not be used
|
||||
dnl defines:
|
||||
dnl LAM_F90 : same as F90
|
||||
dnl LAM_WANT_F90_BINDINGS :
|
||||
dnl OMPI_F90 : same as F90
|
||||
dnl OMPI_WANT_F90_BINDINGS :
|
||||
dnl am_conditional:
|
||||
dnl LAM_WANT_F90_BINDINGS :
|
||||
dnl OMPI_WANT_F90_BINDINGS :
|
||||
|
||||
AC_DEFUN([LAM_SETUP_F90],[
|
||||
AC_DEFUN([OMPI_SETUP_F90],[
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
|
||||
lam_show_subtitle "Fortran 90/95 compiler"
|
||||
ompi_show_subtitle "Fortran 90/95 compiler"
|
||||
|
||||
if test "$LAM_WANT_F77_BINDINGS" = "0" ; then
|
||||
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
|
||||
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (Fortran 77 was disabled)])
|
||||
LAM_WANT_F90_BINDINGS=0
|
||||
LAM_F90="none"
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
OMPI_F90="none"
|
||||
BASEF90="none"
|
||||
elif test "$LAM_WANT_F90_BINDINGS" = "0" ; then
|
||||
elif test "$OMPI_WANT_F90_BINDINGS" = "0" ; then
|
||||
AC_MSG_WARN([*** Fortran 90/95 bindings disabled by user])
|
||||
LAM_WANT_F90_BINDINGS=0
|
||||
LAM_F90="none"
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
OMPI_F90="none"
|
||||
BASEF90="none"
|
||||
else
|
||||
|
||||
@ -40,28 +40,28 @@ else
|
||||
# Check for the compiler
|
||||
#
|
||||
# Note that we don't actually *use* the fortran compiler to build
|
||||
# anything in LAM; it's only used here in configure to find out
|
||||
# anything in OMPI; it's only used here in configure to find out
|
||||
# symbol conventions, type sizes, etc. We also pass it down to
|
||||
# the wrapper compiler mpif90.
|
||||
#
|
||||
|
||||
lam_fcflags_save="$FCFLAGS"
|
||||
ompi_fcflags_save="$FCFLAGS"
|
||||
AC_PROG_FC
|
||||
FCFLAGS="$lam_fcflags_save"
|
||||
FCFLAGS="$ompi_fcflags_save"
|
||||
if test -z "$FC"; then
|
||||
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (could not find compiler)])
|
||||
LAM_WANT_F90_BINDINGS=0
|
||||
LAM_F90="none"
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
OMPI_F90="none"
|
||||
BASEF90="none"
|
||||
elif test "$FC" = "$F77"; then
|
||||
AC_MSG_WARN([*** Found same compiler for Fortran 77 and 90/95.])
|
||||
AC_MSG_WARN([*** Assuming no Fortran 90/95 compiler; disabling])
|
||||
AC_MSG_WARN([*** Fortran 90/95 MPI bindings.])
|
||||
LAM_WANT_F90_BINDINGS=0
|
||||
LAM_F90="none"
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
OMPI_F90="none"
|
||||
BASEF90="none"
|
||||
else
|
||||
LAM_F90="$FC"
|
||||
OMPI_F90="$FC"
|
||||
BASEF90="`basename $FC`"
|
||||
|
||||
AC_LANG_PUSH(Fortran)
|
||||
@ -70,29 +70,29 @@ else
|
||||
AC_FC_SRCEXT(f95)
|
||||
AC_LANG_POP(Fortran)
|
||||
|
||||
AC_MSG_CHECKING([whether $LAM_F77 and $LAM_F90 compilers are compatible])
|
||||
LAM_INTL_F90_F77_INTERACTION(fortran_goodness=1, fortran_goodness=0)
|
||||
AC_MSG_CHECKING([whether $OMPI_F77 and $OMPI_F90 compilers are compatible])
|
||||
OMPI_INTL_F90_F77_INTERACTION(fortran_goodness=1, fortran_goodness=0)
|
||||
if test "$fortran_goodness" = "0" ; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([*** Fortran 77 and Fortran 90 compilers are not link compatible])
|
||||
AC_MSG_WARN([*** Disabling Fortran 90/95 bindings])
|
||||
LAM_WANT_F90_BINDINGS=0
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
LAM_WANT_F90_BINDINGS=1
|
||||
OMPI_WANT_F90_BINDINGS=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(LAM_WANT_F90_BINDINGS, $LAM_WANT_F90_BINDINGS,
|
||||
AC_DEFINE_UNQUOTED(OMPI_WANT_F90_BINDINGS, $OMPI_WANT_F90_BINDINGS,
|
||||
[Whether we want the MPI f90 bindings or not])
|
||||
AC_DEFINE_UNQUOTED(LAM_F90, "$LAM_F90", [LAM underlying F90 compiler])
|
||||
AM_CONDITIONAL(LAM_WANT_F90_BINDINGS, test "$LAM_WANT_F90_BINDINGS" = "1")
|
||||
AC_DEFINE_UNQUOTED(OMPI_F90, "$OMPI_F90", [OMPI underlying F90 compiler])
|
||||
AM_CONDITIONAL(OMPI_WANT_F90_BINDINGS, test "$OMPI_WANT_F90_BINDINGS" = "1")
|
||||
unset fortran_goodness
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([LAM_INTL_F90_F77_INTERACTION], [
|
||||
AC_DEFUN([OMPI_INTL_F90_F77_INTERACTION], [
|
||||
# make sure that we can combine F90 and F77 code
|
||||
AC_LANG_PUSH(Fortran)
|
||||
# Fortran module
|
||||
@ -107,12 +107,12 @@ cat > conftestf90.f <<EOF
|
||||
EOF
|
||||
|
||||
# Try the compile
|
||||
LAM_LOG_COMMAND(
|
||||
[$LAM_F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
|
||||
LAM_LOG_COMMAND(
|
||||
[$LAM_F77 $FFLAGS -c conftestf77.f],
|
||||
LAM_LOG_COMMAND(
|
||||
[$LAM_F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LIBS],
|
||||
OMPI_LOG_COMMAND(
|
||||
[$OMPI_F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
|
||||
OMPI_LOG_COMMAND(
|
||||
[$OMPI_F77 $FFLAGS -c conftestf77.f],
|
||||
OMPI_LOG_COMMAND(
|
||||
[$OMPI_F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LIBS],
|
||||
[HAPPY=1],
|
||||
[HAPPY=0]),
|
||||
[HAPPY=0]),
|
||||
@ -121,14 +121,14 @@ LAM_LOG_COMMAND(
|
||||
if test "$HAPPY" = "1"; then
|
||||
$1
|
||||
else
|
||||
LAM_LOG_MSG([here is the F77 program:], 1)
|
||||
LAM_LOG_FILE([conftestf77.f])
|
||||
LAM_LOG_MSG([here is the F90 program:], 1)
|
||||
LAM_LOG_FILE([conftestf90.f90])
|
||||
OMPI_LOG_MSG([here is the F77 program:], 1)
|
||||
OMPI_LOG_FILE([conftestf77.f])
|
||||
OMPI_LOG_MSG([here is the F90 program:], 1)
|
||||
OMPI_LOG_FILE([conftestf90.f90])
|
||||
$2
|
||||
fi
|
||||
|
||||
unset HAPPY lam_conftest_h
|
||||
unset HAPPY ompi_conftest_h
|
||||
/bin/rm -f conftest*
|
||||
|
||||
AC_LANG_POP(Fortran)
|
||||
|
@ -2,9 +2,9 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LAM_SETUP_LIBEVENT],[
|
||||
AC_DEFUN([OMPI_SETUP_LIBEVENT],[
|
||||
|
||||
dnl LAM: don't use AC_LIBOBJ
|
||||
dnl OMPI: don't use AC_LIBOBJ
|
||||
sources=
|
||||
|
||||
dnl Check for optional stuff
|
||||
@ -58,7 +58,7 @@ needsignal=no
|
||||
haveselect=no
|
||||
AC_CHECK_FUNCS(select, [haveselect=yes], )
|
||||
if test "x$haveselect" = "xyes" ; then
|
||||
# LAM: Don't use AC_LIBOBJ
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="select.c $sources"
|
||||
needsignal=yes
|
||||
fi
|
||||
@ -67,7 +67,7 @@ havepoll=no
|
||||
havertsig=no
|
||||
AC_CHECK_FUNCS(poll, [havepoll=yes], )
|
||||
if test "x$havepoll" = "xyes" ; then
|
||||
# LAM: Don't use AC_LIBOBJ
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="poll.c $sources"
|
||||
needsignal=yes
|
||||
|
||||
@ -88,7 +88,7 @@ yes
|
||||
fi
|
||||
if test "x$havertsig" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_RTSIG, 1, [Define if your system supports POSIX realtime signals])
|
||||
# LAM: Don't use AC_LIBOBJ
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="rtsig.c $sources"
|
||||
AC_MSG_CHECKING(for working rtsig on pipes)
|
||||
AC_TRY_RUN(
|
||||
@ -125,7 +125,7 @@ AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
|
||||
if test "x$haveepoll" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_EPOLL, 1,
|
||||
[Define if your system supports the epoll system calls])
|
||||
# LAM: Don't use AC_LIBOBJ
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="epoll.c $sources"
|
||||
needsignal=yes
|
||||
fi
|
||||
@ -184,7 +184,7 @@ main(int argc, char **argv)
|
||||
AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
|
||||
[Define if kqueue works correctly with pipes])
|
||||
sources="kqueue.c $sources"], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
||||
# LAM: don't use AC_LIBOBJ
|
||||
# OMPI: don't use AC_LIBOBJ
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -217,14 +217,14 @@ main(int argc, char **argv)
|
||||
AC_DEFINE(HAVE_EPOLL, 1,
|
||||
[Define if your system supports the epoll system calls])
|
||||
needsignal=yes
|
||||
# LAM: don't use AC_LIBOBJ
|
||||
# OMPI: don't use AC_LIBOBJ
|
||||
sources="epoll_sub.c epoll.c $sources"
|
||||
], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$needsignal" = "xyes" ; then
|
||||
# LAM: don't use AC_LIBOBJ
|
||||
# OMPI: don't use AC_LIBOBJ
|
||||
sources="signal.c $sources"
|
||||
fi
|
||||
|
||||
@ -249,9 +249,9 @@ AC_TRY_COMPILE([
|
||||
[Define to unsigned int if you dont have it])]
|
||||
)
|
||||
|
||||
# LAM: Save the libobj sources
|
||||
LAM_LIBEVENT_SOURCES="$sources"
|
||||
AC_SUBST(LAM_LIBEVENT_SOURCES)
|
||||
# OMPI: Save the libobj sources
|
||||
OMPI_LIBEVENT_SOURCES="$sources"
|
||||
AC_SUBST(OMPI_LIBEVENT_SOURCES)
|
||||
|
||||
# LAM: All done
|
||||
# OMPI: All done
|
||||
unset sources])dnl
|
||||
|
@ -4,25 +4,25 @@ dnl $HEADER$
|
||||
dnl
|
||||
|
||||
dnl
|
||||
dnl Tests provided by LAM
|
||||
dnl Tests provided by OMPI
|
||||
dnl General tests
|
||||
dnl
|
||||
|
||||
sinclude(../../../../../config/lam_functions.m4)
|
||||
sinclude(../../../../../config/lam_get_version.m4)
|
||||
sinclude(../../../../../config/ompi_functions.m4)
|
||||
sinclude(../../../../../config/ompi_get_version.m4)
|
||||
|
||||
dnl
|
||||
dnl C compiler tests
|
||||
dnl
|
||||
|
||||
sinclude(../../../../../config/lam_setup_cc.m4)
|
||||
sinclude(../../../../../config/lam_check_optflags.m4)
|
||||
sinclude(../../../../../config/ompi_setup_cc.m4)
|
||||
sinclude(../../../../../config/ompi_check_optflags.m4)
|
||||
|
||||
dnl
|
||||
dnl C++ compiler tests
|
||||
dnl
|
||||
|
||||
sinclude(../../../../../config/lam_setup_cxx.m4)
|
||||
sinclude(../../../../../config/ompi_setup_cxx.m4)
|
||||
sinclude(../../../../../config/cxx_find_template_repository.m4)
|
||||
sinclude(../../../../../config/cxx_find_template_parameters.m4)
|
||||
|
||||
|
@ -14,41 +14,41 @@ AC_INIT(@PARAM_INIT_FILE@)
|
||||
AC_PREREQ(2.57)
|
||||
AC_CONFIG_AUX_DIR(@PARAM_CONFIG_AUX_DIR@)
|
||||
|
||||
# Establish the top-level LAM directory
|
||||
# Establish the top-level OMPI directory
|
||||
|
||||
top_lam_srcdir='$(top_srcdir)/../../../../..'
|
||||
top_lam_builddir='$(top_builddir)/../../../../..'
|
||||
top_ompi_srcdir='$(top_srcdir)/../../../../..'
|
||||
top_ompi_builddir='$(top_builddir)/../../../../..'
|
||||
|
||||
AC_SUBST(top_lam_srcdir)
|
||||
AC_SUBST(top_lam_builddir)
|
||||
AC_SUBST(top_ompi_srcdir)
|
||||
AC_SUBST(top_ompi_builddir)
|
||||
|
||||
# Get the version of @MCA_TYPE@ @MCA_MODULE_NAME@ that we are installing.
|
||||
|
||||
if test -n "@PARAM_VERSION_FILE@" -a -f "@PARAM_VERSION_FILE@"; then
|
||||
LAM_GET_VERSION($srcdir/../../../../../config, @PARAM_VERSION_FILE@,
|
||||
OMPI_GET_VERSION($srcdir/../../../../../config, @PARAM_VERSION_FILE@,
|
||||
@PARAM_VAR_PREFIX@)
|
||||
|
||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_MAJOR_VERSION,
|
||||
$@PARAM_VAR_PREFIX@_MAJOR_VERSION,
|
||||
[Major LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
[Major OMPI MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_MINOR_VERSION,
|
||||
$@PARAM_VAR_PREFIX@_MINOR_VERSION,
|
||||
[Minor LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
[Minor OMPI MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_RELEASE_VERSION,
|
||||
$@PARAM_VAR_PREFIX@_RELEASE_VERSION,
|
||||
[Release LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
[Release OMPI MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_ALPHA_VERSION,
|
||||
$@PARAM_VAR_PREFIX@_ALPHA_VERSION,
|
||||
[Alpha LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
[Alpha OMPI MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_BETA_VERSION,
|
||||
$@PARAM_VAR_PREFIX@_BETA_VERSION,
|
||||
[Beta LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
[Beta OMPI MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_CVS_VERSION,
|
||||
$@PARAM_VAR_PREFIX@_CVS_VERSION,
|
||||
[CVS LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
[CVS OMPI MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version])
|
||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_VERSION,
|
||||
"$@PARAM_VAR_PREFIX@_VERSION",
|
||||
[Overall LAM MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version number])
|
||||
[Overall OMPI MCA @MCA_TYPE@ @MCA_MODULE_NAME@ version number])
|
||||
version_string="version $@PARAM_VAR_PREFIX@_VERSION"
|
||||
else
|
||||
version_string=""
|
||||
@ -58,9 +58,9 @@ fi
|
||||
# Start it up
|
||||
#
|
||||
|
||||
LAM_CONFIGURE_SETUP
|
||||
lam_show_title "Configuring MCA @MCA_TYPE@ @MCA_MODULE_NAME@ module $version_string"
|
||||
lam_show_subtitle "Initialization, setup"
|
||||
OMPI_CONFIGURE_SETUP
|
||||
ompi_show_title "Configuring MCA @MCA_TYPE@ @MCA_MODULE_NAME@ module $version_string"
|
||||
ompi_show_subtitle "Initialization, setup"
|
||||
|
||||
#
|
||||
# Init automake
|
||||
@ -76,7 +76,7 @@ AH_TOP([/* -*- c -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* LAM/MPI configuation header file.
|
||||
* OMPI/MPI configuation header file.
|
||||
* MCA @MCA_TYPE@: @MCA_MODULE_NAME@ module
|
||||
*/
|
||||
|
||||
@ -92,7 +92,7 @@ AH_BOTTOM([#endif /* _@PARAM_VAR_PREFIX@_CONFIG_H */])
|
||||
# - figure out the host type
|
||||
# - set the default prefix
|
||||
#
|
||||
LAM_BASIC_SETUP
|
||||
OMPI_BASIC_SETUP
|
||||
|
||||
|
||||
#
|
||||
@ -129,13 +129,13 @@ AC_ARG_WITH(modules,
|
||||
[if name is "@MCA_TYPE@-@MCA_MODULE_NAME@", then @MCA_MODULE_NAME@ will be compiled as a loadable module (if supported on this platform). This directly implies "--enable-shared=@MCA_TYPE@-@MCA_MODULE_NAME@ --disable-static=@MCA_TYPE@-@MCA_MODULE_NAME@"]))
|
||||
|
||||
# Manual conversion of $kind to its generic name (e.g., crmpi->cr,
|
||||
# crlam->cr).
|
||||
# crompi->cr).
|
||||
|
||||
case "@MCA_TYPE@" in
|
||||
crmpi)
|
||||
generic_type="cr"
|
||||
;;
|
||||
crlam)
|
||||
crompi)
|
||||
generic_type="cr"
|
||||
;;
|
||||
*)
|
||||
@ -198,7 +198,7 @@ fi
|
||||
# @MCA_TYPE@ @MCA_MODULE_NAME@ module specific setup
|
||||
##################################
|
||||
|
||||
if test "$LAM_WANT_DIST" = "no"; then
|
||||
if test "$OMPI_WANT_DIST" = "no"; then
|
||||
@CONFIGURE_STUB_MACRO@
|
||||
else
|
||||
@CONFIGURE_DIST_STUB_MACRO@
|
||||
@ -212,7 +212,7 @@ fi
|
||||
# purely aesthetic.
|
||||
#
|
||||
|
||||
CPPFLAGS='-I$(top_lam_srcdir)/src/include'" $CPPFLAGS"
|
||||
CPPFLAGS='-I$(top_ompi_srcdir)/src/include'" $CPPFLAGS"
|
||||
|
||||
#
|
||||
# Delayed the substitution of these until now because they may have
|
||||
@ -226,10 +226,10 @@ AC_SUBST(CPPFLAGS)
|
||||
# libtool magic
|
||||
############################################################################
|
||||
|
||||
lam_show_subtitle "GNU libtool setup"
|
||||
ompi_show_subtitle "GNU libtool setup"
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
AM_CONDITIONAL(LAM_BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE,
|
||||
AM_CONDITIONAL(OMPI_BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE,
|
||||
test "$BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE" = "1")
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ AM_CONDITIONAL(LAM_BUILD_@MCA_TYPE@_@MCA_MODULE_NAME@_LOADABLE_MODULE,
|
||||
# Party on
|
||||
############################################################################
|
||||
|
||||
lam_show_subtitle "Final output"
|
||||
ompi_show_subtitle "Final output"
|
||||
|
||||
AM_CONFIG_HEADER([@PARAM_CONFIG_HEADER_FILE@])
|
||||
AC_CONFIG_FILES([@PARAM_CONFIG_FILES@])
|
||||
|
@ -13,13 +13,13 @@ use File::Basename;
|
||||
# Local variables
|
||||
############################################################################
|
||||
|
||||
my $lam_topdir;
|
||||
my $ompi_topdir;
|
||||
my $module_topdir;
|
||||
my %config_values;
|
||||
my %config_params;
|
||||
|
||||
my $initial_cwd = cwd();
|
||||
my $announce_str = "LAM/MPI MCA module configure generator";
|
||||
my $announce_str = "OMPI/MPI MCA module configure generator";
|
||||
my %config_param_names = (PIFILE => "PARAM_INIT_FILE",
|
||||
PCFGAUXDIR => "PARAM_CONFIG_AUX_DIR",
|
||||
PC => "PARAM_WANT_C",
|
||||
@ -36,45 +36,45 @@ my %config_param_names = (PIFILE => "PARAM_INIT_FILE",
|
||||
############################################################################
|
||||
|
||||
Getopt::Long::Configure("bundling", "require_order");
|
||||
my $ok = Getopt::Long::GetOptions("lamdir|l=s" => \$lam_topdir,
|
||||
my $ok = Getopt::Long::GetOptions("ompidir|l=s" => \$ompi_topdir,
|
||||
"moduledir|m=s" => \$module_topdir);
|
||||
if (!$ok) {
|
||||
print "Usage: $0 [--lamdir=DIR] [--moduledir=DIR]\n";
|
||||
print "Usage: $0 [--ompidir=DIR] [--moduledir=DIR]\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
############################################################################
|
||||
# Try to figure out the lam and module topdirs
|
||||
# Try to figure out the ompi and module topdirs
|
||||
############################################################################
|
||||
|
||||
print "$announce_str starting\n";
|
||||
|
||||
if (!$lam_topdir) {
|
||||
$lam_topdir = dirname($0);
|
||||
if (!$ompi_topdir) {
|
||||
$ompi_topdir = dirname($0);
|
||||
}
|
||||
chdir($lam_topdir);
|
||||
$lam_topdir = cwd();
|
||||
chdir($ompi_topdir);
|
||||
$ompi_topdir = cwd();
|
||||
chdir($initial_cwd);
|
||||
if (!$lam_topdir || ! -f "$lam_topdir/autogen.sh") {
|
||||
croak("Unable to find LAM base directory (try using --lamdir)");
|
||||
if (!$ompi_topdir || ! -f "$ompi_topdir/autogen.sh") {
|
||||
croak("Unable to find OMPI base directory (try using --ompidir)");
|
||||
}
|
||||
|
||||
if (!$module_topdir) {
|
||||
$module_topdir = $initial_cwd;
|
||||
if ($module_topdir eq $lam_topdir) {
|
||||
if ($module_topdir eq $ompi_topdir) {
|
||||
croak("Unable to determine which module to operate on");
|
||||
}
|
||||
}
|
||||
chdir($module_topdir);
|
||||
$module_topdir = cwd();
|
||||
chdir($initial_cwd);
|
||||
if (!$lam_topdir || ! -d $module_topdir) {
|
||||
if (!$ompi_topdir || ! -d $module_topdir) {
|
||||
croak("Unable to find module directory (try using --moduledir)");
|
||||
}
|
||||
|
||||
# Print them out
|
||||
|
||||
print "--> Found LAM top dir: $lam_topdir\n";
|
||||
print "--> Found OMPI top dir: $ompi_topdir\n";
|
||||
print "--> Found module top dir: $module_topdir\n";
|
||||
|
||||
# If we have a configure.params file in the module topdir, we're good to
|
||||
@ -107,11 +107,11 @@ if (-f "$module_topdir/configure.ac") {
|
||||
$config_values{"MCA_TYPE"} = dirname($module_topdir);
|
||||
$config_values{"MCA_TYPE"} = basename($config_values{"MCA_TYPE"});
|
||||
|
||||
# PROCESSED_MCA_TYPE: For "special" MCA types, like "crlam" and
|
||||
# PROCESSED_MCA_TYPE: For "special" MCA types, like "crompi" and
|
||||
# "crmpi".
|
||||
|
||||
$config_values{"PROCESSED_MCA_TYPE"} = $config_values{"MCA_TYPE"};
|
||||
if ($config_values{"PROCESSED_MCA_TYPE"} eq "crlam" ||
|
||||
if ($config_values{"PROCESSED_MCA_TYPE"} eq "crompi" ||
|
||||
$config_values{"PROCESSED_MCA_TYPE"} eq "crmpi") {
|
||||
$config_values{"PROCESSED_MCA_TYPE"} = "cr";
|
||||
}
|
||||
@ -167,7 +167,7 @@ if (-f "$module_topdir/configure.stub") {
|
||||
|
||||
sinclude(configure.stub)\n";
|
||||
$config_values{CONFIGURE_STUB_MACRO} =
|
||||
"lam_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
|
||||
"ompi_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
|
||||
$config_values{"MCA_MODULE_NAME"} . "-specific setup\"
|
||||
MCA_CONFIGURE_STUB";
|
||||
|
||||
@ -182,7 +182,7 @@ MCA_CONFIGURE_STUB";
|
||||
close(STUB);
|
||||
if ($found == 1) {
|
||||
$config_values{CONFIGURE_DIST_STUB_MACRO} =
|
||||
"lam_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
|
||||
"ompi_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
|
||||
$config_values{"MCA_MODULE_NAME"} .
|
||||
"-specific setup (dist specific!)\"
|
||||
MCA_CONFIGURE_DIST_STUB";
|
||||
@ -320,12 +320,12 @@ sub make_template {
|
||||
|
||||
$search = "\@C_COMPILER_SETUP\@";
|
||||
$replace = $config_params{$config_param_names{"PC"}} ?
|
||||
"LAM_SETUP_CC" : "";
|
||||
"OMPI_SETUP_CC" : "";
|
||||
$template =~ s/$search/$replace/;
|
||||
|
||||
$search = "\@CXX_COMPILER_SETUP\@";
|
||||
$replace = $config_params{$config_param_names{"PCXX"}} ?
|
||||
"LAM_SETUP_CXX" : "";
|
||||
"OMPI_SETUP_CXX" : "";
|
||||
$template =~ s/$search/$replace/;
|
||||
|
||||
print "--> Writing output file: $dest\n";
|
||||
@ -339,9 +339,9 @@ sub make_template {
|
||||
|
||||
# Read and fill in the templates
|
||||
|
||||
make_template("$lam_topdir/config/mca_configure.ac",
|
||||
make_template("$ompi_topdir/config/mca_configure.ac",
|
||||
"$module_topdir/configure.ac", 0644);
|
||||
make_template("$lam_topdir/config/mca_acinclude.m4",
|
||||
make_template("$ompi_topdir/config/mca_acinclude.m4",
|
||||
"$module_topdir/acinclude.m4", 0644);
|
||||
|
||||
############################################################################
|
||||
|
320
configure.ac
320
configure.ac
@ -14,40 +14,40 @@ AC_INIT(./src/mpi/c/init.c)
|
||||
AC_PREREQ(2.58)
|
||||
AC_CONFIG_AUX_DIR(./config)
|
||||
|
||||
# Get the version of LAM that we are installing
|
||||
# Get the version of OMPI that we are installing
|
||||
|
||||
LAM_GET_VERSION($srcdir/config, $srcdir/VERSION, LAM)
|
||||
OMPI_GET_VERSION($srcdir/config, $srcdir/VERSION, OMPI)
|
||||
|
||||
AC_DEFINE_UNQUOTED(LAM_MAJOR_VERSION, $LAM_MAJOR_VERSION,
|
||||
[Major LAM version])
|
||||
AC_DEFINE_UNQUOTED(LAM_MINOR_VERSION, $LAM_MINOR_VERSION,
|
||||
[Minor LAM version])
|
||||
AC_DEFINE_UNQUOTED(LAM_RELEASE_VERSION, $LAM_RELEASE_VERSION,
|
||||
[Release LAM version])
|
||||
AC_DEFINE_UNQUOTED(LAM_ALPHA_VERSION, $LAM_ALPHA_VERSION,
|
||||
[Alpha LAM version])
|
||||
AC_DEFINE_UNQUOTED(LAM_BETA_VERSION, $LAM_BETA_VERSION,
|
||||
[Beta LAM version])
|
||||
AC_DEFINE_UNQUOTED(LAM_SVN_VERSION, $LAM_SVN_VERSION,
|
||||
[CVS LAM version])
|
||||
AC_DEFINE_UNQUOTED(LAM_VERSION, "$LAM_VERSION",
|
||||
[Overall LAM version number])
|
||||
AC_DEFINE_UNQUOTED(OMPI_MAJOR_VERSION, $OMPI_MAJOR_VERSION,
|
||||
[Major OMPI version])
|
||||
AC_DEFINE_UNQUOTED(OMPI_MINOR_VERSION, $OMPI_MINOR_VERSION,
|
||||
[Minor OMPI version])
|
||||
AC_DEFINE_UNQUOTED(OMPI_RELEASE_VERSION, $OMPI_RELEASE_VERSION,
|
||||
[Release OMPI version])
|
||||
AC_DEFINE_UNQUOTED(OMPI_ALPHA_VERSION, $OMPI_ALPHA_VERSION,
|
||||
[Alpha OMPI version])
|
||||
AC_DEFINE_UNQUOTED(OMPI_BETA_VERSION, $OMPI_BETA_VERSION,
|
||||
[Beta OMPI version])
|
||||
AC_DEFINE_UNQUOTED(OMPI_SVN_VERSION, $OMPI_SVN_VERSION,
|
||||
[CVS OMPI version])
|
||||
AC_DEFINE_UNQUOTED(OMPI_VERSION, "$OMPI_VERSION",
|
||||
[Overall OMPI version number])
|
||||
|
||||
AC_SUBST(LAM_MAJOR_VERSION)
|
||||
AC_SUBST(LAM_MINOR_VERSION)
|
||||
AC_SUBST(LAM_RELEASE_VERSION)
|
||||
AC_SUBST(LAM_ALPHA_VERSION)
|
||||
AC_SUBST(LAM_BETA_VERSION)
|
||||
AC_SUBST(LAM_CVS_VERSION)
|
||||
AC_SUBST(LAM_VERSION)
|
||||
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_CVS_VERSION)
|
||||
AC_SUBST(OMPI_VERSION)
|
||||
|
||||
#
|
||||
# Start it up
|
||||
#
|
||||
|
||||
LAM_CONFIGURE_SETUP
|
||||
lam_show_title "Configuring LAM version $LAM_VERSION"
|
||||
lam_show_subtitle "Initialization, setup"
|
||||
OMPI_CONFIGURE_SETUP
|
||||
ompi_show_title "Configuring OMPI version $OMPI_VERSION"
|
||||
ompi_show_subtitle "Initialization, setup"
|
||||
|
||||
#
|
||||
# Init automake
|
||||
@ -55,22 +55,22 @@ lam_show_subtitle "Initialization, setup"
|
||||
# VERSION macors
|
||||
#
|
||||
|
||||
AM_INIT_AUTOMAKE(lam, $LAM_VERSION, 'no')
|
||||
AM_INIT_AUTOMAKE(ompi, $OMPI_VERSION, 'no')
|
||||
|
||||
LAM_TOP_BUILDDIR="`pwd`"
|
||||
AC_SUBST(LAM_TOP_BUILDDIR)
|
||||
OMPI_TOP_BUILDDIR="`pwd`"
|
||||
AC_SUBST(OMPI_TOP_BUILDDIR)
|
||||
cd "$srcdir"
|
||||
LAM_TOP_SRCDIR="`pwd`"
|
||||
AC_SUBST(LAM_TOP_SRCDIR)
|
||||
cd "$LAM_TOP_BUILDDIR"
|
||||
OMPI_TOP_SRCDIR="`pwd`"
|
||||
AC_SUBST(OMPI_TOP_SRCDIR)
|
||||
cd "$OMPI_TOP_BUILDDIR"
|
||||
|
||||
AC_MSG_NOTICE([builddir: $LAM_TOP_BUILDDIR])
|
||||
AC_MSG_NOTICE([srcdir: $LAM_TOP_SRCDIR])
|
||||
if test "$LAM_TOP_BUILDDIR" != "$LAM_TOP_SRCDIR"; then
|
||||
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/lam_config.h file
|
||||
# Setup the top of the include/ompi_config.h file
|
||||
|
||||
AH_TOP([/* -*- c -*-
|
||||
*
|
||||
@ -79,28 +79,28 @@ AH_TOP([/* -*- c -*-
|
||||
* Function: - OS, CPU and compiler dependent configuration
|
||||
*/
|
||||
|
||||
#ifndef LAM_CONFIG_H
|
||||
#define LAM_CONFIG_H
|
||||
#ifndef OMPI_CONFIG_H
|
||||
#define OMPI_CONFIG_H
|
||||
])
|
||||
AH_BOTTOM([
|
||||
#include "lam_config_bottom.h"
|
||||
#endif /* LAM_CONFIG_H */
|
||||
#include "ompi_config_bottom.h"
|
||||
#endif /* OMPI_CONFIG_H */
|
||||
])
|
||||
|
||||
# Other basic setup stuff (shared with modules)
|
||||
|
||||
LAM_BASIC_SETUP
|
||||
OMPI_BASIC_SETUP
|
||||
|
||||
top_lam_srcdir="$LAM_TOP_SRCDIR"
|
||||
AC_SUBST(top_lam_srcdir)
|
||||
top_lam_builddir="$LAM_TOP_BUILDDIR"
|
||||
AC_SUBST(top_lam_builddir)
|
||||
top_ompi_srcdir="$OMPI_TOP_SRCDIR"
|
||||
AC_SUBST(top_ompi_srcdir)
|
||||
top_ompi_builddir="$OMPI_TOP_BUILDDIR"
|
||||
AC_SUBST(top_ompi_builddir)
|
||||
|
||||
############################################################################
|
||||
# Configuration options
|
||||
############################################################################
|
||||
|
||||
LAM_CONFIGURE_OPTIONS
|
||||
OMPI_CONFIGURE_OPTIONS
|
||||
|
||||
############################################################################
|
||||
# Libtool: part one
|
||||
@ -116,8 +116,8 @@ LAM_CONFIGURE_OPTIONS
|
||||
# the user requested something or if the default was set here.
|
||||
#
|
||||
|
||||
lam_enable_shared="$enable_shared"
|
||||
lam_enable_static="$enable_static"
|
||||
ompi_enable_shared="$enable_shared"
|
||||
ompi_enable_static="$enable_static"
|
||||
AM_DISABLE_SHARED
|
||||
AM_ENABLE_STATIC
|
||||
|
||||
@ -125,13 +125,13 @@ AM_ENABLE_STATIC
|
||||
############################################################################
|
||||
# Check for compilers and preprocessors
|
||||
############################################################################
|
||||
lam_show_title "Compiler and preprocessor tests"
|
||||
ompi_show_title "Compiler and preprocessor tests"
|
||||
|
||||
##################################
|
||||
# C compiler characteristics
|
||||
##################################
|
||||
|
||||
LAM_SETUP_CC
|
||||
OMPI_SETUP_CC
|
||||
|
||||
#
|
||||
# Check for some types
|
||||
@ -170,20 +170,20 @@ AC_CHECK_SIZEOF(void *)
|
||||
# Check for type alignments
|
||||
#
|
||||
|
||||
LAM_C_GET_ALIGNMENT(char, LAM_ALIGNMENT_CHAR)
|
||||
LAM_C_GET_ALIGNMENT(short, LAM_ALIGNMENT_SHORT)
|
||||
LAM_C_GET_ALIGNMENT(wchar_t, LAM_ALIGNMENT_WCHAR)
|
||||
LAM_C_GET_ALIGNMENT(int, LAM_ALIGNMENT_INT)
|
||||
LAM_C_GET_ALIGNMENT(long, LAM_ALIGNMENT_LONG)
|
||||
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
|
||||
LAM_C_GET_ALIGNMENT(long long, LAM_ALIGNMENT_LONG_LONG)
|
||||
OMPI_C_GET_ALIGNMENT(long long, OMPI_ALIGNMENT_LONG_LONG)
|
||||
fi
|
||||
LAM_C_GET_ALIGNMENT(float, LAM_ALIGNMENT_FLOAT)
|
||||
LAM_C_GET_ALIGNMENT(double, LAM_ALIGNMENT_DOUBLE)
|
||||
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
|
||||
LAM_C_GET_ALIGNMENT(long double, LAM_ALIGNMENT_LONG_DOUBLE)
|
||||
OMPI_C_GET_ALIGNMENT(long double, OMPI_ALIGNMENT_LONG_DOUBLE)
|
||||
fi
|
||||
LAM_C_GET_ALIGNMENT(void *, LAM_ALIGNMENT_VOID_P)
|
||||
OMPI_C_GET_ALIGNMENT(void *, OMPI_ALIGNMENT_VOID_P)
|
||||
|
||||
#
|
||||
# Check for other compiler characteristics
|
||||
@ -191,7 +191,7 @@ LAM_C_GET_ALIGNMENT(void *, LAM_ALIGNMENT_VOID_P)
|
||||
|
||||
AC_C_INLINE
|
||||
AC_C_RESTRICT
|
||||
LAM_C_WEAK_SYMBOLS
|
||||
OMPI_C_WEAK_SYMBOLS
|
||||
|
||||
# If we want the profiling layer:
|
||||
# - If the C compiler has weak symbols, use those.
|
||||
@ -199,16 +199,16 @@ LAM_C_WEAK_SYMBOLS
|
||||
# separate directory.
|
||||
|
||||
if test "$WANT_WEAK_SYMBOLS" = "0"; then
|
||||
LAM_C_HAVE_WEAK_SYMBOLS=0
|
||||
OMPI_C_HAVE_WEAK_SYMBOLS=0
|
||||
fi
|
||||
if test "$WANT_MPI_PROFILING" = "1"; then
|
||||
if test "$LAM_C_HAVE_WEAK_SYMBOLS" = "1"; then
|
||||
LAM_PROFILING_COMPILE_SEPARATELY=0
|
||||
if test "$OMPI_C_HAVE_WEAK_SYMBOLS" = "1"; then
|
||||
OMPI_PROFILING_COMPILE_SEPARATELY=0
|
||||
else
|
||||
LAM_PROFILING_COMPILE_SEPARATELY=1
|
||||
OMPI_PROFILING_COMPILE_SEPARATELY=1
|
||||
fi
|
||||
else
|
||||
LAM_PROFILING_COMPILE_SEPARATELY=0
|
||||
OMPI_PROFILING_COMPILE_SEPARATELY=0
|
||||
fi
|
||||
#
|
||||
# There are 2 layers to the MPI Language binidings
|
||||
@ -225,15 +225,15 @@ fi
|
||||
# each of these layers need to be built or NOT
|
||||
#
|
||||
AM_CONDITIONAL(WANT_MPI_BINDINGS_LAYER,
|
||||
test "$WANT_MPI_PROFILING" = 0 -o "$LAM_PROFILING_COMPILE_SEPARATELY" = 1)
|
||||
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 "$LAM_PROFILING_COMPILE_SEPARATELY" = 1)
|
||||
AC_DEFINE_UNQUOTED(LAM_ENABLE_MPI_PROFILING, $WANT_MPI_PROFILING,
|
||||
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(LAM_HAVE_WEAK_SYMBOLS, $LAM_C_HAVE_WEAK_SYMBOLS,
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_WEAK_SYMBOLS, $OMPI_C_HAVE_WEAK_SYMBOLS,
|
||||
[Wehther we have weak symbols or not])
|
||||
|
||||
|
||||
@ -241,7 +241,7 @@ AC_DEFINE_UNQUOTED(LAM_HAVE_WEAK_SYMBOLS, $LAM_C_HAVE_WEAK_SYMBOLS,
|
||||
# C++ compiler characteristics
|
||||
##################################
|
||||
|
||||
LAM_SETUP_CXX
|
||||
OMPI_SETUP_CXX
|
||||
|
||||
# check for type sizes
|
||||
|
||||
@ -251,7 +251,7 @@ AC_CHECK_SIZEOF(bool)
|
||||
|
||||
# check for type alignments
|
||||
|
||||
LAM_C_GET_ALIGNMENT(bool, LAM_ALIGNMENT_CXX_BOOL)
|
||||
OMPI_C_GET_ALIGNMENT(bool, OMPI_ALIGNMENT_CXX_BOOL)
|
||||
AC_LANG_RESTORE
|
||||
|
||||
|
||||
@ -259,70 +259,70 @@ AC_LANG_RESTORE
|
||||
# Fortran
|
||||
##################################
|
||||
|
||||
LAM_SIZEOF_FORTRAN_INT=0
|
||||
LAM_SIZEOF_FORTRAN_REAL=0
|
||||
LAM_SIZEOF_FORTRAN_DBLPREC=0
|
||||
LAM_SIZEOF_FORTRAN_COMPLEX=0
|
||||
LAM_SIZEOF_FORTRAN_DBLCOMPLEX=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
|
||||
|
||||
LAM_ALIGNMENT_FORTRAN_INT=0
|
||||
LAM_ALIGNMENT_FORTRAN_REAL=0
|
||||
LAM_ALIGNMENT_FORTRAN_DBLPREC=0
|
||||
LAM_ALIGNMENT_FORTRAN_COMPLEX=0
|
||||
LAM_ALIGNMENT_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
|
||||
|
||||
LAM_SETUP_F77
|
||||
if test "$LAM_F77" != "none" ; then
|
||||
LAM_F77_FIND_EXT_SYMBOL_CONVENTION($LAM_F77)
|
||||
OMPI_SETUP_F77
|
||||
if test "$OMPI_F77" != "none" ; then
|
||||
OMPI_F77_FIND_EXT_SYMBOL_CONVENTION($OMPI_F77)
|
||||
|
||||
# checking the sizeof fortran interger. This is needed to define
|
||||
# MPI_Fint. This is needed for C bindings and hence there is no
|
||||
# bearing of --enable-fortran flag on this test.
|
||||
|
||||
LAM_F77_GET_SIZEOF(INTEGER, LAM_SIZEOF_FORTRAN_INT)
|
||||
OMPI_F77_GET_SIZEOF(INTEGER, OMPI_SIZEOF_FORTRAN_INT)
|
||||
fi
|
||||
|
||||
# If we want fortran support, then get the sizes and alignments of all
|
||||
# the rest of the fortran types
|
||||
|
||||
if test "$LAM_WANT_F77_BINDINGS" = "1" ; then
|
||||
if test "$OMPI_WANT_F77_BINDINGS" = "1" ; then
|
||||
# INTEGER is already done, per above
|
||||
LAM_F77_GET_SIZEOF(REAL, LAM_SIZEOF_FORTRAN_REAL)
|
||||
LAM_F77_GET_SIZEOF(DOUBLE PRECISION, LAM_SIZEOF_FORTRAN_DBLPREC)
|
||||
LAM_F77_GET_SIZEOF(COMPLEX, LAM_SIZEOF_FORTRAN_COMPLEX)
|
||||
LAM_F77_GET_SIZEOF(DOUBLE COMPLEX, LAM_SIZEOF_FORTRAN_DBLCOMPLEX)
|
||||
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)
|
||||
|
||||
LAM_F77_GET_ALIGNMENT(INTEGER, LAM_ALIGNMENT_FORTRAN_INT)
|
||||
LAM_F77_GET_ALIGNMENT(REAL, LAM_ALIGNMENT_FORTRAN_REAL)
|
||||
LAM_F77_GET_ALIGNMENT(DOUBLE PRECISION, LAM_ALIGNMENT_FORTRAN_DBLPREC)
|
||||
LAM_F77_GET_ALIGNMENT(COMPLEX, LAM_ALIGNMENT_FORTRAN_COMPLEX)
|
||||
LAM_F77_GET_ALIGNMENT(DOUBLE COMPLEX, LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX)
|
||||
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(LAM_SIZEOF_FORTRAN_INT, $LAM_SIZEOF_FORTRAN_INT,
|
||||
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_INT, $OMPI_SIZEOF_FORTRAN_INT,
|
||||
[Size of fortran integer])
|
||||
AC_DEFINE_UNQUOTED(LAM_SIZEOF_FORTRAN_REAL, $LAM_SIZEOF_FORTRAN_REAL,
|
||||
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_REAL, $OMPI_SIZEOF_FORTRAN_REAL,
|
||||
[Size of fortran real])
|
||||
AC_DEFINE_UNQUOTED(LAM_SIZEOF_FORTRAN_DBLPREC, $LAM_SIZEOF_FORTRAN_DBLPREC,
|
||||
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_DBLPREC, $OMPI_SIZEOF_FORTRAN_DBLPREC,
|
||||
[Size of fortran double precision])
|
||||
AC_DEFINE_UNQUOTED(LAM_SIZEOF_FORTRAN_COMPLEX, $LAM_SIZEOF_FORTRAN_COMPLEX,
|
||||
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_COMPLEX, $OMPI_SIZEOF_FORTRAN_COMPLEX,
|
||||
[Size of fortran complex])
|
||||
AC_DEFINE_UNQUOTED(LAM_SIZEOF_FORTRAN_DBLCOMPLEX,
|
||||
$LAM_SIZEOF_FORTRAN_DBLCOMPLEX,
|
||||
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_DBLCOMPLEX,
|
||||
$OMPI_SIZEOF_FORTRAN_DBLCOMPLEX,
|
||||
[Size of fortran double complex])
|
||||
|
||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_INT, $LAM_ALIGNMENT_FORTRAN_INT,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_INT, $OMPI_ALIGNMENT_FORTRAN_INT,
|
||||
[Size of fortran integer])
|
||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_REAL, $LAM_ALIGNMENT_FORTRAN_REAL,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_REAL, $OMPI_ALIGNMENT_FORTRAN_REAL,
|
||||
[Size of fortran real])
|
||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_DBLPREC,
|
||||
$LAM_ALIGNMENT_FORTRAN_DBLPREC,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLPREC,
|
||||
$OMPI_ALIGNMENT_FORTRAN_DBLPREC,
|
||||
[Size of fortran double precision])
|
||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_COMPLEX,
|
||||
$LAM_ALIGNMENT_FORTRAN_COMPLEX,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_COMPLEX,
|
||||
$OMPI_ALIGNMENT_FORTRAN_COMPLEX,
|
||||
[Size of fortran complex])
|
||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
||||
$LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
||||
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
||||
$OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
||||
[Size of fortran double complex])
|
||||
|
||||
#
|
||||
@ -345,23 +345,23 @@ AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
||||
# each of these layers need to be built or NOT
|
||||
#
|
||||
AM_CONDITIONAL(WANT_MPI_F77_BINDINGS_LAYER,
|
||||
test "$WANT_MPI_PROFILING" = 0 -o "$LAM_PROFILING_COMPILE_SEPARATELY" = 1 -a "$LAM_WANT_F77_BINDINGS" = 1)
|
||||
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 "$LAM_WANT_F77_BINDINGS" = 1 -a "$WANT_MPI_PROFILING" = 1)
|
||||
test "$OMPI_WANT_F77_BINDINGS" = 1 -a "$WANT_MPI_PROFILING" = 1)
|
||||
|
||||
#
|
||||
# Fortran 90 setup
|
||||
#
|
||||
|
||||
LAM_SETUP_F90
|
||||
OMPI_SETUP_F90
|
||||
|
||||
|
||||
##################################
|
||||
# Header files
|
||||
##################################
|
||||
|
||||
lam_show_title "Header file tests"
|
||||
ompi_show_title "Header file tests"
|
||||
|
||||
# snprintf declaration
|
||||
# gethostname declaration
|
||||
@ -379,7 +379,7 @@ AC_CHECK_HEADERS([stdbool.h alloca.h])
|
||||
# Libraries
|
||||
##################################
|
||||
|
||||
lam_show_title "Library and Function tests"
|
||||
ompi_show_title "Library and Function tests"
|
||||
|
||||
# -lsocket
|
||||
# -lnsl
|
||||
@ -398,14 +398,14 @@ lam_show_title "Library and Function tests"
|
||||
# Make sure we can copy va_lists (need check declared, not linkable)
|
||||
#
|
||||
|
||||
AC_CHECK_DECL(va_copy, LAM_HAVE_VA_COPY=1, LAM_HAVE_VA_COPY=0,
|
||||
AC_CHECK_DECL(va_copy, OMPI_HAVE_VA_COPY=1, OMPI_HAVE_VA_COPY=0,
|
||||
[#include <stdarg.h>])
|
||||
AC_DEFINE_UNQUOTED(LAM_HAVE_VA_COPY, $LAM_HAVE_VA_COPY,
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_VA_COPY, $OMPI_HAVE_VA_COPY,
|
||||
[Whether we have va_copy or not])
|
||||
|
||||
AC_CHECK_DECL(__va_copy, LAM_HAVE_UNDERSCORE_VA_COPY=1,
|
||||
LAM_HAVE_UNDERSCORE_VA_COPY=0, [#include <stdarg.h>])
|
||||
AC_DEFINE_UNQUOTED(LAM_HAVE_UNDERSCORE_VA_COPY, $LAM_HAVE_UNDERSCORE_VA_COPY,
|
||||
AC_CHECK_DECL(__va_copy, OMPI_HAVE_UNDERSCORE_VA_COPY=1,
|
||||
OMPI_HAVE_UNDERSCORE_VA_COPY=0, [#include <stdarg.h>])
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_UNDERSCORE_VA_COPY, $OMPI_HAVE_UNDERSCORE_VA_COPY,
|
||||
[Whether we have __va_copy or not])
|
||||
|
||||
|
||||
@ -413,7 +413,7 @@ AC_DEFINE_UNQUOTED(LAM_HAVE_UNDERSCORE_VA_COPY, $LAM_HAVE_UNDERSCORE_VA_COPY,
|
||||
# System-specific tests
|
||||
##################################
|
||||
|
||||
lam_show_title "System-specific tests"
|
||||
ompi_show_title "System-specific tests"
|
||||
#
|
||||
# Determine what MPI_Fint shout be defined as. If the size of
|
||||
# fortran integer is 4 then it is defined to either
|
||||
@ -427,16 +427,16 @@ lam_show_title "System-specific tests"
|
||||
# This test should be carried out ONLY if there is a f77 compiler
|
||||
# available. Else we should default to MPI_Fint being an int.
|
||||
#
|
||||
if test "$LAM_F77" != "none"; then
|
||||
if test "$OMPI_F77" != "none"; then
|
||||
MPI_FINT_TYPE="not found"
|
||||
AC_MSG_CHECKING([checking for type of MPI_Fint])
|
||||
if test "$LAM_SIZEOF_FORTRAN_INT" = 4 ; then
|
||||
if test "$OMPI_SIZEOF_FORTRAN_INT" = 4 ; then
|
||||
if test "$ac_cv_type_int32_t" = "yes"; then
|
||||
MPI_FINT_TYPE=int32_t
|
||||
elif test "$ac_cv_sizeof_int" = 4 ; then
|
||||
MPI_FINT_TYPE=int
|
||||
fi
|
||||
elif test "$LAM_SIZEOF_FORTRAN_INT" = 8 ; then
|
||||
elif test "$OMPI_SIZEOF_FORTRAN_INT" = 8 ; then
|
||||
if test "$ac_cv_type_int64_t" = "yes"; then
|
||||
MPI_FINT_TYPE=int64_t
|
||||
elif test "$ac_cv_type_long_long" = "yes" -a "$ac_cv_sizeof_long_long" = 8; then
|
||||
@ -507,7 +507,7 @@ AC_DEFINE_UNQUOTED(MPI_Offset, $MPI_OFFSET_TYPE, [Type of MPI_Offset])
|
||||
# Check out what thread support we have
|
||||
#
|
||||
|
||||
LAM_CONFIG_THREADS
|
||||
OMPI_CONFIG_THREADS
|
||||
CFLAGS="$CFLAGS $THREAD_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
|
||||
@ -532,7 +532,7 @@ AC_PROG_LN_S
|
||||
# File system case sensitivity
|
||||
#
|
||||
|
||||
LAM_CASE_SENSITIVE_FS_SETUP
|
||||
OMPI_CASE_SENSITIVE_FS_SETUP
|
||||
|
||||
# AIX: FIONBIO in sys/ioctl.h
|
||||
# glibc: memcpy
|
||||
@ -542,29 +542,29 @@ LAM_CASE_SENSITIVE_FS_SETUP
|
||||
# MCA
|
||||
##################################
|
||||
|
||||
lam_show_title "MPI Component Architecture (MCA) setup"
|
||||
ompi_show_title "MPI Component Architecture (MCA) setup"
|
||||
|
||||
AC_MSG_CHECKING([for subdir args])
|
||||
LAM_CONFIG_SUBDIR_ARGS([lam_subdir_args])
|
||||
AC_MSG_RESULT([$lam_subdir_args])
|
||||
OMPI_CONFIG_SUBDIR_ARGS([ompi_subdir_args])
|
||||
AC_MSG_RESULT([$ompi_subdir_args])
|
||||
|
||||
LAM_MCA
|
||||
OMPI_MCA
|
||||
|
||||
|
||||
############################################################################
|
||||
# Final top-level LAM configuration
|
||||
# Final top-level OMPI configuration
|
||||
############################################################################
|
||||
|
||||
lam_show_title "Final top-level LAM configuration"
|
||||
ompi_show_title "Final top-level OMPI configuration"
|
||||
|
||||
############################################################################
|
||||
# Libevent setup
|
||||
############################################################################
|
||||
|
||||
lam_show_subtitle "Libevent 3rd party event handler"
|
||||
ompi_show_subtitle "Libevent 3rd party event handler"
|
||||
CFLAGS_save="$CFLAGS"
|
||||
CFLAGS="$LAM_CFLAGS_BEFORE_PICKY"
|
||||
LAM_SETUP_LIBEVENT
|
||||
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY"
|
||||
OMPI_SETUP_LIBEVENT
|
||||
CFLAGS="$CFLAGS_save"
|
||||
|
||||
|
||||
@ -573,7 +573,7 @@ CFLAGS="$CFLAGS_save"
|
||||
# (after C compiler setup)
|
||||
############################################################################
|
||||
|
||||
lam_show_subtitle "Libtool configuration"
|
||||
ompi_show_subtitle "Libtool configuration"
|
||||
|
||||
# Use convenience libltdl for the moment, because we need to force the
|
||||
# use of the newest libltdl (i.e., the one that ships with libtool
|
||||
@ -590,7 +590,7 @@ AM_PROG_LIBTOOL
|
||||
# passing precious variables down to the sub-configure).
|
||||
#
|
||||
# Note that we also did some magic scripty-foo in autogen.sh to rename
|
||||
# the output libtool library "liblamltdl", so add -llamltdl here.
|
||||
# the output libtool library "libompi_ltdl", so add -lompi_ltdl here.
|
||||
# This is because so many systems have older versions of libltdl
|
||||
# installed very early in ld.so's search path; if we installed our own
|
||||
# libltdl in some non-standard path (e.g., $HOME/local or even
|
||||
@ -598,28 +598,28 @@ AM_PROG_LIBTOOL
|
||||
# it's older -- or just not matching the version that we need, Bad
|
||||
# Things happen. [sigh]
|
||||
#
|
||||
# Finally, make liblamltdl follow the same shared/static convention
|
||||
# that was user for the main LAM libraries. So manually examine
|
||||
# Finally, make libompi_ltdl follow the same shared/static convention
|
||||
# that was user for the main OMPI libraries. So manually examine
|
||||
# $enable_shared and $enable_static and pass down the corresponding
|
||||
# flags.
|
||||
|
||||
lam_show_subtitle "GNU libltdl setup"
|
||||
ompi_show_subtitle "GNU libltdl setup"
|
||||
|
||||
lam_subdir_args="$lam_subdir_args --enable-ltdl-convenience --disable-ltdl-install"
|
||||
ompi_subdir_args="$ompi_subdir_args --enable-ltdl-convenience --disable-ltdl-install"
|
||||
if test "$enable_shared" = "yes"; then
|
||||
lam_subdir_args="$lam_subdir_args --enable-shared"
|
||||
ompi_subdir_args="$ompi_subdir_args --enable-shared"
|
||||
else
|
||||
lam_subdir_args="$lam_subdir_args --disable-shared"
|
||||
ompi_subdir_args="$ompi_subdir_args --disable-shared"
|
||||
fi
|
||||
if test "$enable_static" = "yes"; then
|
||||
lam_subdir_args="$lam_subdir_args --enable-static"
|
||||
ompi_subdir_args="$ompi_subdir_args --enable-static"
|
||||
else
|
||||
lam_subdir_args="$lam_subdir_args --disable-static"
|
||||
ompi_subdir_args="$ompi_subdir_args --disable-static"
|
||||
fi
|
||||
|
||||
CFLAGS_save="$CFLAGS"
|
||||
CFLAGS="$LAM_CFLAGS_BEFORE_PICKY"
|
||||
LAM_CONFIG_SUBDIR(src/libltdl, [$lam_subdir_args], [HAPPY=1], [HAPPY=0])
|
||||
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY"
|
||||
OMPI_CONFIG_SUBDIR(src/libltdl, [$ompi_subdir_args], [HAPPY=1], [HAPPY=0])
|
||||
if test "$HAPPY" = "1"; then
|
||||
LIBLTDL_SUBDIR=libltdl
|
||||
LIBLTDL_LTLIB=libltdl/libltdlc.la
|
||||
@ -629,7 +629,7 @@ if test "$HAPPY" = "1"; then
|
||||
# it. :-(
|
||||
|
||||
flags="`egrep ^LIBADD_DL src/libltdl/Makefile | cut -d= -f2-`"
|
||||
LAM_CHECK_LINKER_FLAGS([src/libltdl/libtool], [-export-dynamic $flags])
|
||||
OMPI_CHECK_LINKER_FLAGS([src/libltdl/libtool], [-export-dynamic $flags])
|
||||
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $extra_ldflags"
|
||||
LDFLAGS="-export-dynamic $LDFLAGS"
|
||||
else
|
||||
@ -641,7 +641,7 @@ CFLAGS="$CFLAGS_save"
|
||||
AC_SUBST(LIBLTDL_SUBDIR)
|
||||
AC_SUBST(LIBLTDL_LTLIB)
|
||||
AM_CONDITIONAL(WANT_LIBLTDL, test "$WANT_LIBLTDL" = "1")
|
||||
AC_DEFINE_UNQUOTED(LAM_WANT_LIBLTDL, $WANT_LIBLTDL,
|
||||
AC_DEFINE_UNQUOTED(OMPI_WANT_LIBLTDL, $WANT_LIBLTDL,
|
||||
[Whether to include support for libltdl or not])
|
||||
|
||||
|
||||
@ -649,7 +649,7 @@ AC_DEFINE_UNQUOTED(LAM_WANT_LIBLTDL, $WANT_LIBLTDL,
|
||||
# final wrapper compiler config
|
||||
############################################################################
|
||||
|
||||
lam_show_subtitle "Wrapper compiler flags"
|
||||
ompi_show_subtitle "Wrapper compiler flags"
|
||||
|
||||
#
|
||||
# This is needed for VPATH builds, so that it will -I the appropriate
|
||||
@ -668,7 +668,7 @@ CXXCPPFLAGS='-I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/src'
|
||||
# WRAPPER_EXTRA_CFLAGS
|
||||
#
|
||||
AC_MSG_CHECKING([for mpicc CFLAGS])
|
||||
LAM_UNIQ(WRAPPER_EXTRA_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])
|
||||
@ -678,7 +678,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_CFLAGS])
|
||||
# WRAPPER_EXTRA_CXXFLAGS
|
||||
#
|
||||
AC_MSG_CHECKING([for mpiCC CXXFLAGS])
|
||||
LAM_UNIQ(WRAPPER_EXTRA_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])
|
||||
@ -688,7 +688,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_CXXFLAGS])
|
||||
# WRAPPER_EXTRA_FFLAGS
|
||||
#
|
||||
AC_MSG_CHECKING([for mpif77/mpif90 FFLAGS])
|
||||
LAM_UNIQ(WRAPPER_EXTRA_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])
|
||||
@ -698,7 +698,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_FFLAGS])
|
||||
# WRAPPER_EXTRA_FCFLAGS
|
||||
#
|
||||
AC_MSG_CHECKING([for mpif77/mpif90 FCFLAGS])
|
||||
LAM_UNIQ(WRAPPER_EXTRA_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])
|
||||
@ -708,7 +708,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_FCFLAGS])
|
||||
# WRAPPER_EXTRA_LDFLAGS
|
||||
#
|
||||
AC_MSG_CHECKING([for wrapper compiler LDFLAGS])
|
||||
LAM_UNIQ(WRAPPER_EXTRA_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])
|
||||
@ -740,9 +740,9 @@ AC_SUBST(FCFLAGS)
|
||||
# Party on
|
||||
############################################################################
|
||||
|
||||
lam_show_subtitle "Final output"
|
||||
ompi_show_subtitle "Final output"
|
||||
|
||||
AM_CONFIG_HEADER([include/lam_config.h])
|
||||
AM_CONFIG_HEADER([include/ompi_config.h])
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
|
||||
@ -755,7 +755,7 @@ AC_CONFIG_FILES([
|
||||
src/include/Makefile
|
||||
|
||||
src/ctnetwork/Makefile
|
||||
src/lfc/Makefile
|
||||
src/class/Makefile
|
||||
src/mem/Makefile
|
||||
src/os/Makefile
|
||||
src/os/cygwin/Makefile
|
||||
@ -824,7 +824,7 @@ AC_CONFIG_FILES([
|
||||
src/mpi/f90/Makefile
|
||||
|
||||
src/tools/Makefile
|
||||
src/tools/laminfo/Makefile
|
||||
src/tools/ompi_info/Makefile
|
||||
src/tools/mpirun/Makefile
|
||||
src/tools/wrappers/Makefile
|
||||
|
||||
@ -833,7 +833,7 @@ AC_CONFIG_FILES([
|
||||
|
||||
test/Makefile
|
||||
test/support/Makefile
|
||||
test/lfc/Makefile
|
||||
test/class/Makefile
|
||||
test/threads/Makefile
|
||||
test/util/Makefile
|
||||
test/rte/Makefile
|
||||
|
@ -6,20 +6,20 @@
|
||||
include $(top_srcdir)/config/Makefile.options
|
||||
|
||||
include_HEADERS = \
|
||||
lam_config.h \
|
||||
lam_config_bottom.h \
|
||||
ompi_config.h \
|
||||
ompi_config_bottom.h \
|
||||
mpi.h \
|
||||
mpif.h
|
||||
|
||||
# Add a hook to run *after* the file lam_config.h has been installed
|
||||
# Add a hook to run *after* the file ompi_config.h has been installed
|
||||
# out to the target location. It changes the pesky PACKAGE_* macros
|
||||
# that autoconf automatically generates (and there is no way of
|
||||
# turning off) into LAM_MPI_PACKAGE_* in order to make <mpi.h> safe to
|
||||
# turning off) into OMPI_MPI_PACKAGE_* in order to make <mpi.h> safe to
|
||||
# include with other files.
|
||||
|
||||
install-data-hook:
|
||||
sed -e 's/define PACKAGE/define LAM_MPI_PACKAGE/' \
|
||||
$(DESTDIR)$(includedir)/lam_config.h \
|
||||
> $(DESTDIR)$(includedir)/lam_config.h.install
|
||||
mv $(DESTDIR)$(includedir)/lam_config.h.install \
|
||||
$(DESTDIR)$(includedir)/lam_config.h
|
||||
sed -e 's/define PACKAGE/define OMPI_MPI_PACKAGE/' \
|
||||
$(DESTDIR)$(includedir)/ompi_config.h \
|
||||
> $(DESTDIR)$(includedir)/ompi_config.h.install
|
||||
mv $(DESTDIR)$(includedir)/ompi_config.h.install \
|
||||
$(DESTDIR)$(includedir)/ompi_config.h
|
||||
|
@ -1,12 +1,12 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*
|
||||
* This file is included at the bottom of lam_config.h, and is
|
||||
* This file is included at the bottom of ompi_config.h, and is
|
||||
* therefore a) after all the #define's that were output from
|
||||
* configure, and b) included in most/all files in LAM/MPI.
|
||||
* configure, and b) included in most/all files in OMPI/MPI.
|
||||
*
|
||||
* Since this file is *only* ever included by lam_config.h, and
|
||||
* lam_config.h already has #ifndef/#endif protection, there is no
|
||||
* Since this file is *only* ever included by ompi_config.h, and
|
||||
* ompi_config.h already has #ifndef/#endif protection, there is no
|
||||
* need to #ifndef/#endif protection here.
|
||||
*/
|
||||
|
||||
@ -27,20 +27,20 @@ typedef enum { false, true } bool;
|
||||
*/
|
||||
#include <limits.h>
|
||||
#if defined(PATH_MAX)
|
||||
#define LAM_PATH_MAX (PATH_MAX + 1)
|
||||
#define OMPI_PATH_MAX (PATH_MAX + 1)
|
||||
#elif defined(_POSIX_PATH_MAX)
|
||||
#define LAM_PATH_MAX (_POSIX_PATH_MAX + 1)
|
||||
#define OMPI_PATH_MAX (_POSIX_PATH_MAX + 1)
|
||||
#else
|
||||
#define LAM_PATH_MAX 256
|
||||
#define OMPI_PATH_MAX 256
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Do we have thread support?
|
||||
*/
|
||||
#define LAM_HAVE_THREADS (LAM_HAVE_SOLARIS_THREADS || LAM_HAVE_POSIX_THREADS)
|
||||
#define OMPI_HAVE_THREADS (OMPI_HAVE_SOLARIS_THREADS || OMPI_HAVE_POSIX_THREADS)
|
||||
|
||||
/* parameter indicating if to check MPI arguments */
|
||||
extern bool lam_mpi_param_check;
|
||||
extern bool ompi_mpi_param_check;
|
||||
|
||||
/*
|
||||
* Do we have <stdint.h>?
|
||||
@ -48,30 +48,30 @@ extern bool lam_mpi_param_check;
|
||||
#if HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include "lam_stdint.h"
|
||||
#include "ompi_stdint.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Do we want memory debugging?
|
||||
*/
|
||||
#if LAM_ENABLE_MEM_DEBUG && defined(LAM_BUILDING) && LAM_BUILDING
|
||||
#if OMPI_ENABLE_MEM_DEBUG && defined(OMPI_BUILDING) && OMPI_BUILDING
|
||||
|
||||
/* It is safe to include mem/malloc.h here because a) it will only
|
||||
happen when we are building LAM and therefore have a full LAM
|
||||
happen when we are building OMPI and therefore have a full OMPI
|
||||
source tree [including headers] available, and b) we guaranteed to
|
||||
*not* to include anything else via mem/malloc.h, so we won't
|
||||
have Cascading Includes Of Death. */
|
||||
#include "mem/malloc.h"
|
||||
#define malloc(size) lam_malloc((size), __FILE__, __LINE__)
|
||||
#define realloc(ptr, size) lam_realloc((ptr), (size), __FILE__, __LINE__)
|
||||
#define free(ptr) lam_free((ptr), __FILE__, __LINE__)
|
||||
#define malloc(size) ompi_malloc((size), __FILE__, __LINE__)
|
||||
#define realloc(ptr, size) ompi_realloc((ptr), (size), __FILE__, __LINE__)
|
||||
#define free(ptr) ompi_free((ptr), __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Do we want to override debugging controls?
|
||||
*/
|
||||
#if defined(LAM_ENABLE_DEBUG_OVERRIDE) && LAM_ENABLE_DEBUG_OVERRIDE
|
||||
#undef LAM_ENABLE_DEBUG
|
||||
#define LAM_ENABLE_DEBUG 1
|
||||
#if defined(OMPI_ENABLE_DEBUG_OVERRIDE) && OMPI_ENABLE_DEBUG_OVERRIDE
|
||||
#undef OMPI_ENABLE_DEBUG
|
||||
#define OMPI_ENABLE_DEBUG 1
|
||||
#endif
|
||||
|
@ -6,10 +6,10 @@
|
||||
* gathered by configure.
|
||||
*/
|
||||
|
||||
#ifndef LAM_STDINT_H
|
||||
#define LAM_STDINT_H 1
|
||||
#ifndef OMPI_STDINT_H
|
||||
#define OMPI_STDINT_H 1
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
|
||||
@ -170,5 +170,5 @@ typedef unsigned long long uintptr_t;
|
||||
|
||||
#endif /* HAVE_STDINT_H */
|
||||
|
||||
#endif /* LAM_STDINT_H */
|
||||
#endif /* OMPI_STDINT_H */
|
||||
|
||||
|
226
include/mpi.h
226
include/mpi.h
@ -2,15 +2,15 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_MPI_H
|
||||
#define LAM_MPI_H
|
||||
#ifndef OMPI_MPI_H
|
||||
#define OMPI_MPI_H
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
/*
|
||||
* Just in case you need it. :-)
|
||||
*/
|
||||
#define LAM_MPI 1
|
||||
#define OMPI_MPI 1
|
||||
|
||||
/*
|
||||
* MPI version
|
||||
@ -22,27 +22,27 @@
|
||||
* Typedefs
|
||||
*/
|
||||
typedef long MPI_Aint;
|
||||
typedef struct lam_communicator_t *MPI_Comm;
|
||||
typedef struct lam_datatype_t *MPI_Datatype;
|
||||
typedef struct lam_errhandler_t *MPI_Errhandler;
|
||||
typedef struct lam_file_t *MPI_File;
|
||||
typedef struct lam_group_t *MPI_Group;
|
||||
typedef struct lam_info_t *MPI_Info;
|
||||
typedef struct lam_op_t *MPI_Op;
|
||||
typedef struct lam_request_t *MPI_Request;
|
||||
typedef struct lam_status_public_t MPI_Status;
|
||||
typedef struct lam_win_t *MPI_Win;
|
||||
typedef struct ompi_communicator_t *MPI_Comm;
|
||||
typedef struct ompi_datatype_t *MPI_Datatype;
|
||||
typedef struct ompi_errhandler_t *MPI_Errhandler;
|
||||
typedef struct ompi_file_t *MPI_File;
|
||||
typedef struct ompi_group_t *MPI_Group;
|
||||
typedef struct ompi_info_t *MPI_Info;
|
||||
typedef struct ompi_op_t *MPI_Op;
|
||||
typedef struct ompi_request_t *MPI_Request;
|
||||
typedef struct ompi_status_public_t MPI_Status;
|
||||
typedef struct ompi_win_t *MPI_Win;
|
||||
|
||||
/*
|
||||
* MPI_Status
|
||||
*/
|
||||
struct lam_status_public_t {
|
||||
struct ompi_status_public_t {
|
||||
int MPI_SOURCE;
|
||||
int MPI_TAG;
|
||||
int MPI_ERROR;
|
||||
int _count;
|
||||
};
|
||||
typedef struct lam_status_public_t lam_status_public_t;
|
||||
typedef struct ompi_status_public_t ompi_status_public_t;
|
||||
|
||||
/*
|
||||
* User typedefs
|
||||
@ -148,18 +148,18 @@ enum {
|
||||
IMPI_HOST_COLOR,
|
||||
|
||||
/*
|
||||
* Predefined attribute keyvals, but LAM-specific
|
||||
* Predefined attribute keyvals, but OMPI-specific
|
||||
*/
|
||||
LAM_UNIVERSE_NCPUS,
|
||||
LAM_UNIVERSE_NNODES,
|
||||
OMPI_UNIVERSE_NCPUS,
|
||||
OMPI_UNIVERSE_NNODES,
|
||||
|
||||
/*
|
||||
* Predefined attribute keyvals, but LAM/MPI-specific
|
||||
* Predefined attribute keyvals, but OMPI/MPI-specific
|
||||
*/
|
||||
LAM_MPI_SSI_COLL,
|
||||
LAM_MPI_SSI_COLL_CROSSOVER,
|
||||
LAM_MPI_SSI_COLL_ASSOCIATIVE,
|
||||
LAM_MPI_SSI_COLL_REDUCE_CROSSOVER
|
||||
OMPI_MPI_SSI_COLL,
|
||||
OMPI_MPI_SSI_COLL_CROSSOVER,
|
||||
OMPI_MPI_SSI_COLL_ASSOCIATIVE,
|
||||
OMPI_MPI_SSI_COLL_REDUCE_CROSSOVER
|
||||
};
|
||||
|
||||
/*
|
||||
@ -181,7 +181,7 @@ enum {
|
||||
MPI_ERR_ARG, /* invalid argument */
|
||||
MPI_ERR_UNKNOWN, /* unknown error */
|
||||
MPI_ERR_TRUNCATE, /* message truncated on receive */
|
||||
MPI_ERR_OTHER, /* LAM error */
|
||||
MPI_ERR_OTHER, /* OMPI error */
|
||||
MPI_ERR_INTERN, /* internal MPI error */
|
||||
MPI_ERR_IN_STATUS, /* error code is in status */
|
||||
MPI_ERR_PENDING, /* pending request */
|
||||
@ -254,12 +254,12 @@ enum {
|
||||
/*
|
||||
* NULL handles
|
||||
*/
|
||||
#define MPI_GROUP_NULL (&lam_mpi_group_null)
|
||||
#define MPI_COMM_NULL (&lam_mpi_comm_null)
|
||||
#define MPI_GROUP_NULL (&ompi_mpi_group_null)
|
||||
#define MPI_COMM_NULL (&ompi_mpi_comm_null)
|
||||
#define MPI_DATATYPE_NULL ((MPI_Datatype) 0)
|
||||
#define MPI_REQUEST_NULL ((MPI_Request) 0)
|
||||
#define MPI_OP_NULL (&lam_mpi_op_null)
|
||||
#define MPI_ERRHANDLER_NULL (&lam_mpi_errhandler_null)
|
||||
#define MPI_OP_NULL (&ompi_mpi_op_null)
|
||||
#define MPI_ERRHANDLER_NULL (&ompi_mpi_errhandler_null)
|
||||
#define MPI_INFO_NULL ((MPI_Info) 0)
|
||||
#define MPI_WIN_NULL ((MPI_Win) 0)
|
||||
#define MPI_FILE_NULL ((MPI_File) 0)
|
||||
@ -279,50 +279,50 @@ enum {
|
||||
/*
|
||||
* External variables
|
||||
*/
|
||||
extern struct lam_communicator_t lam_mpi_comm_world;
|
||||
extern struct lam_communicator_t lam_mpi_comm_self;
|
||||
extern struct lam_communicator_t lam_mpi_comm_null;
|
||||
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;
|
||||
|
||||
extern struct lam_group_t lam_mpi_group_empty;
|
||||
extern struct lam_group_t lam_mpi_group_null;
|
||||
extern struct ompi_group_t ompi_mpi_group_empty;
|
||||
extern struct ompi_group_t ompi_mpi_group_null;
|
||||
|
||||
extern struct lam_op_t lam_mpi_op_null;
|
||||
extern struct lam_op_t lam_mpi_op_max, lam_mpi_op_min;
|
||||
extern struct lam_op_t lam_mpi_op_sum, lam_mpi_op_prod;
|
||||
extern struct lam_op_t lam_mpi_op_land, lam_mpi_op_band;
|
||||
extern struct lam_op_t lam_mpi_op_lor, lam_mpi_op_bor;
|
||||
extern struct lam_op_t lam_mpi_op_lxor, lam_mpi_op_bxor;
|
||||
extern struct lam_op_t lam_mpi_op_maxloc, lam_mpi_op_minloc;
|
||||
extern struct lam_op_t lam_mpi_op_replace;
|
||||
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;
|
||||
|
||||
extern struct lam_datatype_t *lam_mpi_char, *lam_mpi_byte;
|
||||
extern struct lam_datatype_t *lam_mpi_int, *lam_mpi_logic;
|
||||
extern struct lam_datatype_t *lam_mpi_short, *lam_mpi_long;
|
||||
extern struct lam_datatype_t *lam_mpi_float, *lam_mpi_double;
|
||||
extern struct lam_datatype_t *lam_mpi_long_double;
|
||||
extern struct lam_datatype_t *lam_mpi_cplex, *lam_mpi_packed;
|
||||
extern struct lam_datatype_t *lam_mpi_unsigned_char;
|
||||
extern struct lam_datatype_t *lam_mpi_unsigned_short;
|
||||
extern struct lam_datatype_t *lam_mpi_unsigned;
|
||||
extern struct lam_datatype_t *lam_mpi_unsigned_long;
|
||||
extern struct lam_datatype_t *lam_mpi_ub, *lam_mpi_lb;
|
||||
extern struct lam_datatype_t *lam_mpi_float_int, *lam_mpi_double_int;
|
||||
extern struct lam_datatype_t *lam_mpi_long_int, *lam_mpi_2int;
|
||||
extern struct lam_datatype_t *lam_mpi_short_int, *lam_mpi_dblcplex;
|
||||
extern struct lam_datatype_t *lam_mpi_integer, *lam_mpi_real;
|
||||
extern struct lam_datatype_t *lam_mpi_dblprec, *lam_mpi_character;
|
||||
extern struct lam_datatype_t *lam_mpi_2real, *lam_mpi_2dblprec;
|
||||
extern struct lam_datatype_t *lam_mpi_2integer, *lam_mpi_longdbl_int;
|
||||
extern struct lam_datatype_t *lam_mpi_wchar, *lam_mpi_long_long_int;
|
||||
extern struct lam_datatype_t *lam_mpi_long_long, *lam_mpi_unsigned_long_long;
|
||||
extern struct lam_datatype_t *lam_mpi_cxx_cplex, *lam_mpi_cxx_dblcplex;
|
||||
extern struct lam_datatype_t *lam_mpi_cxx_ldblcplex;
|
||||
extern struct lam_datatype_t *lam_mpi_cxx_bool;
|
||||
extern struct lam_datatype_t *lam_mpi_2cplex, *lam_mpi_2dblcplex;
|
||||
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;
|
||||
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;
|
||||
|
||||
extern struct lam_errhandler_t lam_mpi_errhandler_null;
|
||||
extern struct lam_errhandler_t lam_mpi_errors_are_fatal;
|
||||
extern struct lam_errhandler_t lam_mpi_errors_return;
|
||||
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;
|
||||
|
||||
extern MPI_Fint *MPI_F_STATUS_IGNORE;
|
||||
extern MPI_Fint *MPI_F_STATUSES_IGNORE;
|
||||
@ -330,55 +330,55 @@ extern MPI_Fint *MPI_F_STATUSES_IGNORE;
|
||||
/*
|
||||
* MPI predefined handles
|
||||
*/
|
||||
#define MPI_COMM_WORLD (&lam_mpi_comm_world)
|
||||
#define MPI_COMM_SELF (&lam_mpi_comm_self)
|
||||
#define MPI_COMM_WORLD (&ompi_mpi_comm_world)
|
||||
#define MPI_COMM_SELF (&ompi_mpi_comm_self)
|
||||
|
||||
#define MPI_GROUP_EMPTY (&lam_mpi_group_empty)
|
||||
#define MPI_GROUP_EMPTY (&ompi_mpi_group_empty)
|
||||
|
||||
#define MPI_MAX (&lam_mpi_op_max)
|
||||
#define MPI_MIN (&lam_mpi_op_min)
|
||||
#define MPI_SUM (&lam_mpi_op_sum)
|
||||
#define MPI_PROD (&lam_mpi_op_prod)
|
||||
#define MPI_LAND (&lam_mpi_op_land)
|
||||
#define MPI_BAND (&lam_mpi_op_band)
|
||||
#define MPI_LOR (&lam_mpi_op_lor)
|
||||
#define MPI_BOR (&lam_mpi_op_bor)
|
||||
#define MPI_LXOR (&lam_mpi_op_lxor)
|
||||
#define MPI_BXOR (&lam_mpi_op_bxor)
|
||||
#define MPI_MAXLOC (&lam_mpi_op_maxloc)
|
||||
#define MPI_MINLOC (&lam_mpi_op_minloc)
|
||||
#define MPI_REPLACE (&lam_mpi_op_replace)
|
||||
#define MPI_MAX (&ompi_mpi_op_max)
|
||||
#define MPI_MIN (&ompi_mpi_op_min)
|
||||
#define MPI_SUM (&ompi_mpi_op_sum)
|
||||
#define MPI_PROD (&ompi_mpi_op_prod)
|
||||
#define MPI_LAND (&ompi_mpi_op_land)
|
||||
#define MPI_BAND (&ompi_mpi_op_band)
|
||||
#define MPI_LOR (&ompi_mpi_op_lor)
|
||||
#define MPI_BOR (&ompi_mpi_op_bor)
|
||||
#define MPI_LXOR (&ompi_mpi_op_lxor)
|
||||
#define MPI_BXOR (&ompi_mpi_op_bxor)
|
||||
#define MPI_MAXLOC (&ompi_mpi_op_maxloc)
|
||||
#define MPI_MINLOC (&ompi_mpi_op_minloc)
|
||||
#define MPI_REPLACE (&ompi_mpi_op_replace)
|
||||
|
||||
#define MPI_BYTE (lam_mpi_byte)
|
||||
#define MPI_PACKED (lam_mpi_packed)
|
||||
#define MPI_CHAR (lam_mpi_char)
|
||||
#define MPI_SHORT (lam_mpi_short)
|
||||
#define MPI_INT (lam_mpi_int)
|
||||
#define MPI_LONG (lam_mpi_long)
|
||||
#define MPI_FLOAT (lam_mpi_float)
|
||||
#define MPI_DOUBLE (lam_mpi_double)
|
||||
#define MPI_LONG_DOUBLE (lam_mpi_long_double)
|
||||
#define MPI_UNSIGNED_CHAR (lam_mpi_unsigned_char)
|
||||
#define MPI_UNSIGNED_SHORT (lam_mpi_unsigned_short)
|
||||
#define MPI_UNSIGNED_LONG (lam_mpi_unsigned_long)
|
||||
#define MPI_UNSIGNED (lam_mpi_unsigned)
|
||||
#define MPI_FLOAT_INT (lam_mpi_float_int)
|
||||
#define MPI_DOUBLE_INT (lam_mpi_double_int)
|
||||
#define MPI_LONG_DOUBLE_INT (lam_mpi_longdbl_int)
|
||||
#define MPI_LONG_INT (lam_mpi_long_int)
|
||||
#define MPI_SHORT_INT (lam_mpi_short_int)
|
||||
#define MPI_2INT (lam_mpi_2int)
|
||||
#define MPI_UB (lam_mpi_ub)
|
||||
#define MPI_LB (lam_mpi_lb)
|
||||
#define MPI_WCHAR (lam_mpi_wchar)
|
||||
#define MPI_BYTE (ompi_mpi_byte)
|
||||
#define MPI_PACKED (ompi_mpi_packed)
|
||||
#define MPI_CHAR (ompi_mpi_char)
|
||||
#define MPI_SHORT (ompi_mpi_short)
|
||||
#define MPI_INT (ompi_mpi_int)
|
||||
#define MPI_LONG (ompi_mpi_long)
|
||||
#define MPI_FLOAT (ompi_mpi_float)
|
||||
#define MPI_DOUBLE (ompi_mpi_double)
|
||||
#define MPI_LONG_DOUBLE (ompi_mpi_long_double)
|
||||
#define MPI_UNSIGNED_CHAR (ompi_mpi_unsigned_char)
|
||||
#define MPI_UNSIGNED_SHORT (ompi_mpi_unsigned_short)
|
||||
#define MPI_UNSIGNED_LONG (ompi_mpi_unsigned_long)
|
||||
#define MPI_UNSIGNED (ompi_mpi_unsigned)
|
||||
#define MPI_FLOAT_INT (ompi_mpi_float_int)
|
||||
#define MPI_DOUBLE_INT (ompi_mpi_double_int)
|
||||
#define MPI_LONG_DOUBLE_INT (ompi_mpi_longdbl_int)
|
||||
#define MPI_LONG_INT (ompi_mpi_long_int)
|
||||
#define MPI_SHORT_INT (ompi_mpi_short_int)
|
||||
#define MPI_2INT (ompi_mpi_2int)
|
||||
#define MPI_UB (ompi_mpi_ub)
|
||||
#define MPI_LB (ompi_mpi_lb)
|
||||
#define MPI_WCHAR (ompi_mpi_wchar)
|
||||
#if HAVE_LONG_LONG
|
||||
#define MPI_LONG_LONG_INT (lam_mpi_long_long_int)
|
||||
#define MPI_LONG_LONG (lam_mpi_long_long)
|
||||
#define MPI_UNSIGNED_LONG_LONG (lam_mpi_unsigned_long_long)
|
||||
#define MPI_LONG_LONG_INT (ompi_mpi_long_long_int)
|
||||
#define MPI_LONG_LONG (ompi_mpi_long_long)
|
||||
#define MPI_UNSIGNED_LONG_LONG (ompi_mpi_unsigned_long_long)
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
|
||||
#define MPI_ERRORS_ARE_FATAL (&lam_mpi_errors_are_fatal)
|
||||
#define MPI_ERRORS_RETURN (&lam_mpi_errors_return)
|
||||
#define MPI_ERRORS_ARE_FATAL (&ompi_mpi_errors_are_fatal)
|
||||
#define MPI_ERRORS_RETURN (&ompi_mpi_errors_return)
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
@ -1413,4 +1413,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LAM_MPI_H */
|
||||
#endif /* OMPI_MPI_H */
|
||||
|
@ -12,22 +12,22 @@
|
||||
! tells the compiler where to find .h files (specifically, this one). For
|
||||
! example:
|
||||
!
|
||||
! shell$ mpif77 foo.f -o foo -I$LAMHOME/include
|
||||
! shell$ mpif77 foo.f -o foo -I$OMPI_HOME/include
|
||||
!
|
||||
! will probably do the trick (assuming that you have set LAMHOME
|
||||
! will probably do the trick (assuming that you have set OMPI_HOME
|
||||
! properly).
|
||||
!
|
||||
! That being said, LAM's "mpif77" wrapper compiler should
|
||||
! That being said, OMPI's "mpif77" wrapper compiler should
|
||||
! automatically include the -I option for you. The following command
|
||||
! should be equivalent to the command listed above:
|
||||
!
|
||||
! shell$ mpif77 foo.f -o foo
|
||||
!
|
||||
! You should not copy this file to your local directory because it is
|
||||
! possible that this file will be changed between versions of LAM/MPI.
|
||||
! possible that this file will be changed between versions of OMPI/MPI.
|
||||
! Indeed, this mpif.h is incompatible with the mpif.f of other
|
||||
! implementations of MPI. Using this mpif.h with other implementations
|
||||
! of MPI, or with other versions of LAM/MPI will result in undefined
|
||||
! of MPI, or with other versions of OMPI/MPI will result in undefined
|
||||
! behavior (to include incorrect results, segmentation faults,
|
||||
! unexplainable "hanging" in your application, etc.). Always use the
|
||||
! -I command line option instead (or let mpif77 do it for you).
|
||||
@ -37,19 +37,19 @@
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!
|
||||
! LAM version
|
||||
! OMPI version
|
||||
! This file is generated from configure; do not edit it manually.
|
||||
!
|
||||
integer LAM_MAJOR_VERSION, LAM_MINOR_VERSION
|
||||
integer LAM_RELEASE_VERSION
|
||||
integer LAM_ALPHA_VERSION, LAM_BETA_VERSION
|
||||
integer LAM_SVN_VERSION
|
||||
parameter (LAM_MAJOR_VERSION=@LAM_MAJOR_VERSION@)
|
||||
parameter (LAM_MINOR_VERSION=@LAM_MINOR_VERSION@)
|
||||
parameter (LAM_RELEASE_VERSION=@LAM_RELEASE_VERSION@)
|
||||
parameter (LAM_ALPHA_VERSION=@LAM_ALPHA_VERSION@)
|
||||
parameter (LAM_BETA_VERSION=@LAM_BETA_VERSION@)
|
||||
parameter (LAM_SVN_VERSION=@LAM_SVN_VERSION@)
|
||||
integer OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION
|
||||
integer OMPI_RELEASE_VERSION
|
||||
integer OMPI_ALPHA_VERSION, OMPI_BETA_VERSION
|
||||
integer OMPI_SVN_VERSION
|
||||
parameter (OMPI_MAJOR_VERSION=@OMPI_MAJOR_VERSION@)
|
||||
parameter (OMPI_MINOR_VERSION=@OMPI_MINOR_VERSION@)
|
||||
parameter (OMPI_RELEASE_VERSION=@OMPI_RELEASE_VERSION@)
|
||||
parameter (OMPI_ALPHA_VERSION=@OMPI_ALPHA_VERSION@)
|
||||
parameter (OMPI_BETA_VERSION=@OMPI_BETA_VERSION@)
|
||||
parameter (OMPI_SVN_VERSION=@OMPI_SVN_VERSION@)
|
||||
!
|
||||
! MPI version
|
||||
!
|
||||
@ -240,12 +240,12 @@
|
||||
parameter (MPI_INTEGER1=12)
|
||||
parameter (MPI_INTEGER2=13)
|
||||
parameter (MPI_INTEGER4=14)
|
||||
parameter (MPI_INTEGER8=@LAM_INDEXOF_FORTRAN_INTEGER8@)
|
||||
parameter (MPI_INTEGER8=@OMPI_INDEXOF_FORTRAN_INTEGER8@)
|
||||
parameter (MPI_REAL=16)
|
||||
parameter (MPI_REAL2=17)
|
||||
parameter (MPI_REAL4=18)
|
||||
parameter (MPI_REAL8=19)
|
||||
parameter (MPI_REAL16=@LAM_INDEXOF_FORTRAN_REAL16@)
|
||||
parameter (MPI_REAL16=@OMPI_INDEXOF_FORTRAN_REAL16@)
|
||||
parameter (MPI_DOUBLE_PRECISION=21)
|
||||
parameter (MPI_COMPLEX=22)
|
||||
parameter (MPI_DOUBLE_COMPLEX=23)
|
||||
|
@ -17,7 +17,7 @@ SUBDIRS = \
|
||||
file \
|
||||
group \
|
||||
info \
|
||||
lfc \
|
||||
class \
|
||||
mca \
|
||||
mem \
|
||||
mpi \
|
||||
@ -44,7 +44,7 @@ libmpi_la_LIBADD = \
|
||||
event/libevent.la \
|
||||
group/libgroup.la \
|
||||
info/libinfo.la \
|
||||
lfc/liblfc.la \
|
||||
class/liblfc.la \
|
||||
mca/libmca.la \
|
||||
mem/libmem.la \
|
||||
mpi/libmpi_bindings.la \
|
||||
|
@ -19,8 +19,8 @@ libattribute_la_SOURCES = \
|
||||
# Conditionally install the header files
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
lamdir = $(includedir)/lam/attribute
|
||||
lam_HEADERS = $(headers)
|
||||
ompidir = $(includedir)/ompi/attribute
|
||||
ompi_HEADERS = $(headers)
|
||||
else
|
||||
lamdir = $(includedir)
|
||||
ompidir = $(includedir)
|
||||
endif
|
||||
|
@ -17,9 +17,9 @@
|
||||
|
||||
#define MPI_DATATYPE_NULL_COPY_FN MPI_TYPE_NULL_COPY_FN
|
||||
|
||||
#define CREATE_KEY() lam_bitmap_find_and_set_first_unset_bit(key_bitmap)
|
||||
#define CREATE_KEY() ompi_bitmap_find_and_set_first_unset_bit(key_bitmap)
|
||||
|
||||
#define FREE_KEY(key) lam_bitmap_clear_bit(key_bitmap, (key))
|
||||
#define FREE_KEY(key) ompi_bitmap_clear_bit(key_bitmap, (key))
|
||||
|
||||
|
||||
/* Not checking for NULL_DELETE_FN here, since according to the
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#define DELETE_ATTR_OBJECT(type, attribute) \
|
||||
if ((err = (*((key_item->delete_attr_fn).attr_##type##_delete_fn)) \
|
||||
((lam_##type##_t *)object, \
|
||||
((ompi_##type##_t *)object, \
|
||||
key, attribute, \
|
||||
key_item->extra_state)) != MPI_SUCCESS) {\
|
||||
return err;\
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
#define COPY_ATTR_OBJECT(type, old_object, hash_value) \
|
||||
if ((err = (*((hash_value->copy_attr_fn).attr_##type##_copy_fn)) \
|
||||
((lam_##type##_t *)old_object, key, hash_value->extra_state, \
|
||||
((ompi_##type##_t *)old_object, key, hash_value->extra_state, \
|
||||
old_attr, &new_attr, &flag)) != MPI_SUCCESS) { \
|
||||
return err; \
|
||||
}
|
||||
@ -45,74 +45,74 @@
|
||||
/*
|
||||
* Static
|
||||
*/
|
||||
static void lam_attribute_construct(lam_attrkey_t *attribute);
|
||||
static void lam_attribute_destruct(lam_attrkey_t *attribute);
|
||||
static void lam_attrkey_item_construct(lam_attrkey_item_t *item);
|
||||
static void lam_attrkey_item_destruct(lam_attrkey_item_t *item);
|
||||
static void ompi_attribute_construct(ompi_attrkey_t *attribute);
|
||||
static void ompi_attribute_destruct(ompi_attrkey_t *attribute);
|
||||
static void ompi_attrkey_item_construct(ompi_attrkey_item_t *item);
|
||||
static void ompi_attrkey_item_destruct(ompi_attrkey_item_t *item);
|
||||
|
||||
|
||||
/*
|
||||
* lam_attrkey_t classes
|
||||
* ompi_attrkey_t classes
|
||||
*/
|
||||
|
||||
OBJ_CLASS_INSTANCE(lam_attrkey_t,
|
||||
lam_list_t,
|
||||
lam_attribute_construct,
|
||||
lam_attribute_destruct);
|
||||
OBJ_CLASS_INSTANCE(ompi_attrkey_t,
|
||||
ompi_list_t,
|
||||
ompi_attribute_construct,
|
||||
ompi_attribute_destruct);
|
||||
/*
|
||||
* lam_attribute_entry_t classes
|
||||
* ompi_attribute_entry_t classes
|
||||
*/
|
||||
|
||||
OBJ_CLASS_INSTANCE(lam_attrkey_item_t,
|
||||
lam_object_t,
|
||||
lam_attrkey_item_construct,
|
||||
lam_attrkey_item_destruct);
|
||||
OBJ_CLASS_INSTANCE(ompi_attrkey_item_t,
|
||||
ompi_object_t,
|
||||
ompi_attrkey_item_construct,
|
||||
ompi_attrkey_item_destruct);
|
||||
|
||||
|
||||
/*
|
||||
* Static variables
|
||||
*/
|
||||
|
||||
static lam_attrkey_t *attr_hash;
|
||||
static lam_bitmap_t *key_bitmap;
|
||||
static ompi_attrkey_t *attr_hash;
|
||||
static ompi_bitmap_t *key_bitmap;
|
||||
|
||||
|
||||
/*
|
||||
* lam_attrkey_t interface functions
|
||||
* ompi_attrkey_t interface functions
|
||||
*/
|
||||
|
||||
static void
|
||||
lam_attribute_construct(lam_attrkey_t *attribute)
|
||||
ompi_attribute_construct(ompi_attrkey_t *attribute)
|
||||
{
|
||||
attribute->a_fhandle = -1;
|
||||
OBJ_CONSTRUCT(&(attribute->super), lam_hash_table_t);
|
||||
OBJ_CONSTRUCT(&(attribute->super), ompi_hash_table_t);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
lam_attribute_destruct(lam_attrkey_t *attribute)
|
||||
ompi_attribute_destruct(ompi_attrkey_t *attribute)
|
||||
{
|
||||
OBJ_DESTRUCT(&(attribute->super));
|
||||
}
|
||||
|
||||
/*
|
||||
* lam_attrkey_item_t interface functions
|
||||
* ompi_attrkey_item_t interface functions
|
||||
*/
|
||||
|
||||
static void
|
||||
lam_attrkey_item_construct(lam_attrkey_item_t *item)
|
||||
ompi_attrkey_item_construct(ompi_attrkey_item_t *item)
|
||||
{
|
||||
memset(&(item->attr_type), 0,
|
||||
sizeof(lam_attrkey_item_t) - sizeof(lam_object_t));
|
||||
sizeof(ompi_attrkey_item_t) - sizeof(ompi_object_t));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
lam_attrkey_item_destruct(lam_attrkey_item_t *item)
|
||||
ompi_attrkey_item_destruct(ompi_attrkey_item_t *item)
|
||||
{
|
||||
/* Remove the key entry from the hash and free the key */
|
||||
|
||||
lam_hash_table_remove_value_uint32(&(attr_hash->super), item->key);
|
||||
ompi_hash_table_remove_value_uint32(&(attr_hash->super), item->key);
|
||||
FREE_KEY(item->key);
|
||||
}
|
||||
|
||||
@ -123,22 +123,22 @@ lam_attrkey_item_destruct(lam_attrkey_item_t *item)
|
||||
*/
|
||||
|
||||
int
|
||||
lam_attr_init()
|
||||
ompi_attr_init()
|
||||
{
|
||||
attr_hash = OBJ_NEW(lam_attrkey_t);
|
||||
attr_hash = OBJ_NEW(ompi_attrkey_t);
|
||||
if (NULL == attr_hash) {
|
||||
fprintf(stderr, "Error while creating the main attribute list\n");
|
||||
return MPI_ERR_SYSRESOURCE;
|
||||
}
|
||||
key_bitmap = OBJ_NEW(lam_bitmap_t);
|
||||
if (0 != lam_bitmap_init(key_bitmap, 10)) {
|
||||
key_bitmap = OBJ_NEW(ompi_bitmap_t);
|
||||
if (0 != ompi_bitmap_init(key_bitmap, 10)) {
|
||||
return MPI_ERR_SYSRESOURCE;
|
||||
}
|
||||
if (lam_hash_table_init(&attr_hash->super,
|
||||
ATTR_TABLE_SIZE) != LAM_SUCCESS)
|
||||
if (ompi_hash_table_init(&attr_hash->super,
|
||||
ATTR_TABLE_SIZE) != OMPI_SUCCESS)
|
||||
return MPI_ERR_SYSRESOURCE;
|
||||
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ lam_attr_init()
|
||||
*/
|
||||
|
||||
void
|
||||
lam_attr_destroy()
|
||||
ompi_attr_destroy()
|
||||
{
|
||||
OBJ_RELEASE(attr_hash);
|
||||
OBJ_RELEASE(key_bitmap);
|
||||
@ -155,22 +155,22 @@ lam_attr_destroy()
|
||||
|
||||
|
||||
int
|
||||
lam_attr_create_keyval(lam_attribute_type_t type,
|
||||
lam_attribute_fn_ptr_union_t copy_attr_fn,
|
||||
lam_attribute_fn_ptr_union_t delete_attr_fn,
|
||||
ompi_attr_create_keyval(ompi_attribute_type_t type,
|
||||
ompi_attribute_fn_ptr_union_t copy_attr_fn,
|
||||
ompi_attribute_fn_ptr_union_t delete_attr_fn,
|
||||
int *key, void *extra_state, int predefined)
|
||||
{
|
||||
lam_attrkey_item_t *attr;
|
||||
ompi_attrkey_item_t *attr;
|
||||
int ret;
|
||||
|
||||
/* Protect against the user calling lam_attr_destroy and then
|
||||
/* Protect against the user calling ompi_attr_destroy and then
|
||||
calling any of the functions which use it */
|
||||
if (NULL == attr_hash)
|
||||
return MPI_ERR_INTERN;
|
||||
|
||||
/* Allocate space for the list item */
|
||||
|
||||
attr = OBJ_NEW(lam_attrkey_item_t);
|
||||
attr = OBJ_NEW(ompi_attrkey_item_t);
|
||||
if (NULL == attr) {
|
||||
fprintf(stderr, "Error during new object creation for attribute \n");
|
||||
return MPI_ERR_SYSRESOURCE;
|
||||
@ -179,8 +179,8 @@ lam_attr_create_keyval(lam_attribute_type_t type,
|
||||
/* Create a new unique key and fill the hash */
|
||||
|
||||
*key = CREATE_KEY();
|
||||
ret = lam_hash_table_set_value_uint32(&attr_hash->super, *key, attr);
|
||||
if (ret != LAM_SUCCESS)
|
||||
ret = ompi_hash_table_set_value_uint32(&attr_hash->super, *key, attr);
|
||||
if (ret != OMPI_SUCCESS)
|
||||
return ret;
|
||||
|
||||
/* Fill in the list item */
|
||||
@ -190,7 +190,7 @@ lam_attr_create_keyval(lam_attribute_type_t type,
|
||||
attr->extra_state = extra_state;
|
||||
attr->attr_type = type;
|
||||
attr->key = *key;
|
||||
attr->attr_flag = (1 == predefined) ? LAM_PREDEFINED : 0;
|
||||
attr->attr_flag = (1 == predefined) ? OMPI_PREDEFINED : 0;
|
||||
|
||||
/* Bump up the reference count, since we want the object to be
|
||||
destroyed only when free_keyval is called and not when all
|
||||
@ -205,22 +205,22 @@ lam_attr_create_keyval(lam_attribute_type_t type,
|
||||
|
||||
|
||||
int
|
||||
lam_attr_free_keyval(lam_attribute_type_t type, int *key, int predefined)
|
||||
ompi_attr_free_keyval(ompi_attribute_type_t type, int *key, int predefined)
|
||||
{
|
||||
lam_attrkey_item_t *key_item;
|
||||
ompi_attrkey_item_t *key_item;
|
||||
|
||||
/* Protect against the user calling lam_attr_destroy and then
|
||||
/* Protect against the user calling ompi_attr_destroy and then
|
||||
calling any of the functions which use it */
|
||||
if (NULL == attr_hash)
|
||||
return MPI_ERR_INTERN;
|
||||
|
||||
/* Find the key-value pair */
|
||||
|
||||
key_item = (lam_attrkey_item_t*)
|
||||
lam_hash_table_get_value_uint32(&attr_hash->super, *key);
|
||||
key_item = (ompi_attrkey_item_t*)
|
||||
ompi_hash_table_get_value_uint32(&attr_hash->super, *key);
|
||||
|
||||
if ((NULL == key_item) || (key_item->attr_type != type) ||
|
||||
((!predefined) && (key_item->attr_flag & LAM_PREDEFINED)))
|
||||
((!predefined) && (key_item->attr_flag & OMPI_PREDEFINED)))
|
||||
return MPI_INVALID_ATTR_KEYVAL;
|
||||
|
||||
/* Not releasing the object here, it will be done in MPI_*_attr_delete */
|
||||
@ -238,32 +238,32 @@ lam_attr_free_keyval(lam_attribute_type_t type, int *key, int predefined)
|
||||
|
||||
|
||||
int
|
||||
lam_attr_delete(lam_attribute_type_t type, void *object,
|
||||
lam_hash_table_t *keyhash, int key,
|
||||
ompi_attr_delete(ompi_attribute_type_t type, void *object,
|
||||
ompi_hash_table_t *keyhash, int key,
|
||||
int predefined)
|
||||
{
|
||||
lam_attrkey_item_t *key_item;
|
||||
ompi_attrkey_item_t *key_item;
|
||||
int ret, err;
|
||||
void *attr;
|
||||
|
||||
/* Protect against the user calling lam_attr_destroy and then
|
||||
/* Protect against the user calling ompi_attr_destroy and then
|
||||
calling any of the functions which use it */
|
||||
if (NULL == attr_hash)
|
||||
return MPI_ERR_INTERN;
|
||||
|
||||
/* Check if the key is valid in the key-attribute hash */
|
||||
|
||||
key_item = (lam_attrkey_item_t*)
|
||||
lam_hash_table_get_value_uint32(&attr_hash->super, key);
|
||||
key_item = (ompi_attrkey_item_t*)
|
||||
ompi_hash_table_get_value_uint32(&attr_hash->super, key);
|
||||
|
||||
if ((NULL == key_item) || (key_item->attr_type!= type) ||
|
||||
((!predefined) && (key_item->attr_flag & LAM_PREDEFINED)))
|
||||
((!predefined) && (key_item->attr_flag & OMPI_PREDEFINED)))
|
||||
return MPI_INVALID_ATTR_KEYVAL;
|
||||
|
||||
/* Check if the key is valid for the communicator/window/dtype. If
|
||||
yes, then delete the attribute and key entry from the CWD hash */
|
||||
|
||||
attr = lam_hash_table_get_value_uint32(keyhash, key);
|
||||
attr = ompi_hash_table_get_value_uint32(keyhash, key);
|
||||
|
||||
switch(type) {
|
||||
|
||||
@ -281,13 +281,13 @@ lam_attr_delete(lam_attribute_type_t type, void *object,
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "lam_attribute: lam_attr_seet: Invalid type -- "
|
||||
fprintf(stderr, "ompi_attribute: ompi_attr_seet: Invalid type -- "
|
||||
" Should be one of COMM/WIN/TYPE \n");
|
||||
assert(0);
|
||||
}
|
||||
|
||||
ret = lam_hash_table_remove_value_uint32(keyhash, key);
|
||||
if (ret != LAM_SUCCESS) {
|
||||
ret = ompi_hash_table_remove_value_uint32(keyhash, key);
|
||||
if (ret != OMPI_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -301,34 +301,34 @@ lam_attr_delete(lam_attribute_type_t type, void *object,
|
||||
|
||||
|
||||
int
|
||||
lam_attr_set(lam_attribute_type_t type, void *object,
|
||||
lam_hash_table_t *keyhash, int key, void *attribute,
|
||||
ompi_attr_set(ompi_attribute_type_t type, void *object,
|
||||
ompi_hash_table_t *keyhash, int key, void *attribute,
|
||||
int predefined)
|
||||
{
|
||||
lam_attrkey_item_t *key_item;
|
||||
ompi_attrkey_item_t *key_item;
|
||||
int ret, err;
|
||||
void *oldattr;
|
||||
int had_old = 0;
|
||||
|
||||
/* Protect against the user calling lam_attr_destroy and then
|
||||
/* Protect against the user calling ompi_attr_destroy and then
|
||||
calling any of the functions which use it */
|
||||
if (NULL == attr_hash)
|
||||
return MPI_ERR_INTERN;
|
||||
|
||||
key_item = (lam_attrkey_item_t *)
|
||||
lam_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||
key_item = (ompi_attrkey_item_t *)
|
||||
ompi_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||
|
||||
/* If key not found */
|
||||
|
||||
if ((NULL == key_item) || (key_item->attr_type != type) ||
|
||||
((!predefined) && (key_item->attr_flag & LAM_PREDEFINED))) {
|
||||
fprintf(stderr, "lam_attribute: lam_attr_set: key not found \n");
|
||||
((!predefined) && (key_item->attr_flag & OMPI_PREDEFINED))) {
|
||||
fprintf(stderr, "ompi_attribute: ompi_attr_set: key not found \n");
|
||||
return MPI_INVALID_ATTR_KEYVAL;
|
||||
}
|
||||
|
||||
/* Now see if the key is present in the CWD object. If so, delete
|
||||
the old attribute in the key */
|
||||
oldattr = lam_hash_table_get_value_uint32(keyhash, key);
|
||||
oldattr = ompi_hash_table_get_value_uint32(keyhash, key);
|
||||
|
||||
if (oldattr != NULL) {
|
||||
|
||||
@ -347,15 +347,15 @@ lam_attr_set(lam_attribute_type_t type, void *object,
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "lam_attribute: lam_attr_set: Invalid type -- "
|
||||
fprintf(stderr, "ompi_attribute: ompi_attr_set: Invalid type -- "
|
||||
" Should be one of COMM/WIN/TYPE \n");
|
||||
assert(0);
|
||||
}
|
||||
had_old = 1;
|
||||
}
|
||||
|
||||
ret = lam_hash_table_set_value_uint32(keyhash, key, attribute);
|
||||
if (ret != LAM_SUCCESS) {
|
||||
ret = ompi_hash_table_set_value_uint32(keyhash, key, attribute);
|
||||
if (ret != OMPI_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -370,25 +370,25 @@ lam_attr_set(lam_attribute_type_t type, void *object,
|
||||
|
||||
|
||||
int
|
||||
lam_attr_get(lam_hash_table_t *keyhash, int key, void *attribute,
|
||||
ompi_attr_get(ompi_hash_table_t *keyhash, int key, void *attribute,
|
||||
int *flag)
|
||||
{
|
||||
void *attr;
|
||||
lam_attrkey_item_t *key_item;
|
||||
ompi_attrkey_item_t *key_item;
|
||||
|
||||
/* According to MPI specs, the call is invalid if key is not
|
||||
present in the main hash at all. If no attribute is associated
|
||||
with the key, then the call is valid and returns FALSE in the
|
||||
flag argument */
|
||||
|
||||
key_item = (lam_attrkey_item_t *)
|
||||
lam_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||
key_item = (ompi_attrkey_item_t *)
|
||||
ompi_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||
|
||||
if (NULL == key_item) {
|
||||
return MPI_KEYVAL_INVALID;
|
||||
}
|
||||
|
||||
attr = lam_hash_table_get_value_uint32(keyhash, key);
|
||||
attr = ompi_hash_table_get_value_uint32(keyhash, key);
|
||||
|
||||
if (NULL == attr) {
|
||||
*flag = 0;
|
||||
@ -406,35 +406,35 @@ lam_attr_get(lam_hash_table_t *keyhash, int key, void *attribute,
|
||||
/* There is too much of code copy/paste in here, see if some other
|
||||
logic could work here */
|
||||
int
|
||||
lam_attr_copy_all(lam_attribute_type_t type, void *old_object,
|
||||
void *new_object, lam_hash_table_t *oldkeyhash,
|
||||
lam_hash_table_t *newkeyhash)
|
||||
ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
|
||||
void *new_object, ompi_hash_table_t *oldkeyhash,
|
||||
ompi_hash_table_t *newkeyhash)
|
||||
{
|
||||
int ret;
|
||||
int err;
|
||||
uint32_t key;
|
||||
int flag;
|
||||
void *node, *in_node, *old_attr, *new_attr;
|
||||
lam_attrkey_item_t *hash_value;
|
||||
ompi_attrkey_item_t *hash_value;
|
||||
|
||||
/* Protect against the user calling lam_attr_destroy and then
|
||||
/* Protect against the user calling ompi_attr_destroy and then
|
||||
calling any of the functions which use it */
|
||||
if (NULL == attr_hash)
|
||||
return MPI_ERR_INTERN;
|
||||
|
||||
/* Get the first key-attr in the CWD hash */
|
||||
ret = lam_hash_table_get_first_key_uint32(oldkeyhash, &key, &old_attr,
|
||||
ret = ompi_hash_table_get_first_key_uint32(oldkeyhash, &key, &old_attr,
|
||||
&node);
|
||||
|
||||
/* While we still have some key-attr pair in the CWD hash */
|
||||
while (ret != LAM_ERROR) {
|
||||
while (ret != OMPI_ERROR) {
|
||||
in_node = node;
|
||||
|
||||
/* Get the attr_item in the main hash - so that we know
|
||||
what the copy_attr_fn is */
|
||||
|
||||
hash_value = (lam_attrkey_item_t *)
|
||||
lam_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||
hash_value = (ompi_attrkey_item_t *)
|
||||
ompi_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||
|
||||
assert (hash_value != NULL);
|
||||
|
||||
@ -472,11 +472,11 @@ lam_attr_copy_all(lam_attribute_type_t type, void *old_object,
|
||||
assuming that new_attr should have actually been a
|
||||
double pointer in the copy fn, but since its a pointer
|
||||
in that MPI specs, we need to pass *new_attr here */
|
||||
lam_attr_set(type, new_object, newkeyhash, key,
|
||||
ompi_attr_set(type, new_object, newkeyhash, key,
|
||||
new_attr, 1);
|
||||
|
||||
|
||||
ret = lam_hash_table_get_next_key_uint32(oldkeyhash, &key,
|
||||
ret = ompi_hash_table_get_next_key_uint32(oldkeyhash, &key,
|
||||
&old_attr, in_node,
|
||||
&node);
|
||||
}
|
||||
@ -485,23 +485,23 @@ lam_attr_copy_all(lam_attribute_type_t type, void *old_object,
|
||||
|
||||
|
||||
int
|
||||
lam_attr_delete_all(lam_attribute_type_t type, void *object,
|
||||
lam_hash_table_t *keyhash)
|
||||
ompi_attr_delete_all(ompi_attribute_type_t type, void *object,
|
||||
ompi_hash_table_t *keyhash)
|
||||
{
|
||||
int ret;
|
||||
uint32_t key, oldkey;
|
||||
void *node, *in_node, *old_attr;
|
||||
|
||||
/* Protect against the user calling lam_attr_destroy and then
|
||||
/* Protect against the user calling ompi_attr_destroy and then
|
||||
calling any of the functions which use it */
|
||||
if (NULL == attr_hash)
|
||||
return MPI_ERR_INTERN;
|
||||
|
||||
/* Get the first key in local CWD hash */
|
||||
ret = lam_hash_table_get_first_key_uint32(keyhash,
|
||||
ret = ompi_hash_table_get_first_key_uint32(keyhash,
|
||||
&key, &old_attr,
|
||||
&node);
|
||||
while (ret != LAM_ERROR) {
|
||||
while (ret != OMPI_ERROR) {
|
||||
|
||||
/* Save this node info for deletion, before we move onto the
|
||||
next node */
|
||||
@ -511,12 +511,12 @@ lam_attr_delete_all(lam_attribute_type_t type, void *object,
|
||||
|
||||
/* Move to the next node */
|
||||
|
||||
ret = lam_hash_table_get_next_key_uint32(keyhash,
|
||||
ret = ompi_hash_table_get_next_key_uint32(keyhash,
|
||||
&key, &old_attr,
|
||||
in_node, &node);
|
||||
/* Now delete this attribute */
|
||||
|
||||
lam_attr_delete(type, object, keyhash, oldkey, 1);
|
||||
ompi_attr_delete(type, object, keyhash, oldkey, 1);
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,16 +8,16 @@
|
||||
* win or datatype.
|
||||
*/
|
||||
|
||||
#ifndef LAM_ATTRIBUTE_H
|
||||
#define LAM_ATTRIBUTE_H
|
||||
#ifndef OMPI_ATTRIBUTE_H
|
||||
#define OMPI_ATTRIBUTE_H
|
||||
|
||||
#include <string.h>
|
||||
#include "mpi.h"
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "lfc/lam_object.h"
|
||||
#include "lfc/lam_bitmap.h"
|
||||
#include "lfc/lam_hash_table.h"
|
||||
#include "ompi_config.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "class/ompi_bitmap.h"
|
||||
#include "class/ompi_hash_table.h"
|
||||
#include "communicator/communicator.h"
|
||||
#include "datatype/datatype.h"
|
||||
#include "win/win.h"
|
||||
@ -29,15 +29,15 @@
|
||||
just to make things compile now, should take other value in a
|
||||
different enum later */
|
||||
|
||||
enum lam_consts{
|
||||
LAM_PREDEFINED = 1,
|
||||
enum ompi_consts{
|
||||
OMPI_PREDEFINED = 1,
|
||||
MPI_ERROR,
|
||||
MPI_INVALID_ATTR_KEYVAL
|
||||
};
|
||||
|
||||
/* ******************************************************************* */
|
||||
|
||||
enum lam_attribute_type_t{
|
||||
enum ompi_attribute_type_t{
|
||||
COMM_ATTR = 1, /**< The attribute belongs to a comm object. Starts
|
||||
with 1 so that we can have it initialized to 0
|
||||
using memset in the constructor */
|
||||
@ -45,13 +45,13 @@ enum lam_attribute_type_t{
|
||||
TYPE_ATTR /**< The attribute belongs to datatype object */
|
||||
};
|
||||
|
||||
typedef enum lam_attribute_type_t lam_attribute_type_t;
|
||||
typedef enum ompi_attribute_type_t ompi_attribute_type_t;
|
||||
|
||||
/* Union to take care of proper casting of the function pointers
|
||||
passed from the front end functions depending on the type. This
|
||||
will avoid casting function pointers to void* */
|
||||
|
||||
union lam_attribute_fn_ptr_union_t {
|
||||
union ompi_attribute_fn_ptr_union_t {
|
||||
MPI_Comm_delete_attr_function *attr_communicator_delete_fn;
|
||||
MPI_Type_delete_attr_function *attr_datatype_delete_fn;
|
||||
MPI_Win_delete_attr_function *attr_win_delete_fn;
|
||||
@ -61,35 +61,35 @@ union lam_attribute_fn_ptr_union_t {
|
||||
MPI_Win_copy_attr_function *attr_win_copy_fn;
|
||||
};
|
||||
|
||||
typedef union lam_attribute_fn_ptr_union_t lam_attribute_fn_ptr_union_t;
|
||||
typedef union ompi_attribute_fn_ptr_union_t ompi_attribute_fn_ptr_union_t;
|
||||
|
||||
|
||||
struct lam_attrkey_t {
|
||||
lam_hash_table_t super; /**< hash table pointer which will contain
|
||||
struct ompi_attrkey_t {
|
||||
ompi_hash_table_t super; /**< hash table pointer which will contain
|
||||
<key,attr_meta_data> pair */
|
||||
int a_fhandle; /**<Fortran handle for language interoperability */
|
||||
};
|
||||
|
||||
typedef struct lam_attrkey_t lam_attrkey_t;
|
||||
typedef struct ompi_attrkey_t ompi_attrkey_t;
|
||||
|
||||
|
||||
struct lam_attrkey_item_t {
|
||||
lam_object_t super;
|
||||
lam_attribute_type_t attr_type; /**< One of COMM/WIN/DTYPE. This
|
||||
struct ompi_attrkey_item_t {
|
||||
ompi_object_t super;
|
||||
ompi_attribute_type_t attr_type; /**< One of COMM/WIN/DTYPE. This
|
||||
will be used to cast the
|
||||
copy/delete attribute functions
|
||||
properly and error checking */
|
||||
int attr_flag; /**< flag field to denote if its predefined */
|
||||
lam_attribute_fn_ptr_union_t copy_attr_fn; /**< Copy function for the
|
||||
ompi_attribute_fn_ptr_union_t copy_attr_fn; /**< Copy function for the
|
||||
attribute */
|
||||
lam_attribute_fn_ptr_union_t delete_attr_fn; /**< Delete function for the
|
||||
ompi_attribute_fn_ptr_union_t delete_attr_fn; /**< Delete function for the
|
||||
attribute */
|
||||
void *extra_state; /**< Extra state of the attribute */
|
||||
int key; /**< Keep a track of which key this item belongs to, so that
|
||||
the key can be deleted when this object is destroyed */
|
||||
};
|
||||
|
||||
typedef struct lam_attrkey_item_t lam_attrkey_item_t;
|
||||
typedef struct ompi_attrkey_item_t ompi_attrkey_item_t;
|
||||
|
||||
|
||||
/* Functions */
|
||||
@ -104,14 +104,14 @@ extern "C" {
|
||||
*/
|
||||
|
||||
static inline
|
||||
int lam_attr_hash_init(lam_hash_table_t **keyhash)
|
||||
int ompi_attr_hash_init(ompi_hash_table_t **keyhash)
|
||||
{
|
||||
*keyhash = OBJ_NEW(lam_hash_table_t);
|
||||
*keyhash = OBJ_NEW(ompi_hash_table_t);
|
||||
if (NULL == keyhash) {
|
||||
fprintf(stderr, "Error while creating the local attribute list\n");
|
||||
return MPI_ERR_SYSRESOURCE;
|
||||
}
|
||||
if (lam_hash_table_init(*keyhash, ATTR_HASH_SIZE) != LAM_SUCCESS)
|
||||
if (ompi_hash_table_init(*keyhash, ATTR_HASH_SIZE) != OMPI_SUCCESS)
|
||||
return MPI_ERR_SYSRESOURCE;
|
||||
|
||||
return MPI_SUCCESS;
|
||||
@ -120,16 +120,16 @@ int lam_attr_hash_init(lam_hash_table_t **keyhash)
|
||||
/**
|
||||
* Initialize the main attribute hash that stores the key and meta data
|
||||
*
|
||||
* @return LAM return code
|
||||
* @return OMPI return code
|
||||
*/
|
||||
|
||||
int lam_attr_init(void);
|
||||
int ompi_attr_init(void);
|
||||
|
||||
/**
|
||||
* Destroy the main attribute hash that stores the key and meta data
|
||||
*/
|
||||
|
||||
void lam_attr_destroy(void);
|
||||
void ompi_attr_destroy(void);
|
||||
|
||||
|
||||
/**
|
||||
@ -149,33 +149,33 @@ void lam_attr_destroy(void);
|
||||
* any predefined keys or the attributes attached. To accomplish this,
|
||||
* all MPI* calls will have predefined argument set as 0. MPI
|
||||
* implementors who will need to play with the predefined keys and
|
||||
* attributes would call the lam* functions here and not the MPI*
|
||||
* attributes would call the ompi* functions here and not the MPI*
|
||||
* functions, with predefined argument set to 1.
|
||||
* END OF NOTE
|
||||
*
|
||||
* NOTE: For the function pointers, you need to create a variable of the
|
||||
* union type "lam_attribute_fn_ptr_union_t" and assign the proper field.
|
||||
* union type "ompi_attribute_fn_ptr_union_t" and assign the proper field.
|
||||
* to be passed into this function
|
||||
* END OF NOTE
|
||||
*
|
||||
* @return LAM return code
|
||||
* @return OMPI return code
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_attr_create_keyval(lam_attribute_type_t type,
|
||||
lam_attribute_fn_ptr_union_t copy_attr_fn,
|
||||
lam_attribute_fn_ptr_union_t delete_attr_fn,
|
||||
int ompi_attr_create_keyval(ompi_attribute_type_t type,
|
||||
ompi_attribute_fn_ptr_union_t copy_attr_fn,
|
||||
ompi_attribute_fn_ptr_union_t delete_attr_fn,
|
||||
int *key, void *extra_state, int predefined);
|
||||
|
||||
/**
|
||||
* Free an attribute keyval
|
||||
* @param type Type of attribute (COMM/WIN/DTYPE) (IN)
|
||||
* @param key key, which is set to MPI_KEY_INVALID (IN/OUT)
|
||||
* @return LAM error code
|
||||
* @return OMPI error code
|
||||
*/
|
||||
|
||||
int lam_attr_free_keyval(lam_attribute_type_t type, int *key, int predefined);
|
||||
int ompi_attr_free_keyval(ompi_attribute_type_t type, int *key, int predefined);
|
||||
|
||||
/**
|
||||
* Set an attribute on the comm/win/datatype
|
||||
@ -185,12 +185,12 @@ int lam_attr_free_keyval(lam_attribute_type_t type, int *key, int predefined);
|
||||
* @param key Key val for the attribute (IN)
|
||||
* @param attribute The actual attribute pointer (IN)
|
||||
* @param predefined Whether the key is predefined or not 0/1 (IN)
|
||||
* @return LAM error code
|
||||
* @return OMPI error code
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_attr_set(lam_attribute_type_t type, void *object,
|
||||
lam_hash_table_t *keyhash,
|
||||
int ompi_attr_set(ompi_attribute_type_t type, void *object,
|
||||
ompi_hash_table_t *keyhash,
|
||||
int key, void *attribute, int predefined);
|
||||
|
||||
/**
|
||||
@ -200,11 +200,11 @@ int lam_attr_set(lam_attribute_type_t type, void *object,
|
||||
* @param attribute The actual attribute pointer (OUT)
|
||||
* @param flag Flag whether an attribute is associated
|
||||
* with the key (OUT)
|
||||
* @return LAM error code
|
||||
* @return OMPI error code
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_attr_get(lam_hash_table_t *keyhash, int key,
|
||||
int ompi_attr_get(ompi_hash_table_t *keyhash, int key,
|
||||
void *attribute, int *flag);
|
||||
|
||||
|
||||
@ -215,12 +215,12 @@ int lam_attr_get(lam_hash_table_t *keyhash, int key,
|
||||
* @param keyhash The attribute hash table hanging on the object(IN)
|
||||
* @param key Key val for the attribute (IN)
|
||||
* @param predefined Whether the key is predefined or not 0/1 (IN)
|
||||
* @return LAM error code
|
||||
* @return OMPI error code
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_attr_delete(lam_attribute_type_t type, void *object,
|
||||
lam_hash_table_t *keyhash , int key,
|
||||
int ompi_attr_delete(ompi_attribute_type_t type, void *object,
|
||||
ompi_hash_table_t *keyhash , int key,
|
||||
int predefined);
|
||||
|
||||
|
||||
@ -233,13 +233,13 @@ int lam_attr_delete(lam_attribute_type_t type, void *object,
|
||||
* @param new_object The new COMM/WIN/DTYPE object (IN)
|
||||
* @param keyhash The attribute hash table hanging on old object(IN)
|
||||
* @param newkeyhash The attribute hash table hanging on new object(IN)
|
||||
* @return LAM error code
|
||||
* @return OMPI error code
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_attr_copy_all(lam_attribute_type_t type, void *old_object,
|
||||
void *new_object, lam_hash_table_t *oldkeyhash,
|
||||
lam_hash_table_t *newkeyhash);
|
||||
int ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
|
||||
void *new_object, ompi_hash_table_t *oldkeyhash,
|
||||
ompi_hash_table_t *newkeyhash);
|
||||
|
||||
|
||||
/**
|
||||
@ -248,12 +248,12 @@ int lam_attr_copy_all(lam_attribute_type_t type, void *old_object,
|
||||
* @param type Type of attribute (COMM/WIN/DTYPE) (IN)
|
||||
* @param object The COMM/WIN/DTYPE object (IN)
|
||||
* @param keyhash The attribute hash table hanging on the object(IN)
|
||||
* @return LAM error code
|
||||
* @return OMPI error code
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_attr_delete_all(lam_attribute_type_t type, void *object,
|
||||
lam_hash_table_t *keyhash);
|
||||
int ompi_attr_delete_all(ompi_attribute_type_t type, void *object,
|
||||
ompi_hash_table_t *keyhash);
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
@ -261,4 +261,4 @@ int lam_attr_delete_all(lam_attribute_type_t type, void *object,
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* LAM_ATTRIBUTE_H */
|
||||
#endif /* OMPI_ATTRIBUTE_H */
|
||||
|
@ -14,15 +14,15 @@ headers = \
|
||||
|
||||
libcommunicator_la_SOURCES = \
|
||||
$(headers) \
|
||||
lam_comm_init.c \
|
||||
ompi_comm_init.c \
|
||||
comm.c \
|
||||
comm_cid.c
|
||||
|
||||
# Conditionally install the header files
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
lamdir = $(includedir)/lam/communicator
|
||||
lam_HEADERS = $(headers)
|
||||
ompidir = $(includedir)/ompi/communicator
|
||||
ompi_HEADERS = $(headers)
|
||||
else
|
||||
lamdir = $(includedir)
|
||||
ompidir = $(includedir)
|
||||
endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "mpi.h"
|
||||
@ -35,51 +35,51 @@ static int rankkeycompare(const void *, const void *);
|
||||
* This is the function setting all elements of a communicator.
|
||||
* All other routines are just used to determine these elements.
|
||||
*/
|
||||
lam_communicator_t * lam_comm_set ( int mode,
|
||||
lam_communicator_t* oldcomm,
|
||||
lam_communicator_t* bridgecomm,
|
||||
ompi_communicator_t * ompi_comm_set ( int mode,
|
||||
ompi_communicator_t* oldcomm,
|
||||
ompi_communicator_t* bridgecomm,
|
||||
int local_size,
|
||||
lam_proc_t **local_procs,
|
||||
ompi_proc_t **local_procs,
|
||||
int remote_size,
|
||||
lam_proc_t **remote_procs,
|
||||
lam_hash_table_t *attr,
|
||||
lam_errhandler_t *errh,
|
||||
ompi_proc_t **remote_procs,
|
||||
ompi_hash_table_t *attr,
|
||||
ompi_errhandler_t *errh,
|
||||
mca_base_module_t *collmodule,
|
||||
mca_base_module_t *topomodule,
|
||||
int local_leader,
|
||||
int remote_leader
|
||||
)
|
||||
{
|
||||
lam_communicator_t *newcomm;
|
||||
lam_proc_t *my_gpointer;
|
||||
ompi_communicator_t *newcomm;
|
||||
ompi_proc_t *my_gpointer;
|
||||
int my_grank;
|
||||
int rc;
|
||||
|
||||
/* Allocate comm structure */
|
||||
newcomm = lam_comm_allocate ( local_size, remote_size );
|
||||
newcomm = ompi_comm_allocate ( local_size, remote_size );
|
||||
|
||||
/* Set local_group information */
|
||||
memcpy ( newcomm->c_local_group->grp_proc_pointers,
|
||||
local_procs, local_size * sizeof(lam_proc_t *));
|
||||
lam_group_increment_proc_count(newcomm->c_local_group);
|
||||
local_procs, local_size * sizeof(ompi_proc_t *));
|
||||
ompi_group_increment_proc_count(newcomm->c_local_group);
|
||||
|
||||
/* determine my rank */
|
||||
my_grank = oldcomm->c_local_group->grp_my_rank;
|
||||
my_gpointer = oldcomm->c_local_group->grp_proc_pointers[my_grank];
|
||||
lam_set_group_rank(newcomm->c_local_group, my_gpointer);
|
||||
ompi_set_group_rank(newcomm->c_local_group, my_gpointer);
|
||||
newcomm->c_my_rank = newcomm->c_local_group->grp_my_rank;
|
||||
|
||||
/* Set remote group, if applicable */
|
||||
if ( 0 < remote_size) {
|
||||
memcpy ( newcomm->c_remote_group->grp_proc_pointers,
|
||||
remote_procs, remote_size * sizeof(lam_proc_t *));
|
||||
lam_group_increment_proc_count(newcomm->c_remote_group);
|
||||
newcomm->c_flags |= LAM_COMM_INTER;
|
||||
remote_procs, remote_size * sizeof(ompi_proc_t *));
|
||||
ompi_group_increment_proc_count(newcomm->c_remote_group);
|
||||
newcomm->c_flags |= OMPI_COMM_INTER;
|
||||
}
|
||||
|
||||
/* Determine context id. It is identical to f_2_c_handle */
|
||||
#ifdef HAVE_COLLECTIVES
|
||||
newcomm->c_contextid = lam_comm_nextcid ( oldcomm,
|
||||
newcomm->c_contextid = ompi_comm_nextcid ( oldcomm,
|
||||
bridgecomm,
|
||||
local_leader,
|
||||
remote_leader,
|
||||
@ -87,7 +87,7 @@ lam_communicator_t * lam_comm_set ( int mode,
|
||||
#else
|
||||
/* just for now */
|
||||
newcomm->c_contextid = oldcomm->c_contextid + 10;
|
||||
lam_pointer_array_set_item ( &lam_mpi_communicators, newcomm->c_contextid,
|
||||
ompi_pointer_array_set_item ( &ompi_mpi_communicators, newcomm->c_contextid,
|
||||
newcomm );
|
||||
#endif
|
||||
newcomm->c_f_to_c_index = newcomm->c_contextid;
|
||||
@ -101,14 +101,14 @@ lam_communicator_t * lam_comm_set ( int mode,
|
||||
newcomm->c_contextid);
|
||||
|
||||
/* Determine cube_dim */
|
||||
newcomm->c_cube_dim = lam_cube_dim(newcomm->c_local_group->grp_proc_count);
|
||||
newcomm->c_cube_dim = ompi_cube_dim(newcomm->c_local_group->grp_proc_count);
|
||||
|
||||
/* Set Topology, if required */
|
||||
if ( NULL != topomodule ) {
|
||||
if (LAM_COMM_IS_CART ( oldcomm ) )
|
||||
newcomm->c_flags |= LAM_COMM_CART;
|
||||
if (LAM_COMM_IS_GRAPH ( oldcomm ) )
|
||||
newcomm->c_flags |= LAM_COMM_GRAPH;
|
||||
if (OMPI_COMM_IS_CART ( oldcomm ) )
|
||||
newcomm->c_flags |= OMPI_COMM_CART;
|
||||
if (OMPI_COMM_IS_GRAPH ( oldcomm ) )
|
||||
newcomm->c_flags |= OMPI_COMM_GRAPH;
|
||||
|
||||
/* set the topo-module */
|
||||
}
|
||||
@ -119,29 +119,29 @@ lam_communicator_t * lam_comm_set ( int mode,
|
||||
}
|
||||
|
||||
/* Initialize the PML stuff in the newcomm */
|
||||
if ( LAM_ERROR == mca_pml.pml_add_comm(newcomm) ) {
|
||||
if ( OMPI_ERROR == mca_pml.pml_add_comm(newcomm) ) {
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
/* Initialize the coll modules */
|
||||
/* Let the collectives modules fight over who will do
|
||||
collective on this new comm. */
|
||||
if (LAM_ERROR == mca_coll_base_init_comm(newcomm)) {
|
||||
if (OMPI_ERROR == mca_coll_base_init_comm(newcomm)) {
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
/* ******* VPS: Remove this later -- need to be in coll module ****** */
|
||||
/* VPS: Cache the reqs for bcast */
|
||||
newcomm->bcast_lin_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxlin * sizeof(lam_request_t*));
|
||||
malloc (mca_coll_base_bcast_collmaxlin * sizeof(ompi_request_t*));
|
||||
if (NULL == newcomm->bcast_lin_reqs) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto err_exit;
|
||||
}
|
||||
newcomm->bcast_log_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxdim * sizeof(lam_request_t*));
|
||||
malloc (mca_coll_base_bcast_collmaxdim * sizeof(ompi_request_t*));
|
||||
if (NULL == newcomm->bcast_log_reqs) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
@ -158,48 +158,48 @@ lam_communicator_t * lam_comm_set ( int mode,
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*
|
||||
** Counterpart to MPI_Comm_group. To be used within LAM functions.
|
||||
** Counterpart to MPI_Comm_group. To be used within OMPI functions.
|
||||
*/
|
||||
int lam_comm_group ( lam_communicator_t* comm, lam_group_t **group )
|
||||
int ompi_comm_group ( ompi_communicator_t* comm, ompi_group_t **group )
|
||||
{
|
||||
/* increment proc reference counters */
|
||||
OBJ_RETAIN(comm->c_local_group);
|
||||
|
||||
*group = comm->c_local_group;
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*
|
||||
** Counterpart to MPI_Comm_create. To be used within LAM.
|
||||
** Counterpart to MPI_Comm_create. To be used within OMPI.
|
||||
*/
|
||||
int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
||||
lam_communicator_t **newcomm )
|
||||
int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
|
||||
ompi_communicator_t **newcomm )
|
||||
{
|
||||
lam_communicator_t *newcomp;
|
||||
ompi_communicator_t *newcomp;
|
||||
int rsize;
|
||||
int mode;
|
||||
int *allranks=NULL;
|
||||
lam_proc_t **rprocs=NULL;
|
||||
int rc = LAM_SUCCESS;
|
||||
ompi_proc_t **rprocs=NULL;
|
||||
int rc = OMPI_SUCCESS;
|
||||
|
||||
if ( LAM_COMM_IS_INTER(comm) ) {
|
||||
if ( OMPI_COMM_IS_INTER(comm) ) {
|
||||
#ifdef HAVE_COMM_CREATE_FOR_INTERCOMMS
|
||||
int tsize, i, j;
|
||||
|
||||
tsize = comm->c_remote_group->grp_proc_count;
|
||||
allranks = (int *) malloc ( tsize * sizeof(int));
|
||||
if ( NULL == allranks ) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rc = comm->c_coll.coll_allgather_inter ( &group->grp_my_rank,
|
||||
1, MPI_INT, allranks,
|
||||
1, MPI_INT, comm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -214,14 +214,14 @@ int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
||||
MPI_COMM_NULL */
|
||||
if ( 0 == rsize || 0 == group->grp_proc_count ) {
|
||||
*newcomm = MPI_COMM_NULL;
|
||||
rc = LAM_SUCCESS;
|
||||
rc = OMPI_SUCCESS;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Set proc-pointers for remote group */
|
||||
rprocs = (lam_proc_t **) malloc ( sizeof(lam_proc_t *) * rsize);
|
||||
rprocs = (ompi_proc_t **) malloc ( sizeof(ompi_proc_t *) * rsize);
|
||||
if ( NULL == rprocs ) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
for ( j = 0, i = 0; i < rsize; i++ ) {
|
||||
@ -230,7 +230,7 @@ int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
||||
j++;
|
||||
}
|
||||
}
|
||||
mode = LAM_COMM_INTER_INTER;
|
||||
mode = OMPI_COMM_INTER_INTER;
|
||||
#else
|
||||
return ( MPI_ERR_COMM );
|
||||
#endif
|
||||
@ -238,10 +238,10 @@ int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
||||
else {
|
||||
rsize = 0;
|
||||
rprocs = NULL;
|
||||
mode = LAM_COMM_INTRA_INTRA;
|
||||
mode = OMPI_COMM_INTRA_INTRA;
|
||||
}
|
||||
|
||||
newcomp = lam_comm_set ( mode, /* mode */
|
||||
newcomp = ompi_comm_set ( mode, /* mode */
|
||||
comm, /* old comm */
|
||||
NULL, /* bridge comm */
|
||||
group->grp_proc_count, /* local_size */
|
||||
@ -266,9 +266,9 @@ int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
||||
However, we could not avoid the comm_nextcid step, since
|
||||
all processes of the original comm have to participate in
|
||||
that function call. Additionally, all errhandler stuff etc.
|
||||
has to be set to make lam_comm_free happy */
|
||||
has to be set to make ompi_comm_free happy */
|
||||
if ( MPI_PROC_NULL == newcomp->c_local_group->grp_my_rank ) {
|
||||
lam_comm_free ( &newcomp );
|
||||
ompi_comm_free ( &newcomp );
|
||||
}
|
||||
|
||||
exit:
|
||||
@ -288,10 +288,10 @@ int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*
|
||||
** Counterpart to MPI_Comm_split. To be used within LAM (e.g. MPI_Cart_sub).
|
||||
** Counterpart to MPI_Comm_split. To be used within OMPI (e.g. MPI_Cart_sub).
|
||||
*/
|
||||
int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
lam_communicator_t **newcomm )
|
||||
int ompi_comm_split ( ompi_communicator_t* comm, int color, int key,
|
||||
ompi_communicator_t **newcomm )
|
||||
{
|
||||
int myinfo[2];
|
||||
int size, my_size;
|
||||
@ -303,9 +303,9 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
int i, loc;
|
||||
int *results=NULL, *sorted=NULL;
|
||||
int *rresults=NULL, *rsorted=NULL;
|
||||
int rc=LAM_SUCCESS;
|
||||
lam_proc_t **procs=NULL, **rprocs=NULL;
|
||||
lam_communicator_t *newcomp;
|
||||
int rc=OMPI_SUCCESS;
|
||||
ompi_proc_t **procs=NULL, **rprocs=NULL;
|
||||
ompi_communicator_t *newcomp;
|
||||
|
||||
/* Step 1: determine all the information for the local group */
|
||||
/* --------------------------------------------------------- */
|
||||
@ -314,15 +314,15 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
myinfo[0] = color;
|
||||
myinfo[1] = key;
|
||||
|
||||
size = lam_comm_size ( comm );
|
||||
size = ompi_comm_size ( comm );
|
||||
results = (int*) malloc ( 2 * size * sizeof(int));
|
||||
if ( NULL == results ) {
|
||||
return LAM_ERR_OUT_OF_RESOURCE;
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
rc = comm->c_coll.coll_allgather_intra ( myinfo, 2, MPI_INT,
|
||||
results, 2, MPI_INT, comm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -333,7 +333,7 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
|
||||
sorted = (int *) malloc ( sizeof( int ) * my_size * 2);
|
||||
if ( NULL == sorted) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -353,9 +353,9 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
}
|
||||
|
||||
/* put group elements in a list */
|
||||
procs = (lam_proc_t **) malloc ( sizeof(lam_proc_t *) * my_size);
|
||||
procs = (ompi_proc_t **) malloc ( sizeof(ompi_proc_t *) * my_size);
|
||||
if ( NULL == procs ) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
for (i = 0; i < my_size; i++) {
|
||||
@ -364,19 +364,19 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
|
||||
/* Step 2: determine all the information for the remote group */
|
||||
/* --------------------------------------------------------- */
|
||||
if ( LAM_COMM_IS_INTER(comm) ) {
|
||||
if ( OMPI_COMM_IS_INTER(comm) ) {
|
||||
#ifdef HAVE_COMM_SPLIT_FOR_INTERCOMMS
|
||||
rsize = comm->c_remote_group->grp_proc_count;
|
||||
rresults = (int *) malloc ( rsize * 2 * sizeof(int));
|
||||
if ( NULL == rresults ) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rc = comm->c_coll.coll_allgather_inter ( myinfo, 2, MPI_INT,
|
||||
rresults, 2, MPI_INT,
|
||||
comm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
}
|
||||
rsorted = (int *) malloc ( sizeof( int ) * my_rsize * 2);
|
||||
if ( NULL == rsorted) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -406,16 +406,16 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
}
|
||||
|
||||
/* put group elements in a list */
|
||||
rprocs = (lam_proc_t **) malloc ( sizeof(lam_proc_t *) * my_rsize);
|
||||
rprocs = (ompi_proc_t **) malloc ( sizeof(ompi_proc_t *) * my_rsize);
|
||||
if ( NULL == procs ) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
for (i = 0; i < my_rsize; i++) {
|
||||
rprocs[i] = comm->c_remote_group->grp_proc_pointers[rsorted[i*2]];
|
||||
}
|
||||
|
||||
mode = LAM_COMM_INTER_INTER;
|
||||
mode = OMPI_COMM_INTER_INTER;
|
||||
#else
|
||||
/* creating an inter-communicator using MPI_Comm_create will
|
||||
be supported soon, but not in this version */
|
||||
@ -426,14 +426,14 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
else {
|
||||
my_rsize = 0;
|
||||
rprocs = NULL;
|
||||
mode = LAM_COMM_INTRA_INTRA;
|
||||
mode = OMPI_COMM_INTRA_INTRA;
|
||||
}
|
||||
|
||||
|
||||
/* Step 3: set up the communicator */
|
||||
/* --------------------------------------------------------- */
|
||||
/* Create the communicator finally */
|
||||
newcomp = lam_comm_set ( mode, /* mode */
|
||||
newcomp = ompi_comm_set ( mode, /* mode */
|
||||
comm, /* old comm */
|
||||
NULL, /* bridge comm */
|
||||
my_size, /* local_size */
|
||||
@ -473,7 +473,7 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
/* Step 4: if we are not part of the comm, free the struct */
|
||||
/* --------------------------------------------------------- */
|
||||
if ( MPI_UNDEFINED == color ) {
|
||||
lam_comm_free ( &newcomp );
|
||||
ompi_comm_free ( &newcomp );
|
||||
}
|
||||
|
||||
*newcomm = newcomp;
|
||||
@ -485,48 +485,48 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/*
|
||||
** Counterpart to MPI_Comm_free. To be used within LAM.
|
||||
** Counterpart to MPI_Comm_free. To be used within OMPI.
|
||||
** The freeing of all attached objects (groups, errhandlers
|
||||
** etc. ) has moved to the destructor.
|
||||
*/
|
||||
int lam_comm_free ( lam_communicator_t **comm )
|
||||
int ompi_comm_free ( ompi_communicator_t **comm )
|
||||
{
|
||||
|
||||
#if 0
|
||||
/* Release attributes */
|
||||
lam_attr_delete_all ( COMM_ATTR, comm );
|
||||
ompi_attr_delete_all ( COMM_ATTR, comm );
|
||||
#endif
|
||||
|
||||
/* Release the communicator */
|
||||
OBJ_RELEASE ( comm );
|
||||
|
||||
*comm = MPI_COMM_NULL;
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
lam_proc_t **lam_comm_get_rprocs ( lam_communicator_t *local_comm,
|
||||
lam_communicator_t *bridge_comm,
|
||||
ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
|
||||
ompi_communicator_t *bridge_comm,
|
||||
int local_leader,
|
||||
int remote_leader,
|
||||
int tag,
|
||||
int rsize)
|
||||
{
|
||||
int local_rank, local_size;
|
||||
lam_proc_t **rprocs;
|
||||
lam_job_handle_t job;
|
||||
ompi_proc_t **rprocs;
|
||||
ompi_job_handle_t job;
|
||||
uint32_t *rvpids=NULL, *vpids=NULL;
|
||||
int rc, i;
|
||||
|
||||
local_rank = lam_comm_rank ( local_comm );
|
||||
local_rank = ompi_comm_rank ( local_comm );
|
||||
|
||||
vpids = (uint32_t *) malloc ( local_size * sizeof(uint32_t));
|
||||
rvpids = (uint32_t *) malloc ( rsize * sizeof(uint32_t));
|
||||
rprocs = (lam_proc_t **) malloc ( rsize * sizeof(lam_proc_t *));
|
||||
rprocs = (ompi_proc_t **) malloc ( rsize * sizeof(ompi_proc_t *));
|
||||
if ( NULL == vpids || NULL == rvpids || NULL == rprocs ) {
|
||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
||||
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
@ -568,7 +568,7 @@ lam_proc_t **lam_comm_get_rprocs ( lam_communicator_t *local_comm,
|
||||
}
|
||||
|
||||
for ( i = 0; i < rsize; i++ ) {
|
||||
rprocs[i] = lam_proc_find ( job, rvpids[i] );
|
||||
rprocs[i] = ompi_proc_find ( job, rvpids[i] );
|
||||
}
|
||||
|
||||
err_exit:
|
||||
@ -585,15 +585,15 @@ return rprocs;
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
int lam_comm_determine_first ( lam_communicator_t *intercomm, int high )
|
||||
int ompi_comm_determine_first ( ompi_communicator_t *intercomm, int high )
|
||||
{
|
||||
int flag, rhigh;
|
||||
int local_rank, rc;
|
||||
lam_proc_t *lvpid, *rvpid;
|
||||
ompi_proc_t *lvpid, *rvpid;
|
||||
|
||||
lvpid = intercomm->c_local_group->grp_proc_pointers[0];
|
||||
rvpid = intercomm->c_remote_group->grp_proc_pointers[0];
|
||||
local_rank = lam_comm_rank ( intercomm );
|
||||
local_rank = ompi_comm_rank ( intercomm );
|
||||
|
||||
/*
|
||||
* determine maximal high value over the intercomm
|
||||
@ -659,11 +659,11 @@ int lam_comm_determine_first ( lam_communicator_t *intercomm, int high )
|
||||
/********************************************************************************/
|
||||
/********************************************************************************/
|
||||
/********************************************************************************/
|
||||
int lam_comm_dump ( lam_communicator_t *comm )
|
||||
int ompi_comm_dump ( ompi_communicator_t *comm )
|
||||
{
|
||||
mca_pml_ptl_comm_t *pml_comm;
|
||||
mca_ptl_sequence_t *seq;
|
||||
lam_list_t *list;
|
||||
ompi_list_t *list;
|
||||
int i;
|
||||
|
||||
printf("Dumping information for comm_cid %d\n", comm->c_contextid);
|
||||
@ -675,15 +675,15 @@ int lam_comm_dump ( lam_communicator_t *comm )
|
||||
|
||||
printf(" Communicator is:");
|
||||
/* Display flags */
|
||||
if ( LAM_COMM_IS_INTER(comm) )
|
||||
if ( OMPI_COMM_IS_INTER(comm) )
|
||||
printf(" inter-comm,");
|
||||
if ( LAM_COMM_IS_CART(comm))
|
||||
if ( OMPI_COMM_IS_CART(comm))
|
||||
printf(" topo-cart,");
|
||||
if ( LAM_COMM_IS_GRAPH(comm))
|
||||
if ( OMPI_COMM_IS_GRAPH(comm))
|
||||
printf(" topo-graph");
|
||||
printf("\n");
|
||||
|
||||
if (LAM_COMM_IS_INTER(comm)) {
|
||||
if (OMPI_COMM_IS_INTER(comm)) {
|
||||
printf(" Remote group size:%d\n", comm->c_remote_group->grp_proc_count);
|
||||
}
|
||||
|
||||
@ -692,14 +692,14 @@ int lam_comm_dump ( lam_communicator_t *comm )
|
||||
pml_comm = (mca_pml_ptl_comm_t *)comm->c_pml_comm;
|
||||
seq = (mca_ptl_sequence_t *) pml_comm->c_frags_cant_match;
|
||||
for ( i = 0; i < comm->c_local_group->grp_proc_count; i++ ){
|
||||
list = (lam_list_t *)seq+i;
|
||||
list = (ompi_list_t *)seq+i;
|
||||
printf("%d: head->list_next:%p head->list_prev:%p"
|
||||
" tail->list_next:%p tail->list_next:%p\n",
|
||||
i,
|
||||
(char*)list->lam_list_head.lam_list_next,
|
||||
(char*)list->lam_list_head.lam_list_prev,
|
||||
(char*)list->lam_list_tail.lam_list_next,
|
||||
(char*)list->lam_list_tail.lam_list_prev );
|
||||
(char*)list->ompi_list_head.ompi_list_next,
|
||||
(char*)list->ompi_list_head.ompi_list_prev,
|
||||
(char*)list->ompi_list_tail.ompi_list_next,
|
||||
(char*)list->ompi_list_tail.ompi_list_prev );
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "mpi.h"
|
||||
@ -11,7 +11,7 @@
|
||||
#include "op/op.h"
|
||||
#include "proc/proc.h"
|
||||
#include "include/constants.h"
|
||||
#include "lfc/lam_pointer_array.h"
|
||||
#include "class/ompi_pointer_array.h"
|
||||
#include "mca/pcm/pcm.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/coll/coll.h"
|
||||
@ -30,28 +30,28 @@
|
||||
*/
|
||||
|
||||
typedef int ompi_comm_cid_allredfct (int *inbuf, int* outbuf, int count,
|
||||
lam_op_t *op, lam_communicator_t *comm,
|
||||
lam_communicator_t *bridgecomm,
|
||||
ompi_op_t *op, ompi_communicator_t *comm,
|
||||
ompi_communicator_t *bridgecomm,
|
||||
int lleader, int rleader );
|
||||
|
||||
static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||
lam_op_t *op, lam_communicator_t *intercomm,
|
||||
lam_communicator_t *bridgecomm,
|
||||
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||
ompi_communicator_t *bridgecomm,
|
||||
int local_leader, int remote_leader );
|
||||
|
||||
static int ompi_comm_allreduce_emulate_inter ( int *inbuf, int* outbuf, int count,
|
||||
lam_op_t *op, lam_communicator_t *intercomm,
|
||||
lam_communicator_t *bridgecomm,
|
||||
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||
ompi_communicator_t *bridgecomm,
|
||||
int local_leader, int remote_leader );
|
||||
|
||||
static int ompi_comm_allreduce_intra ( int *inbuf, int* outbuf, int count,
|
||||
lam_op_t *op, lam_communicator_t *intercomm,
|
||||
lam_communicator_t *bridgecomm,
|
||||
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||
ompi_communicator_t *bridgecomm,
|
||||
int local_leader, int remote_ledaer );
|
||||
|
||||
|
||||
int lam_comm_nextcid ( lam_communicator_t* comm,
|
||||
lam_communicator_t* bridgecomm,
|
||||
int ompi_comm_nextcid ( ompi_communicator_t* comm,
|
||||
ompi_communicator_t* bridgecomm,
|
||||
int local_leader,
|
||||
int remote_leader,
|
||||
int mode )
|
||||
@ -62,7 +62,7 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
||||
int done=0;
|
||||
int response=0, glresponse=0;
|
||||
int flag;
|
||||
int start=lam_mpi_communicators.lowest_free;
|
||||
int start=ompi_mpi_communicators.lowest_free;
|
||||
int i;
|
||||
|
||||
ompi_comm_cid_allredfct* allredfnct;
|
||||
@ -73,14 +73,14 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
||||
*/
|
||||
switch (mode)
|
||||
{
|
||||
case LAM_COMM_INTRA_INTRA:
|
||||
case OMPI_COMM_INTRA_INTRA:
|
||||
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_intra;
|
||||
break;
|
||||
case LAM_COMM_INTRA_INTER:
|
||||
case OMPI_COMM_INTRA_INTER:
|
||||
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_emulate_inter;
|
||||
break;
|
||||
case LAM_COMM_INTER_INTER:
|
||||
case LAM_COMM_INTER_INTRA:
|
||||
case OMPI_COMM_INTER_INTER:
|
||||
case OMPI_COMM_INTER_INTRA:
|
||||
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_inter;
|
||||
break;
|
||||
default:
|
||||
@ -94,7 +94,7 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
||||
while ( !done ){
|
||||
sleep ( 30 );
|
||||
for (i=start; i<OMPI_MAX_COMM ;i++) {
|
||||
flag = lam_pointer_array_test_and_set_item (&lam_mpi_communicators, i, comm);
|
||||
flag = ompi_pointer_array_test_and_set_item (&ompi_mpi_communicators, i, comm);
|
||||
if (true == flag) {
|
||||
nextlocal_cid = i;
|
||||
break;
|
||||
@ -107,8 +107,8 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
||||
response = 1; /* fine with me */
|
||||
}
|
||||
else {
|
||||
lam_pointer_array_set_item ( &lam_mpi_communicators, nextlocal_cid, NULL);
|
||||
flag = lam_pointer_array_test_and_set_item ( &lam_mpi_communicators,
|
||||
ompi_pointer_array_set_item ( &ompi_mpi_communicators, nextlocal_cid, NULL);
|
||||
flag = ompi_pointer_array_test_and_set_item ( &ompi_mpi_communicators,
|
||||
nextcid, comm );
|
||||
if (true == flag) {
|
||||
response = 1; /* works as well */
|
||||
@ -139,8 +139,8 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
||||
- remote_leader
|
||||
*/
|
||||
static int ompi_comm_allreduce_intra ( int *inbuf, int *outbuf, int count,
|
||||
lam_op_t *op, lam_communicator_t *comm,
|
||||
lam_communicator_t *bridgecomm,
|
||||
ompi_op_t *op, ompi_communicator_t *comm,
|
||||
ompi_communicator_t *bridgecomm,
|
||||
int local_leader, int remote_leader )
|
||||
{
|
||||
return comm->c_coll.coll_allreduce_intra ( inbuf, outbuf, count, MPI_INT, op,
|
||||
@ -153,26 +153,26 @@ static int ompi_comm_allreduce_intra ( int *inbuf, int *outbuf, int count,
|
||||
- remote_leader
|
||||
*/
|
||||
static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||
lam_op_t *op, lam_communicator_t *intercomm,
|
||||
lam_communicator_t *bridgecomm,
|
||||
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||
ompi_communicator_t *bridgecomm,
|
||||
int local_leader, int remote_leader )
|
||||
{
|
||||
int local_rank;
|
||||
lam_proc_t *lvpid, *rvpid;
|
||||
ompi_proc_t *lvpid, *rvpid;
|
||||
int i;
|
||||
int *tmpbuf;
|
||||
int rc;
|
||||
|
||||
if ( &lam_mpi_op_sum != op && &lam_mpi_op_prod != op &&
|
||||
&lam_mpi_op_max != op && &lam_mpi_op_min != op ) {
|
||||
if ( &ompi_mpi_op_sum != op && &ompi_mpi_op_prod != op &&
|
||||
&ompi_mpi_op_max != op && &ompi_mpi_op_min != op ) {
|
||||
return MPI_ERR_OP;
|
||||
}
|
||||
|
||||
if ( !LAM_COMM_IS_INTER (intercomm)) {
|
||||
if ( !OMPI_COMM_IS_INTER (intercomm)) {
|
||||
return MPI_ERR_COMM;
|
||||
}
|
||||
|
||||
local_rank = lam_comm_rank ( intercomm );
|
||||
local_rank = ompi_comm_rank ( intercomm );
|
||||
tmpbuf = (int *) malloc ( count * sizeof(int));
|
||||
if ( NULL == tmpbuf ) {
|
||||
return MPI_ERR_INTERN;
|
||||
@ -180,7 +180,7 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||
|
||||
rc = intercomm->c_coll.coll_allreduce_inter ( inbuf, tmpbuf, count, MPI_INT,
|
||||
op, intercomm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -194,35 +194,35 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||
/* local leader exchange data */
|
||||
rc = mca_pml.pml_irecv (outbuf, count, MPI_INT, 0, OMPI_COMM_CID_TAG,
|
||||
intercomm, &req );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
rc = mca_pml.pml_send (tmpbuf, count, MPI_INT, 0, OMPI_COMM_CID_TAG,
|
||||
MCA_PML_BASE_SEND_STANDARD, intercomm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
rc = mca_pml.pml_wait ( 1, &req, NULL, &status);
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ( &lam_mpi_op_max == op ) {
|
||||
if ( &ompi_mpi_op_max == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
if (tmpbuf[i] > outbuf[i]) outbuf[i] = tmpbuf[i];
|
||||
}
|
||||
}
|
||||
else if ( &lam_mpi_op_min == op ) {
|
||||
else if ( &ompi_mpi_op_min == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
if (tmpbuf[i] < outbuf[i]) outbuf[i] = tmpbuf[i];
|
||||
}
|
||||
}
|
||||
else if ( &lam_mpi_op_sum == op ) {
|
||||
else if ( &ompi_mpi_op_sum == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
outbuf[i] += tmpbuf[i];
|
||||
}
|
||||
}
|
||||
else if ( &lam_mpi_op_prod == op ) {
|
||||
else if ( &ompi_mpi_op_prod == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
outbuf[i] *= tmpbuf[i];
|
||||
}
|
||||
@ -234,14 +234,14 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||
if ( 0 == local_rank ) {
|
||||
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, MPI_ROOT,
|
||||
intercomm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, MPI_PROC_NULL,
|
||||
intercomm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@ -250,7 +250,7 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||
}
|
||||
else {
|
||||
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, 0, intercomm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -273,8 +273,8 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||
all arguments are in use.
|
||||
*/
|
||||
static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count,
|
||||
lam_op_t *op, lam_communicator_t *comm,
|
||||
lam_communicator_t *bridgecomm,
|
||||
ompi_op_t *op, ompi_communicator_t *comm,
|
||||
ompi_communicator_t *bridgecomm,
|
||||
int local_leader, int remote_leader )
|
||||
{
|
||||
int *tmpbuf=NULL;
|
||||
@ -282,12 +282,12 @@ static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count
|
||||
int i;
|
||||
int rc;
|
||||
|
||||
if ( &lam_mpi_op_sum != op && &lam_mpi_op_prod != op &&
|
||||
&lam_mpi_op_max != op && &lam_mpi_op_min != op ) {
|
||||
if ( &ompi_mpi_op_sum != op && &ompi_mpi_op_prod != op &&
|
||||
&ompi_mpi_op_max != op && &ompi_mpi_op_min != op ) {
|
||||
return MPI_ERR_OP;
|
||||
}
|
||||
|
||||
local_rank = lam_comm_rank ( comm );
|
||||
local_rank = ompi_comm_rank ( comm );
|
||||
tmpbuf = (int *) malloc ( count * sizeof(int));
|
||||
if ( NULL == tmpbuf ) {
|
||||
return MPI_ERR_INTERN;
|
||||
@ -296,7 +296,7 @@ static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count
|
||||
/* Intercomm_create */
|
||||
rc = comm->c_coll.coll_allreduce_intra ( inbuf, tmpbuf, count, MPI_INT,
|
||||
op, comm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -306,36 +306,36 @@ static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count
|
||||
|
||||
rc = mca_pml.pml_irecv ( outbuf, count, MPI_INT, remote_leader,
|
||||
OMPI_COMM_CID_TAG, bridgecomm, &req );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
rc = mca_pml.pml_send (tmpbuf, count, MPI_INT, remote_leader,
|
||||
OMPI_COMM_CID_TAG, MCA_PML_BASE_SEND_STANDARD,
|
||||
bridgecomm );
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
rc = mca_pml.pml_wait ( 1, &req, NULL, &status);
|
||||
if ( LAM_SUCCESS != rc ) {
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ( &lam_mpi_op_max == op ) {
|
||||
if ( &ompi_mpi_op_max == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
if (tmpbuf[i] > outbuf[i]) outbuf[i] = tmpbuf[i];
|
||||
}
|
||||
}
|
||||
else if ( &lam_mpi_op_min == op ) {
|
||||
else if ( &ompi_mpi_op_min == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
if (tmpbuf[i] < outbuf[i]) outbuf[i] = tmpbuf[i];
|
||||
}
|
||||
}
|
||||
else if ( &lam_mpi_op_sum == op ) {
|
||||
else if ( &ompi_mpi_op_sum == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
outbuf[i] += tmpbuf[i];
|
||||
}
|
||||
}
|
||||
else if ( &lam_mpi_op_prod == op ) {
|
||||
else if ( &ompi_mpi_op_prod == op ) {
|
||||
for ( i = 0 ; i < count; i++ ) {
|
||||
outbuf[i] *= tmpbuf[i];
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_COMMUNICATOR_H
|
||||
#define LAM_COMMUNICATOR_H
|
||||
#ifndef OMPI_COMMUNICATOR_H
|
||||
#define OMPI_COMMUNICATOR_H
|
||||
|
||||
#include "lfc/lam_object.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "errhandler/errhandler.h"
|
||||
#include "threads/mutex.h"
|
||||
#include "util/output.h"
|
||||
@ -13,23 +13,23 @@
|
||||
#include "group/group.h"
|
||||
#include "mca/coll/coll.h"
|
||||
#include "mca/topo/topo.h"
|
||||
#include "lfc/lam_hash_table.h"
|
||||
#include "class/ompi_hash_table.h"
|
||||
#include "attribute/attribute.h"
|
||||
#include "request/request.h"
|
||||
|
||||
extern lam_class_t lam_communicator_t_class;
|
||||
extern ompi_class_t ompi_communicator_t_class;
|
||||
|
||||
#define LAM_COMM_INTER 0x00000001
|
||||
#define LAM_COMM_CART 0x00000002
|
||||
#define LAM_COMM_GRAPH 0x00000004
|
||||
#define LAM_COMM_NAMEISSET 0x00000008
|
||||
#define LAM_COMM_ISFREED 0x00000010
|
||||
#define OMPI_COMM_INTER 0x00000001
|
||||
#define OMPI_COMM_CART 0x00000002
|
||||
#define OMPI_COMM_GRAPH 0x00000004
|
||||
#define OMPI_COMM_NAMEISSET 0x00000008
|
||||
#define OMPI_COMM_ISFREED 0x00000010
|
||||
|
||||
/* some utility #defines */
|
||||
#define LAM_COMM_IS_INTER(comm) ((comm)->c_flags & LAM_COMM_INTER)
|
||||
#define LAM_COMM_IS_INTRA(comm) (!((comm)->c_flags & LAM_COMM_INTER))
|
||||
#define LAM_COMM_IS_CART(comm) ((comm)->c_flags & LAM_COMM_CART)
|
||||
#define LAM_COMM_IS_GRAPH(comm) ((comm)->c_flags & LAM_COMM_GRAPH)
|
||||
#define OMPI_COMM_IS_INTER(comm) ((comm)->c_flags & OMPI_COMM_INTER)
|
||||
#define OMPI_COMM_IS_INTRA(comm) (!((comm)->c_flags & OMPI_COMM_INTER))
|
||||
#define OMPI_COMM_IS_CART(comm) ((comm)->c_flags & OMPI_COMM_CART)
|
||||
#define OMPI_COMM_IS_GRAPH(comm) ((comm)->c_flags & OMPI_COMM_GRAPH)
|
||||
|
||||
/**
|
||||
* Modes reqquired for accquiring the new comm-id.
|
||||
@ -38,26 +38,26 @@ extern lam_class_t lam_communicator_t_class;
|
||||
* whether the new communicator will be an inter/intra
|
||||
*comm
|
||||
*/
|
||||
#define LAM_COMM_INTRA_INTRA 0x00000020
|
||||
#define LAM_COMM_INTRA_INTER 0x00000040
|
||||
#define LAM_COMM_INTER_INTRA 0x00000080
|
||||
#define LAM_COMM_INTER_INTER 0x00000100
|
||||
#define OMPI_COMM_INTRA_INTRA 0x00000020
|
||||
#define OMPI_COMM_INTRA_INTER 0x00000040
|
||||
#define OMPI_COMM_INTER_INTRA 0x00000080
|
||||
#define OMPI_COMM_INTER_INTER 0x00000100
|
||||
|
||||
extern lam_pointer_array_t lam_mpi_communicators;
|
||||
extern ompi_pointer_array_t ompi_mpi_communicators;
|
||||
|
||||
struct lam_communicator_t {
|
||||
lam_object_t c_base;
|
||||
struct ompi_communicator_t {
|
||||
ompi_object_t c_base;
|
||||
char c_name[MPI_MAX_OBJECT_NAME];
|
||||
uint32_t c_contextid;
|
||||
int c_my_rank;
|
||||
uint32_t c_flags; /* flags, e.g. intercomm,
|
||||
topology, etc. */
|
||||
|
||||
lam_group_t *c_local_group;
|
||||
lam_group_t *c_remote_group;
|
||||
ompi_group_t *c_local_group;
|
||||
ompi_group_t *c_remote_group;
|
||||
|
||||
/* Attributes */
|
||||
lam_hash_table_t *c_keyhash;
|
||||
ompi_hash_table_t *c_keyhash;
|
||||
|
||||
int c_cube_dim; /**< inscribing cube dimension */
|
||||
|
||||
@ -71,10 +71,10 @@ struct lam_communicator_t {
|
||||
int c_f_to_c_index;
|
||||
|
||||
/* Error handling. This field does not have the "c_" prefix so
|
||||
that the LAM_ERRHDL_* macros can find it, regardless of whether
|
||||
that the OMPI_ERRHDL_* macros can find it, regardless of whether
|
||||
it's a comm, window, or file. */
|
||||
|
||||
lam_errhandler_t *error_handler;
|
||||
ompi_errhandler_t *error_handler;
|
||||
|
||||
/* Hooks for PML to hang things */
|
||||
struct mca_pml_comm_t* c_pml_comm;
|
||||
@ -85,19 +85,19 @@ struct lam_communicator_t {
|
||||
struct mca_coll_comm_t* c_coll_comm;
|
||||
|
||||
/* VPS: This will be moved in the coll module later on */
|
||||
lam_request_t **bcast_lin_reqs;
|
||||
lam_request_t **bcast_log_reqs;
|
||||
ompi_request_t **bcast_lin_reqs;
|
||||
ompi_request_t **bcast_log_reqs;
|
||||
|
||||
};
|
||||
typedef struct lam_communicator_t lam_communicator_t;
|
||||
typedef struct ompi_communicator_t ompi_communicator_t;
|
||||
|
||||
|
||||
/**
|
||||
* is this a valid communicator
|
||||
*/
|
||||
static inline int lam_comm_invalid(lam_communicator_t* comm)
|
||||
static inline int ompi_comm_invalid(ompi_communicator_t* comm)
|
||||
{
|
||||
if ( comm->c_flags & LAM_COMM_ISFREED )
|
||||
if ( comm->c_flags & OMPI_COMM_ISFREED )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@ -106,14 +106,14 @@ static inline int lam_comm_invalid(lam_communicator_t* comm)
|
||||
/**
|
||||
* rank w/in the communicator
|
||||
*/
|
||||
static inline int lam_comm_rank(lam_communicator_t* comm)
|
||||
static inline int ompi_comm_rank(ompi_communicator_t* comm)
|
||||
{
|
||||
return comm->c_my_rank;
|
||||
}
|
||||
/**
|
||||
* size of the communicator
|
||||
*/
|
||||
static inline int lam_comm_size(lam_communicator_t* comm)
|
||||
static inline int ompi_comm_size(ompi_communicator_t* comm)
|
||||
{
|
||||
return comm->c_local_group->grp_proc_count;
|
||||
}
|
||||
@ -122,9 +122,9 @@ static inline int lam_comm_size(lam_communicator_t* comm)
|
||||
* size of the remote group for inter-communicators.
|
||||
* returns zero for an intra-communicator
|
||||
*/
|
||||
static inline int lam_comm_remote_size(lam_communicator_t* comm)
|
||||
static inline int ompi_comm_remote_size(ompi_communicator_t* comm)
|
||||
{
|
||||
if ( comm->c_flags & LAM_COMM_INTER )
|
||||
if ( comm->c_flags & OMPI_COMM_INTER )
|
||||
return comm->c_remote_group->grp_proc_count;
|
||||
else
|
||||
return 0;
|
||||
@ -132,25 +132,25 @@ static inline int lam_comm_remote_size(lam_communicator_t* comm)
|
||||
|
||||
/* return pointer to communicator associated with context id cid,
|
||||
* No error checking is done*/
|
||||
static inline lam_communicator_t *lam_comm_lookup(uint32_t cid)
|
||||
static inline ompi_communicator_t *ompi_comm_lookup(uint32_t cid)
|
||||
{
|
||||
/* array of pointers to communicators, indexed by context ID */
|
||||
extern lam_pointer_array_t lam_mpi_communicators;
|
||||
return (lam_communicator_t*)lam_pointer_array_get_item(&lam_mpi_communicators, cid);
|
||||
extern ompi_pointer_array_t ompi_mpi_communicators;
|
||||
return (ompi_communicator_t*)ompi_pointer_array_get_item(&ompi_mpi_communicators, cid);
|
||||
}
|
||||
|
||||
static inline lam_proc_t* lam_comm_peer_lookup(lam_communicator_t* comm, int peer_id)
|
||||
static inline ompi_proc_t* ompi_comm_peer_lookup(ompi_communicator_t* comm, int peer_id)
|
||||
{
|
||||
#if LAM_ENABLE_DEBUG
|
||||
#if OMPI_ENABLE_DEBUG
|
||||
if(peer_id >= comm->c_remote_group->grp_proc_count) {
|
||||
lam_output(0, "lam_comm_lookup_peer: invalid peer index (%d)", peer_id);
|
||||
return (lam_proc_t *) NULL;
|
||||
ompi_output(0, "ompi_comm_lookup_peer: invalid peer index (%d)", peer_id);
|
||||
return (ompi_proc_t *) NULL;
|
||||
}
|
||||
#endif
|
||||
return comm->c_remote_group->grp_proc_pointers[peer_id];
|
||||
}
|
||||
|
||||
static inline bool lam_comm_peer_invalid(lam_communicator_t* comm, int peer_id)
|
||||
static inline bool ompi_comm_peer_invalid(ompi_communicator_t* comm, int peer_id)
|
||||
{
|
||||
if(peer_id < 0 || peer_id >= comm->c_remote_group->grp_proc_count) {
|
||||
return true;
|
||||
@ -158,11 +158,11 @@ static inline bool lam_comm_peer_invalid(lam_communicator_t* comm, int peer_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int lam_cube_dim(int nprocs) {
|
||||
static inline int ompi_cube_dim(int nprocs) {
|
||||
int dim;
|
||||
size_t size;
|
||||
|
||||
if (1 > nprocs) return LAM_ERROR;
|
||||
if (1 > nprocs) return OMPI_ERROR;
|
||||
for(dim = 0, size = 1; size < (size_t)nprocs; ++dim, size <<= 1);
|
||||
|
||||
return dim;
|
||||
@ -176,19 +176,19 @@ extern "C" {
|
||||
/**
|
||||
* Initialise MPI_COMM_WORLD and MPI_COMM_SELF
|
||||
*/
|
||||
int lam_comm_init(void);
|
||||
int lam_comm_link_function(void);
|
||||
int ompi_comm_init(void);
|
||||
int ompi_comm_link_function(void);
|
||||
|
||||
/**
|
||||
* extract the local group from a communicator
|
||||
*/
|
||||
int lam_comm_group ( lam_communicator_t *comm, lam_group_t **group );
|
||||
int ompi_comm_group ( ompi_communicator_t *comm, ompi_group_t **group );
|
||||
|
||||
/**
|
||||
* create a communicator based on a group
|
||||
*/
|
||||
int lam_comm_create ( lam_communicator_t* comm, lam_group_t *group,
|
||||
lam_communicator_t** newcomm );
|
||||
int ompi_comm_create ( ompi_communicator_t* comm, ompi_group_t *group,
|
||||
ompi_communicator_t** newcomm );
|
||||
|
||||
/**
|
||||
* split a communicator based on color and key. Parameters
|
||||
@ -200,13 +200,13 @@ extern "C" {
|
||||
*
|
||||
* @
|
||||
*/
|
||||
int lam_comm_split ( lam_communicator_t *comm, int color, int key,
|
||||
lam_communicator_t** newcomm );
|
||||
int ompi_comm_split ( ompi_communicator_t *comm, int color, int key,
|
||||
ompi_communicator_t** newcomm );
|
||||
|
||||
/**
|
||||
* free a communicator
|
||||
*/
|
||||
int lam_comm_free ( lam_communicator_t **comm );
|
||||
int ompi_comm_free ( ompi_communicator_t **comm );
|
||||
|
||||
/**
|
||||
* allocate a new communicator structure
|
||||
@ -218,7 +218,7 @@ extern "C" {
|
||||
* It furthermore sets the fortran index correctly,
|
||||
* and sets all other elements to zero.
|
||||
*/
|
||||
lam_communicator_t* lam_comm_allocate ( int local_group_size,
|
||||
ompi_communicator_t* ompi_comm_allocate ( int local_group_size,
|
||||
int remote_group_size );
|
||||
|
||||
/**
|
||||
@ -226,13 +226,13 @@ extern "C" {
|
||||
* @param comm: original comm
|
||||
* @param bridgecomm: bridge comm for intercomm_create
|
||||
* @param mode: combination of input and output communicator
|
||||
* LAM_COMM_INTRA_INTRA, LAM_COMM_INTRA_INTER,
|
||||
* LAM_COMM_INTER_INTRA, LAM_COMM_INTER_INTER
|
||||
* OMPI_COMM_INTRA_INTRA, OMPI_COMM_INTRA_INTER,
|
||||
* OMPI_COMM_INTER_INTRA, OMPI_COMM_INTER_INTER
|
||||
*
|
||||
* This routine has to be thread safe in the final version.
|
||||
*/
|
||||
int lam_comm_nextcid ( lam_communicator_t* comm,
|
||||
lam_communicator_t* bridgecomm,
|
||||
int ompi_comm_nextcid ( ompi_communicator_t* comm,
|
||||
ompi_communicator_t* bridgecomm,
|
||||
int local_leader,
|
||||
int remote_leader,
|
||||
int mode);
|
||||
@ -241,21 +241,21 @@ extern "C" {
|
||||
/**
|
||||
* shut down the communicator infrastructure.
|
||||
*/
|
||||
int lam_comm_finalize (void);
|
||||
int ompi_comm_finalize (void);
|
||||
|
||||
/**
|
||||
* This is THE routine, where all the communicator stuff
|
||||
* is really set.
|
||||
*/
|
||||
lam_communicator_t* lam_comm_set ( int mode,
|
||||
lam_communicator_t* oldcomm,
|
||||
lam_communicator_t* bridgecomm,
|
||||
ompi_communicator_t* ompi_comm_set ( int mode,
|
||||
ompi_communicator_t* oldcomm,
|
||||
ompi_communicator_t* bridgecomm,
|
||||
int local_size,
|
||||
lam_proc_t **local_procs,
|
||||
ompi_proc_t **local_procs,
|
||||
int remote_size,
|
||||
lam_proc_t **remote_procs,
|
||||
lam_hash_table_t *attr,
|
||||
lam_errhandler_t *errh,
|
||||
ompi_proc_t **remote_procs,
|
||||
ompi_hash_table_t *attr,
|
||||
ompi_errhandler_t *errh,
|
||||
mca_base_module_t *collmodule,
|
||||
mca_base_module_t *topomodule,
|
||||
int local_leader,
|
||||
@ -263,10 +263,10 @@ extern "C" {
|
||||
/**
|
||||
* This is a short-hand routine used in intercomm_create.
|
||||
* The routine makes sure, that all processes have afterwards
|
||||
* a list of lam_proc_t pointers for the remote group.
|
||||
* a list of ompi_proc_t pointers for the remote group.
|
||||
*/
|
||||
lam_proc_t **lam_comm_get_rprocs ( lam_communicator_t *local_comm,
|
||||
lam_communicator_t *bridge_comm,
|
||||
ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
|
||||
ompi_communicator_t *bridge_comm,
|
||||
int local_leader,
|
||||
int remote_leader,
|
||||
int tag,
|
||||
@ -277,11 +277,11 @@ extern "C" {
|
||||
* remote group will be first in the new intra-comm.
|
||||
* Just used from within MPI_Intercomm_merge.
|
||||
*/
|
||||
int lam_comm_determine_first ( lam_communicator_t *intercomm,
|
||||
int ompi_comm_determine_first ( ompi_communicator_t *intercomm,
|
||||
int high );
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LAM_COMMUNICATOR_H */
|
||||
#endif /* OMPI_COMMUNICATOR_H */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mpi.h"
|
||||
@ -20,143 +20,143 @@
|
||||
** on cid.
|
||||
**
|
||||
*/
|
||||
lam_pointer_array_t lam_mpi_communicators;
|
||||
ompi_pointer_array_t ompi_mpi_communicators;
|
||||
|
||||
lam_communicator_t lam_mpi_comm_world;
|
||||
lam_communicator_t lam_mpi_comm_self;
|
||||
lam_communicator_t lam_mpi_comm_null;
|
||||
ompi_communicator_t ompi_mpi_comm_world;
|
||||
ompi_communicator_t ompi_mpi_comm_self;
|
||||
ompi_communicator_t ompi_mpi_comm_null;
|
||||
|
||||
static void lam_comm_construct(lam_communicator_t* comm);
|
||||
static void lam_comm_destruct(lam_communicator_t* comm);
|
||||
static void ompi_comm_construct(ompi_communicator_t* comm);
|
||||
static void ompi_comm_destruct(ompi_communicator_t* comm);
|
||||
|
||||
OBJ_CLASS_INSTANCE(lam_communicator_t, lam_object_t,lam_comm_construct, lam_comm_destruct );
|
||||
OBJ_CLASS_INSTANCE(ompi_communicator_t, ompi_object_t,ompi_comm_construct, ompi_comm_destruct );
|
||||
|
||||
|
||||
/*
|
||||
* Initialize comm world/self/null.
|
||||
*/
|
||||
int lam_comm_init(void)
|
||||
int ompi_comm_init(void)
|
||||
{
|
||||
lam_group_t *group;
|
||||
ompi_group_t *group;
|
||||
size_t size;
|
||||
|
||||
/* Setup communicator array */
|
||||
OBJ_CONSTRUCT(&lam_mpi_communicators, lam_pointer_array_t);
|
||||
OBJ_CONSTRUCT(&ompi_mpi_communicators, ompi_pointer_array_t);
|
||||
|
||||
|
||||
/* Setup MPI_COMM_WORLD */
|
||||
OBJ_CONSTRUCT(&lam_mpi_comm_world, lam_communicator_t);
|
||||
group = OBJ_NEW(lam_group_t);
|
||||
group->grp_proc_pointers = lam_proc_world(&size);
|
||||
group->grp_my_rank = lam_proc_local()->proc_vpid ;
|
||||
OBJ_CONSTRUCT(&ompi_mpi_comm_world, ompi_communicator_t);
|
||||
group = OBJ_NEW(ompi_group_t);
|
||||
group->grp_proc_pointers = ompi_proc_world(&size);
|
||||
group->grp_my_rank = ompi_proc_local()->proc_vpid ;
|
||||
group->grp_proc_count = size;
|
||||
group->grp_ok_to_free = false;
|
||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||
|
||||
lam_mpi_comm_world.c_contextid = 0;
|
||||
lam_mpi_comm_world.c_f_to_c_index = 0;
|
||||
lam_mpi_comm_world.c_my_rank = group->grp_my_rank;
|
||||
lam_mpi_comm_world.c_local_group = group;
|
||||
lam_mpi_comm_world.c_remote_group = group;
|
||||
lam_mpi_comm_world.c_cube_dim = lam_cube_dim(size);
|
||||
lam_mpi_comm_world.error_handler = &lam_mpi_errors_are_fatal;
|
||||
OBJ_RETAIN( &lam_mpi_errors_are_fatal );
|
||||
mca_pml.pml_add_comm(&lam_mpi_comm_world);
|
||||
lam_pointer_array_set_item (&lam_mpi_communicators, 0, &lam_mpi_comm_world);
|
||||
ompi_mpi_comm_world.c_contextid = 0;
|
||||
ompi_mpi_comm_world.c_f_to_c_index = 0;
|
||||
ompi_mpi_comm_world.c_my_rank = group->grp_my_rank;
|
||||
ompi_mpi_comm_world.c_local_group = group;
|
||||
ompi_mpi_comm_world.c_remote_group = group;
|
||||
ompi_mpi_comm_world.c_cube_dim = ompi_cube_dim(size);
|
||||
ompi_mpi_comm_world.error_handler = &ompi_mpi_errors_are_fatal;
|
||||
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
|
||||
mca_pml.pml_add_comm(&ompi_mpi_comm_world);
|
||||
ompi_pointer_array_set_item (&ompi_mpi_communicators, 0, &ompi_mpi_comm_world);
|
||||
|
||||
strncpy (lam_mpi_comm_world.c_name, "MPI_COMM_WORLD",
|
||||
strncpy (ompi_mpi_comm_world.c_name, "MPI_COMM_WORLD",
|
||||
strlen("MPI_COMM_WORLD")+1 );
|
||||
lam_mpi_comm_world.c_flags |= LAM_COMM_NAMEISSET;
|
||||
lam_attr_hash_init(&lam_mpi_comm_world.c_keyhash);
|
||||
ompi_mpi_comm_world.c_flags |= OMPI_COMM_NAMEISSET;
|
||||
ompi_attr_hash_init(&ompi_mpi_comm_world.c_keyhash);
|
||||
|
||||
/* VPS: Remove this later */
|
||||
lam_mpi_comm_world.bcast_lin_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxlin * sizeof(lam_request_t*));
|
||||
if (NULL == lam_mpi_comm_world.bcast_lin_reqs) {
|
||||
return LAM_ERR_OUT_OF_RESOURCE;
|
||||
ompi_mpi_comm_world.bcast_lin_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxlin * sizeof(ompi_request_t*));
|
||||
if (NULL == ompi_mpi_comm_world.bcast_lin_reqs) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
lam_mpi_comm_world.bcast_log_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxdim * sizeof(lam_request_t*));
|
||||
if (NULL == lam_mpi_comm_world.bcast_log_reqs) {
|
||||
return LAM_ERR_OUT_OF_RESOURCE;
|
||||
ompi_mpi_comm_world.bcast_log_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxdim * sizeof(ompi_request_t*));
|
||||
if (NULL == ompi_mpi_comm_world.bcast_log_reqs) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
|
||||
/* Setup MPI_COMM_SELF */
|
||||
OBJ_CONSTRUCT(&lam_mpi_comm_self, lam_communicator_t);
|
||||
group = OBJ_NEW(lam_group_t);
|
||||
group->grp_proc_pointers = lam_proc_self(&size);
|
||||
OBJ_CONSTRUCT(&ompi_mpi_comm_self, ompi_communicator_t);
|
||||
group = OBJ_NEW(ompi_group_t);
|
||||
group->grp_proc_pointers = ompi_proc_self(&size);
|
||||
group->grp_my_rank = 0;
|
||||
group->grp_proc_count = size;
|
||||
group->grp_ok_to_free = false;
|
||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||
|
||||
lam_mpi_comm_self.c_contextid = 1;
|
||||
lam_mpi_comm_self.c_f_to_c_index = 1;
|
||||
lam_mpi_comm_self.c_my_rank = group->grp_my_rank;
|
||||
lam_mpi_comm_self.c_local_group = group;
|
||||
lam_mpi_comm_self.c_remote_group = group;
|
||||
lam_mpi_comm_self.error_handler = &lam_mpi_errors_are_fatal;
|
||||
OBJ_RETAIN( &lam_mpi_errors_are_fatal );
|
||||
mca_pml.pml_add_comm(&lam_mpi_comm_self);
|
||||
lam_pointer_array_set_item (&lam_mpi_communicators, 1, &lam_mpi_comm_self);
|
||||
ompi_mpi_comm_self.c_contextid = 1;
|
||||
ompi_mpi_comm_self.c_f_to_c_index = 1;
|
||||
ompi_mpi_comm_self.c_my_rank = group->grp_my_rank;
|
||||
ompi_mpi_comm_self.c_local_group = group;
|
||||
ompi_mpi_comm_self.c_remote_group = group;
|
||||
ompi_mpi_comm_self.error_handler = &ompi_mpi_errors_are_fatal;
|
||||
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
|
||||
mca_pml.pml_add_comm(&ompi_mpi_comm_self);
|
||||
ompi_pointer_array_set_item (&ompi_mpi_communicators, 1, &ompi_mpi_comm_self);
|
||||
|
||||
strncpy(lam_mpi_comm_self.c_name,"MPI_COMM_SELF",strlen("MPI_COMM_SELF")+1);
|
||||
lam_mpi_comm_self.c_flags |= LAM_COMM_NAMEISSET;
|
||||
lam_attr_hash_init(&lam_mpi_comm_self.c_keyhash);
|
||||
strncpy(ompi_mpi_comm_self.c_name,"MPI_COMM_SELF",strlen("MPI_COMM_SELF")+1);
|
||||
ompi_mpi_comm_self.c_flags |= OMPI_COMM_NAMEISSET;
|
||||
ompi_attr_hash_init(&ompi_mpi_comm_self.c_keyhash);
|
||||
|
||||
/* VPS: Remove this later */
|
||||
lam_mpi_comm_self.bcast_lin_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxlin * sizeof(lam_request_t*));
|
||||
if (NULL == lam_mpi_comm_self.bcast_lin_reqs) {
|
||||
return LAM_ERR_OUT_OF_RESOURCE;
|
||||
ompi_mpi_comm_self.bcast_lin_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxlin * sizeof(ompi_request_t*));
|
||||
if (NULL == ompi_mpi_comm_self.bcast_lin_reqs) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
lam_mpi_comm_self.bcast_log_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxdim * sizeof(lam_request_t*));
|
||||
if (NULL == lam_mpi_comm_self.bcast_log_reqs) {
|
||||
return LAM_ERR_OUT_OF_RESOURCE;
|
||||
ompi_mpi_comm_self.bcast_log_reqs =
|
||||
malloc (mca_coll_base_bcast_collmaxdim * sizeof(ompi_request_t*));
|
||||
if (NULL == ompi_mpi_comm_self.bcast_log_reqs) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
|
||||
/* Setup MPI_COMM_NULL */
|
||||
OBJ_CONSTRUCT(&lam_mpi_comm_null, lam_communicator_t);
|
||||
group = OBJ_NEW(lam_group_t);
|
||||
OBJ_CONSTRUCT(&ompi_mpi_comm_null, ompi_communicator_t);
|
||||
group = OBJ_NEW(ompi_group_t);
|
||||
group->grp_proc_pointers = NULL;
|
||||
group->grp_my_rank = MPI_PROC_NULL;
|
||||
group->grp_proc_count = 0;
|
||||
group->grp_ok_to_free = false;
|
||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||
|
||||
lam_mpi_comm_null.c_contextid = 2;
|
||||
lam_mpi_comm_null.c_f_to_c_index = 2;
|
||||
lam_mpi_comm_null.c_my_rank = MPI_PROC_NULL;
|
||||
lam_mpi_comm_null.c_local_group = group;
|
||||
lam_mpi_comm_null.c_remote_group = group;
|
||||
lam_mpi_comm_null.error_handler = &lam_mpi_errors_are_fatal;
|
||||
OBJ_RETAIN( &lam_mpi_errors_are_fatal );
|
||||
lam_pointer_array_set_item (&lam_mpi_communicators, 2, &lam_mpi_comm_null);
|
||||
ompi_mpi_comm_null.c_contextid = 2;
|
||||
ompi_mpi_comm_null.c_f_to_c_index = 2;
|
||||
ompi_mpi_comm_null.c_my_rank = MPI_PROC_NULL;
|
||||
ompi_mpi_comm_null.c_local_group = group;
|
||||
ompi_mpi_comm_null.c_remote_group = group;
|
||||
ompi_mpi_comm_null.error_handler = &ompi_mpi_errors_are_fatal;
|
||||
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
|
||||
ompi_pointer_array_set_item (&ompi_mpi_communicators, 2, &ompi_mpi_comm_null);
|
||||
|
||||
strncpy(lam_mpi_comm_null.c_name,"MPI_COMM_NULL",strlen("MPI_COMM_NULL")+1);
|
||||
lam_mpi_comm_null.c_flags |= LAM_COMM_NAMEISSET;
|
||||
strncpy(ompi_mpi_comm_null.c_name,"MPI_COMM_NULL",strlen("MPI_COMM_NULL")+1);
|
||||
ompi_mpi_comm_null.c_flags |= OMPI_COMM_NAMEISSET;
|
||||
|
||||
/* VPS: Remove this later */
|
||||
lam_mpi_comm_null.bcast_lin_reqs = NULL;
|
||||
lam_mpi_comm_null.bcast_log_reqs = NULL;
|
||||
ompi_mpi_comm_null.bcast_lin_reqs = NULL;
|
||||
ompi_mpi_comm_null.bcast_log_reqs = NULL;
|
||||
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
lam_communicator_t *lam_comm_allocate ( int local_size, int remote_size )
|
||||
ompi_communicator_t *ompi_comm_allocate ( int local_size, int remote_size )
|
||||
{
|
||||
lam_communicator_t *new_comm=NULL;
|
||||
ompi_communicator_t *new_comm=NULL;
|
||||
|
||||
/* create new communicator element */
|
||||
new_comm = OBJ_NEW(lam_communicator_t);
|
||||
new_comm->c_local_group = lam_group_allocate ( local_size );
|
||||
new_comm = OBJ_NEW(ompi_communicator_t);
|
||||
new_comm->c_local_group = ompi_group_allocate ( local_size );
|
||||
if ( 0 < remote_size ) {
|
||||
new_comm->c_remote_group = lam_group_allocate (remote_size);
|
||||
new_comm->c_flags |= LAM_COMM_INTER;
|
||||
new_comm->c_remote_group = ompi_group_allocate (remote_size);
|
||||
new_comm->c_flags |= OMPI_COMM_INTER;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
@ -167,8 +167,8 @@ lam_communicator_t *lam_comm_allocate ( int local_size, int remote_size )
|
||||
}
|
||||
|
||||
/* fill in the inscribing hyper-cube dimensions */
|
||||
new_comm->c_cube_dim = lam_cube_dim(local_size);
|
||||
if ( LAM_ERROR == new_comm->c_cube_dim ) {
|
||||
new_comm->c_cube_dim = ompi_cube_dim(local_size);
|
||||
if ( OMPI_ERROR == new_comm->c_cube_dim ) {
|
||||
OBJ_RELEASE(new_comm);
|
||||
new_comm = NULL;
|
||||
}
|
||||
@ -176,24 +176,24 @@ lam_communicator_t *lam_comm_allocate ( int local_size, int remote_size )
|
||||
return new_comm;
|
||||
}
|
||||
|
||||
int lam_comm_finalize(void)
|
||||
int ompi_comm_finalize(void)
|
||||
{
|
||||
/* Destroy all predefined communicators */
|
||||
OBJ_DESTRUCT( &lam_mpi_comm_null );
|
||||
OBJ_DESTRUCT( &lam_mpi_comm_world );
|
||||
OBJ_DESTRUCT( &lam_mpi_comm_self );
|
||||
OBJ_DESTRUCT( &ompi_mpi_comm_null );
|
||||
OBJ_DESTRUCT( &ompi_mpi_comm_world );
|
||||
OBJ_DESTRUCT( &ompi_mpi_comm_self );
|
||||
|
||||
OBJ_DESTRUCT (&lam_mpi_communicators);
|
||||
OBJ_DESTRUCT (&ompi_mpi_communicators);
|
||||
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* For linking only. To be checked.
|
||||
*/
|
||||
int lam_comm_link_function(void)
|
||||
int ompi_comm_link_function(void)
|
||||
{
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/********************************************************************************/
|
||||
@ -201,7 +201,7 @@ int lam_comm_link_function(void)
|
||||
/********************************************************************************/
|
||||
/* static functions */
|
||||
|
||||
static void lam_comm_construct(lam_communicator_t* comm)
|
||||
static void ompi_comm_construct(ompi_communicator_t* comm)
|
||||
{
|
||||
comm->c_f_to_c_index = MPI_UNDEFINED;
|
||||
comm->c_name[0] = '\0';
|
||||
@ -219,17 +219,17 @@ static void lam_comm_construct(lam_communicator_t* comm)
|
||||
return;
|
||||
}
|
||||
|
||||
static void lam_comm_destruct(lam_communicator_t* comm)
|
||||
static void ompi_comm_destruct(ompi_communicator_t* comm)
|
||||
{
|
||||
OBJ_RELEASE ( comm->c_local_group );
|
||||
OBJ_RELEASE ( comm->c_remote_group );
|
||||
|
||||
OBJ_RELEASE ( comm->error_handler );
|
||||
|
||||
/* reset the lam_comm_f_to_c_table entry */
|
||||
if ( NULL != lam_pointer_array_get_item ( &lam_mpi_communicators,
|
||||
/* reset the ompi_comm_f_to_c_table entry */
|
||||
if ( NULL != ompi_pointer_array_get_item ( &ompi_mpi_communicators,
|
||||
comm->c_f_to_c_index )) {
|
||||
lam_pointer_array_set_item ( &lam_mpi_communicators,
|
||||
ompi_pointer_array_set_item ( &ompi_mpi_communicators,
|
||||
comm->c_f_to_c_index, NULL);
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,8 @@ bogus = \
|
||||
# Conditionally install the header files
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
lamdir = $(includedir)/lam/ctnetwork
|
||||
lam_HEADERS = $(headers)
|
||||
ompidir = $(includedir)/ompi/ctnetwork
|
||||
ompi_HEADERS = $(headers)
|
||||
else
|
||||
lamdir = $(includedir)
|
||||
ompidir = $(includedir)
|
||||
endif
|
||||
|
@ -7,10 +7,10 @@
|
||||
#include "ctnetwork/ctchannel.h"
|
||||
|
||||
#define CHANNEL_CLS(chnl) \
|
||||
((lam_ctchannel_class_t *)(((lam_object_t *) chnl)->obj_class))
|
||||
((ompi_ctchannel_class_t *)(((ompi_object_t *) chnl)->obj_class))
|
||||
|
||||
|
||||
static void lam_cth_construct(lam_ctchannel_t *channel)
|
||||
static void ompi_cth_construct(ompi_ctchannel_t *channel)
|
||||
{
|
||||
channel->cth_status = CT_CHNL_CLOSED;
|
||||
channel->cth_id = 0;
|
||||
@ -18,17 +18,17 @@ static void lam_cth_construct(lam_ctchannel_t *channel)
|
||||
}
|
||||
|
||||
|
||||
static void lam_cth_construct(lam_ctchannel_t *channel)
|
||||
static void ompi_cth_construct(ompi_ctchannel_t *channel)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
lam_ctchannel_class_t lam_ct_channel_t_class = {
|
||||
ompi_ctchannel_class_t ompi_ct_channel_t_class = {
|
||||
{
|
||||
"lam_ct_channel_t",
|
||||
OBJ_CLASS(lam_object_t),
|
||||
(lam_construct_t) lam_cth_construct,
|
||||
(lam_destruct_t) lam_object_destruct
|
||||
"ompi_ct_channel_t",
|
||||
OBJ_CLASS(ompi_object_t),
|
||||
(ompi_construct_t) ompi_cth_construct,
|
||||
(ompi_destruct_t) ompi_object_destruct
|
||||
},
|
||||
NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
@ -43,7 +43,7 @@ lam_ctchannel_class_t lam_ct_channel_t_class = {
|
||||
|
||||
|
||||
/* return: error code args: (channel, data, data length, bytes sent) */
|
||||
uint32_t lam_cth_send(lam_ctchannel_t *channel, const uint8_t *data,
|
||||
uint32_t ompi_cth_send(ompi_ctchannel_t *channel, const uint8_t *data,
|
||||
uint32_t data_len, uint32_t *bytes_sent)
|
||||
{
|
||||
return CHANNEL_CLS(channel)->cth_send(channel, data, data_len,
|
||||
@ -51,7 +51,7 @@ uint32_t lam_cth_send(lam_ctchannel_t *channel, const uint8_t *data,
|
||||
}
|
||||
|
||||
/* return: error code args: (channel, recv buffer, buffer length, bytes received) */
|
||||
uint32_t lam_cth_recv(lam_ctchannel_t *channel, const uint8_t *buffer,
|
||||
uint32_t ompi_cth_recv(ompi_ctchannel_t *channel, const uint8_t *buffer,
|
||||
uint32_t buff_len, uint32_t *bytes_recvd)
|
||||
{
|
||||
return CHANNEL_CLS(channel)->cth_recv(channel, buffer,
|
||||
@ -59,13 +59,13 @@ uint32_t lam_cth_recv(lam_ctchannel_t *channel, const uint8_t *buffer,
|
||||
}
|
||||
|
||||
/* return: error code args: (channel, msg ptr) */
|
||||
uint32_t lam_cth_get_msg(lam_ctchannel_t *channel, lam_ctmsg_t **msg)
|
||||
uint32_t ompi_cth_get_msg(ompi_ctchannel_t *channel, ompi_ctmsg_t **msg)
|
||||
{
|
||||
return CHANNEL_CLS(channel)->cth_get_msg(channel, msg);
|
||||
}
|
||||
|
||||
/* return: error code args: (channel, recv buffer ptr, bytes received) */
|
||||
uint32_t lam_cth_get_packed_msg(lam_ctchannel_t *channel,
|
||||
uint32_t ompi_cth_get_packed_msg(ompi_ctchannel_t *channel,
|
||||
const uint8_t **buffer,
|
||||
uint32_t *bytes_recvd)
|
||||
{
|
||||
@ -74,14 +74,14 @@ uint32_t lam_cth_get_packed_msg(lam_ctchannel_t *channel,
|
||||
}
|
||||
|
||||
/* return: error code args: (channel, msg) */
|
||||
uint32_t lam_cth_send_msg(lam_ctchannel_t *channel, lam_ctmsg_t *msg)
|
||||
uint32_t ompi_cth_send_msg(ompi_ctchannel_t *channel, ompi_ctmsg_t *msg)
|
||||
{
|
||||
return CHANNEL_CLS(channel)->cth_send_msg(channel, msg);
|
||||
}
|
||||
|
||||
|
||||
/* return: error code args: (channel, msg ptr, msg len) */
|
||||
uint32_t lam_cth_send_packed_msg(lam_ctchannel_t *channel,
|
||||
uint32_t ompi_cth_send_packed_msg(ompi_ctchannel_t *channel,
|
||||
const uint8_t *packed_msg,
|
||||
uint32_t msg_len)
|
||||
{
|
||||
@ -101,7 +101,7 @@ uint32_t lam_cth_send_packed_msg(lam_ctchannel_t *channel,
|
||||
*/
|
||||
|
||||
|
||||
static void lam_tcpch_construct(lam_tcp_chnl_t *channel)
|
||||
static void ompi_tcpch_construct(ompi_tcp_chnl_t *channel)
|
||||
{
|
||||
channel->tcp_sockfd = 0;
|
||||
memset(&(channel->tcp_addr), 0, sizeof(channel->tcp_addr));
|
||||
@ -109,28 +109,28 @@ static void lam_tcpch_construct(lam_tcp_chnl_t *channel)
|
||||
}
|
||||
|
||||
|
||||
static void lam_tcpch_destruct(lam_tcp_chnl_t *channel)
|
||||
static void ompi_tcpch_destruct(ompi_tcp_chnl_t *channel)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
lam_ctchannel_class_t lam_tcp_chnl_t_class = {
|
||||
ompi_ctchannel_class_t ompi_tcp_chnl_t_class = {
|
||||
{
|
||||
"lam_tcp_chnl_t",
|
||||
OBJ_CLASS(lam_ctchannel_t),
|
||||
(lam_construct_t) lam_tcpch_construct,
|
||||
(lam_destruct_t) lam_tcpch_destruct
|
||||
"ompi_tcp_chnl_t",
|
||||
OBJ_CLASS(ompi_ctchannel_t),
|
||||
(ompi_construct_t) ompi_tcpch_construct,
|
||||
(ompi_destruct_t) ompi_tcpch_destruct
|
||||
},
|
||||
lam_tcpch_send,
|
||||
lam_tcpch_recv,
|
||||
lam_tcpch_get_msg,
|
||||
lam_tcpch_get_packed_msg,
|
||||
lam_tcpch_send_msg,
|
||||
lam_tcpch_send_packed_msg
|
||||
ompi_tcpch_send,
|
||||
ompi_tcpch_recv,
|
||||
ompi_tcpch_get_msg,
|
||||
ompi_tcpch_get_packed_msg,
|
||||
ompi_tcpch_send_msg,
|
||||
ompi_tcpch_send_packed_msg
|
||||
};
|
||||
|
||||
|
||||
uint32_t lam_tcpch_send(lam_tcp_chnl_t *channel, const uint8_t *data,
|
||||
uint32_t ompi_tcpch_send(ompi_tcp_chnl_t *channel, const uint8_t *data,
|
||||
uint32_t data_len, uint32_t *bytes_sent)
|
||||
{
|
||||
uint32_t ret = CT_CHNL_ERR_OK;
|
||||
@ -139,7 +139,7 @@ uint32_t lam_tcpch_send(lam_tcp_chnl_t *channel, const uint8_t *data,
|
||||
}
|
||||
|
||||
|
||||
uint32_t lam_tcpch_recv(lam_tcp_chnl_t *channel, const uint8_t *buffer,
|
||||
uint32_t ompi_tcpch_recv(ompi_tcp_chnl_t *channel, const uint8_t *buffer,
|
||||
uint32_t buff_len, uint32_t *bytes_recvd)
|
||||
{
|
||||
uint32_t ret = CT_CHNL_ERR_OK;
|
||||
@ -148,7 +148,7 @@ uint32_t lam_tcpch_recv(lam_tcp_chnl_t *channel, const uint8_t *buffer,
|
||||
}
|
||||
|
||||
|
||||
uint32_t lam_tcpch_get_msg(lam_tcp_chnl_t *channel, lam_ctmsg_t **msg)
|
||||
uint32_t ompi_tcpch_get_msg(ompi_tcp_chnl_t *channel, ompi_ctmsg_t **msg)
|
||||
{
|
||||
uint32_t ret = CT_CHNL_ERR_OK;
|
||||
|
||||
@ -156,7 +156,7 @@ uint32_t lam_tcpch_get_msg(lam_tcp_chnl_t *channel, lam_ctmsg_t **msg)
|
||||
}
|
||||
|
||||
|
||||
uint32_t lam_tcpch_get_packed_msg(lam_tcp_chnl_t *channel,
|
||||
uint32_t ompi_tcpch_get_packed_msg(ompi_tcp_chnl_t *channel,
|
||||
const uint8_t **buffer,
|
||||
uint32_t *bytes_recvd)
|
||||
{
|
||||
@ -166,7 +166,7 @@ uint32_t lam_tcpch_get_packed_msg(lam_tcp_chnl_t *channel,
|
||||
}
|
||||
|
||||
|
||||
uint32_t lam_tcpch_send_msg(lam_tcp_chnl_t *channel, lam_ctmsg_t *msg)
|
||||
uint32_t ompi_tcpch_send_msg(ompi_tcp_chnl_t *channel, ompi_ctmsg_t *msg)
|
||||
{
|
||||
uint32_t ret = CT_CHNL_ERR_OK;
|
||||
|
||||
@ -174,7 +174,7 @@ uint32_t lam_tcpch_send_msg(lam_tcp_chnl_t *channel, lam_ctmsg_t *msg)
|
||||
}
|
||||
|
||||
|
||||
uint32_t lam_tcpch_send_packed_msg(lam_tcp_chnl_t *channel,
|
||||
uint32_t ompi_tcpch_send_packed_msg(ompi_tcp_chnl_t *channel,
|
||||
const uint8_t *packed_msg,
|
||||
uint32_t msg_len)
|
||||
{
|
||||
|
@ -2,14 +2,14 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_CT_CHANNEL_H
|
||||
#define LAM_CT_CHANNEL_H
|
||||
#ifndef OMPI_CT_CHANNEL_H
|
||||
#define OMPI_CT_CHANNEL_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "lfc/lam_object.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "ctnetwork/ctmessage.h"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ typedef enum
|
||||
CT_CHNL_ERR_CONN_LOST, /* lost connection */
|
||||
CT_CHNL_ERR_INVALID_MSG, /* unable to pack/unpack msg or msg is NULL */
|
||||
CT_CHNL_ERR_TIMED_OUT /* channel operation timed out. */
|
||||
} lam_ctchnl_error_t;
|
||||
} ompi_ctchnl_error_t;
|
||||
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@ typedef enum
|
||||
CT_CHNL_CLOSED = 0,
|
||||
CT_CHNL_CONNECTED,
|
||||
CT_CHNL_FAILED
|
||||
} lam_ctchnl_status_t;
|
||||
} ompi_ctchnl_status_t;
|
||||
|
||||
/*
|
||||
*
|
||||
@ -47,66 +47,66 @@ typedef enum
|
||||
* communicate in the network.
|
||||
*/
|
||||
|
||||
#define CTCHANNEL(obj) (lam_ctchannel_t *)(obj)
|
||||
#define CTCHANNEL(obj) (ompi_ctchannel_t *)(obj)
|
||||
|
||||
struct lam_ctchannel;
|
||||
struct ompi_ctchannel;
|
||||
|
||||
/* return: error code args: (channel, data, data length, bytes sent) */
|
||||
typedef uint32_t (*lam_cth_send_fn_t)(struct lam_ctchannel *,
|
||||
typedef uint32_t (*ompi_cth_send_fn_t)(struct ompi_ctchannel *,
|
||||
const uint8_t *, uint32_t, uint32_t *);
|
||||
|
||||
/* return: error code args: (channel, recv buffer, buffer length, bytes received) */
|
||||
typedef uint32_t (*lam_cth_recv_fn_t)(struct lam_ctchannel *,
|
||||
typedef uint32_t (*ompi_cth_recv_fn_t)(struct ompi_ctchannel *,
|
||||
const uint8_t *, uint32_t, uint32_t *);
|
||||
|
||||
/* return: error code args: (channel, msg ptr) */
|
||||
typedef uint32_t (*lam_cth_get_msg_fn_t)(struct lam_ctchannel *,
|
||||
lam_ctmsg_t **);
|
||||
typedef uint32_t (*ompi_cth_get_msg_fn_t)(struct ompi_ctchannel *,
|
||||
ompi_ctmsg_t **);
|
||||
|
||||
/* return: error code args: (channel, recv buffer ptr, bytes received) */
|
||||
typedef uint32_t (*lam_cth_get_packed_msg_fn_t)(struct lam_ctchannel *,
|
||||
typedef uint32_t (*ompi_cth_get_packed_msg_fn_t)(struct ompi_ctchannel *,
|
||||
const uint8_t **, uint32_t *);
|
||||
|
||||
/* return: error code args: (channel, msg) */
|
||||
typedef uint32_t (*lam_cth_send_msg_fn_t)(struct lam_ctchannel *,
|
||||
lam_ctmsg_t *);
|
||||
typedef uint32_t (*ompi_cth_send_msg_fn_t)(struct ompi_ctchannel *,
|
||||
ompi_ctmsg_t *);
|
||||
|
||||
/* return: error code args: (channel, msg ptr, msg len) */
|
||||
typedef uint32_t (*lam_cth_send_packed_msg_fn_t)(struct lam_ctchannel *,
|
||||
typedef uint32_t (*ompi_cth_send_packed_msg_fn_t)(struct ompi_ctchannel *,
|
||||
const uint8_t *, uint32_t);
|
||||
|
||||
typedef struct lam_ctchannel_class
|
||||
typedef struct ompi_ctchannel_class
|
||||
{
|
||||
lam_class_t super;
|
||||
ompi_class_t super;
|
||||
/* return: error code args: (channel, data, data length, bytes sent) */
|
||||
lam_cth_send_fn_t *send;
|
||||
ompi_cth_send_fn_t *send;
|
||||
|
||||
/* return: error code args: (channel, recv buffer, buffer length, bytes received) */
|
||||
lam_cth_recv_fn_t *recv;
|
||||
ompi_cth_recv_fn_t *recv;
|
||||
|
||||
/* return: error code args: (channel, msg ptr) */
|
||||
lam_cth_get_msg_fn_t *get_msg;
|
||||
ompi_cth_get_msg_fn_t *get_msg;
|
||||
|
||||
/* return: error code args: (channel, recv buffer ptr, bytes received) */
|
||||
lam_cth_get_packed_msg_fn_t *get_packed_msg;
|
||||
ompi_cth_get_packed_msg_fn_t *get_packed_msg;
|
||||
|
||||
/* return: error code args: (channel, msg) */
|
||||
lam_cth_send_msg_fn_t *send_msg;
|
||||
ompi_cth_send_msg_fn_t *send_msg;
|
||||
|
||||
/* return: error code args: (channel, msg ptr, msg len) */
|
||||
lam_cth_send_packed_msg_fn_t *send_packed_msg;
|
||||
} lam_ctchannel_class_t;
|
||||
ompi_cth_send_packed_msg_fn_t *send_packed_msg;
|
||||
} ompi_ctchannel_class_t;
|
||||
|
||||
|
||||
extern lam_ctchannel_class_t lam_ct_channel_t_class;
|
||||
extern ompi_ctchannel_class_t ompi_ct_channel_t_class;
|
||||
|
||||
typedef struct lam_ctchannel
|
||||
typedef struct ompi_ctchannel
|
||||
{
|
||||
lam_object_t super;
|
||||
ompi_object_t super;
|
||||
int cth_status;
|
||||
uint32_t cth_id;
|
||||
uint32_t cth_timeout_secs;
|
||||
} lam_ctchannel_t;
|
||||
} ompi_ctchannel_t;
|
||||
|
||||
|
||||
/*
|
||||
@ -115,30 +115,30 @@ typedef struct lam_ctchannel
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_cth_is_connected(lam_ctchannel_t *channel);
|
||||
inline int lam_cth_is_connected(lam_ctchannel_t *channel)
|
||||
int ompi_cth_is_connected(ompi_ctchannel_t *channel);
|
||||
inline int ompi_cth_is_connected(ompi_ctchannel_t *channel)
|
||||
{
|
||||
return (CT_CHNL_CONNECTED == channel->cth_status);
|
||||
}
|
||||
|
||||
uint32_t lam_cth_get_id(lam_ctchannel_t *channel);
|
||||
inline uint32_t lam_cth_get_id(lam_ctchannel_t *channel)
|
||||
uint32_t ompi_cth_get_id(ompi_ctchannel_t *channel);
|
||||
inline uint32_t ompi_cth_get_id(ompi_ctchannel_t *channel)
|
||||
{
|
||||
return channel->cth_id;
|
||||
}
|
||||
void lam_cth_set_id(lam_ctchannel_t *channel, uint32_t cid);
|
||||
inline void lam_cth_set_id(lam_ctchannel_t *channel, uint32_t cid)
|
||||
void ompi_cth_set_id(ompi_ctchannel_t *channel, uint32_t cid);
|
||||
inline void ompi_cth_set_id(ompi_ctchannel_t *channel, uint32_t cid)
|
||||
{
|
||||
channel->cth_id = cid;
|
||||
}
|
||||
|
||||
uint32_t lam_cth_get_timeout(lam_ctchannel_t *channel);
|
||||
inline uint32_t lam_cth_get_timeout(lam_ctchannel_t *channel)
|
||||
uint32_t ompi_cth_get_timeout(ompi_ctchannel_t *channel);
|
||||
inline uint32_t ompi_cth_get_timeout(ompi_ctchannel_t *channel)
|
||||
{
|
||||
return channel->cth_timeout_secs;
|
||||
}
|
||||
void lam_cth_set_timeout(lam_ctchannel_t *channel, uint32_t timeout);
|
||||
inline void lam_cth_set_timeout(lam_ctchannel_t *channel, uint32_t timeout)
|
||||
void ompi_cth_set_timeout(ompi_ctchannel_t *channel, uint32_t timeout);
|
||||
inline void ompi_cth_set_timeout(ompi_ctchannel_t *channel, uint32_t timeout)
|
||||
{
|
||||
channel->cth_timeout_secs = timeout;
|
||||
}
|
||||
@ -152,25 +152,25 @@ inline void lam_cth_set_timeout(lam_ctchannel_t *channel, uint32_t timeout)
|
||||
|
||||
|
||||
/* return: error code args: (channel, data, data length, bytes sent) */
|
||||
uint32_t lam_cth_send(lam_ctchannel_t *channel, const uint8_t *data,
|
||||
uint32_t ompi_cth_send(ompi_ctchannel_t *channel, const uint8_t *data,
|
||||
uint32_t data_len, uint32_t *bytes_sent);
|
||||
|
||||
/* return: error code args: (channel, recv buffer, buffer length, bytes received) */
|
||||
uint32_t lam_cth_recv(lam_ctchannel_t *channel, const uint8_t *buffer,
|
||||
uint32_t ompi_cth_recv(ompi_ctchannel_t *channel, const uint8_t *buffer,
|
||||
uint32_t buff_len, uint32_t *bytes_recvd);
|
||||
|
||||
/* return: error code args: (channel, msg ptr) */
|
||||
uint32_t lam_cth_get_msg(lam_ctchannel_t *channel, lam_ctmsg_t **msg);
|
||||
uint32_t ompi_cth_get_msg(ompi_ctchannel_t *channel, ompi_ctmsg_t **msg);
|
||||
|
||||
/* return: error code args: (channel, recv buffer ptr, bytes received) */
|
||||
uint32_t lam_cth_get_packed_msg(lam_ctchannel_t *channel, const uint8_t **buffer,
|
||||
uint32_t ompi_cth_get_packed_msg(ompi_ctchannel_t *channel, const uint8_t **buffer,
|
||||
uint32_t *bytes_recvd);
|
||||
|
||||
/* return: error code args: (channel, msg) */
|
||||
uint32_t lam_cth_send_msg(lam_ctchannel_t *channel, lam_ctmsg_t *msg);
|
||||
uint32_t ompi_cth_send_msg(ompi_ctchannel_t *channel, ompi_ctmsg_t *msg);
|
||||
|
||||
/* return: error code args: (channel, msg ptr, msg len) */
|
||||
uint32_t lam_cth_send_packed_msg(lam_ctchannel_t *channel, const uint8_t *packed_msg,
|
||||
uint32_t ompi_cth_send_packed_msg(ompi_ctchannel_t *channel, const uint8_t *packed_msg,
|
||||
uint32_t msg_len);
|
||||
|
||||
/*
|
||||
@ -179,32 +179,32 @@ uint32_t lam_cth_send_packed_msg(lam_ctchannel_t *channel, const uint8_t *packed
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct lam_tcp_channel
|
||||
typedef struct ompi_tcp_channel
|
||||
{
|
||||
lam_ctchannel_t super;
|
||||
ompi_ctchannel_t super;
|
||||
int tcp_sockfd;
|
||||
struct sockaddr_in tcp_addr;
|
||||
int tcp_blocking;
|
||||
} lam_tcp_chnl_t;
|
||||
} ompi_tcp_chnl_t;
|
||||
|
||||
extern lam_ctchannel_class_t lam_tcp_chnl_t_class;
|
||||
extern ompi_ctchannel_class_t ompi_tcp_chnl_t_class;
|
||||
|
||||
uint32_t lam_tcpch_send(lam_tcp_chnl_t *channel, const uint8_t *data,
|
||||
uint32_t ompi_tcpch_send(ompi_tcp_chnl_t *channel, const uint8_t *data,
|
||||
uint32_t data_len, uint32_t *bytes_sent);
|
||||
|
||||
uint32_t lam_tcpch_recv(lam_tcp_chnl_t *channel, const uint8_t *buffer,
|
||||
uint32_t ompi_tcpch_recv(ompi_tcp_chnl_t *channel, const uint8_t *buffer,
|
||||
uint32_t buff_len, uint32_t *bytes_recvd);
|
||||
|
||||
uint32_t lam_tcpch_get_msg(lam_tcp_chnl_t *channel, lam_ctmsg_t **msg);
|
||||
uint32_t ompi_tcpch_get_msg(ompi_tcp_chnl_t *channel, ompi_ctmsg_t **msg);
|
||||
|
||||
uint32_t lam_tcpch_get_packed_msg(lam_tcp_chnl_t *channel, const uint8_t **buffer,
|
||||
uint32_t ompi_tcpch_get_packed_msg(ompi_tcp_chnl_t *channel, const uint8_t **buffer,
|
||||
uint32_t *bytes_recvd);
|
||||
|
||||
uint32_t lam_tcpch_send_msg(lam_tcp_chnl_t *channel, lam_ctmsg_t *msg);
|
||||
uint32_t ompi_tcpch_send_msg(ompi_tcp_chnl_t *channel, ompi_ctmsg_t *msg);
|
||||
|
||||
uint32_t lam_tcpch_send_packed_msg(lam_tcp_chnl_t *channel,
|
||||
uint32_t ompi_tcpch_send_packed_msg(ompi_tcp_chnl_t *channel,
|
||||
const uint8_t *packed_msg,
|
||||
uint32_t msg_len);
|
||||
|
||||
|
||||
#endif /* LAM_CT_CHANNEL_H */
|
||||
#endif /* OMPI_CT_CHANNEL_H */
|
||||
|
@ -2,8 +2,8 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_CT_CLIENT_H
|
||||
#define LAM_CT_CLIENT_H
|
||||
#ifndef OMPI_CT_CLIENT_H
|
||||
#define OMPI_CT_CLIENT_H
|
||||
|
||||
#endif /* LAM_CT_CLIENT_H */
|
||||
#endif /* OMPI_CT_CLIENT_H */
|
||||
|
||||
|
@ -2,42 +2,42 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_CT_CONTROLLER_H
|
||||
#define LAM_CT_CONTROLLER_H
|
||||
#ifndef OMPI_CT_CONTROLLER_H
|
||||
#define OMPI_CT_CONTROLLER_H
|
||||
|
||||
#include "lfc/lam_object.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "ctnetwork/ctnode.h"
|
||||
|
||||
typedef void (*lam_ctmsg_recvd_fn)(struct lam_ctcontroller *,
|
||||
lam_ctmsg_t *,
|
||||
typedef void (*ompi_ctmsg_recvd_fn)(struct ompi_ctcontroller *,
|
||||
ompi_ctmsg_t *,
|
||||
void *);
|
||||
|
||||
typedef void (*lam_ctnode_failed_fn)(struct lam_ctcontroller *,
|
||||
lam_ctnode_t *,
|
||||
typedef void (*ompi_ctnode_failed_fn)(struct ompi_ctcontroller *,
|
||||
ompi_ctnode_t *,
|
||||
void *);
|
||||
|
||||
typedef struct lam_ctcontroller
|
||||
typedef struct ompi_ctcontroller
|
||||
{
|
||||
lam_object_t super;
|
||||
lam_ctnode_t ctl_node;
|
||||
ompi_object_t super;
|
||||
ompi_ctnode_t ctl_node;
|
||||
void *ctl_user_info;
|
||||
lam_ctmsg_recvd_fn ctl_msg_recvd_callback;
|
||||
lam_ctnode_failed_fn ctl_node_failed_callback;
|
||||
} lam_ctctrl_t;
|
||||
ompi_ctmsg_recvd_fn ctl_msg_recvd_callback;
|
||||
ompi_ctnode_failed_fn ctl_node_failed_callback;
|
||||
} ompi_ctctrl_t;
|
||||
|
||||
void lam_ctl_construct(lam_ctctrl_t *ctrl);
|
||||
void lam_ctl_destruct(lam_ctctrl_t *ctrl);
|
||||
void ompi_ctl_construct(ompi_ctctrl_t *ctrl);
|
||||
void ompi_ctl_destruct(ompi_ctctrl_t *ctrl);
|
||||
|
||||
inline void lam_ctl_set_recvd_callback(lam_ctctrl_t *ctrl, lam_ctmsg_recvd_fn callback)
|
||||
inline void ompi_ctl_set_recvd_callback(ompi_ctctrl_t *ctrl, ompi_ctmsg_recvd_fn callback)
|
||||
{
|
||||
ctrl->ctl_msg_recvd_callback = callback;
|
||||
}
|
||||
|
||||
|
||||
inline void lam_ctl_set_failed_callback(lam_ctctrl_t *ctrl, lam_ctnode_failed_fn callback)
|
||||
inline void ompi_ctl_set_failed_callback(ompi_ctctrl_t *ctrl, ompi_ctnode_failed_fn callback)
|
||||
{
|
||||
ctrl->ctl_node_failed_callback = callback;
|
||||
}
|
||||
|
||||
|
||||
#endif /* LAM_CT_CONTROLLER_H */
|
||||
#endif /* OMPI_CT_CONTROLLER_H */
|
||||
|
@ -5,29 +5,29 @@
|
||||
#include "ctnetwork/ctmessage.h"
|
||||
|
||||
|
||||
lam_class_t lam_ct_ctrl_t_class = {
|
||||
"lam_ct_ctrl_t",
|
||||
OBJ_CLASS(lam_object_t),
|
||||
(lam_construct_t) lam_ctc_construct,
|
||||
(lam_destruct_t) lam_ctc_destruct
|
||||
ompi_class_t ompi_ct_ctrl_t_class = {
|
||||
"ompi_ct_ctrl_t",
|
||||
OBJ_CLASS(ompi_object_t),
|
||||
(ompi_construct_t) ompi_ctc_construct,
|
||||
(ompi_destruct_t) ompi_ctc_destruct
|
||||
};
|
||||
|
||||
|
||||
lam_class_t lam_ctmsg_t_class = {
|
||||
"lam_ctmsg_t",
|
||||
OBJ_CLASS(lam_object_t),
|
||||
(lam_construct_t) lam_ctm_construct,
|
||||
(lam_destruct_t) lam_ctm_destruct
|
||||
ompi_class_t ompi_ctmsg_t_class = {
|
||||
"ompi_ctmsg_t",
|
||||
OBJ_CLASS(ompi_object_t),
|
||||
(ompi_construct_t) ompi_ctm_construct,
|
||||
(ompi_destruct_t) ompi_ctm_destruct
|
||||
};
|
||||
|
||||
|
||||
static const uint32_t ctrl_alloc_len = sizeof(lam_ct_ctrl_t) -
|
||||
sizeof(lam_object_t) - sizeof(ctrl->ctc_info);
|
||||
static const uint32_t ctrl_alloc_len = sizeof(ompi_ct_ctrl_t) -
|
||||
sizeof(ompi_object_t) - sizeof(ctrl->ctc_info);
|
||||
|
||||
void lam_ctc_construct(lam_ct_ctrl_t *ctrl)
|
||||
void ompi_ctc_construct(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
ctrl->ctc_is_user_msg = 0;
|
||||
ctrl->ctc_routing_type = LAM_CT_PT2PT;
|
||||
ctrl->ctc_routing_type = OMPI_CT_PT2PT;
|
||||
ctrl->ctc_sender = 0;
|
||||
ctrl->ctc_dest = 0;
|
||||
ctrl->ctc_forwarding = 0;
|
||||
@ -38,14 +38,14 @@ void lam_ctc_construct(lam_ct_ctrl_t *ctrl)
|
||||
|
||||
|
||||
|
||||
void lam_ctc_destruct(lam_ct_ctrl_t *ctrl)
|
||||
void ompi_ctc_destruct(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
lam_free(ctrl->ctc_info);
|
||||
ompi_free(ctrl->ctc_info);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void lam_ctc_construct_with(lam_ct_ctrl_t *ctrl, int routing_type,
|
||||
void ompi_ctc_construct_with(ompi_ct_ctrl_t *ctrl, int routing_type,
|
||||
uint32_t sender, uint32_t dest)
|
||||
{
|
||||
ctrl->ctc_routing_type = routing_type;
|
||||
@ -54,12 +54,12 @@ void lam_ctc_construct_with(lam_ct_ctrl_t *ctrl, int routing_type,
|
||||
}
|
||||
|
||||
|
||||
uint32_t lam_ctc_pack_size(lam_ct_ctrl_t *ctrl)
|
||||
uint32_t ompi_ctc_pack_size(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
return ctrl_alloc_len + ctrl->ctc_info_len;
|
||||
}
|
||||
|
||||
uint8_t *lam_ctc_pack(lam_ct_ctrl_t *ctrl, uint32_t *len)
|
||||
uint8_t *ompi_ctc_pack(ompi_ct_ctrl_t *ctrl, uint32_t *len)
|
||||
{
|
||||
/* ASSERT: packed control struct looks like
|
||||
<ctc_is_user_msg (uint16_t)><ctc_routing_type (uint16_t)>
|
||||
@ -69,20 +69,20 @@ uint8_t *lam_ctc_pack(lam_ct_ctrl_t *ctrl, uint32_t *len)
|
||||
*/
|
||||
uint8_t *buffer;
|
||||
|
||||
buffer = (uint8_t *) lam_malloc(ctrl_alloc_len + ctrl->ctc_info_len);
|
||||
buffer = (uint8_t *) ompi_malloc(ctrl_alloc_len + ctrl->ctc_info_len);
|
||||
if (0 == buffer) {
|
||||
return 0;
|
||||
}
|
||||
lam_ctc_pack_buffer(ctrl, buffer, len);
|
||||
ompi_ctc_pack_buffer(ctrl, buffer, len);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
lam_ct_ctrl_t *lam_ctc_unpack(uint8_t *buffer)
|
||||
ompi_ct_ctrl_t *ompi_ctc_unpack(uint8_t *buffer)
|
||||
{
|
||||
lam_ct_ctrl_t *ctrl;
|
||||
ompi_ct_ctrl_t *ctrl;
|
||||
|
||||
/* ASSERT: packed control struct looks like
|
||||
<ctc_is_user_msg (uint16_t)><ctc_routing_type (uint16_t)>
|
||||
@ -90,13 +90,13 @@ lam_ct_ctrl_t *lam_ctc_unpack(uint8_t *buffer)
|
||||
<ctc_forwarding (uint32_t)><ctc_client_tag (uint32_t)>
|
||||
<ctc_info_len (uint32_t)><ctc_info (uint8_t *)>
|
||||
*/
|
||||
ctrl = OBJ_NEW(lam_ct_ctrl_t);
|
||||
ctrl = OBJ_NEW(ompi_ct_ctrl_t);
|
||||
if (0 == ctrl) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(&(ctrl->ctc_is_user_msg), buffer, ctrl_alloc_len);
|
||||
ctrl->ctc_info = (uint8_t *) lam_malloc(ctrl->ctc_info_len);
|
||||
ctrl->ctc_info = (uint8_t *) ompi_malloc(ctrl->ctc_info_len);
|
||||
if (0 == ctrl->ctc_info) {
|
||||
OBJ_RELEASE(ctrl);
|
||||
return 0;
|
||||
@ -108,7 +108,7 @@ lam_ct_ctrl_t *lam_ctc_unpack(uint8_t *buffer)
|
||||
|
||||
|
||||
|
||||
int lam_ctc_pack_buffer(lam_ct_ctrl_t *ctrl, uint8_t *buffer,
|
||||
int ompi_ctc_pack_buffer(ompi_ct_ctrl_t *ctrl, uint8_t *buffer,
|
||||
uint32_t *len)
|
||||
{
|
||||
int ret = 0;
|
||||
@ -122,7 +122,7 @@ int lam_ctc_pack_buffer(lam_ct_ctrl_t *ctrl, uint8_t *buffer,
|
||||
|
||||
|
||||
|
||||
int lam_ctc_unpack_buffer(lam_ct_ctrl_t *ctrl, uint8_t *buffer,
|
||||
int ompi_ctc_unpack_buffer(ompi_ct_ctrl_t *ctrl, uint8_t *buffer,
|
||||
uint32_t *len)
|
||||
{
|
||||
int ret = 0;
|
||||
@ -137,47 +137,47 @@ int lam_ctc_unpack_buffer(lam_ct_ctrl_t *ctrl, uint8_t *buffer,
|
||||
* control struct.
|
||||
*/
|
||||
|
||||
uint16_t lam_pk_ctc_is_user_msg(uint8_t *buffer)
|
||||
uint16_t ompi_pk_ctc_is_user_msg(uint8_t *buffer)
|
||||
{
|
||||
return *((uint16_t *) buffer);
|
||||
}
|
||||
|
||||
uint16_t lam_pk_ctc_get_routing_type(uint8_t *buffer)
|
||||
uint16_t ompi_pk_ctc_get_routing_type(uint8_t *buffer)
|
||||
{
|
||||
return *(uint16_t *) (buffer + sizeof(uint16_t));
|
||||
}
|
||||
|
||||
uint32_t lam_pk_ctc_get_sender(uint8_t *buffer)
|
||||
uint32_t ompi_pk_ctc_get_sender(uint8_t *buffer)
|
||||
{
|
||||
return *(uint32_t *) (buffer + 2 * sizeof(uint16_t));
|
||||
}
|
||||
|
||||
uint32_t lam_pkctc_get_dest(uint8_t *buffer)
|
||||
uint32_t ompi_pkctc_get_dest(uint8_t *buffer)
|
||||
{
|
||||
return *(uint32_t *) (buffer + 2 * sizeof(uint16_t) +
|
||||
sizeof(uint32_t));
|
||||
}
|
||||
|
||||
uint32_t lam_pk_ctc_get_forwarding(uint8_t *buffer)
|
||||
uint32_t ompi_pk_ctc_get_forwarding(uint8_t *buffer)
|
||||
{
|
||||
return *(uint32_t *) (buffer + 2 * sizeof(uint16_t)
|
||||
+ 2 * sizeof(uint32_t));
|
||||
}
|
||||
|
||||
void lam_pk_ctc_set_forwarding(uint8_t *buffer, uint32_t node)
|
||||
void ompi_pk_ctc_set_forwarding(uint8_t *buffer, uint32_t node)
|
||||
{
|
||||
memcpy(buffer + 2 * sizeof(uint16_t) + 2 * sizeof(uint32_t),
|
||||
&node, sizeof(node));
|
||||
}
|
||||
|
||||
uint8_t *lam_pk_ctc_get_info(uint8_t *buffer, uint32_t *len)
|
||||
uint8_t *ompi_pk_ctc_get_info(uint8_t *buffer, uint32_t *len)
|
||||
{
|
||||
memcpy(len, buffer + ctrl_alloc_len - sizeof(uint32_t),
|
||||
sizeof(uint32_t));
|
||||
return buffer + ctrl_alloc_len;
|
||||
}
|
||||
|
||||
void lam_pk_ctc_set_info(uint8_t *buffer, uint8_t *info)
|
||||
void ompi_pk_ctc_set_info(uint8_t *buffer, uint8_t *info)
|
||||
{
|
||||
uint32_t len;
|
||||
|
||||
@ -194,36 +194,36 @@ void lam_pk_ctc_set_info(uint8_t *buffer, uint8_t *info)
|
||||
*/
|
||||
|
||||
|
||||
void lam_ctm_construct(lam_ctmsg_t *msg)
|
||||
void ompi_ctm_construct(ompi_ctmsg_t *msg)
|
||||
{
|
||||
msg->ctm_ctrl = OBJ_NEW(lam_ct_ctrl_t);
|
||||
msg->ctm_ctrl = OBJ_NEW(ompi_ct_ctrl_t);
|
||||
msg->ctm_len = 0;
|
||||
msg->ctm_data = 0;
|
||||
msg->ctm_should_free = 1;
|
||||
}
|
||||
|
||||
void lam_ctm_destruct(lam_ctmsg_t *msg)
|
||||
void ompi_ctm_destruct(ompi_ctmsg_t *msg)
|
||||
{
|
||||
if (msg->ctm_should_free) {
|
||||
lam_free(msg->ctm_data);
|
||||
ompi_free(msg->ctm_data);
|
||||
}
|
||||
OBJECT_RELEASE(msg->ctm_ctrl);
|
||||
}
|
||||
|
||||
lam_ctmsg_t *lam_ctm_create_with(int is_user_msg, int routing_type,
|
||||
ompi_ctmsg_t *ompi_ctm_create_with(int is_user_msg, int routing_type,
|
||||
uint32_t sender,
|
||||
uint32_t dest, uint8_t *data,
|
||||
uint32_t data_len, int should_free)
|
||||
{
|
||||
lam_ctmsg_t *msg;
|
||||
ompi_ctmsg_t *msg;
|
||||
|
||||
msg = OBJ_NEW(lam_ctmsg_t);
|
||||
msg = OBJ_NEW(ompi_ctmsg_t);
|
||||
if (0 == msg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
OBJ_CONSTRUCT(&msg->ctm_ctrl, lam_ct_ctrl_t);
|
||||
lam_ctc_construct_with(&(msg->ctm_ctrl), sender, dest);
|
||||
OBJ_CONSTRUCT(&msg->ctm_ctrl, ompi_ct_ctrl_t);
|
||||
ompi_ctc_construct_with(&(msg->ctm_ctrl), sender, dest);
|
||||
msg->ctm_should_free = should_free;
|
||||
msg->ctm_data = data;
|
||||
msg->ctm_len = data_len;
|
||||
@ -231,7 +231,7 @@ lam_ctmsg_t *lam_ctm_create_with(int is_user_msg, int routing_type,
|
||||
return msg;
|
||||
}
|
||||
|
||||
uint8_t *lam_ctm_pack(lam_ctmsg_t *msg)
|
||||
uint8_t *ompi_ctm_pack(ompi_ctmsg_t *msg)
|
||||
{
|
||||
/* packed msg layout
|
||||
<msg len (uint32_t)><packed ctrl><data len (uint32_t)>
|
||||
@ -242,7 +242,7 @@ uint8_t *lam_ctm_pack(lam_ctmsg_t *msg)
|
||||
|
||||
}
|
||||
|
||||
lam_ctmsg_t *lam_ctm_unpack(uint8_t *buffer)
|
||||
ompi_ctmsg_t *ompi_ctm_unpack(uint8_t *buffer)
|
||||
{
|
||||
/* packed msg layout
|
||||
<msg len (uint32_t)><packed ctrl><data len (uint32_t)>
|
||||
@ -256,12 +256,12 @@ lam_ctmsg_t *lam_ctm_unpack(uint8_t *buffer)
|
||||
* msg struct.
|
||||
*/
|
||||
|
||||
uint8_t *lam_pk_ctm_get_control(uint8_t *buffer)
|
||||
uint8_t *ompi_pk_ctm_get_control(uint8_t *buffer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
uint8_t *lam_pk_ctm_get_data(uint8_t *buffer, uint32_t *len)
|
||||
uint8_t *ompi_pk_ctm_get_data(uint8_t *buffer, uint32_t *len)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_CT_MESSAGE_H
|
||||
#define LAM_CT_MESSAGE_H
|
||||
#ifndef OMPI_CT_MESSAGE_H
|
||||
#define OMPI_CT_MESSAGE_H
|
||||
|
||||
#include "lfc/lam_object.h"
|
||||
#include "class/ompi_object.h"
|
||||
|
||||
|
||||
/*
|
||||
@ -14,8 +14,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
extern lam_class_t lam_ct_ctrl_t_class;
|
||||
extern lam_class_t lam_ctmsg_t_class;
|
||||
extern ompi_class_t ompi_ct_ctrl_t_class;
|
||||
extern ompi_class_t ompi_ctmsg_t_class;
|
||||
|
||||
/*
|
||||
*
|
||||
@ -34,10 +34,10 @@ extern lam_class_t lam_ctmsg_t_class;
|
||||
|
||||
enum
|
||||
{
|
||||
LAM_CT_BCAST = 1,
|
||||
LAM_CT_ALLGATHER,
|
||||
LAM_CT_SCATTER,
|
||||
LAM_CT_PT2PT
|
||||
OMPI_CT_BCAST = 1,
|
||||
OMPI_CT_ALLGATHER,
|
||||
OMPI_CT_SCATTER,
|
||||
OMPI_CT_PT2PT
|
||||
};
|
||||
|
||||
/*
|
||||
@ -48,9 +48,9 @@ enum
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct lam_ct_ctrl
|
||||
typedef struct ompi_ct_ctrl
|
||||
{
|
||||
lam_object_t super;
|
||||
ompi_object_t super;
|
||||
uint16_t ctc_is_user_msg; /* 1 -> msg is for user app. */
|
||||
uint16_t ctc_routing_type; /* broadcast, scatter, pt2pt, etc. */
|
||||
uint32_t ctc_sender; /* node that initiated send. */
|
||||
@ -59,110 +59,110 @@ typedef struct lam_ct_ctrl
|
||||
uint32_t ctc_client_tag; /* tag if client sent msg. */
|
||||
uint32_t ctc_info_len;
|
||||
uint8_t *ctc_info;
|
||||
} lam_ct_ctrl_t;
|
||||
} ompi_ct_ctrl_t;
|
||||
|
||||
|
||||
void lam_ctc_construct(lam_ct_ctrl_t *ctrl);
|
||||
void lam_ctc_destruct(lam_ct_ctrl_t *ctrl);
|
||||
void ompi_ctc_construct(ompi_ct_ctrl_t *ctrl);
|
||||
void ompi_ctc_destruct(ompi_ct_ctrl_t *ctrl);
|
||||
|
||||
void lam_ctc_construct_with(lam_ct_ctrl_t *ctrl, int routing_type,
|
||||
void ompi_ctc_construct_with(ompi_ct_ctrl_t *ctrl, int routing_type,
|
||||
uint32_t sender,
|
||||
uint32_t dest);
|
||||
|
||||
uint32_t lam_ctc_pack_size(lam_ct_ctrl_t *ctrl);
|
||||
uint8_t *lam_ctc_pack(lam_ct_ctrl_t *ctrl, uint32_t *len);
|
||||
lam_ct_ctrl_t *lam_ctc_unpack(uint8_t *buffer);
|
||||
uint32_t ompi_ctc_pack_size(ompi_ct_ctrl_t *ctrl);
|
||||
uint8_t *ompi_ctc_pack(ompi_ct_ctrl_t *ctrl, uint32_t *len);
|
||||
ompi_ct_ctrl_t *ompi_ctc_unpack(uint8_t *buffer);
|
||||
|
||||
int lam_ctc_pack_buffer(lam_ct_ctrl_t *ctrl, uint8_t *buffer, uint32_t *len);
|
||||
int lam_ctc_unpack_buffer(lam_ct_ctrl_t *ctrl, uint8_t *buffer, uint32_t *len);
|
||||
int ompi_ctc_pack_buffer(ompi_ct_ctrl_t *ctrl, uint8_t *buffer, uint32_t *len);
|
||||
int ompi_ctc_unpack_buffer(ompi_ct_ctrl_t *ctrl, uint8_t *buffer, uint32_t *len);
|
||||
|
||||
/*
|
||||
* Functions for accessing data in packed
|
||||
* control struct.
|
||||
*/
|
||||
|
||||
uint16_t lam_pk_ctc_is_user_msg(uint8_t *buffer);
|
||||
uint16_t ompi_pk_ctc_is_user_msg(uint8_t *buffer);
|
||||
|
||||
uint16_t lam_pk_ctc_get_routing_type(uint8_t *buffer);
|
||||
uint16_t ompi_pk_ctc_get_routing_type(uint8_t *buffer);
|
||||
|
||||
uint32_t lam_pk_ctc_get_sender(uint8_t *buffer);
|
||||
uint32_t ompi_pk_ctc_get_sender(uint8_t *buffer);
|
||||
|
||||
uint32_t lam_pk_ctc_get_dest(uint8_t *buffer);
|
||||
uint32_t ompi_pk_ctc_get_dest(uint8_t *buffer);
|
||||
|
||||
uint32_t lam_pk_ctc_get_forwarding(uint8_t *buffer);
|
||||
void lam_pk_ctc_set_forwarding(uint8_t *buffer, uint32_t node);
|
||||
uint32_t ompi_pk_ctc_get_forwarding(uint8_t *buffer);
|
||||
void ompi_pk_ctc_set_forwarding(uint8_t *buffer, uint32_t node);
|
||||
|
||||
uint8_t *lam_pk_ctc_get_info(uint8_t *buffer, uint32_t *len);
|
||||
void lam_pk_ctc_set_info(uint8_t *buffer, uint8_t *info);
|
||||
uint8_t *ompi_pk_ctc_get_info(uint8_t *buffer, uint32_t *len);
|
||||
void ompi_pk_ctc_set_info(uint8_t *buffer, uint8_t *info);
|
||||
|
||||
/*
|
||||
* Accessor functions
|
||||
*/
|
||||
|
||||
bool lam_ctc_get_is_user_msg(lam_ct_ctrl_t *ctrl);
|
||||
inline bool lam_ctc_get_is_user_msg(lam_ct_ctrl_t *ctrl)
|
||||
bool ompi_ctc_get_is_user_msg(ompi_ct_ctrl_t *ctrl);
|
||||
inline bool ompi_ctc_get_is_user_msg(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
return ctrl->ctc_is_user_msg;
|
||||
}
|
||||
void lam_ctc_set_is_user_msg(lam_ct_ctrl_t *ctrl, bool yn);
|
||||
inline void lam_ctc_set_is_user_msg(lam_ct_ctrl_t *ctrl, bool yn)
|
||||
void ompi_ctc_set_is_user_msg(ompi_ct_ctrl_t *ctrl, bool yn);
|
||||
inline void ompi_ctc_set_is_user_msg(ompi_ct_ctrl_t *ctrl, bool yn)
|
||||
{
|
||||
ctrl->ctc_is_user_msg = yn;
|
||||
}
|
||||
|
||||
uint16_t lam_ctc_get_routing_type(lam_ct_ctrl_t *ctrl);
|
||||
inline uint16_t lam_ctc_get_routing_type(lam_ct_ctrl_t *ctrl)
|
||||
uint16_t ompi_ctc_get_routing_type(ompi_ct_ctrl_t *ctrl);
|
||||
inline uint16_t ompi_ctc_get_routing_type(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
return ctrl->ctc_routing_type;
|
||||
}
|
||||
void lam_ctc_set_routing_type(lam_ct_ctrl_t *ctrl, int rtype);
|
||||
inline void lam_ctc_set_routing_type(lam_ct_ctrl_t *ctrl, int rtype)
|
||||
void ompi_ctc_set_routing_type(ompi_ct_ctrl_t *ctrl, int rtype);
|
||||
inline void ompi_ctc_set_routing_type(ompi_ct_ctrl_t *ctrl, int rtype)
|
||||
{
|
||||
ctrl->ctc_routing_type = rtype;
|
||||
}
|
||||
|
||||
uint32_t lam_ctc_get_sender(lam_ct_ctrl_t *ctrl);
|
||||
inline uint32_t lam_ctc_get_sender(lam_ct_ctrl_t *ctrl)
|
||||
uint32_t ompi_ctc_get_sender(ompi_ct_ctrl_t *ctrl);
|
||||
inline uint32_t ompi_ctc_get_sender(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
return ctrl->ctc_sender;
|
||||
}
|
||||
void lam_ctc_set_sender(lam_ct_ctrl_t *ctrl, uint32_t sender);
|
||||
inline void lam_ctc_set_sender(lam_ct_ctrl_t *ctrl, uint32_t sender)
|
||||
void ompi_ctc_set_sender(ompi_ct_ctrl_t *ctrl, uint32_t sender);
|
||||
inline void ompi_ctc_set_sender(ompi_ct_ctrl_t *ctrl, uint32_t sender)
|
||||
{
|
||||
ctrl->ctc_sender = sender;
|
||||
}
|
||||
|
||||
uint32_t lam_ctc_get_dest(lam_ct_ctrl_t *ctrl);
|
||||
inline uint32_t lam_ctc_get_dest(lam_ct_ctrl_t *ctrl)
|
||||
uint32_t ompi_ctc_get_dest(ompi_ct_ctrl_t *ctrl);
|
||||
inline uint32_t ompi_ctc_get_dest(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
return ctrl->ctc_dest;
|
||||
}
|
||||
void lam_ctc_set_dest(lam_ct_ctrl_t *ctrl, uint32_t dest);
|
||||
inline void lam_ctc_set_dest(lam_ct_ctrl_t *ctrl, uint32_t dest)
|
||||
void ompi_ctc_set_dest(ompi_ct_ctrl_t *ctrl, uint32_t dest);
|
||||
inline void ompi_ctc_set_dest(ompi_ct_ctrl_t *ctrl, uint32_t dest)
|
||||
{
|
||||
ctrl->ctc_dest = dest;
|
||||
}
|
||||
|
||||
uint32_t lam_ctc_get_forwarding(lam_ct_ctrl_t *ctrl);
|
||||
inline uint32_t lam_ctc_get_forwarding(lam_ct_ctrl_t *ctrl)
|
||||
uint32_t ompi_ctc_get_forwarding(ompi_ct_ctrl_t *ctrl);
|
||||
inline uint32_t ompi_ctc_get_forwarding(ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
return ctrl->ctc_forwarding;
|
||||
}
|
||||
void lam_ctc_set_forwarding(lam_ct_ctrl_t *ctrl, uint32_t node);
|
||||
inline void lam_ctc_set_forwarding(lam_ct_ctrl_t *ctrl, uint32_t node)
|
||||
void ompi_ctc_set_forwarding(ompi_ct_ctrl_t *ctrl, uint32_t node);
|
||||
inline void ompi_ctc_set_forwarding(ompi_ct_ctrl_t *ctrl, uint32_t node)
|
||||
{
|
||||
ctrl->ctc_forwarding = node;
|
||||
}
|
||||
|
||||
uint8_t *lam_ctc_get_info(lam_ct_ctrl_t *ctrl, uint32_t *len);
|
||||
inline uint8_t *lam_ctc_get_info(lam_ct_ctrl_t *ctrl, uint32_t *len)
|
||||
uint8_t *ompi_ctc_get_info(ompi_ct_ctrl_t *ctrl, uint32_t *len);
|
||||
inline uint8_t *ompi_ctc_get_info(ompi_ct_ctrl_t *ctrl, uint32_t *len)
|
||||
{
|
||||
*len = ctrl->ctc_info_len;
|
||||
return ctrl->ctc_info;
|
||||
}
|
||||
|
||||
void lam_ctc_set_info(lam_ct_ctrl_t *ctrl, uint32_t len, uint8_t *info);
|
||||
inline void lam_ctc_set_info(lam_ct_ctrl_t *ctrl, uint32_t len, uint8_t *info)
|
||||
void ompi_ctc_set_info(ompi_ct_ctrl_t *ctrl, uint32_t len, uint8_t *info);
|
||||
inline void ompi_ctc_set_info(ompi_ct_ctrl_t *ctrl, uint32_t len, uint8_t *info)
|
||||
{
|
||||
ctrl->ctc_info_len = len;
|
||||
ctrl->ctc_info = info;
|
||||
@ -177,35 +177,35 @@ inline void lam_ctc_set_info(lam_ct_ctrl_t *ctrl, uint32_t len, uint8_t *info)
|
||||
*/
|
||||
|
||||
|
||||
typedef struct lam_ctmsg
|
||||
typedef struct ompi_ctmsg
|
||||
{
|
||||
lam_object_t super;
|
||||
lam_ct_ctrl_t *ctm_ctrl;
|
||||
ompi_object_t super;
|
||||
ompi_ct_ctrl_t *ctm_ctrl;
|
||||
uint32_t ctm_len;
|
||||
uint8_t *ctm_data;
|
||||
int ctm_should_free;
|
||||
} lam_ctmsg_t;
|
||||
} ompi_ctmsg_t;
|
||||
|
||||
|
||||
void lam_ctm_construct(lam_ctmsg_t *msg);
|
||||
void lam_ctm_destruct(lam_ctmsg_t *msg);
|
||||
void ompi_ctm_construct(ompi_ctmsg_t *msg);
|
||||
void ompi_ctm_destruct(ompi_ctmsg_t *msg);
|
||||
|
||||
lam_ctmsg_t *lam_ctm_create_with(int is_user_msg, int routing_type,
|
||||
ompi_ctmsg_t *ompi_ctm_create_with(int is_user_msg, int routing_type,
|
||||
uint32_t sender,
|
||||
uint32_t dest, uint8_t *data,
|
||||
uint32_t data_len,
|
||||
int should_free);
|
||||
|
||||
uint8_t *lam_ctm_pack(lam_ctmsg_t *msg);
|
||||
lam_ctmsg_t *lam_ctm_unpack(uint8_t *buffer);
|
||||
uint8_t *ompi_ctm_pack(ompi_ctmsg_t *msg);
|
||||
ompi_ctmsg_t *ompi_ctm_unpack(uint8_t *buffer);
|
||||
|
||||
/*
|
||||
* Functions for accessing data in packed
|
||||
* msg struct.
|
||||
*/
|
||||
|
||||
uint8_t *lam_pk_ctm_get_control(uint8_t *buffer);
|
||||
uint8_t *lam_pk_ctm_get_data(uint8_t *buffer, uint32_t *len);
|
||||
uint8_t *ompi_pk_ctm_get_control(uint8_t *buffer);
|
||||
uint8_t *ompi_pk_ctm_get_data(uint8_t *buffer, uint32_t *len);
|
||||
|
||||
/*
|
||||
*
|
||||
@ -213,16 +213,16 @@ uint8_t *lam_pk_ctm_get_data(uint8_t *buffer, uint32_t *len);
|
||||
*
|
||||
*/
|
||||
|
||||
lam_ct_ctrl_t *lam_ctm_get_control(lam_ctmsg_t *msg);
|
||||
inline lam_ct_ctrl_t *lam_ctm_get_control(lam_ctmsg_t *msg)
|
||||
ompi_ct_ctrl_t *ompi_ctm_get_control(ompi_ctmsg_t *msg);
|
||||
inline ompi_ct_ctrl_t *ompi_ctm_get_control(ompi_ctmsg_t *msg)
|
||||
{
|
||||
return msg->ctm_ctrl;
|
||||
}
|
||||
void lam_ctm_set_control(lam_ctmsg_t *msg, lam_ct_ctrl_t *ctrl);
|
||||
inline void lam_ctm_set_control(lam_ctmsg_t *msg, lam_ct_ctrl_t *ctrl)
|
||||
void ompi_ctm_set_control(ompi_ctmsg_t *msg, ompi_ct_ctrl_t *ctrl);
|
||||
inline void ompi_ctm_set_control(ompi_ctmsg_t *msg, ompi_ct_ctrl_t *ctrl)
|
||||
{
|
||||
msg->ctm_ctrl = ctrl;
|
||||
}
|
||||
|
||||
|
||||
#endif /* LAM_CT_MESSAGE_H */
|
||||
#endif /* OMPI_CT_MESSAGE_H */
|
||||
|
@ -2,11 +2,11 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_CT_NODE_H
|
||||
#define LAM_CT_NODE_H
|
||||
#ifndef OMPI_CT_NODE_H
|
||||
#define OMPI_CT_NODE_H
|
||||
|
||||
#include "lfc/lam_object.h"
|
||||
#include "lfc/hash_table.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "class/hash_table.h"
|
||||
|
||||
|
||||
/*
|
||||
@ -15,19 +15,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define CTNODE(obj) (lam_ctnode_t *)(obj)
|
||||
#define CTNODE(obj) (ompi_ctnode_t *)(obj)
|
||||
|
||||
struct lam_ctnode;
|
||||
struct ompi_ctnode;
|
||||
|
||||
typedef uint32_t (*lam_ctl_label_for_link_fn_t)(struct lam_ctnode *, uint32_t);
|
||||
typedef char *(*lam_ctl_isa_neighbor_fn_t)(struct lam_ctnode *, uint32_t);
|
||||
typedef uint32_t (*ompi_ctl_label_for_link_fn_t)(struct ompi_ctnode *, uint32_t);
|
||||
typedef char *(*ompi_ctl_isa_neighbor_fn_t)(struct ompi_ctnode *, uint32_t);
|
||||
|
||||
typedef struct lam_ctnode_class
|
||||
typedef struct ompi_ctnode_class
|
||||
{
|
||||
lam_class_t super;
|
||||
lam_ctl_label_for_link_fn_t *ctl_label_for_link;
|
||||
lam_ctl_isa_neighbor_fn_t *ctl_isa_neighbor;
|
||||
} lam_ctnode_class_t;
|
||||
ompi_class_t super;
|
||||
ompi_ctl_label_for_link_fn_t *ctl_label_for_link;
|
||||
ompi_ctl_isa_neighbor_fn_t *ctl_isa_neighbor;
|
||||
} ompi_ctnode_class_t;
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ typedef struct lam_ctnode_class
|
||||
*/
|
||||
|
||||
|
||||
extern lam_ctnode_class_t hypercube_t_class;
|
||||
extern ompi_ctnode_class_t hypercube_t_class;
|
||||
|
||||
|
||||
|
||||
@ -51,20 +51,20 @@ extern lam_ctnode_class_t hypercube_t_class;
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct lam_ctnode
|
||||
typedef struct ompi_ctnode
|
||||
{
|
||||
lam_object_t super;
|
||||
ompi_object_t super;
|
||||
uint32_t ctn_label;
|
||||
uint32_t ctn_num_nodes; /* total # of nodes in network */
|
||||
void *ctn_user_info;
|
||||
lam_fast_hash_t ctn_neighbors;
|
||||
lam_fast_hash_t ctn_scatter_cache;
|
||||
lam_fast_hash_t ctn_bcast_cache;
|
||||
} lam_ctnode_t;
|
||||
ompi_fast_hash_t ctn_neighbors;
|
||||
ompi_fast_hash_t ctn_scatter_cache;
|
||||
ompi_fast_hash_t ctn_bcast_cache;
|
||||
} ompi_ctnode_t;
|
||||
|
||||
|
||||
void lam_ctn_construct(lam_ctnode_t *node);
|
||||
void lam_ctn_destruct(lam_ctnode_t *node);
|
||||
void ompi_ctn_construct(ompi_ctnode_t *node);
|
||||
void ompi_ctn_destruct(ompi_ctnode_t *node);
|
||||
|
||||
/*
|
||||
*
|
||||
@ -72,13 +72,13 @@ void lam_ctn_destruct(lam_ctnode_t *node);
|
||||
*
|
||||
*/
|
||||
|
||||
void *lam_ctn_get_neighbor(lam_ctnode_t *node, uint32_t neighbor_label);
|
||||
void *ompi_ctn_get_neighbor(ompi_ctnode_t *node, uint32_t neighbor_label);
|
||||
/*
|
||||
PRE: neighbor_label is the label of the node's neighbor
|
||||
POST: returns a pointer to the node's neighbor
|
||||
*/
|
||||
|
||||
void lam_ctn_set_neighbor(lam_ctnode_t *node, uint32_t label, void *neighbor);
|
||||
void ompi_ctn_set_neighbor(ompi_ctnode_t *node, uint32_t label, void *neighbor);
|
||||
/*
|
||||
PRE: label represents the label for a valid neighbor.
|
||||
POST: Adds a link to a neighbor with specified label.
|
||||
@ -91,11 +91,11 @@ void lam_ctn_set_neighbor(lam_ctnode_t *node, uint32_t label, void *neighbor);
|
||||
*
|
||||
*/
|
||||
|
||||
inline uint32_t lam_ctn_get_label(lam_ctnode_t *node) {return node->ctn_label;}
|
||||
inline void lam_ctn_set_label(lam_ctnode_t *node, uint32_t label)
|
||||
inline uint32_t ompi_ctn_get_label(ompi_ctnode_t *node) {return node->ctn_label;}
|
||||
inline void ompi_ctn_set_label(ompi_ctnode_t *node, uint32_t label)
|
||||
{node->ctn_label = label;}
|
||||
|
||||
inline uint32_t lam_ctn_get_num_nodes(lam_ctnode_t *node) {return node->ctn_num_nodes;}
|
||||
inline uint32_t ompi_ctn_get_num_nodes(ompi_ctnode_t *node) {return node->ctn_num_nodes;}
|
||||
|
||||
|
||||
/*
|
||||
@ -105,7 +105,7 @@ inline uint32_t lam_ctn_get_num_nodes(lam_ctnode_t *node) {return node->ctn_num_
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_ctn_isa_neighbor(lam_ctnode_t *node, uint32_t label);
|
||||
int ompi_ctn_isa_neighbor(ompi_ctnode_t *node, uint32_t label);
|
||||
/*
|
||||
POST: returns 1 if a node with specified label is a label for
|
||||
a neighbor node. This does not imply that the get_neighbor() function
|
||||
@ -114,7 +114,7 @@ int lam_ctn_isa_neighbor(lam_ctnode_t *node, uint32_t label);
|
||||
*/
|
||||
|
||||
|
||||
uint32_t lam_ctn_label_for_link(lam_ctnode_t *node, uint32_t link);
|
||||
uint32_t ompi_ctn_label_for_link(ompi_ctnode_t *node, uint32_t link);
|
||||
/*
|
||||
PRE: The graph edges connecting node to its neighbors are oriented
|
||||
so that the links (edges) are numbered starting from 1.
|
||||
@ -131,7 +131,7 @@ uint32_t lam_ctn_label_for_link(lam_ctnode_t *node, uint32_t link);
|
||||
*/
|
||||
|
||||
|
||||
char *lam_ctn_initial_control_data(lam_ctnode_t *node, uint32_t *ctrl_size);
|
||||
char *ompi_ctn_initial_control_data(ompi_ctnode_t *node, uint32_t *ctrl_size);
|
||||
/*
|
||||
POST: Returns pointer to byte array for control data for routing
|
||||
messages. The length of the control array is stored in
|
||||
@ -146,12 +146,12 @@ char *lam_ctn_initial_control_data(lam_ctnode_t *node, uint32_t *ctrl_size);
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct lam_hcube
|
||||
typedef struct ompi_hcube
|
||||
{
|
||||
lam_ctnode_t super;
|
||||
ompi_ctnode_t super;
|
||||
unsigned int hc_hsize; /* hc_hsize = log2(# nodes in network) */
|
||||
} lam_hcube_t;
|
||||
} ompi_hcube_t;
|
||||
|
||||
extern lam_class_t hcube_t_class;
|
||||
extern ompi_class_t hcube_t_class;
|
||||
|
||||
#endif /* LAM_CT_NODE_H */
|
||||
#endif /* OMPI_CT_NODE_H */
|
||||
|
@ -2,9 +2,9 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_CT_PEER_H
|
||||
#define LAM_CT_PEER_H
|
||||
#ifndef OMPI_CT_PEER_H
|
||||
#define OMPI_CT_PEER_H
|
||||
|
||||
#include "lfc/lam_object.h"
|
||||
#include "class/ompi_object.h"
|
||||
|
||||
#endif /* LAM_CT_PEER_H */
|
||||
#endif /* OMPI_CT_PEER_H */
|
||||
|
@ -20,8 +20,8 @@ libdatatype_la_SOURCES = \
|
||||
# Conditionally install the header files
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
lamdir = $(includedir)/lam/datatype
|
||||
lam_HEADERS = $(headers)
|
||||
ompidir = $(includedir)/ompi/datatype
|
||||
ompi_HEADERS = $(headers)
|
||||
else
|
||||
lamdir = $(includedir)
|
||||
ompidir = $(includedir)
|
||||
endif
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
|
||||
/**
|
||||
* lam_datatype_t interface for LAM internal data type representation
|
||||
* ompi_datatype_t interface for OMPI internal data type representation
|
||||
*
|
||||
* lam_datatype_t is a class which represents contiguous or
|
||||
* ompi_datatype_t is a class which represents contiguous or
|
||||
* non-contiguous data together with constituent type-related
|
||||
* information.
|
||||
*/
|
||||
@ -11,15 +11,15 @@
|
||||
#ifndef DATATYPE_H_HAS_BEEN_INCLUDED
|
||||
#define DATATYPE_H_HAS_BEEN_INCLUDED
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/uio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include "include/constants.h"
|
||||
#include "errhandler/errhandler.h"
|
||||
#include "lfc/lam_object.h"
|
||||
#include "lfc/lam_hash_table.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "class/ompi_hash_table.h"
|
||||
#include "mpi.h"
|
||||
|
||||
/* if there are more basic datatypes than the number of bytes in the int type
|
||||
@ -48,8 +48,8 @@ typedef struct __dt_struct_desc {
|
||||
|
||||
/* the data description.
|
||||
*/
|
||||
typedef struct lam_datatype_t {
|
||||
lam_object_t super; /**< basic superclass */
|
||||
typedef struct ompi_datatype_t {
|
||||
ompi_object_t super; /**< basic superclass */
|
||||
u_int32_t size; /**< total size in bytes of the memory used by the data if
|
||||
* the data is put on a contiguous buffer */
|
||||
long true_lb;
|
||||
@ -63,7 +63,7 @@ typedef struct lam_datatype_t {
|
||||
u_int64_t bdt_used; /**< which basic datatypes are used in the data description */
|
||||
|
||||
/* Attribute fields */
|
||||
lam_hash_table_t *d_keyhash;
|
||||
ompi_hash_table_t *d_keyhash;
|
||||
char name[MPI_MAX_OBJECT_NAME];
|
||||
dt_type_desc_t desc; /**< the data description */
|
||||
dt_type_desc_t opt_desc; /**< short description of the data used when conversion is useless
|
||||
@ -73,61 +73,61 @@ typedef struct lam_datatype_t {
|
||||
/* basic elements count used to compute the size of the datatype for
|
||||
* remote nodes */
|
||||
u_int32_t btypes[DT_MAX_PREDEFINED];
|
||||
} dt_desc_t, lam_datatype_t;
|
||||
} dt_desc_t, ompi_datatype_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION( lam_datatype_t );
|
||||
OBJ_CLASS_DECLARATION( ompi_datatype_t );
|
||||
|
||||
int lam_ddt_init( void );
|
||||
int lam_ddt_finalize( void );
|
||||
dt_desc_t* lam_ddt_create( int expectedSize );
|
||||
int lam_ddt_commit( dt_desc_t** );
|
||||
int lam_ddt_destroy( dt_desc_t** );
|
||||
void lam_ddt_dump( dt_desc_t* pData );
|
||||
void lam_ddt_dump_complete( dt_desc_t* pData );
|
||||
int ompi_ddt_init( void );
|
||||
int ompi_ddt_finalize( void );
|
||||
dt_desc_t* ompi_ddt_create( int expectedSize );
|
||||
int ompi_ddt_commit( dt_desc_t** );
|
||||
int ompi_ddt_destroy( dt_desc_t** );
|
||||
void ompi_ddt_dump( dt_desc_t* pData );
|
||||
void ompi_ddt_dump_complete( dt_desc_t* pData );
|
||||
/* data creation functions */
|
||||
int lam_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_contiguous( int count, dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_vector( int count, int bLength, long stride,
|
||||
int ompi_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int ompi_ddt_create_contiguous( int count, dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int ompi_ddt_create_vector( int count, int bLength, long stride,
|
||||
dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_hvector( int count, int bLength, long stride,
|
||||
int ompi_ddt_create_hvector( int count, int bLength, long stride,
|
||||
dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_indexed( int count, int* pBlockLength, int* pDisp,
|
||||
int ompi_ddt_create_indexed( int count, int* pBlockLength, int* pDisp,
|
||||
dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_hindexed( int count, int* pBlockLength, long* pDisp,
|
||||
int ompi_ddt_create_hindexed( int count, int* pBlockLength, long* pDisp,
|
||||
dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_indexed_block( int count, int bLength, int* pDisp,
|
||||
int ompi_ddt_create_indexed_block( int count, int bLength, int* pDisp,
|
||||
dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
||||
int ompi_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
||||
dt_desc_t** pTypes, dt_desc_t** newType );
|
||||
int lam_ddt_create_resized( dt_desc_t* oldType, long lb, long extent, dt_desc_t** newType );
|
||||
int lam_ddt_create_subarray( int ndims, int* pSizes, int* pSubSizes, int* pStarts,
|
||||
int ompi_ddt_create_resized( dt_desc_t* oldType, long lb, long extent, dt_desc_t** newType );
|
||||
int ompi_ddt_create_subarray( int ndims, int* pSizes, int* pSubSizes, int* pStarts,
|
||||
int order, dt_desc_t* oldType, dt_desc_t** newType );
|
||||
int lam_ddt_create_darray( int size, int rank, int ndims, int* pGSizes, int *pDistrib,
|
||||
int ompi_ddt_create_darray( int size, int rank, int ndims, int* pGSizes, int *pDistrib,
|
||||
int* pDArgs, int* pPSizes, int order, dt_desc_t* oldType,
|
||||
dt_desc_t** newType );
|
||||
|
||||
int lam_ddt_add( dt_desc_t* pdtBase, dt_desc_t* pdtNew, unsigned int count, long disp, long extent );
|
||||
int ompi_ddt_add( dt_desc_t* pdtBase, dt_desc_t* pdtNew, unsigned int count, long disp, long extent );
|
||||
|
||||
static inline int lam_ddt_type_lb( dt_desc_t* pData, long* disp )
|
||||
static inline int ompi_ddt_type_lb( dt_desc_t* pData, long* disp )
|
||||
{ *disp = pData->lb; return 0; }
|
||||
static inline int lam_ddt_type_ub( dt_desc_t* pData, long* disp )
|
||||
static inline int ompi_ddt_type_ub( dt_desc_t* pData, long* disp )
|
||||
{ *disp = pData->ub; return 0; }
|
||||
static inline int lam_ddt_type_size ( dt_desc_t* pData, int *size )
|
||||
static inline int ompi_ddt_type_size ( dt_desc_t* pData, int *size )
|
||||
{ *size = pData->size; return 0; }
|
||||
static inline int lam_ddt_type_extent( dt_desc_t* pData, long* extent )
|
||||
static inline int ompi_ddt_type_extent( dt_desc_t* pData, long* extent )
|
||||
{ *extent = (pData->ub - pData->lb); return 0; }
|
||||
|
||||
static inline int lam_ddt_type_resize( dt_desc_t* pOld, long lb, long extent, dt_desc_t** pNew )
|
||||
static inline int ompi_ddt_type_resize( dt_desc_t* pOld, long lb, long extent, dt_desc_t** pNew )
|
||||
{ /* empty function */ return -1; }
|
||||
static inline int lam_ddt_get_extent( dt_desc_t* pData, long* lb, long* extent)
|
||||
static inline int ompi_ddt_get_extent( dt_desc_t* pData, long* lb, long* extent)
|
||||
{ *lb = pData->lb; *extent = pData->ub - pData->lb; return 0; }
|
||||
static inline int lam_ddt_get_true_extent( dt_desc_t* pData, long* true_lb, long* true_extent)
|
||||
static inline int ompi_ddt_get_true_extent( dt_desc_t* pData, long* true_lb, long* true_extent)
|
||||
{ *true_lb = pData->true_lb; *true_extent = (pData->true_ub - pData->true_lb); return 0; }
|
||||
|
||||
int lam_ddt_get_element_count( dt_desc_t* pData, int iSize );
|
||||
int lam_ddt_copy_content_same_ddt( dt_desc_t* pData, int count, char* pDestBuf, char* pSrcBuf );
|
||||
int ompi_ddt_get_element_count( dt_desc_t* pData, int iSize );
|
||||
int ompi_ddt_copy_content_same_ddt( dt_desc_t* pData, int count, char* pDestBuf, char* pSrcBuf );
|
||||
|
||||
int lam_ddt_optimize_short( dt_desc_t* pData, int count, dt_type_desc_t* pTypeDesc );
|
||||
int ompi_ddt_optimize_short( dt_desc_t* pData, int count, dt_type_desc_t* pTypeDesc );
|
||||
|
||||
/* flags for the datatypes */
|
||||
|
||||
@ -137,14 +137,14 @@ typedef int (*conversion_fct_t)( unsigned int count,
|
||||
unsigned int* used );
|
||||
|
||||
typedef struct __dt_stack dt_stack_t;
|
||||
typedef struct lam_convertor_t lam_convertor_t;
|
||||
typedef int (*convertor_advance_fct_t)( lam_convertor_t* pConvertor,
|
||||
typedef struct ompi_convertor_t ompi_convertor_t;
|
||||
typedef int (*convertor_advance_fct_t)( ompi_convertor_t* pConvertor,
|
||||
struct iovec* pInputv,
|
||||
unsigned int inputCount );
|
||||
|
||||
/* and now the convertor stuff */
|
||||
struct lam_convertor_t {
|
||||
lam_object_t super; /**< basic superclass */
|
||||
struct ompi_convertor_t {
|
||||
ompi_object_t super; /**< basic superclass */
|
||||
dt_desc_t* pDesc;
|
||||
long remoteArch;
|
||||
dt_stack_t* pStack;
|
||||
@ -161,42 +161,42 @@ struct lam_convertor_t {
|
||||
convertor_advance_fct_t fAdvance;
|
||||
conversion_fct_t* pFunctions;
|
||||
};
|
||||
OBJ_CLASS_DECLARATION( lam_convertor_t );
|
||||
OBJ_CLASS_DECLARATION( ompi_convertor_t );
|
||||
|
||||
/* some convertor flags */
|
||||
#define lam_convertor_progress( PCONV, IOVEC, COUNT ) \
|
||||
#define ompi_convertor_progress( PCONV, IOVEC, COUNT ) \
|
||||
(PCONV)->fAdvance( (PCONV), (IOVEC), (COUNT) );
|
||||
|
||||
/* and finally the convertor functions */
|
||||
lam_convertor_t* lam_convertor_create( int remote_arch, int mode );
|
||||
lam_convertor_t* lam_convertor_get_copy( lam_convertor_t* pConvertor );
|
||||
int lam_convertor_copy( lam_convertor_t* pSrcConv, lam_convertor_t* pDestConv );
|
||||
int lam_convertor_init_for_send( lam_convertor_t* pConv, unsigned int flags,
|
||||
ompi_convertor_t* ompi_convertor_create( int remote_arch, int mode );
|
||||
ompi_convertor_t* ompi_convertor_get_copy( ompi_convertor_t* pConvertor );
|
||||
int ompi_convertor_copy( ompi_convertor_t* pSrcConv, ompi_convertor_t* pDestConv );
|
||||
int ompi_convertor_init_for_send( ompi_convertor_t* pConv, unsigned int flags,
|
||||
dt_desc_t* pData, int count,
|
||||
void* pUserBuf, int local_starting_point );
|
||||
int lam_convertor_init_for_recv( lam_convertor_t* pConv, unsigned int flags,
|
||||
int ompi_convertor_init_for_recv( ompi_convertor_t* pConv, unsigned int flags,
|
||||
dt_desc_t* pData, int count,
|
||||
void* pUserBuf, int remote_starting_point );
|
||||
int lam_convertor_need_buffers( lam_convertor_t* pConvertor );
|
||||
int lam_convertor_pack( lam_convertor_t* pConv, struct iovec* in, unsigned int in_size );
|
||||
int lam_convertor_unpack( lam_convertor_t* pConv, struct iovec* out, unsigned int out_size );
|
||||
int lam_convertor_get_packed_size( lam_convertor_t* pConv, int* pSize );
|
||||
int lam_convertor_get_unpacked_size( lam_convertor_t* pConv, int* pSize );
|
||||
int lam_create_stack_with_pos( lam_convertor_t* pConv,
|
||||
int ompi_convertor_need_buffers( ompi_convertor_t* pConvertor );
|
||||
int ompi_convertor_pack( ompi_convertor_t* pConv, struct iovec* in, unsigned int in_size );
|
||||
int ompi_convertor_unpack( ompi_convertor_t* pConv, struct iovec* out, unsigned int out_size );
|
||||
int ompi_convertor_get_packed_size( ompi_convertor_t* pConv, int* pSize );
|
||||
int ompi_convertor_get_unpacked_size( ompi_convertor_t* pConv, int* pSize );
|
||||
int ompi_create_stack_with_pos( ompi_convertor_t* pConv,
|
||||
int local_starting_point,
|
||||
int* local_sizes );
|
||||
|
||||
/* temporary function prototypes. They should move in other place later. */
|
||||
int lam_ddt_get_args( dt_desc_t* pData, int which,
|
||||
int ompi_ddt_get_args( dt_desc_t* pData, int which,
|
||||
int * ci, int * i,
|
||||
int * ca, MPI_Aint * a,
|
||||
int * cd, MPI_Datatype * d, int * type);
|
||||
int lam_ddt_set_args( dt_desc_t* pData,
|
||||
int ompi_ddt_set_args( dt_desc_t* pData,
|
||||
int ci, int ** i,
|
||||
int ca, MPI_Aint* a,
|
||||
int cd, MPI_Datatype* d,int type);
|
||||
/* VPS: Added */
|
||||
int lam_ddt_sndrcv(void *sbuf, int scount, MPI_Datatype sdtype, void *rbuf,
|
||||
int ompi_ddt_sndrcv(void *sbuf, int scount, MPI_Datatype sdtype, void *rbuf,
|
||||
int rcount, MPI_Datatype rdtype, int tag, MPI_Comm comm);
|
||||
|
||||
#endif /* DATATYPE_H_HAS_BEEN_INCLUDED */
|
||||
|
@ -131,17 +131,17 @@ typedef struct __dt_endloop_desc {
|
||||
typedef struct {
|
||||
float r;
|
||||
float i;
|
||||
} lam_complex_float_t;
|
||||
} ompi_complex_float_t;
|
||||
|
||||
typedef struct {
|
||||
double r;
|
||||
double i;
|
||||
} lam_complex_double_t;
|
||||
} ompi_complex_double_t;
|
||||
|
||||
typedef struct {
|
||||
long double r;
|
||||
long double i;
|
||||
} lam_complex_long_double_t;
|
||||
} ompi_complex_long_double_t;
|
||||
|
||||
extern dt_desc_t basicDatatypes[DT_MAX_PREDEFINED];
|
||||
|
||||
|
@ -19,9 +19,9 @@ int mpich_typeub( void )
|
||||
int blens[2];
|
||||
dt_desc_t *type1, *type2, *type3, *types[2];
|
||||
|
||||
lam_ddt_create_vector( 2, 1, 4, &(basicDatatypes[DT_INT]), &type1 );
|
||||
lam_ddt_commit( &type1 );
|
||||
lam_ddt_get_extent( type1, &lb, &extent );
|
||||
ompi_ddt_create_vector( 2, 1, 4, &(basicDatatypes[DT_INT]), &type1 );
|
||||
ompi_ddt_commit( &type1 );
|
||||
ompi_ddt_get_extent( type1, &lb, &extent );
|
||||
extent1 = 5 * sizeof(int);
|
||||
if (extent != extent1) {
|
||||
printf("EXTENT 1 %ld != %ld\n",extent,extent1);
|
||||
@ -39,9 +39,9 @@ int mpich_typeub( void )
|
||||
|
||||
/* using MPI_UB and Type_struct, monkey with the extent, making it 16
|
||||
*/
|
||||
lam_ddt_create_struct( 2, blens, displ, types, &type2 );
|
||||
lam_ddt_commit( &type2 );
|
||||
lam_ddt_get_extent( type2, &lb, &extent );
|
||||
ompi_ddt_create_struct( 2, blens, displ, types, &type2 );
|
||||
ompi_ddt_commit( &type2 );
|
||||
ompi_ddt_get_extent( type2, &lb, &extent );
|
||||
if (extent != extent2) {
|
||||
printf("EXTENT 2 %ld != %ld\n",extent,extent2);
|
||||
errs++;
|
||||
@ -57,10 +57,10 @@ int mpich_typeub( void )
|
||||
types[1]=&(basicDatatypes[DT_UB]);
|
||||
extent3 = extent2;
|
||||
|
||||
lam_ddt_create_struct( 2, blens, displ, types, &type3 );
|
||||
lam_ddt_commit( &type3 );
|
||||
ompi_ddt_create_struct( 2, blens, displ, types, &type3 );
|
||||
ompi_ddt_commit( &type3 );
|
||||
|
||||
lam_ddt_get_extent( type3, &lb, &extent );
|
||||
ompi_ddt_get_extent( type3, &lb, &extent );
|
||||
if (extent != extent3) {
|
||||
printf("EXTENT 3 %ld != %ld\n",extent,extent3);
|
||||
errs++;
|
||||
@ -92,11 +92,11 @@ int mpich_typeub2( void )
|
||||
types[1] = &(basicDatatypes[DT_INT]);
|
||||
types[2] = &(basicDatatypes[DT_UB]);
|
||||
|
||||
lam_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
||||
lam_ddt_commit(&dt1);
|
||||
ompi_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
||||
ompi_ddt_commit(&dt1);
|
||||
|
||||
lam_ddt_type_lb(dt1, &lb); lam_ddt_type_ub(dt1, &ub);
|
||||
lam_ddt_type_extent(dt1,&ex1); lam_ddt_type_size(dt1,&sz1);
|
||||
ompi_ddt_type_lb(dt1, &lb); ompi_ddt_type_ub(dt1, &ub);
|
||||
ompi_ddt_type_extent(dt1,&ex1); ompi_ddt_type_size(dt1,&sz1);
|
||||
|
||||
/* Values should be lb = -3, ub = 6 extent 9; size depends on implementation */
|
||||
if (lb != -3 || ub != 6 || ex1 != 9) {
|
||||
@ -106,9 +106,9 @@ int mpich_typeub2( void )
|
||||
else
|
||||
printf("Example 3.26 type1 correct\n" );
|
||||
|
||||
lam_ddt_create_contiguous(2,dt1,&dt2);
|
||||
lam_ddt_type_lb(dt2, &lb); lam_ddt_type_ub(dt2, &ub);
|
||||
lam_ddt_type_extent(dt2,&ex2); lam_ddt_type_size(dt2,&sz2);
|
||||
ompi_ddt_create_contiguous(2,dt1,&dt2);
|
||||
ompi_ddt_type_lb(dt2, &lb); ompi_ddt_type_ub(dt2, &ub);
|
||||
ompi_ddt_type_extent(dt2,&ex2); ompi_ddt_type_size(dt2,&sz2);
|
||||
/* Values should be lb = -3, ub = 15, extent = 18, size depends on implementation */
|
||||
if (lb != -3 || ub != 15 || ex2 != 18) {
|
||||
printf("Example 3.26 type2 lb %d ub %d extent %d size %d\n", (int)-3, (int)15, (int)18, 8);
|
||||
@ -118,9 +118,9 @@ int mpich_typeub2( void )
|
||||
else
|
||||
printf("Example 3.26 type1 correct\n" );
|
||||
OBJ_RELEASE( dt2 ); assert( dt2 == NULL );
|
||||
lam_ddt_create_contiguous(2,dt1,&dt2);
|
||||
lam_ddt_type_lb(dt2, &lb); lam_ddt_type_ub(dt2, &ub);
|
||||
lam_ddt_type_extent(dt2,&ex2); lam_ddt_type_size(dt2,&sz2);
|
||||
ompi_ddt_create_contiguous(2,dt1,&dt2);
|
||||
ompi_ddt_type_lb(dt2, &lb); ompi_ddt_type_ub(dt2, &ub);
|
||||
ompi_ddt_type_extent(dt2,&ex2); ompi_ddt_type_size(dt2,&sz2);
|
||||
/* Values should be lb = -3, ub = 15, extent = 18, size depends on implementation */
|
||||
if (lb != -3 || ub != 15 || ex2 != 18) {
|
||||
printf("Example 3.26 type2 lb %d ub %d extent %d size %d\n", (int)-3, (int)15, (int)18, 8);
|
||||
@ -134,11 +134,11 @@ int mpich_typeub2( void )
|
||||
blocklen[0]=1; blocklen[1]=1;
|
||||
disp[0]=0; disp[1]=ex1;
|
||||
|
||||
lam_ddt_create_struct(2, blocklen, disp, types, &dt3);
|
||||
lam_ddt_commit(&dt3);
|
||||
ompi_ddt_create_struct(2, blocklen, disp, types, &dt3);
|
||||
ompi_ddt_commit(&dt3);
|
||||
|
||||
lam_ddt_type_lb(dt3, &lb); lam_ddt_type_ub(dt3, &ub);
|
||||
lam_ddt_type_extent(dt3,&ex3); lam_ddt_type_size(dt3,&sz3);
|
||||
ompi_ddt_type_lb(dt3, &lb); ompi_ddt_type_ub(dt3, &ub);
|
||||
ompi_ddt_type_extent(dt3,&ex3); ompi_ddt_type_size(dt3,&sz3);
|
||||
/* Another way to express type2 */
|
||||
if (lb != -3 || ub != 15 || ex3 != 18) {
|
||||
printf("type3 lb %d ub %d extent %d size %d\n", (int)-3, (int)15, (int)18, 8);
|
||||
@ -172,8 +172,8 @@ int mpich_typeub3( void )
|
||||
types[2] = &(basicDatatypes[DT_UB]);
|
||||
|
||||
/* Generate samples for contiguous, hindexed, hvector, indexed, and vector (struct and contiguous tested in typeub2) */
|
||||
lam_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
||||
lam_ddt_commit(&dt1);
|
||||
ompi_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
||||
ompi_ddt_commit(&dt1);
|
||||
|
||||
/* This type is the same as in typeub2, and is tested there */
|
||||
types[0]=dt1; types[1]=dt1;
|
||||
@ -181,11 +181,11 @@ int mpich_typeub3( void )
|
||||
disp[0]=-4; disp[1]=7;
|
||||
idisp[0]=-4; idisp[1]=7;
|
||||
|
||||
lam_ddt_create_hindexed( 2, blocklen, disp, dt1, &dt2 );
|
||||
lam_ddt_commit( &dt2 );
|
||||
ompi_ddt_create_hindexed( 2, blocklen, disp, dt1, &dt2 );
|
||||
ompi_ddt_commit( &dt2 );
|
||||
|
||||
lam_ddt_type_lb( dt2, &lb ); lam_ddt_type_ub( dt2, &ub );
|
||||
lam_ddt_type_extent( dt2, &ex ); lam_ddt_type_size( dt2, &sz );
|
||||
ompi_ddt_type_lb( dt2, &lb ); ompi_ddt_type_ub( dt2, &ub );
|
||||
ompi_ddt_type_extent( dt2, &ex ); ompi_ddt_type_size( dt2, &sz );
|
||||
|
||||
if (lb != -7 || ub != 13 || ex != 20) {
|
||||
printf("hindexed lb %d ub %d extent %d size %d\n", (int)-7, (int)13, (int)20, sz);
|
||||
@ -195,11 +195,11 @@ int mpich_typeub3( void )
|
||||
else
|
||||
printf( "hindexed ok\n" );
|
||||
|
||||
lam_ddt_create_indexed( 2, blocklen, idisp, dt1, &dt3 );
|
||||
lam_ddt_commit( &dt3 );
|
||||
ompi_ddt_create_indexed( 2, blocklen, idisp, dt1, &dt3 );
|
||||
ompi_ddt_commit( &dt3 );
|
||||
|
||||
lam_ddt_type_lb( dt3, &lb ); lam_ddt_type_ub( dt3, &ub );
|
||||
lam_ddt_type_extent( dt3, &ex ); lam_ddt_type_size( dt3, &sz );
|
||||
ompi_ddt_type_lb( dt3, &lb ); ompi_ddt_type_ub( dt3, &ub );
|
||||
ompi_ddt_type_extent( dt3, &ex ); ompi_ddt_type_size( dt3, &sz );
|
||||
|
||||
if (lb != -39 || ub != 69 || ex != 108) {
|
||||
printf("indexed lb %d ub %d extent %d size %d\n", (int)-39, (int)69, (int)108, sz);
|
||||
@ -209,11 +209,11 @@ int mpich_typeub3( void )
|
||||
else
|
||||
printf( "indexed ok\n" );
|
||||
|
||||
lam_ddt_create_hvector( 2, 1, 14, dt1, &dt4 );
|
||||
lam_ddt_commit( &dt4 );
|
||||
ompi_ddt_create_hvector( 2, 1, 14, dt1, &dt4 );
|
||||
ompi_ddt_commit( &dt4 );
|
||||
|
||||
lam_ddt_type_lb( dt4, &lb ); lam_ddt_type_ub( dt4, &ub );
|
||||
lam_ddt_type_extent( dt4, &ex ); lam_ddt_type_size( dt4, &sz );
|
||||
ompi_ddt_type_lb( dt4, &lb ); ompi_ddt_type_ub( dt4, &ub );
|
||||
ompi_ddt_type_extent( dt4, &ex ); ompi_ddt_type_size( dt4, &sz );
|
||||
|
||||
if (lb != -3 || ub != 20 || ex != 23) {
|
||||
printf("hvector lb %d ub %d extent %d size %d\n", (int)-3, (int)20, (int)23, sz);
|
||||
@ -223,11 +223,11 @@ int mpich_typeub3( void )
|
||||
else
|
||||
printf( "hvector ok\n" );
|
||||
|
||||
lam_ddt_create_vector( 2, 1, 14, dt1, &dt5 );
|
||||
lam_ddt_commit( &dt5 );
|
||||
ompi_ddt_create_vector( 2, 1, 14, dt1, &dt5 );
|
||||
ompi_ddt_commit( &dt5 );
|
||||
|
||||
lam_ddt_type_lb( dt5, &lb ); lam_ddt_type_ub( dt5, &ub );
|
||||
lam_ddt_type_extent( dt5, &ex ); lam_ddt_type_size( dt5, &sz );
|
||||
ompi_ddt_type_lb( dt5, &lb ); ompi_ddt_type_ub( dt5, &ub );
|
||||
ompi_ddt_type_extent( dt5, &ex ); ompi_ddt_type_size( dt5, &sz );
|
||||
|
||||
if (lb != -3 || ub != 132 || ex != 135) {
|
||||
printf("vector lb %d ub %d extent %d size %d\n", (int)-3, (int)132, (int)135, sz);
|
||||
@ -309,7 +309,7 @@ dt_desc_t* upper_matrix( unsigned int mat_size )
|
||||
blocklen[i] = mat_size - i;
|
||||
}
|
||||
|
||||
lam_ddt_create_indexed( mat_size, blocklen, disp, &(basicDatatypes[DT_DOUBLE]),
|
||||
ompi_ddt_create_indexed( mat_size, blocklen, disp, &(basicDatatypes[DT_DOUBLE]),
|
||||
&upper );
|
||||
free( disp );
|
||||
free( blocklen );
|
||||
@ -330,7 +330,7 @@ dt_desc_t* lower_matrix( unsigned int mat_size )
|
||||
blocklen[i] = i;
|
||||
}
|
||||
|
||||
lam_ddt_create_indexed( mat_size, blocklen, disp, &(basicDatatypes[DT_DOUBLE]),
|
||||
ompi_ddt_create_indexed( mat_size, blocklen, disp, &(basicDatatypes[DT_DOUBLE]),
|
||||
&upper );
|
||||
free( disp );
|
||||
free( blocklen );
|
||||
@ -343,7 +343,7 @@ int test_upper( unsigned int length )
|
||||
{
|
||||
double *mat1, *mat2, *inbuf;
|
||||
dt_desc_t *pdt, *pdt1;
|
||||
lam_convertor_t * pConv;
|
||||
ompi_convertor_t * pConv;
|
||||
char *ptr;
|
||||
int i, j, split_chunk, total_length, rc;
|
||||
struct iovec a;
|
||||
@ -369,12 +369,12 @@ int test_upper( unsigned int length )
|
||||
inbuf++;
|
||||
}
|
||||
inbuf = (double*)ptr;
|
||||
pConv = lam_convertor_create( 0, 0 );
|
||||
lam_convertor_init_for_recv( pConv, 0, pdt, 1, mat2, 0 );
|
||||
pConv = ompi_convertor_create( 0, 0 );
|
||||
ompi_convertor_init_for_recv( pConv, 0, pdt, 1, mat2, 0 );
|
||||
|
||||
/* test the automatic destruction pf the data */
|
||||
lam_ddt_destroy( &pdt ); assert( pdt == NULL );
|
||||
lam_ddt_destroy( &pdt1 ); assert( pdt1 == NULL );
|
||||
ompi_ddt_destroy( &pdt ); assert( pdt == NULL );
|
||||
ompi_ddt_destroy( &pdt1 ); assert( pdt1 == NULL );
|
||||
|
||||
GET_TIME( start );
|
||||
split_chunk = (length + 1) * sizeof(double);
|
||||
@ -383,7 +383,7 @@ int test_upper( unsigned int length )
|
||||
if( i < split_chunk ) split_chunk = i;
|
||||
a.iov_base = ptr;
|
||||
a.iov_len = split_chunk;
|
||||
lam_convertor_unpack( pConv, &a, 1 );
|
||||
ompi_convertor_unpack( pConv, &a, 1 );
|
||||
ptr += split_chunk;
|
||||
i -= split_chunk;
|
||||
if( mat2[0] != inbuf[0] ) assert(0);
|
||||
@ -412,9 +412,9 @@ dt_desc_t* test_matrix_borders( unsigned int size, unsigned int width )
|
||||
disp[1] = (size - width) * sizeof(double);
|
||||
blocklen[1] = width;
|
||||
|
||||
lam_ddt_create_indexed( 2, blocklen, disp, &(basicDatatypes[DT_DOUBLE]),
|
||||
ompi_ddt_create_indexed( 2, blocklen, disp, &(basicDatatypes[DT_DOUBLE]),
|
||||
&pdt_line );
|
||||
lam_ddt_create_contiguous( size, pdt_line, &pdt );
|
||||
ompi_ddt_create_contiguous( size, pdt_line, &pdt );
|
||||
OBJ_RELEASE( pdt_line ); assert( pdt_line == NULL );
|
||||
return pdt;
|
||||
}
|
||||
@ -424,18 +424,18 @@ dt_desc_t* test_contiguous( void )
|
||||
dt_desc_t *pdt, *pdt1, *pdt2;
|
||||
|
||||
printf( "test contiguous (alignement)\n" );
|
||||
pdt1 = lam_ddt_create( -1 );
|
||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
||||
lam_ddt_dump( pdt1 );
|
||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
||||
lam_ddt_dump( pdt1 );
|
||||
lam_ddt_create_contiguous( 4, pdt1, &pdt2 );
|
||||
pdt1 = ompi_ddt_create( -1 );
|
||||
ompi_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
||||
ompi_ddt_dump( pdt1 );
|
||||
ompi_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
||||
ompi_ddt_dump( pdt1 );
|
||||
ompi_ddt_create_contiguous( 4, pdt1, &pdt2 );
|
||||
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
||||
lam_ddt_dump( pdt2 );
|
||||
lam_ddt_create_contiguous( 2, pdt2, &pdt );
|
||||
ompi_ddt_dump( pdt2 );
|
||||
ompi_ddt_create_contiguous( 2, pdt2, &pdt );
|
||||
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
||||
lam_ddt_dump( pdt );
|
||||
lam_ddt_dump_complete( pdt );
|
||||
ompi_ddt_dump( pdt );
|
||||
ompi_ddt_dump_complete( pdt );
|
||||
return pdt;
|
||||
}
|
||||
|
||||
@ -449,16 +449,16 @@ dt_desc_t* test_struct( void )
|
||||
dt_desc_t* pdt, *pdt1;
|
||||
|
||||
printf( "test struct\n" );
|
||||
pdt1 = lam_ddt_create( -1 );
|
||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
||||
lam_ddt_dump_complete( pdt1 );
|
||||
pdt1 = ompi_ddt_create( -1 );
|
||||
ompi_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
||||
ompi_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
||||
ompi_ddt_dump_complete( pdt1 );
|
||||
|
||||
types[1] = pdt1;
|
||||
|
||||
lam_ddt_create_struct( 3, lengths, disp, types, &pdt );
|
||||
ompi_ddt_create_struct( 3, lengths, disp, types, &pdt );
|
||||
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
||||
lam_ddt_dump_complete( pdt );
|
||||
ompi_ddt_dump_complete( pdt );
|
||||
return pdt;
|
||||
}
|
||||
|
||||
@ -488,12 +488,12 @@ dt_desc_t* create_strange_dt( void )
|
||||
|
||||
dispi[0] = (int)((char*)&(v[0].i1) - (char*)&(v[0])); /* 0 */
|
||||
dispi[1] = (int)(((char*)(&(v[0].i2)) - (char*)&(v[0])) / sizeof(int)); /* 2 */
|
||||
lam_ddt_create_indexed_block( 2, 1, dispi, &(basicDatatypes[DT_INT]), &pdtTemp );
|
||||
ompi_ddt_create_indexed_block( 2, 1, dispi, &(basicDatatypes[DT_INT]), &pdtTemp );
|
||||
#ifdef USE_RESIZED
|
||||
/* optional */
|
||||
displ[0] = 0;
|
||||
displ[1] = (char*)&(v[1]) - (char*)&(v[0]);
|
||||
lam_ddt_create_resized( pdtTemp, displ[0], displ[1], &pdt1 );
|
||||
ompi_ddt_create_resized( pdtTemp, displ[0], displ[1], &pdt1 );
|
||||
OBJ_RELEASE( pdtTemp ); assert( pdtTemp == NULL );
|
||||
#else
|
||||
pdt1 = pdtTemp;
|
||||
@ -504,24 +504,24 @@ dt_desc_t* create_strange_dt( void )
|
||||
displ[0] = 0;
|
||||
displ[1] = (long)((char*)&(t[0].v[0]) - (char*)&(t[0]));
|
||||
displ[2] = (long)((char*)&(t[0].last) - (char*)&(t[0]));
|
||||
lam_ddt_create_struct( 3, pBlock, displ, types, &pdtTemp );
|
||||
ompi_ddt_create_struct( 3, pBlock, displ, types, &pdtTemp );
|
||||
#ifdef USE_RESIZED
|
||||
/* optional */
|
||||
displ[1] = (char*)&(t[1]) - (char*)&(t[0]);
|
||||
lam_ddt_create_resized( pdtTemp, displ[0], displ[1], &pdt2 );
|
||||
ompi_ddt_create_resized( pdtTemp, displ[0], displ[1], &pdt2 );
|
||||
OBJ_RELEASE( pdtTemp ); assert( pdtTemp == NULL );
|
||||
#else
|
||||
pdt2 = pdtTemp;
|
||||
#endif /* USE_RESIZED */
|
||||
|
||||
lam_ddt_create_contiguous( SSTRANGE_CNT, pdt2, &pdt );
|
||||
ompi_ddt_create_contiguous( SSTRANGE_CNT, pdt2, &pdt );
|
||||
|
||||
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
||||
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
||||
lam_ddt_dump( pdt );
|
||||
ompi_ddt_dump( pdt );
|
||||
{
|
||||
dt_type_desc_t pElemDesc = { 0, 0, NULL };
|
||||
lam_ddt_optimize_short( pdt, 1, &pElemDesc );
|
||||
ompi_ddt_optimize_short( pdt, 1, &pElemDesc );
|
||||
if( pElemDesc.desc != NULL ) free( pElemDesc.desc );
|
||||
}
|
||||
return pdt;
|
||||
@ -531,14 +531,14 @@ int local_copy_ddt_count( dt_desc_t* pdt, int count )
|
||||
{
|
||||
long extent;
|
||||
void *pdst, *psrc;
|
||||
lam_ddt_type_extent( pdt, &extent );
|
||||
ompi_ddt_type_extent( pdt, &extent );
|
||||
|
||||
pdst = malloc( extent * count );
|
||||
psrc = malloc( extent * count );
|
||||
|
||||
pdt = create_strange_dt();
|
||||
|
||||
lam_ddt_copy_content_same_ddt( pdt, count, pdst, psrc );
|
||||
ompi_ddt_copy_content_same_ddt( pdt, count, pdst, psrc );
|
||||
|
||||
free( pdst );
|
||||
free( psrc );
|
||||
@ -551,7 +551,7 @@ int main( int argc, char* argv[] )
|
||||
dt_desc_t *pdt, *pdt1, *pdt2, *pdt3;
|
||||
int rc, length = 500;
|
||||
|
||||
lam_ddt_init();
|
||||
ompi_ddt_init();
|
||||
|
||||
pdt = create_strange_dt();
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
@ -571,7 +571,7 @@ int main( int argc, char* argv[] )
|
||||
printf( "decode [NOT PASSED]\n" );
|
||||
|
||||
pdt = test_matrix_borders( length, 100 );
|
||||
lam_ddt_dump( pdt );
|
||||
ompi_ddt_dump( pdt );
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
|
||||
printf( ">>--------------------------------------------<<\n" );
|
||||
@ -582,31 +582,31 @@ int main( int argc, char* argv[] )
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
printf( ">>--------------------------------------------<<\n" );
|
||||
|
||||
pdt1 = lam_ddt_create( -1 );
|
||||
pdt2 = lam_ddt_create( -1 );
|
||||
pdt3 = lam_ddt_create( -1 );
|
||||
lam_ddt_add( pdt3, &(basicDatatypes[DT_INT]), 10, 0, -1 );
|
||||
lam_ddt_add( pdt3, &(basicDatatypes[DT_FLOAT]), 5, 10 * sizeof(int), -1 );
|
||||
pdt1 = ompi_ddt_create( -1 );
|
||||
pdt2 = ompi_ddt_create( -1 );
|
||||
pdt3 = ompi_ddt_create( -1 );
|
||||
ompi_ddt_add( pdt3, &(basicDatatypes[DT_INT]), 10, 0, -1 );
|
||||
ompi_ddt_add( pdt3, &(basicDatatypes[DT_FLOAT]), 5, 10 * sizeof(int), -1 );
|
||||
|
||||
lam_ddt_add( pdt2, &(basicDatatypes[DT_INT]), 1, 0, -1 );
|
||||
lam_ddt_add( pdt2, pdt3, 3, sizeof(int) * 1, -1 );
|
||||
ompi_ddt_add( pdt2, &(basicDatatypes[DT_INT]), 1, 0, -1 );
|
||||
ompi_ddt_add( pdt2, pdt3, 3, sizeof(int) * 1, -1 );
|
||||
|
||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_LONG_LONG]), 5, 0, -1 );
|
||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_LONG_DOUBLE]), 2, sizeof(long long) * 5, -1 );
|
||||
ompi_ddt_add( pdt1, &(basicDatatypes[DT_LONG_LONG]), 5, 0, -1 );
|
||||
ompi_ddt_add( pdt1, &(basicDatatypes[DT_LONG_DOUBLE]), 2, sizeof(long long) * 5, -1 );
|
||||
|
||||
printf( ">>--------------------------------------------<<\n" );
|
||||
lam_ddt_dump( pdt1 );
|
||||
ompi_ddt_dump( pdt1 );
|
||||
printf( ">>--------------------------------------------<<\n" );
|
||||
lam_ddt_dump( pdt2 );
|
||||
ompi_ddt_dump( pdt2 );
|
||||
printf( ">>--------------------------------------------<<\n" );
|
||||
lam_ddt_dump( pdt3 );
|
||||
ompi_ddt_dump( pdt3 );
|
||||
|
||||
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
||||
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
||||
OBJ_RELEASE( pdt3 ); assert( pdt3 == NULL );
|
||||
|
||||
/* clean-ups all data allocations */
|
||||
lam_ddt_finalize();
|
||||
ompi_ddt_finalize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
* the second is the internal representation using extents
|
||||
* the last is the representation used for send operations
|
||||
*/
|
||||
int lam_ddt_add( dt_desc_t* pdtBase, dt_desc_t* pdtAdd, unsigned int count, long disp, long extent )
|
||||
int ompi_ddt_add( dt_desc_t* pdtBase, dt_desc_t* pdtAdd, unsigned int count, long disp, long extent )
|
||||
{
|
||||
int newLength, place_needed = 0, i;
|
||||
short localFlags;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <lam_config.h>
|
||||
#include <ompi_config.h>
|
||||
#include <mpi.h>
|
||||
#include <datatype.h>
|
||||
#include <datatype_internal.h>
|
||||
@ -11,17 +11,17 @@ typedef struct __dt_args {
|
||||
int* i;
|
||||
MPI_Aint* a;
|
||||
MPI_Datatype* d;
|
||||
} lam_ddt_args_t;
|
||||
} ompi_ddt_args_t;
|
||||
|
||||
#define ALLOC_ARGS(PDATA, IC, AC, DC) \
|
||||
do { \
|
||||
int length = sizeof(lam_ddt_args_t) + (IC) * sizeof(int) + (AC) * sizeof(MPI_Aint) + (DC) * sizeof(MPI_Datatype); \
|
||||
int length = sizeof(ompi_ddt_args_t) + (IC) * sizeof(int) + (AC) * sizeof(MPI_Aint) + (DC) * sizeof(MPI_Datatype); \
|
||||
char* buf = (char*)malloc( length ); \
|
||||
lam_ddt_args_t* pArgs = (lam_ddt_args_t*)buf; \
|
||||
ompi_ddt_args_t* pArgs = (ompi_ddt_args_t*)buf; \
|
||||
pArgs->ci = (IC); \
|
||||
pArgs->ca = (AC); \
|
||||
pArgs->cd = (DC); \
|
||||
buf += sizeof(lam_ddt_args_t); \
|
||||
buf += sizeof(ompi_ddt_args_t); \
|
||||
if( pArgs->ci == 0 ) pArgs->i = NULL; \
|
||||
else { \
|
||||
pArgs->i = (int*)buf; \
|
||||
@ -40,18 +40,18 @@ do { \
|
||||
#define FREE_ARGS(PDATA) \
|
||||
if( (PDATA)->args != NULL ) free( (PDATA)->args );
|
||||
|
||||
int lam_ddt_set_args( lam_datatype_t* pData,
|
||||
int ompi_ddt_set_args( ompi_datatype_t* pData,
|
||||
int ci, int ** i,
|
||||
int ca, MPI_Aint* a,
|
||||
int cd, MPI_Datatype* d,int type)
|
||||
{
|
||||
int pos;
|
||||
lam_ddt_args_t* pArgs;
|
||||
ompi_ddt_args_t* pArgs;
|
||||
|
||||
FREE_ARGS( pData );
|
||||
ALLOC_ARGS( pData, ci, ca, cd );
|
||||
|
||||
pArgs = (lam_ddt_args_t*)pData->args;
|
||||
pArgs = (ompi_ddt_args_t*)pData->args;
|
||||
pArgs->create_type = type;
|
||||
|
||||
switch(type){
|
||||
@ -157,12 +157,12 @@ int lam_ddt_set_args( lam_datatype_t* pData,
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
int lam_ddt_get_args( lam_datatype_t* pData, int which,
|
||||
int ompi_ddt_get_args( ompi_datatype_t* pData, int which,
|
||||
int * ci, int * i,
|
||||
int * ca, MPI_Aint * a,
|
||||
int * cd, MPI_Datatype * d, int * type)
|
||||
{
|
||||
lam_ddt_args_t* pArgs = pData->args;
|
||||
ompi_ddt_args_t* pArgs = pData->args;
|
||||
|
||||
if( (pData->flags & DT_FLAG_BASIC) == DT_FLAG_BASIC ) {
|
||||
switch(which){
|
||||
|
@ -42,11 +42,11 @@ static void __destroy_ddt_struct( dt_desc_t* pData )
|
||||
pData->args = NULL;
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(lam_datatype_t, lam_object_t, __get_free_dt_struct, __destroy_ddt_struct );
|
||||
OBJ_CLASS_INSTANCE(ompi_datatype_t, ompi_object_t, __get_free_dt_struct, __destroy_ddt_struct );
|
||||
|
||||
dt_desc_t* lam_ddt_create( int expectedSize )
|
||||
dt_desc_t* ompi_ddt_create( int expectedSize )
|
||||
{
|
||||
dt_desc_t* pdt = (dt_desc_t*)OBJ_NEW(lam_datatype_t);
|
||||
dt_desc_t* pdt = (dt_desc_t*)OBJ_NEW(ompi_datatype_t);
|
||||
|
||||
if( expectedSize == -1 ) expectedSize = DT_INCREASE_STACK;
|
||||
pdt->desc.length = expectedSize + 1; /* one for the fake elem at the end */
|
||||
@ -56,9 +56,9 @@ dt_desc_t* lam_ddt_create( int expectedSize )
|
||||
return pdt;
|
||||
}
|
||||
|
||||
int lam_ddt_create_resized( dt_desc_t* oldType, long lb, long extent, dt_desc_t** newType )
|
||||
int ompi_ddt_create_resized( dt_desc_t* oldType, long lb, long extent, dt_desc_t** newType )
|
||||
{
|
||||
lam_ddt_duplicate( oldType, newType );
|
||||
ompi_ddt_duplicate( oldType, newType );
|
||||
(*newType)->lb = lb;
|
||||
(*newType)->ub = lb + extent;
|
||||
return 0;
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
#include "datatype.h"
|
||||
|
||||
int lam_ddt_create_subarray( int ndims, int* pSizes, int* pSubSizes, int* pStarts,
|
||||
int ompi_ddt_create_subarray( int ndims, int* pSizes, int* pSubSizes, int* pStarts,
|
||||
int order, dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int lam_ddt_create_darray( int size, int rank, int ndims, int* pGSizes, int *pDistrib,
|
||||
int ompi_ddt_create_darray( int size, int rank, int ndims, int* pGSizes, int *pDistrib,
|
||||
int* pDArgs, int* pPSizes, int order, dt_desc_t* oldType,
|
||||
dt_desc_t** newType )
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "datatype.h"
|
||||
#include "datatype_internal.h"
|
||||
|
||||
int lam_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType )
|
||||
int ompi_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
dt_desc_t* pdt;
|
||||
void* temp;
|
||||
@ -11,7 +11,7 @@ int lam_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType )
|
||||
|
||||
if( oldType->flags & DT_FLAG_COMMITED ) desc_size++;
|
||||
|
||||
pdt = lam_ddt_create( desc_size );
|
||||
pdt = ompi_ddt_create( desc_size );
|
||||
temp = pdt->desc.desc; /* temporary copy of the desc pointer */
|
||||
memcpy( pdt, oldType, sizeof(dt_desc_t) );
|
||||
pdt->desc.desc = temp;
|
||||
@ -23,10 +23,10 @@ int lam_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lam_ddt_create_contiguous( int count, dt_desc_t* oldType, dt_desc_t** newType )
|
||||
int ompi_ddt_create_contiguous( int count, dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
dt_desc_t* pdt = lam_ddt_create( oldType->desc.used + 2 );
|
||||
lam_ddt_add( pdt, oldType, count, 0, (oldType->ub - oldType->lb) );
|
||||
dt_desc_t* pdt = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
ompi_ddt_add( pdt, oldType, count, 0, (oldType->ub - oldType->lb) );
|
||||
*newType = pdt;
|
||||
return 0;
|
||||
}
|
||||
|
@ -3,14 +3,14 @@
|
||||
#include "datatype.h"
|
||||
|
||||
/* We try to merge together data that are contiguous */
|
||||
int lam_ddt_create_indexed( int count, int* pBlockLength, int* pDisp,
|
||||
int ompi_ddt_create_indexed( int count, int* pBlockLength, int* pDisp,
|
||||
dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
dt_desc_t* pdt;
|
||||
int i, dLength, endat, disp;
|
||||
long extent = oldType->ub - oldType->lb;
|
||||
|
||||
pdt = lam_ddt_create( count * (2 + oldType->desc.used) );
|
||||
pdt = ompi_ddt_create( count * (2 + oldType->desc.used) );
|
||||
disp = pDisp[0];
|
||||
dLength = pBlockLength[0];
|
||||
endat = disp + dLength;
|
||||
@ -20,19 +20,19 @@ int lam_ddt_create_indexed( int count, int* pBlockLength, int* pDisp,
|
||||
dLength += pBlockLength[i];
|
||||
endat += pBlockLength[i];
|
||||
} else {
|
||||
lam_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
ompi_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
disp = pDisp[i];
|
||||
dLength = pBlockLength[i];
|
||||
endat = disp + pBlockLength[i];
|
||||
}
|
||||
}
|
||||
lam_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
ompi_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
|
||||
*newType = pdt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lam_ddt_create_hindexed( int count, int* pBlockLength, long* pDisp,
|
||||
int ompi_ddt_create_hindexed( int count, int* pBlockLength, long* pDisp,
|
||||
dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
dt_desc_t* pdt;
|
||||
@ -40,7 +40,7 @@ int lam_ddt_create_hindexed( int count, int* pBlockLength, long* pDisp,
|
||||
long extent = oldType->ub - oldType->lb;
|
||||
long disp, endat;
|
||||
|
||||
pdt = lam_ddt_create( count * (2 + oldType->desc.used) );
|
||||
pdt = ompi_ddt_create( count * (2 + oldType->desc.used) );
|
||||
disp = pDisp[0];
|
||||
dLength = pBlockLength[0];
|
||||
endat = disp + dLength * extent;
|
||||
@ -50,26 +50,26 @@ int lam_ddt_create_hindexed( int count, int* pBlockLength, long* pDisp,
|
||||
dLength += pBlockLength[i];
|
||||
endat += pBlockLength[i] * extent;
|
||||
} else {
|
||||
lam_ddt_add( pdt, oldType, dLength, disp, extent );
|
||||
ompi_ddt_add( pdt, oldType, dLength, disp, extent );
|
||||
disp = pDisp[i];
|
||||
dLength = pBlockLength[i];
|
||||
endat = disp + pBlockLength[i] * extent;
|
||||
}
|
||||
}
|
||||
lam_ddt_add( pdt, oldType, dLength, disp, extent );
|
||||
ompi_ddt_add( pdt, oldType, dLength, disp, extent );
|
||||
|
||||
*newType = pdt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lam_ddt_create_indexed_block( int count, int bLength, int* pDisp,
|
||||
int ompi_ddt_create_indexed_block( int count, int bLength, int* pDisp,
|
||||
dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
dt_desc_t* pdt;
|
||||
int i, dLength, endat, disp;
|
||||
long extent = oldType->ub - oldType->lb;
|
||||
|
||||
pdt = lam_ddt_create( count * (2 + oldType->desc.used) );
|
||||
pdt = ompi_ddt_create( count * (2 + oldType->desc.used) );
|
||||
disp = pDisp[0];
|
||||
dLength = bLength;
|
||||
endat = disp + dLength;
|
||||
@ -79,13 +79,13 @@ int lam_ddt_create_indexed_block( int count, int bLength, int* pDisp,
|
||||
dLength += bLength;
|
||||
endat += bLength;
|
||||
} else {
|
||||
lam_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
ompi_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
disp = pDisp[i];
|
||||
dLength = bLength;
|
||||
endat = disp + bLength;
|
||||
}
|
||||
}
|
||||
lam_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
ompi_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||
|
||||
*newType = pdt;
|
||||
return 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "datatype.h"
|
||||
|
||||
int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
||||
int ompi_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
||||
dt_desc_t** pTypes, dt_desc_t** newType )
|
||||
{
|
||||
int i;
|
||||
@ -42,7 +42,7 @@ int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
||||
lastDisp = pDisp[0];
|
||||
endto = pDisp[0] + lastExtent * lastBlock;
|
||||
|
||||
pdt = lam_ddt_create( disp );
|
||||
pdt = ompi_ddt_create( disp );
|
||||
|
||||
/* Do again the same loop but now add the elements */
|
||||
for( i = 1; i < count; i++ ) {
|
||||
@ -50,7 +50,7 @@ int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
||||
lastBlock += pBlockLength[i];
|
||||
endto = lastDisp + lastBlock * lastExtent;
|
||||
} else {
|
||||
lam_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
||||
ompi_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
||||
lastType = pTypes[i];
|
||||
lastExtent = lastType->ub - lastType->lb;
|
||||
lastBlock = pBlockLength[i];
|
||||
@ -58,7 +58,7 @@ int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
||||
endto = lastDisp + lastExtent * lastBlock;
|
||||
}
|
||||
}
|
||||
lam_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
||||
ompi_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
||||
|
||||
*newType = pdt;
|
||||
return 0;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
int lam_ddt_create_vector( int count, int bLength, long stride,
|
||||
int ompi_ddt_create_vector( int count, int bLength, long stride,
|
||||
dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
long extent = oldType->ub - oldType->lb;
|
||||
@ -16,30 +16,30 @@ int lam_ddt_create_vector( int count, int bLength, long stride,
|
||||
|
||||
if( bLength == stride ) {
|
||||
/* the elements are contiguous */
|
||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
||||
lam_ddt_add( pData, oldType, count * bLength, 0, extent );
|
||||
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
ompi_ddt_add( pData, oldType, count * bLength, 0, extent );
|
||||
} else {
|
||||
if( count > 1 ) {
|
||||
if( bLength == 1 ) {
|
||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
||||
lam_ddt_add( pData, oldType, count - 1, 0, stride * extent );
|
||||
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
ompi_ddt_add( pData, oldType, count - 1, 0, stride * extent );
|
||||
} else {
|
||||
pTempData = lam_ddt_create( oldType->desc.used + 2 );
|
||||
pData = lam_ddt_create( oldType->desc.used + 2 + 2 );
|
||||
lam_ddt_add( pTempData, oldType, bLength, 0, extent );
|
||||
lam_ddt_add( pData, pTempData, count - 1, 0, stride * extent );
|
||||
pTempData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
pData = ompi_ddt_create( oldType->desc.used + 2 + 2 );
|
||||
ompi_ddt_add( pTempData, oldType, bLength, 0, extent );
|
||||
ompi_ddt_add( pData, pTempData, count - 1, 0, stride * extent );
|
||||
OBJ_RELEASE( pTempData );
|
||||
}
|
||||
} else {
|
||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
||||
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
}
|
||||
lam_ddt_add( pData, oldType, bLength, (count - 1) * extent * stride, extent );
|
||||
ompi_ddt_add( pData, oldType, bLength, (count - 1) * extent * stride, extent );
|
||||
}
|
||||
*newType = pData;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lam_ddt_create_hvector( int count, int bLength, long stride,
|
||||
int ompi_ddt_create_hvector( int count, int bLength, long stride,
|
||||
dt_desc_t* oldType, dt_desc_t** newType )
|
||||
{
|
||||
long extent = oldType->ub - oldType->lb;
|
||||
@ -47,19 +47,19 @@ int lam_ddt_create_hvector( int count, int bLength, long stride,
|
||||
|
||||
if( (extent * bLength) == stride ) {
|
||||
/* contiguous */
|
||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
||||
lam_ddt_add( pData, oldType, count * bLength, 0, extent );
|
||||
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
ompi_ddt_add( pData, oldType, count * bLength, 0, extent );
|
||||
} else {
|
||||
if( count > 1 ) {
|
||||
pTempData = lam_ddt_create( oldType->desc.used + 2 );
|
||||
pData = lam_ddt_create( oldType->desc.used + 2 + 2 );
|
||||
lam_ddt_add( pTempData, oldType, bLength, 0, extent );
|
||||
lam_ddt_add( pData, pTempData, count - 1, 0, stride );
|
||||
pTempData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
pData = ompi_ddt_create( oldType->desc.used + 2 + 2 );
|
||||
ompi_ddt_add( pTempData, oldType, bLength, 0, extent );
|
||||
ompi_ddt_add( pData, pTempData, count - 1, 0, stride );
|
||||
OBJ_RELEASE( pTempData );
|
||||
} else {
|
||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
||||
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||
}
|
||||
lam_ddt_add( pData, oldType, bLength, (count - 1) * stride, extent );
|
||||
ompi_ddt_add( pData, oldType, bLength, (count - 1) * stride, extent );
|
||||
}
|
||||
*newType = pData;
|
||||
return 0;
|
||||
|
@ -3,12 +3,12 @@
|
||||
#include "datatype.h"
|
||||
#include "datatype_internal.h"
|
||||
|
||||
int lam_ddt_destroy( dt_desc_t** dt )
|
||||
int ompi_ddt_destroy( dt_desc_t** dt )
|
||||
{
|
||||
dt_desc_t* pData = *dt;
|
||||
|
||||
if( pData->flags & DT_FLAG_FOREVER )
|
||||
return LAM_ERROR;
|
||||
return OMPI_ERROR;
|
||||
|
||||
OBJ_RELEASE( pData );
|
||||
*dt = NULL;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
/* other fields starting after bdt_used (index of DT_LOOP should be ONE) */
|
||||
#define EMPTY_DATA(NAME) NULL, "MPI_" # NAME, {0, 0, NULL}, {0, 0, NULL}, NULL, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
#define BASEOBJ_DATA { OBJ_CLASS(lam_datatype_t), 1 }
|
||||
#define BASEOBJ_DATA { OBJ_CLASS(ompi_datatype_t), 1 }
|
||||
#define INIT_BASIC_DATA( TYPE, ALIGN, NAME ) \
|
||||
{ BASEOBJ_DATA, sizeof(TYPE), 0, sizeof(TYPE), ALIGN, \
|
||||
0, sizeof(TYPE), DT_FLAG_BASIC | DT_FLAG_DATA, DT_##NAME, 1, \
|
||||
@ -15,42 +15,42 @@
|
||||
0, 0, DT_FLAG_BASIC, DT_##NAME, 1, \
|
||||
(((long long)1)<<(DT_##NAME)), EMPTY_DATA(NAME) }
|
||||
|
||||
lam_datatype_t basicDatatypes[DT_MAX_PREDEFINED] = {
|
||||
ompi_datatype_t basicDatatypes[DT_MAX_PREDEFINED] = {
|
||||
INIT_BASIC_TYPE( DT_LOOP, LOOP ),
|
||||
INIT_BASIC_TYPE( DT_END_LOOP, END_LOOP ),
|
||||
INIT_BASIC_TYPE( DT_LB, LB ),
|
||||
INIT_BASIC_TYPE( DT_UB, UB ),
|
||||
INIT_BASIC_DATA( char, LAM_ALIGNMENT_CHAR, CHAR ),
|
||||
INIT_BASIC_DATA( char, LAM_ALIGNMENT_CHAR, CHARACTER ),
|
||||
INIT_BASIC_DATA( unsigned char, LAM_ALIGNMENT_CHAR, UNSIGNED_CHAR ),
|
||||
INIT_BASIC_DATA( unsigned char, LAM_ALIGNMENT_CHAR, BYTE ),
|
||||
INIT_BASIC_DATA( short, LAM_ALIGNMENT_SHORT, SHORT ),
|
||||
INIT_BASIC_DATA( unsigned short, LAM_ALIGNMENT_SHORT, UNSIGNED_SHORT ),
|
||||
INIT_BASIC_DATA( int, LAM_ALIGNMENT_INT, INT ),
|
||||
INIT_BASIC_DATA( unsigned int, LAM_ALIGNMENT_INT, UNSIGNED_INT ),
|
||||
INIT_BASIC_DATA( long, LAM_ALIGNMENT_LONG, LONG ),
|
||||
INIT_BASIC_DATA( unsigned long, LAM_ALIGNMENT_LONG, UNSIGNED_LONG ),
|
||||
INIT_BASIC_DATA( char, OMPI_ALIGNMENT_CHAR, CHAR ),
|
||||
INIT_BASIC_DATA( char, OMPI_ALIGNMENT_CHAR, CHARACTER ),
|
||||
INIT_BASIC_DATA( unsigned char, OMPI_ALIGNMENT_CHAR, UNSIGNED_CHAR ),
|
||||
INIT_BASIC_DATA( unsigned char, OMPI_ALIGNMENT_CHAR, BYTE ),
|
||||
INIT_BASIC_DATA( short, OMPI_ALIGNMENT_SHORT, SHORT ),
|
||||
INIT_BASIC_DATA( unsigned short, OMPI_ALIGNMENT_SHORT, UNSIGNED_SHORT ),
|
||||
INIT_BASIC_DATA( int, OMPI_ALIGNMENT_INT, INT ),
|
||||
INIT_BASIC_DATA( unsigned int, OMPI_ALIGNMENT_INT, UNSIGNED_INT ),
|
||||
INIT_BASIC_DATA( long, OMPI_ALIGNMENT_LONG, LONG ),
|
||||
INIT_BASIC_DATA( unsigned long, OMPI_ALIGNMENT_LONG, UNSIGNED_LONG ),
|
||||
#if HAVE_LONG_LONG
|
||||
INIT_BASIC_DATA( long long, LAM_ALIGNMENT_LONG_LONG, LONG_LONG ),
|
||||
INIT_BASIC_DATA( long long, LAM_ALIGNMENT_LONG_LONG, LONG_LONG_INT ),
|
||||
INIT_BASIC_DATA( unsigned long long, LAM_ALIGNMENT_LONG_LONG, UNSIGNED_LONG_LONG ),
|
||||
INIT_BASIC_DATA( long long, OMPI_ALIGNMENT_LONG_LONG, LONG_LONG ),
|
||||
INIT_BASIC_DATA( long long, OMPI_ALIGNMENT_LONG_LONG, LONG_LONG_INT ),
|
||||
INIT_BASIC_DATA( unsigned long long, OMPI_ALIGNMENT_LONG_LONG, UNSIGNED_LONG_LONG ),
|
||||
#else
|
||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
INIT_BASIC_DATA( float, LAM_ALIGNMENT_FLOAT, FLOAT ),
|
||||
INIT_BASIC_DATA( double, LAM_ALIGNMENT_DOUBLE, DOUBLE ),
|
||||
INIT_BASIC_DATA( long double, LAM_ALIGNMENT_LONG_DOUBLE, LONG_DOUBLE ),
|
||||
INIT_BASIC_DATA( lam_complex_float_t, LAM_ALIGNMENT_FLOAT, COMPLEX_FLOAT ),
|
||||
INIT_BASIC_DATA( lam_complex_double_t, LAM_ALIGNMENT_DOUBLE, COMPLEX_DOUBLE ),
|
||||
INIT_BASIC_DATA( float, OMPI_ALIGNMENT_FLOAT, FLOAT ),
|
||||
INIT_BASIC_DATA( double, OMPI_ALIGNMENT_DOUBLE, DOUBLE ),
|
||||
INIT_BASIC_DATA( long double, OMPI_ALIGNMENT_LONG_DOUBLE, LONG_DOUBLE ),
|
||||
INIT_BASIC_DATA( ompi_complex_float_t, OMPI_ALIGNMENT_FLOAT, COMPLEX_FLOAT ),
|
||||
INIT_BASIC_DATA( ompi_complex_double_t, OMPI_ALIGNMENT_DOUBLE, COMPLEX_DOUBLE ),
|
||||
#if HAVE_LONG_DOUBLE
|
||||
INIT_BASIC_DATA( lam_complex_long_double_t, LAM_ALIGNMENT_LONG_DOUBLE, COMPLEX_LONG_DOUBLE ),
|
||||
INIT_BASIC_DATA( ompi_complex_long_double_t, OMPI_ALIGNMENT_LONG_DOUBLE, COMPLEX_LONG_DOUBLE ),
|
||||
#else
|
||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||
#endif /* HAVE_LONG_DOUBLE */
|
||||
INIT_BASIC_DATA( char, LAM_ALIGNMENT_CHAR, PACKED ),
|
||||
INIT_BASIC_DATA( int, LAM_ALIGNMENT_INT, LOGIC ),
|
||||
INIT_BASIC_DATA( char, OMPI_ALIGNMENT_CHAR, PACKED ),
|
||||
INIT_BASIC_DATA( int, OMPI_ALIGNMENT_INT, LOGIC ),
|
||||
INIT_BASIC_TYPE( DT_FLOAT_INT, FLOAT_INT ),
|
||||
INIT_BASIC_TYPE( DT_DOUBLE_INT, DOUBLE_INT ),
|
||||
#if HAVE_LONG_DOUBLE
|
||||
@ -78,54 +78,54 @@ lam_datatype_t basicDatatypes[DT_MAX_PREDEFINED] = {
|
||||
INIT_BASIC_TYPE( DT_UNAVAILABLE, UNAVAILABLE )
|
||||
};
|
||||
|
||||
lam_datatype_t* lam_mpi_char = basicDatatypes + DT_CHAR;
|
||||
lam_datatype_t* lam_mpi_byte = basicDatatypes + DT_BYTE;
|
||||
lam_datatype_t* lam_mpi_int = basicDatatypes + DT_INT;
|
||||
lam_datatype_t* lam_mpi_logic = basicDatatypes + DT_LOGIC;
|
||||
lam_datatype_t* lam_mpi_short = basicDatatypes + DT_SHORT;
|
||||
lam_datatype_t* lam_mpi_long = basicDatatypes + DT_LONG;
|
||||
lam_datatype_t* lam_mpi_float = basicDatatypes + DT_FLOAT;
|
||||
lam_datatype_t* lam_mpi_double = basicDatatypes + DT_DOUBLE;
|
||||
lam_datatype_t* lam_mpi_long_double = basicDatatypes + DT_LONG_DOUBLE;
|
||||
lam_datatype_t* lam_mpi_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||
lam_datatype_t* lam_mpi_packed = basicDatatypes + DT_PACKED;
|
||||
lam_datatype_t* lam_mpi_unsigned_char = basicDatatypes + DT_UNSIGNED_CHAR;
|
||||
lam_datatype_t* lam_mpi_unsigned_short = basicDatatypes + DT_UNSIGNED_SHORT;
|
||||
lam_datatype_t* lam_mpi_unsigned = basicDatatypes + DT_UNSIGNED_INT;
|
||||
lam_datatype_t* lam_mpi_unsigned_long = basicDatatypes + DT_UNSIGNED_LONG;
|
||||
lam_datatype_t* lam_mpi_ub = basicDatatypes + DT_UB;
|
||||
lam_datatype_t* lam_mpi_lb = basicDatatypes + DT_LB;
|
||||
lam_datatype_t* lam_mpi_float_int = basicDatatypes + DT_FLOAT_INT;
|
||||
lam_datatype_t* lam_mpi_double_int = basicDatatypes + DT_DOUBLE_INT;
|
||||
lam_datatype_t* lam_mpi_long_int = basicDatatypes + DT_LONG_INT;
|
||||
lam_datatype_t* lam_mpi_2int = basicDatatypes + DT_2INT;
|
||||
lam_datatype_t* lam_mpi_short_int = basicDatatypes + DT_SHORT_INT;
|
||||
lam_datatype_t* lam_mpi_dblcplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||
lam_datatype_t* lam_mpi_integer = basicDatatypes + DT_INTEGER;
|
||||
lam_datatype_t* lam_mpi_real = basicDatatypes + DT_REAL;
|
||||
lam_datatype_t* lam_mpi_dblprec = basicDatatypes + DT_DBLPREC;
|
||||
lam_datatype_t* lam_mpi_character = basicDatatypes + DT_CHARACTER;
|
||||
lam_datatype_t* lam_mpi_2real = basicDatatypes + DT_2REAL;
|
||||
lam_datatype_t* lam_mpi_2dblprec = basicDatatypes + DT_2DBLPREC;
|
||||
lam_datatype_t* lam_mpi_2integer = basicDatatypes + DT_2INTEGER;
|
||||
lam_datatype_t* lam_mpi_longdbl_int = basicDatatypes + DT_LONGDBL_INT;
|
||||
lam_datatype_t* lam_mpi_wchar = basicDatatypes + DT_WCHAR;
|
||||
lam_datatype_t* lam_mpi_long_long_int = basicDatatypes + DT_LONG_LONG_INT;
|
||||
lam_datatype_t* lam_mpi_long_long = basicDatatypes + DT_LONG_LONG;
|
||||
lam_datatype_t* lam_mpi_unsigned_long_long = basicDatatypes + DT_UNSIGNED_LONG_LONG;
|
||||
lam_datatype_t* lam_mpi_cxx_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||
lam_datatype_t* lam_mpi_cxx_dblcplex = basicDatatypes + DT_COMPLEX_DOUBLE;
|
||||
lam_datatype_t* lam_mpi_cxx_ldblcplex = basicDatatypes + DT_COMPLEX_LONG_DOUBLE;
|
||||
lam_datatype_t* lam_mpi_cxx_bool;
|
||||
lam_datatype_t* lam_mpi_2cplex = basicDatatypes + DT_2COMPLEX;
|
||||
lam_datatype_t* lam_mpi_2dblcplex = basicDatatypes + DT_2DOUBLE_COMPLEX;
|
||||
ompi_datatype_t* ompi_mpi_char = basicDatatypes + DT_CHAR;
|
||||
ompi_datatype_t* ompi_mpi_byte = basicDatatypes + DT_BYTE;
|
||||
ompi_datatype_t* ompi_mpi_int = basicDatatypes + DT_INT;
|
||||
ompi_datatype_t* ompi_mpi_logic = basicDatatypes + DT_LOGIC;
|
||||
ompi_datatype_t* ompi_mpi_short = basicDatatypes + DT_SHORT;
|
||||
ompi_datatype_t* ompi_mpi_long = basicDatatypes + DT_LONG;
|
||||
ompi_datatype_t* ompi_mpi_float = basicDatatypes + DT_FLOAT;
|
||||
ompi_datatype_t* ompi_mpi_double = basicDatatypes + DT_DOUBLE;
|
||||
ompi_datatype_t* ompi_mpi_long_double = basicDatatypes + DT_LONG_DOUBLE;
|
||||
ompi_datatype_t* ompi_mpi_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||
ompi_datatype_t* ompi_mpi_packed = basicDatatypes + DT_PACKED;
|
||||
ompi_datatype_t* ompi_mpi_unsigned_char = basicDatatypes + DT_UNSIGNED_CHAR;
|
||||
ompi_datatype_t* ompi_mpi_unsigned_short = basicDatatypes + DT_UNSIGNED_SHORT;
|
||||
ompi_datatype_t* ompi_mpi_unsigned = basicDatatypes + DT_UNSIGNED_INT;
|
||||
ompi_datatype_t* ompi_mpi_unsigned_long = basicDatatypes + DT_UNSIGNED_LONG;
|
||||
ompi_datatype_t* ompi_mpi_ub = basicDatatypes + DT_UB;
|
||||
ompi_datatype_t* ompi_mpi_lb = basicDatatypes + DT_LB;
|
||||
ompi_datatype_t* ompi_mpi_float_int = basicDatatypes + DT_FLOAT_INT;
|
||||
ompi_datatype_t* ompi_mpi_double_int = basicDatatypes + DT_DOUBLE_INT;
|
||||
ompi_datatype_t* ompi_mpi_long_int = basicDatatypes + DT_LONG_INT;
|
||||
ompi_datatype_t* ompi_mpi_2int = basicDatatypes + DT_2INT;
|
||||
ompi_datatype_t* ompi_mpi_short_int = basicDatatypes + DT_SHORT_INT;
|
||||
ompi_datatype_t* ompi_mpi_dblcplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||
ompi_datatype_t* ompi_mpi_integer = basicDatatypes + DT_INTEGER;
|
||||
ompi_datatype_t* ompi_mpi_real = basicDatatypes + DT_REAL;
|
||||
ompi_datatype_t* ompi_mpi_dblprec = basicDatatypes + DT_DBLPREC;
|
||||
ompi_datatype_t* ompi_mpi_character = basicDatatypes + DT_CHARACTER;
|
||||
ompi_datatype_t* ompi_mpi_2real = basicDatatypes + DT_2REAL;
|
||||
ompi_datatype_t* ompi_mpi_2dblprec = basicDatatypes + DT_2DBLPREC;
|
||||
ompi_datatype_t* ompi_mpi_2integer = basicDatatypes + DT_2INTEGER;
|
||||
ompi_datatype_t* ompi_mpi_longdbl_int = basicDatatypes + DT_LONGDBL_INT;
|
||||
ompi_datatype_t* ompi_mpi_wchar = basicDatatypes + DT_WCHAR;
|
||||
ompi_datatype_t* ompi_mpi_long_long_int = basicDatatypes + DT_LONG_LONG_INT;
|
||||
ompi_datatype_t* ompi_mpi_long_long = basicDatatypes + DT_LONG_LONG;
|
||||
ompi_datatype_t* ompi_mpi_unsigned_long_long = basicDatatypes + DT_UNSIGNED_LONG_LONG;
|
||||
ompi_datatype_t* ompi_mpi_cxx_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||
ompi_datatype_t* ompi_mpi_cxx_dblcplex = basicDatatypes + DT_COMPLEX_DOUBLE;
|
||||
ompi_datatype_t* ompi_mpi_cxx_ldblcplex = basicDatatypes + DT_COMPLEX_LONG_DOUBLE;
|
||||
ompi_datatype_t* ompi_mpi_cxx_bool;
|
||||
ompi_datatype_t* ompi_mpi_2cplex = basicDatatypes + DT_2COMPLEX;
|
||||
ompi_datatype_t* ompi_mpi_2dblcplex = basicDatatypes + DT_2DOUBLE_COMPLEX;
|
||||
|
||||
int local_sizes[DT_MAX_PREDEFINED];
|
||||
|
||||
/* VPS: fake convertor for time being / to provide pack/unpack functions */
|
||||
lam_convertor_t* lam_convertor;
|
||||
ompi_convertor_t* ompi_convertor;
|
||||
|
||||
static lam_convertor_t* pDumpConv = NULL;
|
||||
static ompi_convertor_t* pDumpConv = NULL;
|
||||
|
||||
#define COPY_DATA_DESC( PDST, PSRC ) \
|
||||
do { \
|
||||
@ -152,7 +152,7 @@ static lam_convertor_t* pDumpConv = NULL;
|
||||
#define DECLARE_MPI2_COMPOSED_STRUCT_DDT( PDATA, MPIDDT, MPIDDTNAME, type1, type2, MPIType1, MPIType2 ) \
|
||||
do { \
|
||||
struct { type1 v1; type2 v2; } s[2]; \
|
||||
lam_datatype_t *types[2], *ptype; \
|
||||
ompi_datatype_t *types[2], *ptype; \
|
||||
int bLength[2] = {1, 1}; \
|
||||
long base, displ[2]; \
|
||||
\
|
||||
@ -164,14 +164,14 @@ static lam_convertor_t* pDumpConv = NULL;
|
||||
displ[1] = (long)(&(s[0].v2)); \
|
||||
displ[1] -= base; \
|
||||
\
|
||||
lam_ddt_create_struct( 2, bLength, displ, types, &ptype ); \
|
||||
ompi_ddt_create_struct( 2, bLength, displ, types, &ptype ); \
|
||||
displ[0] = (long)(&(s[1])); \
|
||||
displ[0] -= base; \
|
||||
if( displ[0] != sizeof(s[0]) ) \
|
||||
ptype->ub = displ[0]; /* force a new extent for the datatype */ \
|
||||
ptype->flags |= DT_FLAG_FOREVER; \
|
||||
ptype->id = MPIDDT; \
|
||||
lam_ddt_commit( &ptype ); \
|
||||
ompi_ddt_commit( &ptype ); \
|
||||
COPY_DATA_DESC( PDATA, ptype ); \
|
||||
ptype->desc.desc = NULL; \
|
||||
ptype->opt_desc.desc = NULL; \
|
||||
@ -181,11 +181,11 @@ static lam_convertor_t* pDumpConv = NULL;
|
||||
|
||||
#define DECLARE_MPI2_COMPOSED_BLOCK_DDT( PDATA, MPIDDT, MPIDDTNAME, MPIType ) \
|
||||
do { \
|
||||
lam_datatype_t *ptype; \
|
||||
lam_ddt_create_contiguous( 2, &(basicDatatypes[MPIType]), &ptype ); \
|
||||
ompi_datatype_t *ptype; \
|
||||
ompi_ddt_create_contiguous( 2, &(basicDatatypes[MPIType]), &ptype ); \
|
||||
ptype->flags |= DT_FLAG_FOREVER; \
|
||||
ptype->id = MPIDDT; \
|
||||
lam_ddt_commit( &ptype ); \
|
||||
ompi_ddt_commit( &ptype ); \
|
||||
COPY_DATA_DESC( PDATA, ptype ); \
|
||||
ptype->desc.desc = NULL; \
|
||||
ptype->opt_desc.desc = NULL; \
|
||||
@ -193,7 +193,7 @@ static lam_convertor_t* pDumpConv = NULL;
|
||||
strncpy( PDATA->name, MPIDDTNAME, MPI_MAX_OBJECT_NAME ); \
|
||||
} while(0)
|
||||
|
||||
int lam_ddt_init( void )
|
||||
int ompi_ddt_init( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -210,37 +210,37 @@ int lam_ddt_init( void )
|
||||
}
|
||||
|
||||
/* the 2 complex datatypes (float and double) */
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_cplex, DT_COMPLEX_FLOAT, "MPI_COMPLEX", float, float, DT_FLOAT, DT_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_dblcplex, DT_COMPLEX_DOUBLE, "MPI_DOUBLE_COMPLEX", double, double, DT_DOUBLE, DT_DOUBLE );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_cplex, DT_COMPLEX_FLOAT, "MPI_COMPLEX", float, float, DT_FLOAT, DT_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_dblcplex, DT_COMPLEX_DOUBLE, "MPI_DOUBLE_COMPLEX", double, double, DT_DOUBLE, DT_DOUBLE );
|
||||
/* C++ complex types */
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_cxx_cplex, DT_COMPLEX_FLOAT, "MPI_CXX_COMPLEX", float, float, DT_FLOAT, DT_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_cxx_dblcplex, DT_COMPLEX_DOUBLE, "MPI_CXX_DOUBLE_COMPLEX", double, double, DT_DOUBLE, DT_DOUBLE );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_cxx_ldblcplex, DT_COMPLEX_LONG_DOUBLE, "MPI_CXX_LONG_DOUBLE_COMPLEX", long double, long double, DT_LONG_DOUBLE, DT_LONG_DOUBLE );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_cxx_cplex, DT_COMPLEX_FLOAT, "MPI_CXX_COMPLEX", float, float, DT_FLOAT, DT_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_cxx_dblcplex, DT_COMPLEX_DOUBLE, "MPI_CXX_DOUBLE_COMPLEX", double, double, DT_DOUBLE, DT_DOUBLE );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_cxx_ldblcplex, DT_COMPLEX_LONG_DOUBLE, "MPI_CXX_LONG_DOUBLE_COMPLEX", long double, long double, DT_LONG_DOUBLE, DT_LONG_DOUBLE );
|
||||
|
||||
/* Now the predefined MPI2 datatypes (they should last forever!) */
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_float_int, DT_FLOAT_INT, "MPI_FLOAT_INT", float, int, DT_FLOAT, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_double_int, DT_DOUBLE_INT, "MPI_DOUBLE_INT", double, int, DT_DOUBLE, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_long_int, DT_LONG_INT, "MPI_LONG_INT", long, int, DT_LONG, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_short_int, DT_SHORT_INT, "MPI_SHORT_INT", short, int, DT_SHORT, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( lam_mpi_longdbl_int, DT_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT", long double, int, DT_LONG_DOUBLE, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_float_int, DT_FLOAT_INT, "MPI_FLOAT_INT", float, int, DT_FLOAT, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_double_int, DT_DOUBLE_INT, "MPI_DOUBLE_INT", double, int, DT_DOUBLE, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_long_int, DT_LONG_INT, "MPI_LONG_INT", long, int, DT_LONG, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_short_int, DT_SHORT_INT, "MPI_SHORT_INT", short, int, DT_SHORT, DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( ompi_mpi_longdbl_int, DT_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT", long double, int, DT_LONG_DOUBLE, DT_INT );
|
||||
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( lam_mpi_2int, DT_2INT, "MPI_2INT", DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( lam_mpi_2integer, DT_2INTEGER, "MPI_2INTEGER", DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( lam_mpi_2real, DT_2REAL, "MPI_2REAL", DT_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( lam_mpi_2dblprec, DT_2DBLPREC, "MPI_2DOUBLE_PRECISION", DT_DOUBLE );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( lam_mpi_2cplex, DT_2COMPLEX, "MPI_2COMPLEX", DT_COMPLEX_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( lam_mpi_2dblcplex, DT_2DOUBLE_COMPLEX, "MPI_2DOUBLE_COMPLEX", DT_COMPLEX_DOUBLE );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( ompi_mpi_2int, DT_2INT, "MPI_2INT", DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( ompi_mpi_2integer, DT_2INTEGER, "MPI_2INTEGER", DT_INT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( ompi_mpi_2real, DT_2REAL, "MPI_2REAL", DT_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( ompi_mpi_2dblprec, DT_2DBLPREC, "MPI_2DOUBLE_PRECISION", DT_DOUBLE );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( ompi_mpi_2cplex, DT_2COMPLEX, "MPI_2COMPLEX", DT_COMPLEX_FLOAT );
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( ompi_mpi_2dblcplex, DT_2DOUBLE_COMPLEX, "MPI_2DOUBLE_COMPLEX", DT_COMPLEX_DOUBLE );
|
||||
|
||||
for( i = 0; i < DT_MAX_PREDEFINED; i++ )
|
||||
local_sizes[i] = basicDatatypes[i].size;
|
||||
|
||||
/* VPS: Create a fake convertor. No error checking here now, since
|
||||
this will be removed sometime */
|
||||
lam_convertor = lam_convertor_create(0,0);
|
||||
ompi_convertor = ompi_convertor_create(0,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lam_ddt_finalize( void )
|
||||
int ompi_ddt_finalize( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -312,7 +312,7 @@ static void __dt_contain_basic_datatypes( dt_desc_t* pData )
|
||||
}
|
||||
}
|
||||
|
||||
void lam_ddt_dump( dt_desc_t* data )
|
||||
void ompi_ddt_dump( dt_desc_t* data )
|
||||
{
|
||||
dt_desc_t* pData = (dt_desc_t*)data;
|
||||
|
||||
@ -371,8 +371,8 @@ DUMP_TYPE( long, long )
|
||||
DUMP_TYPE( double, double )
|
||||
DUMP_TYPE( long_long, long long )
|
||||
DUMP_TYPE( long_double, long double )
|
||||
DUMP_TYPE( complex_float, lam_complex_float_t )
|
||||
DUMP_TYPE( complex_double, lam_complex_double_t )
|
||||
DUMP_TYPE( complex_float, ompi_complex_float_t )
|
||||
DUMP_TYPE( complex_double, ompi_complex_double_t )
|
||||
|
||||
static conversion_fct_t dump_functions[DT_MAX_PREDEFINED] = {
|
||||
(conversion_fct_t)NULL, /* DT_LOOP */
|
||||
@ -392,7 +392,7 @@ static conversion_fct_t dump_functions[DT_MAX_PREDEFINED] = {
|
||||
(conversion_fct_t)dump_complex_double, /* DT_COMPLEX_DOUBLE */
|
||||
};
|
||||
|
||||
void lam_ddt_dump_complete( dt_desc_t* data )
|
||||
void ompi_ddt_dump_complete( dt_desc_t* data )
|
||||
{
|
||||
dt_desc_t* pData = (dt_desc_t*)data;
|
||||
struct iovec fake = { (void*)0, 0 };
|
||||
@ -416,13 +416,13 @@ void lam_ddt_dump_complete( dt_desc_t* data )
|
||||
printf( ")\n contain " ); __dt_contain_basic_datatypes( pData );
|
||||
printf( "\n{\n" );
|
||||
if( pDumpConv == NULL ) {
|
||||
pDumpConv = lam_convertor_create( 0, 0 );
|
||||
pDumpConv = ompi_convertor_create( 0, 0 );
|
||||
}
|
||||
lam_convertor_init_for_recv( pDumpConv, 0, pData, 1, NULL, 0 );
|
||||
ompi_convertor_init_for_recv( pDumpConv, 0, pData, 1, NULL, 0 );
|
||||
pDumpConv->pFunctions = dump_functions;
|
||||
|
||||
fake.iov_len = pData->size;
|
||||
lam_convertor_unpack( pDumpConv, &fake, 1 );
|
||||
ompi_convertor_unpack( pDumpConv, &fake, 1 );
|
||||
/* As this convertor wii be here forever (at least until the end of the
|
||||
* application, we should release the ddt pointer and free the stack.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "datatype.h"
|
||||
#include "datatype_internal.h"
|
||||
@ -40,7 +40,7 @@ static inline long GET_LOOP_DISP( dt_elem_desc_t* _pElem )
|
||||
return _pElem->disp;
|
||||
}
|
||||
|
||||
int lam_ddt_optimize_short( dt_desc_t* pData, int count, dt_type_desc_t* pTypeDesc )
|
||||
int ompi_ddt_optimize_short( dt_desc_t* pData, int count, dt_type_desc_t* pTypeDesc )
|
||||
{
|
||||
dt_elem_desc_t* pElemDesc;
|
||||
long lastDisp = 0;
|
||||
@ -163,7 +163,7 @@ int lam_ddt_optimize_short( dt_desc_t* pData, int count, dt_type_desc_t* pTypeDe
|
||||
__sofar += (LENGTH); \
|
||||
}
|
||||
|
||||
static int lam_ddt_unroll( dt_desc_t* pData, int count )
|
||||
static int ompi_ddt_unroll( dt_desc_t* pData, int count )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
int pos_desc; /* actual position in the description of the derived datatype */
|
||||
@ -277,7 +277,7 @@ static int lam_ddt_unroll( dt_desc_t* pData, int count )
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lam_ddt_commit( dt_desc_t** data )
|
||||
int ompi_ddt_commit( dt_desc_t** data )
|
||||
{
|
||||
dt_desc_t* pData = (dt_desc_t*)*data;
|
||||
dt_elem_desc_t* pLast = &(pData->desc.desc[pData->desc.used]);
|
||||
@ -296,7 +296,7 @@ int lam_ddt_commit( dt_desc_t** data )
|
||||
|
||||
/* If the data is contiguous is useless to generate an optimized version. */
|
||||
if( pData->size != (pData->true_ub - pData->true_lb) ) {
|
||||
(void)lam_ddt_optimize_short( pData, 1, &(pData->opt_desc) );
|
||||
(void)ompi_ddt_optimize_short( pData, 1, &(pData->opt_desc) );
|
||||
/* let's add a fake element at the end just to avoid useless comparaisons
|
||||
* in pack/unpack functions.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "datatype.h"
|
||||
#include "datatype_internal.h"
|
||||
@ -10,7 +10,7 @@
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
static int lam_convertor_pack_general( lam_convertor_t* pConvertor,
|
||||
static int ompi_convertor_pack_general( ompi_convertor_t* pConvertor,
|
||||
struct iovec* out, unsigned int outCount )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
@ -135,7 +135,7 @@ static int lam_convertor_pack_general( lam_convertor_t* pConvertor,
|
||||
|
||||
/* We suppose here that we work with an already optimized version of the data
|
||||
*/
|
||||
static int lam_convertor_pack_homogeneous( lam_convertor_t* pConv,
|
||||
static int ompi_convertor_pack_homogeneous( ompi_convertor_t* pConv,
|
||||
struct iovec* iov, unsigned int out_size )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
@ -271,10 +271,10 @@ static int lam_convertor_pack_homogeneous( lam_convertor_t* pConv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lam_convertor_pack_homogeneous_contig( lam_convertor_t* pConv,
|
||||
static int ompi_convertor_pack_homogeneous_contig( ompi_convertor_t* pConv,
|
||||
struct iovec* out, unsigned int out_size )
|
||||
{
|
||||
lam_datatype_t* pData = pConv->pDesc;
|
||||
ompi_datatype_t* pData = pConv->pDesc;
|
||||
char* pSrc = pConv->pBaseBuf + pData->true_lb + pConv->bConverted;
|
||||
size_t length = pData->size * pConv->count;
|
||||
long extent;
|
||||
@ -308,7 +308,7 @@ static int lam_convertor_pack_homogeneous_contig( lam_convertor_t* pConv,
|
||||
* 1 if everything went fine and the data was completly converted
|
||||
* -1 something wrong occurs.
|
||||
*/
|
||||
int lam_convertor_pack( lam_convertor_t* pConv, struct iovec* out, unsigned int out_size )
|
||||
int ompi_convertor_pack( ompi_convertor_t* pConv, struct iovec* out, unsigned int out_size )
|
||||
{
|
||||
dt_desc_t* pData = pConv->pDesc;
|
||||
|
||||
@ -324,11 +324,11 @@ int lam_convertor_pack( lam_convertor_t* pConv, struct iovec* out, unsigned int
|
||||
pConv->freebuf = out[0].iov_base;
|
||||
}
|
||||
}
|
||||
return lam_convertor_progress( pConv, out, out_size );
|
||||
return ompi_convertor_progress( pConv, out, out_size );
|
||||
}
|
||||
|
||||
extern int local_sizes[DT_MAX_PREDEFINED];
|
||||
int lam_convertor_init_for_send( lam_convertor_t* pConv, unsigned int flags,
|
||||
int ompi_convertor_init_for_send( ompi_convertor_t* pConv, unsigned int flags,
|
||||
dt_desc_t* dt, int count,
|
||||
void* pUserBuf, int local_starting_point )
|
||||
{
|
||||
@ -352,23 +352,23 @@ int lam_convertor_init_for_send( lam_convertor_t* pConv, unsigned int flags,
|
||||
pConv->bConverted = 0;
|
||||
if( dt->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
pConv->flags |= DT_FLAG_CONTIGUOUS;
|
||||
pConv->fAdvance = lam_convertor_pack_homogeneous_contig;
|
||||
pConv->fAdvance = ompi_convertor_pack_homogeneous_contig;
|
||||
} else {
|
||||
/* TODO handle the sender convert case */
|
||||
pConv->fAdvance = lam_convertor_pack_general;
|
||||
pConv->fAdvance = lam_convertor_pack_homogeneous;
|
||||
pConv->fAdvance = ompi_convertor_pack_general;
|
||||
pConv->fAdvance = ompi_convertor_pack_homogeneous;
|
||||
}
|
||||
if( pConv->freebuf != NULL ) {
|
||||
free( pConv->freebuf );
|
||||
pConv->freebuf = NULL;
|
||||
}
|
||||
lam_create_stack_with_pos( pConv, local_starting_point, local_sizes );
|
||||
ompi_create_stack_with_pos( pConv, local_starting_point, local_sizes );
|
||||
return 0;
|
||||
}
|
||||
|
||||
lam_convertor_t* lam_convertor_create( int remote_arch, int mode )
|
||||
ompi_convertor_t* ompi_convertor_create( int remote_arch, int mode )
|
||||
{
|
||||
lam_convertor_t* pConv = OBJ_NEW(lam_convertor_t);
|
||||
ompi_convertor_t* pConv = OBJ_NEW(ompi_convertor_t);
|
||||
|
||||
pConv->pDesc = NULL;
|
||||
pConv->pStack = NULL;
|
||||
@ -378,7 +378,7 @@ lam_convertor_t* lam_convertor_create( int remote_arch, int mode )
|
||||
return pConv;
|
||||
}
|
||||
|
||||
static int lam_convertor_destroy( lam_convertor_t* pConv )
|
||||
static int ompi_convertor_destroy( ompi_convertor_t* pConv )
|
||||
{
|
||||
if( pConv == NULL ) return 0;
|
||||
if( pConv->pStack != NULL ) free( pConv->pStack );
|
||||
@ -387,11 +387,11 @@ static int lam_convertor_destroy( lam_convertor_t* pConv )
|
||||
return 0;
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(lam_convertor_t, lam_object_t, NULL, lam_convertor_destroy );
|
||||
OBJ_CLASS_INSTANCE(ompi_convertor_t, ompi_object_t, NULL, ompi_convertor_destroy );
|
||||
|
||||
inline int lam_convertor_copy( lam_convertor_t* pSrcConv, lam_convertor_t* pDestConv )
|
||||
inline int ompi_convertor_copy( ompi_convertor_t* pSrcConv, ompi_convertor_t* pDestConv )
|
||||
{
|
||||
MEMCPY( pDestConv, pSrcConv, sizeof(lam_convertor_t) );
|
||||
MEMCPY( pDestConv, pSrcConv, sizeof(ompi_convertor_t) );
|
||||
pDestConv->pStack = NULL;
|
||||
pDestConv->pDesc = NULL;
|
||||
pDestConv->count = 0;
|
||||
@ -399,27 +399,27 @@ inline int lam_convertor_copy( lam_convertor_t* pSrcConv, lam_convertor_t* pDest
|
||||
pDestConv->bConverted = 0;
|
||||
pDestConv->fAdvance = NULL;
|
||||
pDestConv->freebuf = NULL;
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
lam_convertor_t* lam_convertor_get_copy( lam_convertor_t* pConvertor )
|
||||
ompi_convertor_t* ompi_convertor_get_copy( ompi_convertor_t* pConvertor )
|
||||
{
|
||||
lam_convertor_t* pDestConv = OBJ_NEW(lam_convertor_t);
|
||||
(void)lam_convertor_copy( pConvertor, pDestConv );
|
||||
ompi_convertor_t* pDestConv = OBJ_NEW(ompi_convertor_t);
|
||||
(void)ompi_convertor_copy( pConvertor, pDestConv );
|
||||
return pDestConv;
|
||||
}
|
||||
|
||||
/* Actually we suppose that we can only do receiver side conversion */
|
||||
int lam_convertor_get_packed_size( lam_convertor_t* pConv, int* pSize )
|
||||
int ompi_convertor_get_packed_size( ompi_convertor_t* pConv, int* pSize )
|
||||
{
|
||||
if( lam_ddt_type_size( pConv->pDesc, pSize ) != 0 )
|
||||
if( ompi_ddt_type_size( pConv->pDesc, pSize ) != 0 )
|
||||
return -1;
|
||||
/* actually *pSize contain the size of one instance of the data */
|
||||
*pSize = (*pSize) * pConv->count;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int lam_convertor_get_unpacked_size( lam_convertor_t* pConv, int* pSize )
|
||||
int ompi_convertor_get_unpacked_size( ompi_convertor_t* pConv, int* pSize )
|
||||
{
|
||||
int i;
|
||||
dt_desc_t* pData = pConv->pDesc;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "datatype/datatype.h"
|
||||
|
||||
/*
|
||||
* lam_dtsndrcv
|
||||
* ompi_dtsndrcv
|
||||
*
|
||||
* Function: - copy MPI message from buffer into another
|
||||
* - send/recv done if cannot optimize
|
||||
@ -24,7 +24,7 @@
|
||||
* Returns: - MPI_SUCCESS or error code
|
||||
*/
|
||||
int
|
||||
lam_ddt_sndrcv(void *sbuf, int scount, MPI_Datatype sdtype, void *rbuf,
|
||||
ompi_ddt_sndrcv(void *sbuf, int scount, MPI_Datatype sdtype, void *rbuf,
|
||||
int rcount, MPI_Datatype rdtype, int tag, MPI_Comm comm)
|
||||
{
|
||||
int err; /* error code */
|
||||
@ -38,7 +38,7 @@ lam_ddt_sndrcv(void *sbuf, int scount, MPI_Datatype sdtype, void *rbuf,
|
||||
*/
|
||||
if (sdtype == rdtype) {
|
||||
if (scount <= rcount) {
|
||||
lam_ddt_copy_content_same_ddt(rdtype, scount, (char *) rbuf,
|
||||
ompi_ddt_copy_content_same_ddt(rdtype, scount, (char *) rbuf,
|
||||
(char *) sbuf);
|
||||
err = MPI_SUCCESS;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
#include "datatype.h"
|
||||
#include "datatype_internal.h"
|
||||
|
||||
@ -39,7 +39,7 @@ void dump_stack( dt_stack_t* pStack, int stack_pos, dt_elem_desc_t* pDesc, char*
|
||||
* 1 if everything went fine and the data was completly converted
|
||||
* -1 something wrong occurs.
|
||||
*/
|
||||
static int lam_convertor_unpack_general( lam_convertor_t* pConvertor,
|
||||
static int ompi_convertor_unpack_general( ompi_convertor_t* pConvertor,
|
||||
struct iovec* pInputv, unsigned int inputCount )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
@ -160,7 +160,7 @@ static int lam_convertor_unpack_general( lam_convertor_t* pConvertor,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lam_convertor_unpack_homogeneous( lam_convertor_t* pConv,
|
||||
static int ompi_convertor_unpack_homogeneous( ompi_convertor_t* pConv,
|
||||
struct iovec* iov, unsigned int out_size )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
@ -270,7 +270,7 @@ static int lam_convertor_unpack_homogeneous( lam_convertor_t* pConv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lam_convertor_unpack_homogeneous_contig( lam_convertor_t* pConv,
|
||||
static int ompi_convertor_unpack_homogeneous_contig( ompi_convertor_t* pConv,
|
||||
struct iovec* iov, unsigned int out_size )
|
||||
{
|
||||
dt_desc_t *pData = pConv->pDesc;
|
||||
@ -302,7 +302,7 @@ static int lam_convertor_unpack_homogeneous_contig( lam_convertor_t* pConv,
|
||||
return (pConv->bConverted == (pData->size * pConv->count));
|
||||
}
|
||||
|
||||
int lam_convertor_unpack( lam_convertor_t* pConvertor,
|
||||
int ompi_convertor_unpack( ompi_convertor_t* pConvertor,
|
||||
struct iovec* pInputv,
|
||||
unsigned int inputCount )
|
||||
{
|
||||
@ -332,7 +332,7 @@ int lam_convertor_unpack( lam_convertor_t* pConvertor,
|
||||
if( (pInput >= pOutput) && (pInput < (pOutput + pConvertor->count * (pData->ub - pData->lb))) ) {
|
||||
return 1;
|
||||
}
|
||||
return lam_convertor_progress( pConvertor, pInputv, inputCount );
|
||||
return ompi_convertor_progress( pConvertor, pInputv, inputCount );
|
||||
}
|
||||
|
||||
/* Return value:
|
||||
@ -385,8 +385,8 @@ COPY_TYPE( long, long )
|
||||
/*COPY_TYPE( double, double );*/
|
||||
COPY_TYPE( long_long, long long )
|
||||
COPY_TYPE( long_double, long double )
|
||||
COPY_TYPE( complex_float, lam_complex_float_t )
|
||||
COPY_TYPE( complex_double, lam_complex_double_t )
|
||||
COPY_TYPE( complex_float, ompi_complex_float_t )
|
||||
COPY_TYPE( complex_double, ompi_complex_double_t )
|
||||
|
||||
static int copy_double( unsigned int count,
|
||||
char* from, unsigned int from_len, long from_extent,
|
||||
@ -444,14 +444,14 @@ conversion_fct_t copy_functions[DT_MAX_PREDEFINED] = {
|
||||
/* Should we supply buffers to the convertor or can we use directly
|
||||
* the user buffer ?
|
||||
*/
|
||||
int lam_convertor_need_buffers( lam_convertor_t* pConvertor )
|
||||
int ompi_convertor_need_buffers( ompi_convertor_t* pConvertor )
|
||||
{
|
||||
if( pConvertor->flags & DT_FLAG_CONTIGUOUS ) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern int local_sizes[DT_MAX_PREDEFINED];
|
||||
int lam_convertor_init_for_recv( lam_convertor_t* pConv, unsigned int flags,
|
||||
int ompi_convertor_init_for_recv( ompi_convertor_t* pConv, unsigned int flags,
|
||||
dt_desc_t* pData, int count,
|
||||
void* pUserBuf, int starting_point )
|
||||
{
|
||||
@ -476,11 +476,11 @@ int lam_convertor_init_for_recv( lam_convertor_t* pConv, unsigned int flags,
|
||||
/* TODO: work only on homogeneous architectures */
|
||||
if( pData->flags & DT_FLAG_CONTIGUOUS ) {
|
||||
pConv->flags |= DT_FLAG_CONTIGUOUS;
|
||||
pConv->fAdvance = lam_convertor_unpack_homogeneous_contig;
|
||||
pConv->fAdvance = ompi_convertor_unpack_homogeneous_contig;
|
||||
} else {
|
||||
pConv->fAdvance = lam_convertor_unpack_homogeneous;
|
||||
pConv->fAdvance = ompi_convertor_unpack_homogeneous;
|
||||
}
|
||||
lam_create_stack_with_pos( pConv, starting_point, local_sizes );
|
||||
ompi_create_stack_with_pos( pConv, starting_point, local_sizes );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -493,7 +493,7 @@ int lam_convertor_init_for_recv( lam_convertor_t* pConv, unsigned int flags,
|
||||
* positive = number of basic elements inside
|
||||
* negative = some error occurs
|
||||
*/
|
||||
int lam_ddt_get_element_count( dt_desc_t* pData, int iSize )
|
||||
int ompi_ddt_get_element_count( dt_desc_t* pData, int iSize )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
int pos_desc; /* actual position in the description of the derived datatype */
|
||||
@ -557,7 +557,7 @@ int lam_ddt_get_element_count( dt_desc_t* pData, int iSize )
|
||||
return nbElems;
|
||||
}
|
||||
|
||||
int lam_ddt_copy_content_same_ddt( dt_desc_t* pData, int count,
|
||||
int ompi_ddt_copy_content_same_ddt( dt_desc_t* pData, int count,
|
||||
char* pDestBuf, char* pSrcBuf )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "datatype.h"
|
||||
#include "datatype_internal.h"
|
||||
@ -16,19 +16,19 @@ static inline long GET_LOOP_DISP( dt_elem_desc_t* _pElem )
|
||||
return _pElem->disp;
|
||||
}
|
||||
|
||||
int lam_create_stack_with_pos( lam_convertor_t* pConvertor,
|
||||
int ompi_create_stack_with_pos( ompi_convertor_t* pConvertor,
|
||||
int starting_point, int* sizes );
|
||||
int lam_create_stack_with_pos_general( lam_convertor_t* pConvertor,
|
||||
int ompi_create_stack_with_pos_general( ompi_convertor_t* pConvertor,
|
||||
int starting_point, int* sizes );
|
||||
|
||||
int lam_create_stack_with_pos_general( lam_convertor_t* pConvertor,
|
||||
int ompi_create_stack_with_pos_general( ompi_convertor_t* pConvertor,
|
||||
int starting_point, int* sizes )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
int pos_desc; /* actual position in the description of the derived datatype */
|
||||
int type, lastLength = 0;
|
||||
long totalDisp;
|
||||
lam_datatype_t* pData = pConvertor->pDesc;
|
||||
ompi_datatype_t* pData = pConvertor->pDesc;
|
||||
int* remoteLength;
|
||||
int loop_length;
|
||||
int resting_place = starting_point;
|
||||
@ -141,14 +141,14 @@ int lam_create_stack_with_pos_general( lam_convertor_t* pConvertor,
|
||||
* because we can split a basic data in the middle if we
|
||||
* have a optimized representation.
|
||||
*/
|
||||
int lam_create_stack_with_pos( lam_convertor_t* pConvertor,
|
||||
int ompi_create_stack_with_pos( ompi_convertor_t* pConvertor,
|
||||
int starting_point, int* sizes )
|
||||
{
|
||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||
int pos_desc; /* actual position in the description of the derived datatype */
|
||||
int type, lastLength = 0;
|
||||
long totalDisp;
|
||||
lam_datatype_t* pData = pConvertor->pDesc;
|
||||
ompi_datatype_t* pData = pConvertor->pDesc;
|
||||
int* remoteLength;
|
||||
int loop_length;
|
||||
int resting_place = starting_point;
|
||||
|
@ -22,8 +22,8 @@ liberrhandler_la_SOURCES = \
|
||||
# Conditionally install the header files
|
||||
|
||||
if WANT_INSTALL_HEADERS
|
||||
lamdir = $(includedir)/lam/errhandler
|
||||
lam_HEADERS = $(headers)
|
||||
ompidir = $(includedir)/ompi/errhandler
|
||||
ompi_HEADERS = $(headers)
|
||||
else
|
||||
lamdir = $(includedir)
|
||||
ompidir = $(includedir)
|
||||
endif
|
||||
|
@ -2,46 +2,46 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "communicator/communicator.h"
|
||||
#include "win/win.h"
|
||||
#include "file/file.h"
|
||||
#include "errhandler/errhandler.h"
|
||||
#include "errhandler/errhandler_predefined.h"
|
||||
#include "lfc/lam_pointer_array.h"
|
||||
#include "class/ompi_pointer_array.h"
|
||||
|
||||
|
||||
/*
|
||||
* Table for Fortran <-> C errhandler handle conversion
|
||||
*/
|
||||
lam_pointer_array_t *lam_errhandler_f_to_c_table;
|
||||
ompi_pointer_array_t *ompi_errhandler_f_to_c_table;
|
||||
|
||||
|
||||
/*
|
||||
* Class information
|
||||
*/
|
||||
static void lam_errhandler_construct(lam_errhandler_t *eh);
|
||||
static void lam_errhandler_destruct(lam_errhandler_t *eh);
|
||||
static void ompi_errhandler_construct(ompi_errhandler_t *eh);
|
||||
static void ompi_errhandler_destruct(ompi_errhandler_t *eh);
|
||||
|
||||
|
||||
/*
|
||||
* Class instance
|
||||
*/
|
||||
OBJ_CLASS_INSTANCE(lam_errhandler_t, lam_object_t, lam_errhandler_construct,
|
||||
lam_errhandler_destruct);
|
||||
OBJ_CLASS_INSTANCE(ompi_errhandler_t, ompi_object_t, ompi_errhandler_construct,
|
||||
ompi_errhandler_destruct);
|
||||
|
||||
|
||||
/*
|
||||
* MPI_ERRHANDLER_NULL
|
||||
*/
|
||||
lam_errhandler_t lam_mpi_errhandler_null = {
|
||||
ompi_errhandler_t ompi_mpi_errhandler_null = {
|
||||
{ NULL, 0 },
|
||||
|
||||
"MPI_ERRHANDLER_NULL",
|
||||
true,
|
||||
false,
|
||||
LAM_ERRHANDLER_TYPE_COMM,
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -49,14 +49,14 @@ lam_errhandler_t lam_mpi_errhandler_null = {
|
||||
/*
|
||||
* MPI_ERRORS_ARE_FATAL
|
||||
*/
|
||||
lam_errhandler_t lam_mpi_errors_are_fatal = {
|
||||
ompi_errhandler_t ompi_mpi_errors_are_fatal = {
|
||||
{ NULL, 0 },
|
||||
|
||||
"MPI_ERRORS_ARE_FATAL",
|
||||
true,
|
||||
false,
|
||||
LAM_ERRHANDLER_TYPE_COMM,
|
||||
{ lam_mpi_errors_are_fatal_handler },
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
{ ompi_mpi_errors_are_fatal_handler },
|
||||
-1
|
||||
};
|
||||
|
||||
@ -64,76 +64,76 @@ lam_errhandler_t lam_mpi_errors_are_fatal = {
|
||||
/*
|
||||
* MPI_ERRORS_RETURN
|
||||
*/
|
||||
lam_errhandler_t lam_mpi_errors_return = {
|
||||
ompi_errhandler_t ompi_mpi_errors_return = {
|
||||
{ NULL, 0 },
|
||||
|
||||
"MPI_ERRORS_ARE_RETURN",
|
||||
true,
|
||||
false,
|
||||
LAM_ERRHANDLER_TYPE_COMM,
|
||||
{ lam_mpi_errors_return_handler },
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
{ ompi_mpi_errors_return_handler },
|
||||
-1
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Initialize LAM errhandler infrastructure
|
||||
* Initialize OMPI errhandler infrastructure
|
||||
*/
|
||||
int lam_errhandler_init(void)
|
||||
int ompi_errhandler_init(void)
|
||||
{
|
||||
int ret_val;
|
||||
|
||||
/* initialize lam_errhandler_f_to_c_table */
|
||||
/* initialize ompi_errhandler_f_to_c_table */
|
||||
|
||||
lam_errhandler_f_to_c_table = OBJ_NEW(lam_pointer_array_t);
|
||||
if (NULL == lam_errhandler_f_to_c_table){
|
||||
return LAM_ERROR;
|
||||
ompi_errhandler_f_to_c_table = OBJ_NEW(ompi_pointer_array_t);
|
||||
if (NULL == ompi_errhandler_f_to_c_table){
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
/* Initialize the predefined error handlers */
|
||||
OBJ_CONSTRUCT( &lam_mpi_errhandler_null, lam_errhandler_t );
|
||||
if( lam_mpi_errhandler_null.eh_f_to_c_index != LAM_ERRHANDLER_NULL_FORTRAN )
|
||||
return LAM_ERROR;
|
||||
OBJ_CONSTRUCT( &ompi_mpi_errhandler_null, ompi_errhandler_t );
|
||||
if( ompi_mpi_errhandler_null.eh_f_to_c_index != OMPI_ERRHANDLER_NULL_FORTRAN )
|
||||
return OMPI_ERROR;
|
||||
|
||||
OBJ_CONSTRUCT( &lam_mpi_errors_are_fatal, lam_errhandler_t );
|
||||
if( lam_mpi_errors_are_fatal.eh_f_to_c_index != LAM_ERRORS_ARE_FATAL_FORTRAN )
|
||||
return LAM_ERROR;
|
||||
OBJ_CONSTRUCT( &ompi_mpi_errors_are_fatal, ompi_errhandler_t );
|
||||
if( ompi_mpi_errors_are_fatal.eh_f_to_c_index != OMPI_ERRORS_ARE_FATAL_FORTRAN )
|
||||
return OMPI_ERROR;
|
||||
|
||||
OBJ_CONSTRUCT( &lam_mpi_errors_return, lam_errhandler_t );
|
||||
if( lam_mpi_errors_return.eh_f_to_c_index != LAM_ERRORS_RETURN_FORTRAN )
|
||||
return LAM_ERROR;
|
||||
OBJ_CONSTRUCT( &ompi_mpi_errors_return, ompi_errhandler_t );
|
||||
if( ompi_mpi_errors_return.eh_f_to_c_index != OMPI_ERRORS_RETURN_FORTRAN )
|
||||
return OMPI_ERROR;
|
||||
|
||||
/* All done */
|
||||
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Clean up the errorhandler resources
|
||||
*/
|
||||
int lam_errhandler_finalize(void)
|
||||
int ompi_errhandler_finalize(void)
|
||||
{
|
||||
/* Remove errhandler F2C table */
|
||||
|
||||
OBJ_RELEASE(lam_errhandler_f_to_c_table);
|
||||
OBJ_RELEASE(ompi_errhandler_f_to_c_table);
|
||||
|
||||
/* All done */
|
||||
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
lam_errhandler_t *lam_errhandler_create(lam_errhandler_type_t object_type,
|
||||
lam_errhandler_fortran_handler_fn_t *func)
|
||||
ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type,
|
||||
ompi_errhandler_fortran_handler_fn_t *func)
|
||||
{
|
||||
lam_errhandler_t *new_errhandler;
|
||||
ompi_errhandler_t *new_errhandler;
|
||||
|
||||
/* Create a new object and ensure that it's valid */
|
||||
|
||||
new_errhandler = OBJ_NEW(lam_errhandler_t);
|
||||
new_errhandler = OBJ_NEW(ompi_errhandler_t);
|
||||
if (NULL == new_errhandler) {
|
||||
if (LAM_ERROR == new_errhandler->eh_f_to_c_index) {
|
||||
if (OMPI_ERROR == new_errhandler->eh_f_to_c_index) {
|
||||
OBJ_RELEASE(new_errhandler);
|
||||
new_errhandler = NULL;
|
||||
} else {
|
||||
@ -155,7 +155,7 @@ lam_errhandler_t *lam_errhandler_create(lam_errhandler_type_t object_type,
|
||||
|
||||
|
||||
/* All done */
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -168,13 +168,13 @@ lam_errhandler_t *lam_errhandler_create(lam_errhandler_type_t object_type,
|
||||
/**
|
||||
* Errhandler constructor
|
||||
*/
|
||||
static void lam_errhandler_construct(lam_errhandler_t *new_errhandler)
|
||||
static void ompi_errhandler_construct(ompi_errhandler_t *new_errhandler)
|
||||
{
|
||||
int ret_val;
|
||||
|
||||
/* assign entry in fortran <-> c translation array */
|
||||
|
||||
ret_val = lam_pointer_array_add(lam_errhandler_f_to_c_table,
|
||||
ret_val = ompi_pointer_array_add(ompi_errhandler_f_to_c_table,
|
||||
new_errhandler);
|
||||
new_errhandler->eh_f_to_c_index = ret_val;
|
||||
}
|
||||
@ -183,14 +183,14 @@ static void lam_errhandler_construct(lam_errhandler_t *new_errhandler)
|
||||
/**
|
||||
* Errhandler destructor
|
||||
*/
|
||||
static void lam_errhandler_destruct(lam_errhandler_t *errhandler)
|
||||
static void ompi_errhandler_destruct(ompi_errhandler_t *errhandler)
|
||||
{
|
||||
/* reset the lam_errhandler_f_to_c_table entry - make sure that the
|
||||
/* reset the ompi_errhandler_f_to_c_table entry - make sure that the
|
||||
entry is in the table */
|
||||
|
||||
if (NULL!= lam_pointer_array_get_item(lam_errhandler_f_to_c_table,
|
||||
if (NULL!= ompi_pointer_array_get_item(ompi_errhandler_f_to_c_table,
|
||||
errhandler->eh_f_to_c_index)) {
|
||||
lam_pointer_array_set_item(lam_errhandler_f_to_c_table,
|
||||
ompi_pointer_array_set_item(ompi_errhandler_f_to_c_table,
|
||||
errhandler->eh_f_to_c_index, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -3,51 +3,51 @@
|
||||
*/
|
||||
/** @file **/
|
||||
|
||||
#ifndef LAM_ERRHANDLER_H
|
||||
#define LAM_ERRHANDLER_H
|
||||
#ifndef OMPI_ERRHANDLER_H
|
||||
#define OMPI_ERRHANDLER_H
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "mpi.h"
|
||||
#include "lfc/lam_object.h"
|
||||
#include "lfc/lam_pointer_array.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "class/ompi_pointer_array.h"
|
||||
|
||||
/*
|
||||
* These must correspond to the fortran handle indices
|
||||
*/
|
||||
#define LAM_ERRHANDLER_NULL_FORTRAN 0
|
||||
#define LAM_ERRORS_ARE_FATAL_FORTRAN 1
|
||||
#define LAM_ERRORS_RETURN_FORTRAN 2
|
||||
#define OMPI_ERRHANDLER_NULL_FORTRAN 0
|
||||
#define OMPI_ERRORS_ARE_FATAL_FORTRAN 1
|
||||
#define OMPI_ERRORS_RETURN_FORTRAN 2
|
||||
|
||||
|
||||
/**
|
||||
* Typedef for all fortran errhandler functions
|
||||
*/
|
||||
typedef void (lam_errhandler_fortran_handler_fn_t)(int *, int *, ...);
|
||||
typedef void (ompi_errhandler_fortran_handler_fn_t)(int *, int *, ...);
|
||||
|
||||
|
||||
/**
|
||||
* Enum used to describe what kind MPI object an error handler is used for
|
||||
*/
|
||||
enum lam_errhandler_type_t {
|
||||
LAM_ERRHANDLER_TYPE_COMM,
|
||||
LAM_ERRHANDLER_TYPE_WIN,
|
||||
LAM_ERRHANDLER_TYPE_FILE
|
||||
enum ompi_errhandler_type_t {
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
OMPI_ERRHANDLER_TYPE_WIN,
|
||||
OMPI_ERRHANDLER_TYPE_FILE
|
||||
};
|
||||
typedef enum lam_errhandler_type_t lam_errhandler_type_t;
|
||||
typedef enum ompi_errhandler_type_t ompi_errhandler_type_t;
|
||||
|
||||
|
||||
/**
|
||||
* Back-end type for MPI_Errorhandler.
|
||||
*/
|
||||
struct lam_errhandler_t {
|
||||
lam_object_t super;
|
||||
struct ompi_errhandler_t {
|
||||
ompi_object_t super;
|
||||
|
||||
char eh_name[MPI_MAX_OBJECT_NAME];
|
||||
|
||||
/* Type of MPI object that this handler is for */
|
||||
|
||||
lam_errhandler_type_t eh_mpi_object_type;
|
||||
ompi_errhandler_type_t eh_mpi_object_type;
|
||||
|
||||
/* Flags about the error handler */
|
||||
|
||||
@ -61,35 +61,35 @@ struct lam_errhandler_t {
|
||||
MPI_File_errhandler_fn *c_file_fn;
|
||||
MPI_Win_errhandler_fn *c_win_fn;
|
||||
|
||||
lam_errhandler_fortran_handler_fn_t *fort_fn;
|
||||
ompi_errhandler_fortran_handler_fn_t *fort_fn;
|
||||
} eh_func;
|
||||
|
||||
/* index in Fortran <-> C translation array */
|
||||
|
||||
int eh_f_to_c_index;
|
||||
};
|
||||
typedef struct lam_errhandler_t lam_errhandler_t;
|
||||
typedef struct ompi_errhandler_t ompi_errhandler_t;
|
||||
|
||||
|
||||
/**
|
||||
* Global variable for MPI_ERRHANDLER_NULL
|
||||
*/
|
||||
extern lam_errhandler_t lam_mpi_errhandler_null;
|
||||
extern ompi_errhandler_t ompi_mpi_errhandler_null;
|
||||
|
||||
/**
|
||||
* Global variable for MPI_ERRORS_ARE_FATAL
|
||||
*/
|
||||
extern lam_errhandler_t lam_mpi_errors_are_fatal;
|
||||
extern ompi_errhandler_t ompi_mpi_errors_are_fatal;
|
||||
|
||||
/**
|
||||
* Global variable for MPI_ERRORS_RETURN
|
||||
*/
|
||||
extern lam_errhandler_t lam_mpi_errors_return;
|
||||
extern ompi_errhandler_t ompi_mpi_errors_return;
|
||||
|
||||
/**
|
||||
* Table for Fortran <-> C errhandler handle conversion
|
||||
*/
|
||||
extern lam_pointer_array_t *lam_errhandler_f_to_c_table;
|
||||
extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table;
|
||||
|
||||
|
||||
/**
|
||||
@ -104,11 +104,11 @@ extern lam_pointer_array_t *lam_errhandler_f_to_c_table;
|
||||
*
|
||||
* This macro is used when you want to directly invoke the error
|
||||
* handler. It is exactly equivalent to calling
|
||||
* lam_errhandler_invoke() directly, but is provided to have a
|
||||
* parallel invocation to LAM_ERRHANDLER_CHECK() and LAM_ERRHANDLER_RETURN().
|
||||
* ompi_errhandler_invoke() directly, but is provided to have a
|
||||
* parallel invocation to OMPI_ERRHANDLER_CHECK() and OMPI_ERRHANDLER_RETURN().
|
||||
*/
|
||||
#define LAM_ERRHANDLER_INVOKE(mpi_object, err_code, message) \
|
||||
lam_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
#define OMPI_ERRHANDLER_INVOKE(mpi_object, err_code, message) \
|
||||
ompi_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
(err_code), (message));
|
||||
|
||||
/**
|
||||
@ -122,11 +122,11 @@ extern lam_pointer_array_t *lam_errhandler_f_to_c_table;
|
||||
* MPI function that is invoking the error.
|
||||
*
|
||||
* This macro will invoke the error handler if the return code is not
|
||||
* LAM_SUCCESS.
|
||||
* OMPI_SUCCESS.
|
||||
*/
|
||||
#define LAM_ERRHANDLER_CHECK(rc, mpi_object, err_code, message) \
|
||||
if (rc != LAM_SUCCESS) { \
|
||||
lam_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
#define OMPI_ERRHANDLER_CHECK(rc, mpi_object, err_code, message) \
|
||||
if (rc != OMPI_SUCCESS) { \
|
||||
ompi_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
(err_code), (message)); \
|
||||
return (err_code); \
|
||||
}
|
||||
@ -143,12 +143,12 @@ extern lam_pointer_array_t *lam_errhandler_f_to_c_table;
|
||||
* MPI function that is invoking the error.
|
||||
*
|
||||
* This macro will invoke the error handler if the return code is not
|
||||
* LAM_SUCCESS. If the return code is LAM_SUCCESS, then return
|
||||
* OMPI_SUCCESS. If the return code is OMPI_SUCCESS, then return
|
||||
* MPI_SUCCESS.
|
||||
*/
|
||||
#define LAM_ERRHANDLER_RETURN(rc, mpi_object, err_code, message) \
|
||||
if (rc != LAM_SUCCESS) { \
|
||||
lam_errhandler_invoke((mpi_object != NULL) ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
#define OMPI_ERRHANDLER_RETURN(rc, mpi_object, err_code, message) \
|
||||
if (rc != OMPI_SUCCESS) { \
|
||||
ompi_errhandler_invoke((mpi_object != NULL) ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
(err_code), (message)); \
|
||||
return (err_code); \
|
||||
} else { \
|
||||
@ -163,31 +163,31 @@ extern "C" {
|
||||
/**
|
||||
* Initialize the error handler interface.
|
||||
*
|
||||
* @returns LAM_SUCCESS Upon success
|
||||
* @returns LAM_ERROR Otherwise
|
||||
* @returns OMPI_SUCCESS Upon success
|
||||
* @returns OMPI_ERROR Otherwise
|
||||
*
|
||||
* Invoked from lam_mpi_init(); sets up the error handler interface,
|
||||
* Invoked from ompi_mpi_init(); sets up the error handler interface,
|
||||
* creates the predefined MPI errorhandlers, and creates the
|
||||
* corresopnding F2C translation table.
|
||||
*/
|
||||
int lam_errhandler_init(void);
|
||||
int ompi_errhandler_init(void);
|
||||
|
||||
/**
|
||||
* Finalize the error handler interface.
|
||||
*
|
||||
* @returns LAM_SUCCESS Always
|
||||
* @returns OMPI_SUCCESS Always
|
||||
*
|
||||
* Invokes from lam_mpi_finalize(); tears down the error handler
|
||||
* Invokes from ompi_mpi_finalize(); tears down the error handler
|
||||
* interface, and destroys the F2C translation table.
|
||||
*/
|
||||
int lam_errhandler_finalize(void);
|
||||
int ompi_errhandler_finalize(void);
|
||||
|
||||
/**
|
||||
* \internal
|
||||
*
|
||||
* This function should not be invoked directly; it should only be
|
||||
* invoked by LAM_ERRHANDLER_INVOKE(), LAM_ERRHANDLER_CHECK(), or
|
||||
* LAM_ERRHANDLER_RETURN().
|
||||
* invoked by OMPI_ERRHANDLER_INVOKE(), OMPI_ERRHANDLER_CHECK(), or
|
||||
* OMPI_ERRHANDLER_RETURN().
|
||||
*
|
||||
* @param errhandler The MPI_Errhandler to invoke
|
||||
* @param mpi_object The MPI object to invoke the errhandler on (a
|
||||
@ -206,22 +206,22 @@ extern "C" {
|
||||
* If this function returns, it returns the err_code. Note that it
|
||||
* may not return (e.g., for MPI_ERRORS_ARE_FATAL).
|
||||
*/
|
||||
int lam_errhandler_invoke(lam_errhandler_t *errhandler, void *mpi_object,
|
||||
int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
|
||||
int err_code, char *message);
|
||||
|
||||
|
||||
/**
|
||||
* Create a lam_errhandler_t
|
||||
* Create a ompi_errhandler_t
|
||||
*
|
||||
* @param object_type Enum of the type of MPI object
|
||||
* @param func Function pointer of the error handler
|
||||
*
|
||||
* @returns errhandler Pointer to the lam_errorhandler_t that will be
|
||||
* @returns errhandler Pointer to the ompi_errorhandler_t that will be
|
||||
* created and returned
|
||||
*
|
||||
* This function is called as the back-end of all the
|
||||
* MPI_*_CREATE_ERRHANDLER functions. It creates a new
|
||||
* lam_errhandler_t object, initializes it to the correct object
|
||||
* ompi_errhandler_t object, initializes it to the correct object
|
||||
* type, and sets the callback function on it.
|
||||
*
|
||||
* The type of the function pointer is (arbitrarily) the fortran
|
||||
@ -236,8 +236,8 @@ extern "C" {
|
||||
* wrappers for MPI_*_CREATE_ERRHANDLER are expected to reset this
|
||||
* flag to true manually.
|
||||
*/
|
||||
lam_errhandler_t *lam_errhandler_create(lam_errhandler_type_t object_type,
|
||||
lam_errhandler_fortran_handler_fn_t *func);
|
||||
ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type,
|
||||
ompi_errhandler_fortran_handler_fn_t *func);
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
@ -255,9 +255,9 @@ extern "C" {
|
||||
* this function is provided to hide the internal structure field
|
||||
* names.
|
||||
*/
|
||||
static inline bool lam_errhandler_is_intrinsic(lam_errhandler_t *errhandler)
|
||||
static inline bool ompi_errhandler_is_intrinsic(ompi_errhandler_t *errhandler)
|
||||
{
|
||||
return errhandler->eh_is_intrinsic;
|
||||
}
|
||||
|
||||
#endif /* LAM_ERRHANDLER_H */
|
||||
#endif /* OMPI_ERRHANDLER_H */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "communicator/communicator.h"
|
||||
#include "win/win.h"
|
||||
@ -10,20 +10,20 @@
|
||||
#include "errhandler/errhandler.h"
|
||||
|
||||
|
||||
int lam_errhandler_invoke(lam_errhandler_t *errhandler, void *mpi_object,
|
||||
int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
|
||||
int err_code, char *message)
|
||||
{
|
||||
int fortran_handle;
|
||||
lam_communicator_t *comm;
|
||||
lam_win_t *win;
|
||||
lam_file_t *file;
|
||||
ompi_communicator_t *comm;
|
||||
ompi_win_t *win;
|
||||
ompi_file_t *file;
|
||||
|
||||
/* Figure out what kind of errhandler it is, figure out if it's
|
||||
fortran or C, and then invoke it */
|
||||
|
||||
switch (errhandler->eh_mpi_object_type) {
|
||||
case LAM_ERRHANDLER_TYPE_COMM:
|
||||
comm = (lam_communicator_t *) mpi_object;
|
||||
case OMPI_ERRHANDLER_TYPE_COMM:
|
||||
comm = (ompi_communicator_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = comm->c_f_to_c_index;
|
||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
||||
@ -32,8 +32,8 @@ int lam_errhandler_invoke(lam_errhandler_t *errhandler, void *mpi_object,
|
||||
}
|
||||
break;
|
||||
|
||||
case LAM_ERRHANDLER_TYPE_WIN:
|
||||
win = (lam_win_t *) mpi_object;
|
||||
case OMPI_ERRHANDLER_TYPE_WIN:
|
||||
win = (ompi_win_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = win->w_f_to_c_index;
|
||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
||||
@ -42,8 +42,8 @@ int lam_errhandler_invoke(lam_errhandler_t *errhandler, void *mpi_object,
|
||||
}
|
||||
break;
|
||||
|
||||
case LAM_ERRHANDLER_TYPE_FILE:
|
||||
file = (lam_file_t *) mpi_object;
|
||||
case OMPI_ERRHANDLER_TYPE_FILE:
|
||||
file = (ompi_file_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = file->f_f_to_c_index;
|
||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "errhandler/errhandler_predefined.h"
|
||||
|
||||
|
||||
void lam_mpi_errors_are_fatal_handler(lam_communicator_t **comm,
|
||||
void ompi_mpi_errors_are_fatal_handler(ompi_communicator_t **comm,
|
||||
int *error_code, ...)
|
||||
{
|
||||
va_list arglist;
|
||||
@ -23,11 +23,11 @@ void lam_mpi_errors_are_fatal_handler(lam_communicator_t **comm,
|
||||
#else
|
||||
va_start(arglist);
|
||||
#endif
|
||||
lam_output(0, "*** An error occurred in %s", va_arg(arglist, char *));
|
||||
lam_output(0, "*** on communicator %s", (*comm)->c_name);
|
||||
lam_output(0, "*** error code: %d\n", *error_code);
|
||||
ompi_output(0, "*** An error occurred in %s", va_arg(arglist, char *));
|
||||
ompi_output(0, "*** on communicator %s", (*comm)->c_name);
|
||||
ompi_output(0, "*** error code: %d\n", *error_code);
|
||||
/* JMS: Should print the error string as well */
|
||||
lam_output(0, "*** MPI_ERRORS_ARE_FATAL");
|
||||
ompi_output(0, "*** MPI_ERRORS_ARE_FATAL");
|
||||
va_end(arglist);
|
||||
|
||||
/* Should we do something more intelligent here? */
|
||||
@ -36,7 +36,7 @@ void lam_mpi_errors_are_fatal_handler(lam_communicator_t **comm,
|
||||
}
|
||||
|
||||
|
||||
void lam_mpi_errors_return_handler(lam_communicator_t **comm,
|
||||
void ompi_mpi_errors_return_handler(ompi_communicator_t **comm,
|
||||
int *error_code, ...)
|
||||
{
|
||||
/* Don't need anything more -- just need this function to exist */
|
||||
|
@ -2,8 +2,8 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef LAM_ERRHANDLER_PREDEFINED_H
|
||||
#define LAM_ERRHANDLER_PREDEFINED_H
|
||||
#ifndef OMPI_ERRHANDLER_PREDEFINED_H
|
||||
#define OMPI_ERRHANDLER_PREDEFINED_H
|
||||
|
||||
#include "errhandler/errhandler.h"
|
||||
#include "communicator/communicator.h"
|
||||
@ -12,15 +12,15 @@
|
||||
/**
|
||||
* Handler function for MPI_ERRORS_ARE_FATAL
|
||||
*/
|
||||
void lam_mpi_errors_are_fatal_handler(lam_communicator_t **comm,
|
||||
void ompi_mpi_errors_are_fatal_handler(ompi_communicator_t **comm,
|
||||
int *error_code, ...);
|
||||
|
||||
/**
|
||||
* Handler function for MPI_ERRORS_RETURN
|
||||
*/
|
||||
void lam_mpi_errors_return_handler(lam_communicator_t **comm,
|
||||
void ompi_mpi_errors_return_handler(ompi_communicator_t **comm,
|
||||
int *error_code, ...);
|
||||
|
||||
|
||||
|
||||
#endif /* LAM_ERRHANDLER_PREDEFINED_H */
|
||||
#endif /* OMPI_ERRHANDLER_PREDEFINED_H */
|
||||
|
@ -1,8 +1,8 @@
|
||||
include $(top_srcdir)/config/Makefile.options
|
||||
|
||||
# LAM Get the dirs where lam_config.h and lam_config_bottom.h live.
|
||||
# OMPI Get the dirs where ompi_config.h and ompi_config_bottom.h live.
|
||||
# Also specify where we can find this package's config.h because some
|
||||
# of the header files in this directory get included elsewhere in LAM.
|
||||
# of the header files in this directory get included elsewhere in OMPI.
|
||||
# #@%@#$...
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/event/compat \
|
||||
@ -10,14 +10,14 @@ AM_CPPFLAGS = \
|
||||
-I$(top_builddir)/../include \
|
||||
-I$(top_builddir)/..
|
||||
|
||||
# LAM: No need to build the sample or test
|
||||
# OMPI: No need to build the sample or test
|
||||
#SUBDIRS = . sample test
|
||||
SUBDIRS = compat
|
||||
|
||||
EXTRA_DIST = err.c event.h evsignal.h event.3 kqueue.c \
|
||||
epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c
|
||||
|
||||
# LAM: This causes problems
|
||||
# OMPI: This causes problems
|
||||
junk = \
|
||||
sample/Makefile.am sample/Makefile.in sample/event-test.c \
|
||||
sample/signal-test.c sample/time-test.c \
|
||||
@ -33,13 +33,13 @@ junk = \
|
||||
WIN32-Prj/signal_test/signal_test.dsp WIN32-Prj/time_test \
|
||||
WIN32-Prj/time_test/time_test.dsp
|
||||
|
||||
# LAM: Changed to noinst and libevent.la
|
||||
# OMPI: Changed to noinst and libevent.la
|
||||
noinst_LTLIBRARIES = libevent.la
|
||||
|
||||
# LAM: Automake sillyness so that we can have variable sources
|
||||
objects = $(LAM_LIBEVENT_SOURCES:.c=.lo)
|
||||
# OMPI: Automake sillyness so that we can have variable sources
|
||||
objects = $(OMPI_LIBEVENT_SOURCES:.c=.lo)
|
||||
|
||||
# LAM: Changed to libevent_la_*
|
||||
# OMPI: Changed to libevent_la_*
|
||||
libevent_la_SOURCES = event.c event.h
|
||||
libevent_la_LIBADD = $(objects)
|
||||
libevent_la_DEPENDENCIES = $(objects)
|
||||
|
@ -24,7 +24,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 "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
@ -55,16 +55,16 @@
|
||||
#include "evsignal.h"
|
||||
#include "threads/mutex.h"
|
||||
|
||||
extern struct lam_event_list lam_eventqueue;
|
||||
extern volatile sig_atomic_t lam_evsignal_caught;
|
||||
extern lam_mutex_t lam_event_lock;
|
||||
extern struct ompi_event_list ompi_eventqueue;
|
||||
extern volatile sig_atomic_t ompi_evsignal_caught;
|
||||
extern ompi_mutex_t ompi_event_lock;
|
||||
|
||||
/* due to limitations in the epoll interface, we need to keep track of
|
||||
* all file descriptors outself.
|
||||
*/
|
||||
struct evepoll {
|
||||
struct lam_event *evread;
|
||||
struct lam_event *evwrite;
|
||||
struct ompi_event *evread;
|
||||
struct ompi_event *evwrite;
|
||||
};
|
||||
|
||||
struct epollop {
|
||||
@ -77,12 +77,12 @@ struct epollop {
|
||||
} epollop;
|
||||
|
||||
static void *epoll_init (void);
|
||||
static int epoll_add (void *, struct lam_event *);
|
||||
static int epoll_del (void *, struct lam_event *);
|
||||
static int epoll_add (void *, struct ompi_event *);
|
||||
static int epoll_del (void *, struct ompi_event *);
|
||||
static int epoll_recalc (void *, int);
|
||||
static int epoll_dispatch (void *, struct timeval *);
|
||||
|
||||
struct lam_eventop lam_epollops = {
|
||||
struct ompi_eventop ompi_epollops = {
|
||||
"epoll",
|
||||
epoll_init,
|
||||
epoll_add,
|
||||
@ -131,7 +131,7 @@ epoll_init(void)
|
||||
}
|
||||
epollop.nfds = nfiles;
|
||||
|
||||
lam_evsignal_init(&epollop.evsigmask);
|
||||
ompi_evsignal_init(&epollop.evsigmask);
|
||||
|
||||
return (&epollop);
|
||||
}
|
||||
@ -159,7 +159,7 @@ epoll_recalc(void *arg, int max)
|
||||
epollop->nfds = nfds;
|
||||
}
|
||||
|
||||
return (lam_evsignal_recalc(&epollop->evsigmask));
|
||||
return (ompi_evsignal_recalc(&epollop->evsigmask));
|
||||
}
|
||||
|
||||
int
|
||||
@ -170,19 +170,19 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
||||
struct evepoll *evep;
|
||||
int i, res, timeout;
|
||||
|
||||
if (lam_evsignal_deliver(&epollop->evsigmask) == -1)
|
||||
if (ompi_evsignal_deliver(&epollop->evsigmask) == -1)
|
||||
return (-1);
|
||||
|
||||
timeout = tv->tv_sec * 1000 + tv->tv_usec / 1000;
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
} else {
|
||||
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
|
||||
}
|
||||
|
||||
if (lam_evsignal_recalc(&epollop->evsigmask) == -1)
|
||||
if (ompi_evsignal_recalc(&epollop->evsigmask) == -1)
|
||||
return (-1);
|
||||
|
||||
if (res == -1) {
|
||||
@ -191,17 +191,17 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
lam_evsignal_process();
|
||||
ompi_evsignal_process();
|
||||
return (0);
|
||||
} else if (lam_evsignal_caught)
|
||||
lam_evsignal_process();
|
||||
} else if (ompi_evsignal_caught)
|
||||
ompi_evsignal_process();
|
||||
|
||||
LOG_DBG((LOG_MISC, 80, "%s: epoll_wait reports %d", __func__, res));
|
||||
|
||||
for (i = 0; i < res; i++) {
|
||||
int which = 0;
|
||||
int what = events[i].events;
|
||||
struct lam_event *evread = NULL, *evwrite = NULL;
|
||||
struct ompi_event *evread = NULL, *evwrite = NULL;
|
||||
|
||||
evep = (struct evepoll *)events[i].data.ptr;
|
||||
|
||||
@ -212,27 +212,27 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
||||
|
||||
if (what & EPOLLIN) {
|
||||
evread = evep->evread;
|
||||
which |= LAM_EV_READ;
|
||||
which |= OMPI_EV_READ;
|
||||
}
|
||||
|
||||
if (what & EPOLLOUT) {
|
||||
evwrite = evep->evwrite;
|
||||
which |= LAM_EV_WRITE;
|
||||
which |= OMPI_EV_WRITE;
|
||||
}
|
||||
|
||||
if (!which)
|
||||
continue;
|
||||
|
||||
if (evread != NULL && !(evread->ev_events & LAM_EV_PERSIST))
|
||||
lam_event_del_i(evread);
|
||||
if (evread != NULL && !(evread->ev_events & OMPI_EV_PERSIST))
|
||||
ompi_event_del_i(evread);
|
||||
if (evwrite != NULL && evwrite != evread &&
|
||||
!(evwrite->ev_events & LAM_EV_PERSIST))
|
||||
lam_event_del_i(evwrite);
|
||||
!(evwrite->ev_events & OMPI_EV_PERSIST))
|
||||
ompi_event_del_i(evwrite);
|
||||
|
||||
if (evread != NULL)
|
||||
lam_event_active_i(evread, LAM_EV_READ, 1);
|
||||
ompi_event_active_i(evread, OMPI_EV_READ, 1);
|
||||
if (evwrite != NULL)
|
||||
lam_event_active_i(evwrite, LAM_EV_WRITE, 1);
|
||||
ompi_event_active_i(evwrite, OMPI_EV_WRITE, 1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
@ -240,15 +240,15 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
||||
|
||||
|
||||
static int
|
||||
epoll_add(void *arg, struct lam_event *ev)
|
||||
epoll_add(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
struct epollop *epollop = arg;
|
||||
struct epoll_event epev;
|
||||
struct evepoll *evep;
|
||||
int fd, op, events;
|
||||
|
||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
||||
return (lam_evsignal_add(&epollop->evsigmask, ev));
|
||||
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||
return (ompi_evsignal_add(&epollop->evsigmask, ev));
|
||||
|
||||
fd = ev->ev_fd;
|
||||
if (fd >= epollop->nfds) {
|
||||
@ -268,9 +268,9 @@ epoll_add(void *arg, struct lam_event *ev)
|
||||
op = EPOLL_CTL_MOD;
|
||||
}
|
||||
|
||||
if (ev->ev_events & LAM_EV_READ)
|
||||
if (ev->ev_events & OMPI_EV_READ)
|
||||
events |= EPOLLIN;
|
||||
if (ev->ev_events & LAM_EV_WRITE)
|
||||
if (ev->ev_events & OMPI_EV_WRITE)
|
||||
events |= EPOLLOUT;
|
||||
|
||||
epev.data.ptr = evep;
|
||||
@ -279,16 +279,16 @@ epoll_add(void *arg, struct lam_event *ev)
|
||||
return (-1);
|
||||
|
||||
/* Update events responsible */
|
||||
if (ev->ev_events & LAM_EV_READ)
|
||||
if (ev->ev_events & OMPI_EV_READ)
|
||||
evep->evread = ev;
|
||||
if (ev->ev_events & LAM_EV_WRITE)
|
||||
if (ev->ev_events & OMPI_EV_WRITE)
|
||||
evep->evwrite = ev;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
epoll_del(void *arg, struct lam_event *ev)
|
||||
epoll_del(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
struct epollop *epollop = arg;
|
||||
struct epoll_event epev;
|
||||
@ -296,8 +296,8 @@ epoll_del(void *arg, struct lam_event *ev)
|
||||
int fd, events, op;
|
||||
int needwritedelete = 1, needreaddelete = 1;
|
||||
|
||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
||||
return (lam_evsignal_del(&epollop->evsigmask, ev));
|
||||
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||
return (ompi_evsignal_del(&epollop->evsigmask, ev));
|
||||
|
||||
fd = ev->ev_fd;
|
||||
if (fd >= epollop->nfds)
|
||||
@ -307,9 +307,9 @@ epoll_del(void *arg, struct lam_event *ev)
|
||||
op = EPOLL_CTL_DEL;
|
||||
events = 0;
|
||||
|
||||
if (ev->ev_events & LAM_EV_READ)
|
||||
if (ev->ev_events & OMPI_EV_READ)
|
||||
events |= EPOLLIN;
|
||||
if (ev->ev_events & LAM_EV_WRITE)
|
||||
if (ev->ev_events & OMPI_EV_WRITE)
|
||||
events |= EPOLLOUT;
|
||||
|
||||
if ((events & (EPOLLIN|EPOLLOUT)) != (EPOLLIN|EPOLLOUT)) {
|
||||
|
@ -26,7 +26,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 "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
@ -62,84 +62,84 @@
|
||||
#include "event.h"
|
||||
#include "include/types.h"
|
||||
#include "include/constants.h"
|
||||
#include "lfc/lam_object.h"
|
||||
#include "class/ompi_object.h"
|
||||
#include "threads/mutex.h"
|
||||
#include "threads/thread.h"
|
||||
#include "util/output.h"
|
||||
|
||||
#if HAVE_SELECT
|
||||
extern const struct lam_eventop lam_selectops;
|
||||
extern const struct ompi_eventop ompi_selectops;
|
||||
#endif
|
||||
#if HAVE_POLL
|
||||
extern const struct lam_eventop lam_pollops;
|
||||
extern const struct ompi_eventop ompi_pollops;
|
||||
#endif
|
||||
#if HAVE_RTSIG
|
||||
extern const struct lam_eventop lam_rtsigops;
|
||||
extern const struct ompi_eventop ompi_rtsigops;
|
||||
#endif
|
||||
#if HAVE_EPOLL
|
||||
extern const struct lam_eventop lam_epollops;
|
||||
extern const struct ompi_eventop ompi_epollops;
|
||||
#endif
|
||||
#if HAVE_WORKING_KQUEUE
|
||||
extern const struct lam_eventop lam_kqops;
|
||||
extern const struct ompi_eventop ompi_kqops;
|
||||
#endif
|
||||
#if WIN32
|
||||
extern const struct lam_eventop lam_win32ops;
|
||||
extern const struct ompi_eventop ompi_win32ops;
|
||||
#endif
|
||||
|
||||
/* In order of preference */
|
||||
static const struct lam_eventop *lam_eventops[] = {
|
||||
static const struct ompi_eventop *ompi_eventops[] = {
|
||||
#if HAVE_WORKING_KQUEUE
|
||||
&lam_kqops,
|
||||
&ompi_kqops,
|
||||
#endif
|
||||
#if HAVE_EPOLL
|
||||
&lam_epollops,
|
||||
&ompi_epollops,
|
||||
#endif
|
||||
#if HAVE_RTSIG
|
||||
&lam_rtsigops,
|
||||
&ompi_rtsigops,
|
||||
#endif
|
||||
#if HAVE_POLL
|
||||
&lam_pollops,
|
||||
&ompi_pollops,
|
||||
#endif
|
||||
#if HAVE_SELECT
|
||||
&lam_selectops,
|
||||
&ompi_selectops,
|
||||
#endif
|
||||
#if WIN32
|
||||
&lam_win32ops,
|
||||
&ompi_win32ops,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
const struct lam_eventop *lam_evsel;
|
||||
void *lam_evbase;
|
||||
const struct ompi_eventop *ompi_evsel;
|
||||
void *ompi_evbase;
|
||||
|
||||
/* Handle signals */
|
||||
int (*lam_event_sigcb)(void); /* Signal callback when gotsig is set */
|
||||
int lam_event_gotsig; /* Set in signal handler */
|
||||
int (*ompi_event_sigcb)(void); /* Signal callback when gotsig is set */
|
||||
int ompi_event_gotsig; /* Set in signal handler */
|
||||
|
||||
/* Prototypes */
|
||||
static void lam_event_process_active(void);
|
||||
static void lam_timeout_correct(struct timeval *off);
|
||||
static void lam_timeout_insert(struct lam_event *);
|
||||
static void lam_event_queue_insert(struct lam_event *, int);
|
||||
static void lam_event_queue_remove(struct lam_event *, int);
|
||||
static void lam_timeout_process(void);
|
||||
int lam_event_haveevents(void);
|
||||
static void ompi_event_process_active(void);
|
||||
static void ompi_timeout_correct(struct timeval *off);
|
||||
static void ompi_timeout_insert(struct ompi_event *);
|
||||
static void ompi_event_queue_insert(struct ompi_event *, int);
|
||||
static void ompi_event_queue_remove(struct ompi_event *, int);
|
||||
static void ompi_timeout_process(void);
|
||||
int ompi_event_haveevents(void);
|
||||
|
||||
static RB_HEAD(lam_event_tree, lam_event) lam_timetree;
|
||||
static struct lam_event_list lam_activequeue;
|
||||
struct lam_event_list lam_signalqueue;
|
||||
struct lam_event_list lam_eventqueue;
|
||||
static struct timeval lam_event_tv;
|
||||
lam_mutex_t lam_event_lock;
|
||||
#if LAM_HAVE_THREADS
|
||||
lam_thread_t lam_event_thread;
|
||||
lam_event_t lam_event_pipe_event;
|
||||
int lam_event_pipe[2];
|
||||
int lam_event_pipe_signalled;
|
||||
static RB_HEAD(ompi_event_tree, ompi_event) ompi_timetree;
|
||||
static struct ompi_event_list ompi_activequeue;
|
||||
struct ompi_event_list ompi_signalqueue;
|
||||
struct ompi_event_list ompi_eventqueue;
|
||||
static struct timeval ompi_event_tv;
|
||||
ompi_mutex_t ompi_event_lock;
|
||||
#if OMPI_HAVE_THREADS
|
||||
ompi_thread_t ompi_event_thread;
|
||||
ompi_event_t ompi_event_pipe_event;
|
||||
int ompi_event_pipe[2];
|
||||
int ompi_event_pipe_signalled;
|
||||
#endif
|
||||
|
||||
static int
|
||||
compare(struct lam_event *a, struct lam_event *b)
|
||||
compare(struct ompi_event *a, struct ompi_event *b)
|
||||
{
|
||||
if (timercmp(&a->ev_timeout, &b->ev_timeout, <))
|
||||
return (-1);
|
||||
@ -148,17 +148,17 @@ compare(struct lam_event *a, struct lam_event *b)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static RB_PROTOTYPE(lam_event_tree, lam_event, ev_timeout_node, compare)
|
||||
static RB_PROTOTYPE(ompi_event_tree, ompi_event, ev_timeout_node, compare)
|
||||
|
||||
static RB_GENERATE(lam_event_tree, lam_event, ev_timeout_node, compare)
|
||||
static RB_GENERATE(ompi_event_tree, ompi_event, ev_timeout_node, compare)
|
||||
|
||||
static int lam_timeout_next(struct timeval *tv)
|
||||
static int ompi_timeout_next(struct timeval *tv)
|
||||
{
|
||||
struct timeval dflt = LAM_TIMEOUT_DEFAULT;
|
||||
struct timeval dflt = OMPI_TIMEOUT_DEFAULT;
|
||||
struct timeval now;
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
|
||||
if ((ev = RB_MIN(lam_event_tree, &lam_timetree)) == NULL) {
|
||||
if ((ev = RB_MIN(ompi_event_tree, &ompi_timetree)) == NULL) {
|
||||
*tv = dflt;
|
||||
return(0);
|
||||
}
|
||||
@ -176,76 +176,76 @@ static int lam_timeout_next(struct timeval *tv)
|
||||
}
|
||||
|
||||
/* run loop for dispatch thread */
|
||||
static void* lam_event_run(lam_object_t* arg)
|
||||
static void* ompi_event_run(ompi_object_t* arg)
|
||||
{
|
||||
lam_event_loop(0);
|
||||
ompi_event_loop(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#if LAM_HAVE_THREADS
|
||||
static void lam_event_pipe_handler(int sd, short flags, void* user)
|
||||
#if OMPI_HAVE_THREADS
|
||||
static void ompi_event_pipe_handler(int sd, short flags, void* user)
|
||||
{
|
||||
unsigned char byte;
|
||||
if(read(sd, &byte, 1) != 1) {
|
||||
lam_output(0, "lam_event_pipe: read failed with: errno=%d\n", errno);
|
||||
lam_event_del(&lam_event_pipe_event);
|
||||
ompi_output(0, "ompi_event_pipe: read failed with: errno=%d\n", errno);
|
||||
ompi_event_del(&ompi_event_pipe_event);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
lam_event_init(void)
|
||||
ompi_event_init(void)
|
||||
{
|
||||
static int inited = false;
|
||||
int i;
|
||||
#if LAM_HAVE_THREADS
|
||||
#if OMPI_HAVE_THREADS
|
||||
int rc;
|
||||
#endif
|
||||
|
||||
if(inited)
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
lam_event_sigcb = NULL;
|
||||
lam_event_gotsig = 0;
|
||||
gettimeofday(&lam_event_tv, NULL);
|
||||
ompi_event_sigcb = NULL;
|
||||
ompi_event_gotsig = 0;
|
||||
gettimeofday(&ompi_event_tv, NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&lam_event_lock, lam_mutex_t);
|
||||
RB_INIT(&lam_timetree);
|
||||
TAILQ_INIT(&lam_eventqueue);
|
||||
TAILQ_INIT(&lam_activequeue);
|
||||
TAILQ_INIT(&lam_signalqueue);
|
||||
OBJ_CONSTRUCT(&ompi_event_lock, ompi_mutex_t);
|
||||
RB_INIT(&ompi_timetree);
|
||||
TAILQ_INIT(&ompi_eventqueue);
|
||||
TAILQ_INIT(&ompi_activequeue);
|
||||
TAILQ_INIT(&ompi_signalqueue);
|
||||
|
||||
lam_evbase = NULL;
|
||||
for (i = 0; lam_eventops[i] && !lam_evbase; i++) {
|
||||
lam_evsel = lam_eventops[i];
|
||||
lam_evbase = lam_evsel->init();
|
||||
ompi_evbase = NULL;
|
||||
for (i = 0; ompi_eventops[i] && !ompi_evbase; i++) {
|
||||
ompi_evsel = ompi_eventops[i];
|
||||
ompi_evbase = ompi_evsel->init();
|
||||
}
|
||||
|
||||
if (lam_evbase == NULL)
|
||||
if (ompi_evbase == NULL)
|
||||
errx(1, "%s: no event mechanism available", __func__);
|
||||
|
||||
#if LAM_HAVE_THREADS
|
||||
if(pipe(lam_event_pipe) != 0) {
|
||||
lam_output(0, "lam_event_init: pipe() failed with errno=%d\n", errno);
|
||||
return LAM_ERROR;
|
||||
#if OMPI_HAVE_THREADS
|
||||
if(pipe(ompi_event_pipe) != 0) {
|
||||
ompi_output(0, "ompi_event_init: pipe() failed with errno=%d\n", errno);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
lam_event_pipe_signalled = 1;
|
||||
lam_event_set(
|
||||
&lam_event_pipe_event,
|
||||
lam_event_pipe[0],
|
||||
LAM_EV_READ|LAM_EV_PERSIST,
|
||||
lam_event_pipe_handler,
|
||||
ompi_event_pipe_signalled = 1;
|
||||
ompi_event_set(
|
||||
&ompi_event_pipe_event,
|
||||
ompi_event_pipe[0],
|
||||
OMPI_EV_READ|OMPI_EV_PERSIST,
|
||||
ompi_event_pipe_handler,
|
||||
0);
|
||||
lam_event_add_i(&lam_event_pipe_event, 0);
|
||||
lam_event_pipe_signalled = 0;
|
||||
ompi_event_add_i(&ompi_event_pipe_event, 0);
|
||||
ompi_event_pipe_signalled = 0;
|
||||
|
||||
/* spin up a thread to dispatch events */
|
||||
OBJ_CONSTRUCT(&lam_event_thread, lam_thread_t);
|
||||
lam_event_thread.t_run = lam_event_run;
|
||||
if((rc = lam_thread_start(&lam_event_thread)) != LAM_SUCCESS)
|
||||
OBJ_CONSTRUCT(&ompi_event_thread, ompi_thread_t);
|
||||
ompi_event_thread.t_run = ompi_event_run;
|
||||
if((rc = ompi_thread_start(&ompi_event_thread)) != OMPI_SUCCESS)
|
||||
return rc;
|
||||
#endif
|
||||
|
||||
@ -254,25 +254,25 @@ lam_event_init(void)
|
||||
log_debug_cmd(LOG_MISC, 80);
|
||||
#endif
|
||||
inited = true;
|
||||
return LAM_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
lam_event_haveevents(void)
|
||||
ompi_event_haveevents(void)
|
||||
{
|
||||
return (RB_ROOT(&lam_timetree) || TAILQ_FIRST(&lam_eventqueue) ||
|
||||
TAILQ_FIRST(&lam_signalqueue) || TAILQ_FIRST(&lam_activequeue));
|
||||
return (RB_ROOT(&ompi_timetree) || TAILQ_FIRST(&ompi_eventqueue) ||
|
||||
TAILQ_FIRST(&ompi_signalqueue) || TAILQ_FIRST(&ompi_activequeue));
|
||||
}
|
||||
|
||||
static void
|
||||
lam_event_process_active(void)
|
||||
ompi_event_process_active(void)
|
||||
{
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
short ncalls;
|
||||
|
||||
for (ev = TAILQ_FIRST(&lam_activequeue); ev;
|
||||
ev = TAILQ_FIRST(&lam_activequeue)) {
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_ACTIVE);
|
||||
for (ev = TAILQ_FIRST(&ompi_activequeue); ev;
|
||||
ev = TAILQ_FIRST(&ompi_activequeue)) {
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_ACTIVE);
|
||||
|
||||
/* Allows deletes to work */
|
||||
ncalls = ev->ev_ncalls;
|
||||
@ -280,10 +280,10 @@ lam_event_process_active(void)
|
||||
while (ncalls) {
|
||||
ncalls--;
|
||||
ev->ev_ncalls = ncalls;
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
(*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg);
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
} else {
|
||||
(*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg);
|
||||
}
|
||||
@ -292,121 +292,121 @@ lam_event_process_active(void)
|
||||
}
|
||||
|
||||
int
|
||||
lam_event_dispatch(void)
|
||||
ompi_event_dispatch(void)
|
||||
{
|
||||
return (lam_event_loop(0));
|
||||
return (ompi_event_loop(0));
|
||||
}
|
||||
|
||||
int
|
||||
lam_event_loop(int flags)
|
||||
ompi_event_loop(int flags)
|
||||
{
|
||||
struct timeval tv;
|
||||
int res, done;
|
||||
|
||||
if(lam_using_threads()) {
|
||||
THREAD_LOCK(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
THREAD_LOCK(&ompi_event_lock);
|
||||
}
|
||||
|
||||
/* Calculate the initial events that we are waiting for */
|
||||
if (lam_evsel->recalc && lam_evsel->recalc(lam_evbase, 0) == -1) {
|
||||
lam_output(0, "lam_event_loop: lam_evsel->recalc() failed.");
|
||||
THREAD_UNLOCK(&lam_event_lock);
|
||||
if (ompi_evsel->recalc && ompi_evsel->recalc(ompi_evbase, 0) == -1) {
|
||||
ompi_output(0, "ompi_event_loop: ompi_evsel->recalc() failed.");
|
||||
THREAD_UNLOCK(&ompi_event_lock);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
done = 0;
|
||||
while (!done) {
|
||||
while (lam_event_gotsig) {
|
||||
lam_event_gotsig = 0;
|
||||
if (lam_event_sigcb) {
|
||||
res = (*lam_event_sigcb)();
|
||||
while (ompi_event_gotsig) {
|
||||
ompi_event_gotsig = 0;
|
||||
if (ompi_event_sigcb) {
|
||||
res = (*ompi_event_sigcb)();
|
||||
if (res == -1) {
|
||||
lam_output(0, "lam_event_loop: lam_event_sigcb() failed.");
|
||||
ompi_output(0, "ompi_event_loop: ompi_event_sigcb() failed.");
|
||||
errno = EINTR;
|
||||
THREAD_UNLOCK(&lam_event_lock);
|
||||
THREAD_UNLOCK(&ompi_event_lock);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(flags & LAM_EVLOOP_NONBLOCK)) {
|
||||
static struct timeval dflt = LAM_TIMEOUT_DEFAULT;
|
||||
if (!(flags & OMPI_EVLOOP_NONBLOCK)) {
|
||||
static struct timeval dflt = OMPI_TIMEOUT_DEFAULT;
|
||||
tv = dflt;
|
||||
} else
|
||||
timerclear(&tv);
|
||||
|
||||
#if LAM_HAVE_THREADS
|
||||
lam_event_pipe_signalled = 0;
|
||||
#if OMPI_HAVE_THREADS
|
||||
ompi_event_pipe_signalled = 0;
|
||||
#endif
|
||||
res = lam_evsel->dispatch(lam_evbase, &tv);
|
||||
#if LAM_HAVE_THREADS
|
||||
lam_event_pipe_signalled = 1;
|
||||
res = ompi_evsel->dispatch(ompi_evbase, &tv);
|
||||
#if OMPI_HAVE_THREADS
|
||||
ompi_event_pipe_signalled = 1;
|
||||
#endif
|
||||
if (res == -1) {
|
||||
lam_output(0, "lam_event_loop: lam_evesel->dispatch() failed.");
|
||||
THREAD_UNLOCK(&lam_event_lock);
|
||||
ompi_output(0, "ompi_event_loop: ompi_evesel->dispatch() failed.");
|
||||
THREAD_UNLOCK(&ompi_event_lock);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if(NULL != RB_MIN(lam_event_tree, &lam_timetree)) {
|
||||
if(NULL != RB_MIN(ompi_event_tree, &ompi_timetree)) {
|
||||
/* Check if time is running backwards */
|
||||
gettimeofday(&tv, NULL);
|
||||
if (timercmp(&tv, &lam_event_tv, <)) {
|
||||
if (timercmp(&tv, &ompi_event_tv, <)) {
|
||||
struct timeval off;
|
||||
LOG_DBG((LOG_MISC, 10,
|
||||
"%s: time is running backwards, corrected",
|
||||
__func__));
|
||||
|
||||
timersub(&lam_event_tv, &tv, &off);
|
||||
lam_timeout_correct(&off);
|
||||
timersub(&ompi_event_tv, &tv, &off);
|
||||
ompi_timeout_correct(&off);
|
||||
}
|
||||
lam_event_tv = tv;
|
||||
lam_timeout_process();
|
||||
ompi_event_tv = tv;
|
||||
ompi_timeout_process();
|
||||
}
|
||||
|
||||
if (TAILQ_FIRST(&lam_activequeue)) {
|
||||
lam_event_process_active();
|
||||
if (flags & LAM_EVLOOP_ONCE)
|
||||
if (TAILQ_FIRST(&ompi_activequeue)) {
|
||||
ompi_event_process_active();
|
||||
if (flags & OMPI_EVLOOP_ONCE)
|
||||
done = 1;
|
||||
} else if (flags & (LAM_EVLOOP_NONBLOCK|LAM_EVLOOP_ONCE))
|
||||
} else if (flags & (OMPI_EVLOOP_NONBLOCK|OMPI_EVLOOP_ONCE))
|
||||
done = 1;
|
||||
|
||||
if (lam_evsel->recalc && lam_evsel->recalc(lam_evbase, 0) == -1) {
|
||||
lam_output(0, "lam_event_loop: lam_evesel->recalc() failed.");
|
||||
THREAD_UNLOCK(&lam_event_lock);
|
||||
if (ompi_evsel->recalc && ompi_evsel->recalc(ompi_evbase, 0) == -1) {
|
||||
ompi_output(0, "ompi_event_loop: ompi_evesel->recalc() failed.");
|
||||
THREAD_UNLOCK(&ompi_event_lock);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
THREAD_UNLOCK(&lam_event_lock);
|
||||
THREAD_UNLOCK(&ompi_event_lock);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
lam_event_add_i(struct lam_event *ev, struct timeval *tv)
|
||||
ompi_event_add_i(struct ompi_event *ev, struct timeval *tv)
|
||||
{
|
||||
int rc = 0;
|
||||
LOG_DBG((LOG_MISC, 55,
|
||||
"event_add: event: %p, %s%s%scall %p",
|
||||
ev,
|
||||
ev->ev_events & LAM_EV_READ ? "LAM_EV_READ " : " ",
|
||||
ev->ev_events & LAM_EV_WRITE ? "LAM_EV_WRITE " : " ",
|
||||
tv ? "LAM_EV_TIMEOUT " : " ",
|
||||
ev->ev_events & OMPI_EV_READ ? "OMPI_EV_READ " : " ",
|
||||
ev->ev_events & OMPI_EV_WRITE ? "OMPI_EV_WRITE " : " ",
|
||||
tv ? "OMPI_EV_TIMEOUT " : " ",
|
||||
ev->ev_callback));
|
||||
|
||||
assert(!(ev->ev_flags & ~LAM_EVLIST_ALL));
|
||||
assert(!(ev->ev_flags & ~OMPI_EVLIST_ALL));
|
||||
|
||||
if (tv != NULL) {
|
||||
struct timeval now;
|
||||
|
||||
if (ev->ev_flags & LAM_EVLIST_TIMEOUT)
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_TIMEOUT);
|
||||
if (ev->ev_flags & OMPI_EVLIST_TIMEOUT)
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_TIMEOUT);
|
||||
|
||||
/* Check if it is active due to a timeout. Rescheduling
|
||||
* this timeout before the callback can be executed
|
||||
* removes it from the active list. */
|
||||
if ((ev->ev_flags & LAM_EVLIST_ACTIVE) &&
|
||||
(ev->ev_res & LAM_EV_TIMEOUT)) {
|
||||
if ((ev->ev_flags & OMPI_EVLIST_ACTIVE) &&
|
||||
(ev->ev_res & OMPI_EV_TIMEOUT)) {
|
||||
/* See if we are just active executing this
|
||||
* event in a loop
|
||||
*/
|
||||
@ -415,7 +415,7 @@ lam_event_add_i(struct lam_event *ev, struct timeval *tv)
|
||||
*ev->ev_pncalls = 0;
|
||||
}
|
||||
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_ACTIVE);
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_ACTIVE);
|
||||
}
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
@ -425,37 +425,37 @@ lam_event_add_i(struct lam_event *ev, struct timeval *tv)
|
||||
"event_add: timeout in %d seconds, call %p",
|
||||
tv->tv_sec, ev->ev_callback));
|
||||
|
||||
lam_event_queue_insert(ev, LAM_EVLIST_TIMEOUT);
|
||||
ompi_event_queue_insert(ev, OMPI_EVLIST_TIMEOUT);
|
||||
}
|
||||
|
||||
if ((ev->ev_events & (LAM_EV_READ|LAM_EV_WRITE)) &&
|
||||
!(ev->ev_flags & (LAM_EVLIST_INSERTED|LAM_EVLIST_ACTIVE))) {
|
||||
lam_event_queue_insert(ev, LAM_EVLIST_INSERTED);
|
||||
rc = (lam_evsel->add(lam_evbase, ev));
|
||||
} else if ((ev->ev_events & LAM_EV_SIGNAL) &&
|
||||
!(ev->ev_flags & LAM_EVLIST_SIGNAL)) {
|
||||
lam_event_queue_insert(ev, LAM_EVLIST_SIGNAL);
|
||||
rc = (lam_evsel->add(lam_evbase, ev));
|
||||
if ((ev->ev_events & (OMPI_EV_READ|OMPI_EV_WRITE)) &&
|
||||
!(ev->ev_flags & (OMPI_EVLIST_INSERTED|OMPI_EVLIST_ACTIVE))) {
|
||||
ompi_event_queue_insert(ev, OMPI_EVLIST_INSERTED);
|
||||
rc = (ompi_evsel->add(ompi_evbase, ev));
|
||||
} else if ((ev->ev_events & OMPI_EV_SIGNAL) &&
|
||||
!(ev->ev_flags & OMPI_EVLIST_SIGNAL)) {
|
||||
ompi_event_queue_insert(ev, OMPI_EVLIST_SIGNAL);
|
||||
rc = (ompi_evsel->add(ompi_evbase, ev));
|
||||
}
|
||||
|
||||
#if LAM_HAVE_THREADS
|
||||
if(lam_event_pipe_signalled == 0) {
|
||||
#if OMPI_HAVE_THREADS
|
||||
if(ompi_event_pipe_signalled == 0) {
|
||||
unsigned char byte = 0;
|
||||
if(write(lam_event_pipe[1], &byte, 1) != 1)
|
||||
lam_output(0, "lam_event_add: write() to lam_event_pipe[1] failed with errno=%d\n", errno);
|
||||
lam_event_pipe_signalled++;
|
||||
if(write(ompi_event_pipe[1], &byte, 1) != 1)
|
||||
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);
|
||||
ompi_event_pipe_signalled++;
|
||||
}
|
||||
#endif
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int lam_event_del_i(struct lam_event *ev)
|
||||
int ompi_event_del_i(struct ompi_event *ev)
|
||||
{
|
||||
LOG_DBG((LOG_MISC, 80, "event_del: %p, callback %p",
|
||||
ev, ev->ev_callback));
|
||||
|
||||
assert(!(ev->ev_flags & ~LAM_EVLIST_ALL));
|
||||
assert(!(ev->ev_flags & ~OMPI_EVLIST_ALL));
|
||||
|
||||
/* See if we are just active executing this event in a loop */
|
||||
if (ev->ev_ncalls && ev->ev_pncalls) {
|
||||
@ -463,26 +463,26 @@ int lam_event_del_i(struct lam_event *ev)
|
||||
*ev->ev_pncalls = 0;
|
||||
}
|
||||
|
||||
if (ev->ev_flags & LAM_EVLIST_TIMEOUT)
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_TIMEOUT);
|
||||
if (ev->ev_flags & OMPI_EVLIST_TIMEOUT)
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_TIMEOUT);
|
||||
|
||||
if (ev->ev_flags & LAM_EVLIST_ACTIVE)
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_ACTIVE);
|
||||
if (ev->ev_flags & OMPI_EVLIST_ACTIVE)
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_ACTIVE);
|
||||
|
||||
if (ev->ev_flags & LAM_EVLIST_INSERTED) {
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_INSERTED);
|
||||
return (lam_evsel->del(lam_evbase, ev));
|
||||
} else if (ev->ev_flags & LAM_EVLIST_SIGNAL) {
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_SIGNAL);
|
||||
return (lam_evsel->del(lam_evbase, ev));
|
||||
if (ev->ev_flags & OMPI_EVLIST_INSERTED) {
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_INSERTED);
|
||||
return (ompi_evsel->del(ompi_evbase, ev));
|
||||
} else if (ev->ev_flags & OMPI_EVLIST_SIGNAL) {
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_SIGNAL);
|
||||
return (ompi_evsel->del(ompi_evbase, ev));
|
||||
}
|
||||
|
||||
#if LAM_HAVE_THREADS
|
||||
if(lam_event_pipe_signalled == 0) {
|
||||
#if OMPI_HAVE_THREADS
|
||||
if(ompi_event_pipe_signalled == 0) {
|
||||
unsigned char byte = 0;
|
||||
if(write(lam_event_pipe[1], &byte, 1) != 1)
|
||||
lam_output(0, "lam_event_add: write() to lam_event_pipe[1] failed with errno=%d\n", errno);
|
||||
lam_event_pipe_signalled++;
|
||||
if(write(ompi_event_pipe[1], &byte, 1) != 1)
|
||||
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);
|
||||
ompi_event_pipe_signalled++;
|
||||
}
|
||||
#endif
|
||||
return (0);
|
||||
@ -490,48 +490,48 @@ int lam_event_del_i(struct lam_event *ev)
|
||||
|
||||
|
||||
static void
|
||||
lam_timeout_correct(struct timeval *off)
|
||||
ompi_timeout_correct(struct timeval *off)
|
||||
{
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
|
||||
/* We can modify the key element of the node without destroying
|
||||
* the key, beause we apply it to all in the right order.
|
||||
*/
|
||||
RB_FOREACH(ev, lam_event_tree, &lam_timetree)
|
||||
RB_FOREACH(ev, ompi_event_tree, &ompi_timetree)
|
||||
timersub(&ev->ev_timeout, off, &ev->ev_timeout);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
lam_timeout_process(void)
|
||||
ompi_timeout_process(void)
|
||||
{
|
||||
struct timeval now;
|
||||
struct lam_event *ev, *next;
|
||||
struct ompi_event *ev, *next;
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
|
||||
for (ev = RB_MIN(lam_event_tree, &lam_timetree); ev; ev = next) {
|
||||
for (ev = RB_MIN(ompi_event_tree, &ompi_timetree); ev; ev = next) {
|
||||
if (timercmp(&ev->ev_timeout, &now, >))
|
||||
break;
|
||||
next = RB_NEXT(lam_event_tree, &lam_timetree, ev);
|
||||
next = RB_NEXT(ompi_event_tree, &ompi_timetree, ev);
|
||||
|
||||
lam_event_queue_remove(ev, LAM_EVLIST_TIMEOUT);
|
||||
ompi_event_queue_remove(ev, OMPI_EVLIST_TIMEOUT);
|
||||
|
||||
/* delete this event from the I/O queues */
|
||||
lam_event_del_i(ev);
|
||||
ompi_event_del_i(ev);
|
||||
|
||||
LOG_DBG((LOG_MISC, 60, "timeout_process: call %p",
|
||||
ev->ev_callback));
|
||||
lam_event_active_i(ev, LAM_EV_TIMEOUT, 1);
|
||||
ompi_event_active_i(ev, OMPI_EV_TIMEOUT, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
lam_timeout_insert(struct lam_event *ev)
|
||||
ompi_timeout_insert(struct ompi_event *ev)
|
||||
{
|
||||
struct lam_event *tmp;
|
||||
struct ompi_event *tmp;
|
||||
|
||||
tmp = RB_FIND(lam_event_tree, &lam_timetree, ev);
|
||||
tmp = RB_FIND(ompi_event_tree, &ompi_timetree, ev);
|
||||
|
||||
if (tmp != NULL) {
|
||||
struct timeval tv;
|
||||
@ -541,18 +541,18 @@ lam_timeout_insert(struct lam_event *ev)
|
||||
tv = ev->ev_timeout;
|
||||
do {
|
||||
timeradd(&tv, &add, &tv);
|
||||
tmp = RB_NEXT(lam_event_tree, &lam_timetree, tmp);
|
||||
tmp = RB_NEXT(ompi_event_tree, &ompi_timetree, tmp);
|
||||
} while (tmp != NULL && timercmp(&tmp->ev_timeout, &tv, ==));
|
||||
|
||||
ev->ev_timeout = tv;
|
||||
}
|
||||
|
||||
tmp = RB_INSERT(lam_event_tree, &lam_timetree, ev);
|
||||
tmp = RB_INSERT(ompi_event_tree, &ompi_timetree, ev);
|
||||
assert(tmp == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
lam_event_queue_remove(struct lam_event *ev, int queue)
|
||||
ompi_event_queue_remove(struct ompi_event *ev, int queue)
|
||||
{
|
||||
if (!(ev->ev_flags & queue))
|
||||
errx(1, "%s: %p(fd %d) not on queue %x", __func__,
|
||||
@ -560,17 +560,17 @@ lam_event_queue_remove(struct lam_event *ev, int queue)
|
||||
|
||||
ev->ev_flags &= ~queue;
|
||||
switch (queue) {
|
||||
case LAM_EVLIST_ACTIVE:
|
||||
TAILQ_REMOVE(&lam_activequeue, ev, ev_active_next);
|
||||
case OMPI_EVLIST_ACTIVE:
|
||||
TAILQ_REMOVE(&ompi_activequeue, ev, ev_active_next);
|
||||
break;
|
||||
case LAM_EVLIST_SIGNAL:
|
||||
TAILQ_REMOVE(&lam_signalqueue, ev, ev_signal_next);
|
||||
case OMPI_EVLIST_SIGNAL:
|
||||
TAILQ_REMOVE(&ompi_signalqueue, ev, ev_signal_next);
|
||||
break;
|
||||
case LAM_EVLIST_TIMEOUT:
|
||||
RB_REMOVE(lam_event_tree, &lam_timetree, ev);
|
||||
case OMPI_EVLIST_TIMEOUT:
|
||||
RB_REMOVE(ompi_event_tree, &ompi_timetree, ev);
|
||||
break;
|
||||
case LAM_EVLIST_INSERTED:
|
||||
TAILQ_REMOVE(&lam_eventqueue, ev, ev_next);
|
||||
case OMPI_EVLIST_INSERTED:
|
||||
TAILQ_REMOVE(&ompi_eventqueue, ev, ev_next);
|
||||
break;
|
||||
default:
|
||||
errx(1, "%s: unknown queue %x", __func__, queue);
|
||||
@ -578,7 +578,7 @@ lam_event_queue_remove(struct lam_event *ev, int queue)
|
||||
}
|
||||
|
||||
static void
|
||||
lam_event_queue_insert(struct lam_event *ev, int queue)
|
||||
ompi_event_queue_insert(struct ompi_event *ev, int queue)
|
||||
{
|
||||
if (ev->ev_flags & queue)
|
||||
errx(1, "%s: %p(fd %d) already on queue %x", __func__,
|
||||
@ -586,27 +586,27 @@ lam_event_queue_insert(struct lam_event *ev, int queue)
|
||||
|
||||
ev->ev_flags |= queue;
|
||||
switch (queue) {
|
||||
case LAM_EVLIST_ACTIVE:
|
||||
TAILQ_INSERT_TAIL(&lam_activequeue, ev, ev_active_next);
|
||||
case OMPI_EVLIST_ACTIVE:
|
||||
TAILQ_INSERT_TAIL(&ompi_activequeue, ev, ev_active_next);
|
||||
break;
|
||||
case LAM_EVLIST_SIGNAL:
|
||||
TAILQ_INSERT_TAIL(&lam_signalqueue, ev, ev_signal_next);
|
||||
case OMPI_EVLIST_SIGNAL:
|
||||
TAILQ_INSERT_TAIL(&ompi_signalqueue, ev, ev_signal_next);
|
||||
break;
|
||||
case LAM_EVLIST_TIMEOUT:
|
||||
lam_timeout_insert(ev);
|
||||
case OMPI_EVLIST_TIMEOUT:
|
||||
ompi_timeout_insert(ev);
|
||||
break;
|
||||
case LAM_EVLIST_INSERTED:
|
||||
TAILQ_INSERT_TAIL(&lam_eventqueue, ev, ev_next);
|
||||
case OMPI_EVLIST_INSERTED:
|
||||
TAILQ_INSERT_TAIL(&ompi_eventqueue, ev, ev_next);
|
||||
break;
|
||||
default:
|
||||
errx(1, "%s: unknown queue %x", __func__, queue);
|
||||
}
|
||||
}
|
||||
|
||||
void lam_event_active_i(struct lam_event * ev, int res, short ncalls)
|
||||
void ompi_event_active_i(struct ompi_event * ev, int res, short ncalls)
|
||||
{
|
||||
/* We get different kinds of events, add them together */
|
||||
if (ev->ev_flags & LAM_EVLIST_ACTIVE) {
|
||||
if (ev->ev_flags & OMPI_EVLIST_ACTIVE) {
|
||||
ev->ev_res |= res;
|
||||
return;
|
||||
}
|
||||
@ -614,7 +614,7 @@ void lam_event_active_i(struct lam_event * ev, int res, short ncalls)
|
||||
ev->ev_res = res;
|
||||
ev->ev_ncalls = ncalls;
|
||||
ev->ev_pncalls = NULL;
|
||||
lam_event_queue_insert(ev, LAM_EVLIST_ACTIVE);
|
||||
ompi_event_queue_insert(ev, OMPI_EVLIST_ACTIVE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,10 +34,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
/* LAM: Conform to LAM's header file scheme -- specify the full
|
||||
/* OMPI: Conform to OMPI's header file scheme -- specify the full
|
||||
include path from "src/". Also, config.h is a terrible
|
||||
unqualified name for a header file. :-) */
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
#endif
|
||||
#include "threads/mutex.h"
|
||||
|
||||
@ -49,23 +49,23 @@ extern "C" {
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#define LAM_EVLIST_TIMEOUT 0x01
|
||||
#define LAM_EVLIST_INSERTED 0x02
|
||||
#define LAM_EVLIST_SIGNAL 0x04
|
||||
#define LAM_EVLIST_ACTIVE 0x08
|
||||
#define LAM_EVLIST_INIT 0x80
|
||||
#define OMPI_EVLIST_TIMEOUT 0x01
|
||||
#define OMPI_EVLIST_INSERTED 0x02
|
||||
#define OMPI_EVLIST_SIGNAL 0x04
|
||||
#define OMPI_EVLIST_ACTIVE 0x08
|
||||
#define OMPI_EVLIST_INIT 0x80
|
||||
|
||||
/* EVLIST_X_ Private space: 0x1000-0xf000 */
|
||||
#define LAM_EVLIST_ALL (0xf000 | 0x8f)
|
||||
#define OMPI_EVLIST_ALL (0xf000 | 0x8f)
|
||||
|
||||
#define LAM_EV_TIMEOUT 0x01
|
||||
#define LAM_EV_READ 0x02
|
||||
#define LAM_EV_WRITE 0x04
|
||||
#define LAM_EV_SIGNAL 0x08
|
||||
#define LAM_EV_PERSIST 0x10 /* Persistant event */
|
||||
#define OMPI_EV_TIMEOUT 0x01
|
||||
#define OMPI_EV_READ 0x02
|
||||
#define OMPI_EV_WRITE 0x04
|
||||
#define OMPI_EV_SIGNAL 0x08
|
||||
#define OMPI_EV_PERSIST 0x10 /* Persistant event */
|
||||
|
||||
#ifndef LAM_EVENT_USE_SIGNALS
|
||||
#define LAM_EVENT_USE_SIGNALS 0
|
||||
#ifndef OMPI_EVENT_USE_SIGNALS
|
||||
#define OMPI_EVENT_USE_SIGNALS 0
|
||||
#endif
|
||||
|
||||
/* Fix so that ppl dont have to run with <sys/queue.h> */
|
||||
@ -88,11 +88,11 @@ struct { \
|
||||
}
|
||||
#endif /* !RB_ENTRY */
|
||||
|
||||
struct lam_event {
|
||||
TAILQ_ENTRY (lam_event) ev_next;
|
||||
TAILQ_ENTRY (lam_event) ev_active_next;
|
||||
TAILQ_ENTRY (lam_event) ev_signal_next;
|
||||
RB_ENTRY (lam_event) ev_timeout_node;
|
||||
struct ompi_event {
|
||||
TAILQ_ENTRY (ompi_event) ev_next;
|
||||
TAILQ_ENTRY (ompi_event) ev_active_next;
|
||||
TAILQ_ENTRY (ompi_event) ev_signal_next;
|
||||
RB_ENTRY (ompi_event) ev_timeout_node;
|
||||
|
||||
#ifdef WIN32
|
||||
HANDLE ev_fd;
|
||||
@ -112,67 +112,67 @@ struct lam_event {
|
||||
int ev_res; /* result passed to event callback */
|
||||
int ev_flags;
|
||||
};
|
||||
typedef struct lam_event lam_event_t;
|
||||
typedef struct ompi_event ompi_event_t;
|
||||
|
||||
#define LAM_EVENT_SIGNAL(ev) (int)ev->ev_fd
|
||||
#define LAM_EVENT_FD(ev) (int)ev->ev_fd
|
||||
#define OMPI_EVENT_SIGNAL(ev) (int)ev->ev_fd
|
||||
#define OMPI_EVENT_FD(ev) (int)ev->ev_fd
|
||||
|
||||
#ifdef _EVENT_DEFINED_TQENTRY
|
||||
#undef TAILQ_ENTRY
|
||||
#undef _EVENT_DEFINED_TQENTRY
|
||||
#else
|
||||
TAILQ_HEAD (lam_event_list, lam_event);
|
||||
TAILQ_HEAD (ompi_event_list, ompi_event);
|
||||
#endif /* _EVENT_DEFINED_TQENTRY */
|
||||
#ifdef _EVENT_DEFINED_RBENTRY
|
||||
#undef RB_ENTRY
|
||||
#undef _EVENT_DEFINED_RBENTRY
|
||||
#endif /* _EVENT_DEFINED_RBENTRY */
|
||||
|
||||
struct lam_eventop {
|
||||
struct ompi_eventop {
|
||||
char *name;
|
||||
void *(*init)(void);
|
||||
int (*add)(void *, struct lam_event *);
|
||||
int (*del)(void *, struct lam_event *);
|
||||
int (*add)(void *, struct ompi_event *);
|
||||
int (*del)(void *, struct ompi_event *);
|
||||
int (*recalc)(void *, int);
|
||||
int (*dispatch)(void *, struct timeval *);
|
||||
};
|
||||
|
||||
#define LAM_TIMEOUT_DEFAULT {10, 0}
|
||||
#define LAM_EVLOOP_ONCE 0x01
|
||||
#define LAM_EVLOOP_NONBLOCK 0x02
|
||||
#define OMPI_TIMEOUT_DEFAULT {10, 0}
|
||||
#define OMPI_EVLOOP_ONCE 0x01
|
||||
#define OMPI_EVLOOP_NONBLOCK 0x02
|
||||
|
||||
|
||||
int lam_event_init(void);
|
||||
int lam_event_dispatch(void);
|
||||
int lam_event_loop(int);
|
||||
int ompi_event_init(void);
|
||||
int ompi_event_dispatch(void);
|
||||
int ompi_event_loop(int);
|
||||
|
||||
#define lam_evtimer_add(ev, tv) lam_event_add(ev, tv)
|
||||
#define lam_evtimer_set(ev, cb, arg) lam_event_set(ev, -1, 0, cb, arg)
|
||||
#define lam_evtimer_del(ev) lam_event_del(ev)
|
||||
#define lam_evtimer_pending(ev, tv) lam_event_pending(ev, LAM_EV_TIMEOUT, tv)
|
||||
#define lam_evtimer_initialized(ev) (ev)->ev_flags & LAM_EVLIST_INIT)
|
||||
#define ompi_evtimer_add(ev, tv) ompi_event_add(ev, tv)
|
||||
#define ompi_evtimer_set(ev, cb, arg) ompi_event_set(ev, -1, 0, cb, arg)
|
||||
#define ompi_evtimer_del(ev) ompi_event_del(ev)
|
||||
#define ompi_evtimer_pending(ev, tv) ompi_event_pending(ev, OMPI_EV_TIMEOUT, tv)
|
||||
#define ompi_evtimer_initialized(ev) (ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||
|
||||
#define lam_timeout_add(ev, tv) lam_event_add(ev, tv)
|
||||
#define lam_timeout_set(ev, cb, arg) lam_event_set(ev, -1, 0, cb, arg)
|
||||
#define lam_timeout_del(ev) lam_event_del(ev)
|
||||
#define lam_timeout_pending(ev, tv) lam_event_pending(ev, LAM_EV_TIMEOUT, tv)
|
||||
#define lam_timeout_initialized(ev) ((ev)->ev_flags & LAM_EVLIST_INIT)
|
||||
#define ompi_timeout_add(ev, tv) ompi_event_add(ev, tv)
|
||||
#define ompi_timeout_set(ev, cb, arg) ompi_event_set(ev, -1, 0, cb, arg)
|
||||
#define ompi_timeout_del(ev) ompi_event_del(ev)
|
||||
#define ompi_timeout_pending(ev, tv) ompi_event_pending(ev, OMPI_EV_TIMEOUT, tv)
|
||||
#define ompi_timeout_initialized(ev) ((ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||
|
||||
#define lam_signal_add(ev, tv) lam_event_add(ev, tv)
|
||||
#define lam_signal_set(ev, x, cb, arg) \
|
||||
lam_event_set(ev, x, LAM_EV_SIGNAL|LAM_EV_PERSIST, cb, arg)
|
||||
#define lam_signal_del(ev) lam_event_del(ev)
|
||||
#define lam_signal_pending(ev, tv) lam_event_pending(ev, LAM_EV_SIGNAL, tv)
|
||||
#define lam_signal_initialized(ev) ((ev)->ev_flags & LAM_EVLIST_INIT)
|
||||
#define ompi_signal_add(ev, tv) ompi_event_add(ev, tv)
|
||||
#define ompi_signal_set(ev, x, cb, arg) \
|
||||
ompi_event_set(ev, x, OMPI_EV_SIGNAL|OMPI_EV_PERSIST, cb, arg)
|
||||
#define ompi_signal_del(ev) ompi_event_del(ev)
|
||||
#define ompi_signal_pending(ev, tv) ompi_event_pending(ev, OMPI_EV_SIGNAL, tv)
|
||||
#define ompi_signal_initialized(ev) ((ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||
|
||||
/* for internal use only */
|
||||
int lam_event_add_i(struct lam_event *, struct timeval *);
|
||||
int lam_event_del_i(struct lam_event *);
|
||||
void lam_event_active_i(struct lam_event*, int, short);
|
||||
int ompi_event_add_i(struct ompi_event *, struct timeval *);
|
||||
int ompi_event_del_i(struct ompi_event *);
|
||||
void ompi_event_active_i(struct ompi_event*, int, short);
|
||||
|
||||
/* public functions */
|
||||
static inline void
|
||||
lam_event_set(struct lam_event *ev, int fd, short events,
|
||||
ompi_event_set(struct ompi_event *ev, int fd, short events,
|
||||
void (*callback)(int, short, void *), void *arg)
|
||||
{
|
||||
ev->ev_callback = callback;
|
||||
@ -184,70 +184,70 @@ lam_event_set(struct lam_event *ev, int fd, short events,
|
||||
ev->ev_fd = fd;
|
||||
#endif
|
||||
ev->ev_events = events;
|
||||
ev->ev_flags = LAM_EVLIST_INIT;
|
||||
ev->ev_flags = OMPI_EVLIST_INIT;
|
||||
ev->ev_ncalls = 0;
|
||||
ev->ev_pncalls = NULL;
|
||||
}
|
||||
|
||||
static inline int
|
||||
lam_event_add(struct lam_event *ev, struct timeval *tv)
|
||||
ompi_event_add(struct ompi_event *ev, struct timeval *tv)
|
||||
{
|
||||
extern lam_mutex_t lam_event_lock;
|
||||
extern ompi_mutex_t ompi_event_lock;
|
||||
int rc;
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
rc = lam_event_add_i(ev, tv);
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
rc = ompi_event_add_i(ev, tv);
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
} else {
|
||||
rc = lam_event_add_i(ev, tv);
|
||||
rc = ompi_event_add_i(ev, tv);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline int
|
||||
lam_event_del(struct lam_event *ev)
|
||||
ompi_event_del(struct ompi_event *ev)
|
||||
{
|
||||
extern lam_mutex_t lam_event_lock;
|
||||
extern ompi_mutex_t ompi_event_lock;
|
||||
int rc;
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
rc = lam_event_del_i(ev);
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
rc = ompi_event_del_i(ev);
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
} else {
|
||||
rc = lam_event_del_i(ev);
|
||||
rc = ompi_event_del_i(ev);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline void
|
||||
lam_event_active(struct lam_event* ev, int res, short ncalls)
|
||||
ompi_event_active(struct ompi_event* ev, int res, short ncalls)
|
||||
{
|
||||
extern lam_mutex_t lam_event_lock;
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
lam_event_active_i(ev, res, ncalls);
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
extern ompi_mutex_t ompi_event_lock;
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
ompi_event_active_i(ev, res, ncalls);
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
} else {
|
||||
lam_event_active_i(ev, res, ncalls);
|
||||
ompi_event_active_i(ev, res, ncalls);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
lam_event_pending(struct lam_event *ev, short event, struct timeval *tv)
|
||||
ompi_event_pending(struct ompi_event *ev, short event, struct timeval *tv)
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
if (ev->ev_flags & LAM_EVLIST_INSERTED)
|
||||
flags |= (ev->ev_events & (LAM_EV_READ|LAM_EV_WRITE));
|
||||
if (ev->ev_flags & LAM_EVLIST_ACTIVE)
|
||||
if (ev->ev_flags & OMPI_EVLIST_INSERTED)
|
||||
flags |= (ev->ev_events & (OMPI_EV_READ|OMPI_EV_WRITE));
|
||||
if (ev->ev_flags & OMPI_EVLIST_ACTIVE)
|
||||
flags |= ev->ev_res;
|
||||
if (ev->ev_flags & LAM_EVLIST_TIMEOUT)
|
||||
flags |= LAM_EV_TIMEOUT;
|
||||
if (ev->ev_flags & OMPI_EVLIST_TIMEOUT)
|
||||
flags |= OMPI_EV_TIMEOUT;
|
||||
|
||||
event &= (LAM_EV_TIMEOUT|LAM_EV_READ|LAM_EV_WRITE);
|
||||
event &= (OMPI_EV_TIMEOUT|OMPI_EV_READ|OMPI_EV_WRITE);
|
||||
|
||||
/* See if there is a timeout that we should report */
|
||||
if (tv != NULL && (flags & event & LAM_EV_TIMEOUT))
|
||||
if (tv != NULL && (flags & event & OMPI_EV_TIMEOUT))
|
||||
*tv = ev->ev_timeout;
|
||||
|
||||
return (flags & event);
|
||||
@ -255,9 +255,9 @@ lam_event_pending(struct lam_event *ev, short event, struct timeval *tv)
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#define lam_event_initialized(ev) ((ev)->ev_flags & LAM_EVLIST_INIT && (ev)->ev_fd != INVALID_HANDLE_VALUE)
|
||||
#define ompi_event_initialized(ev) ((ev)->ev_flags & OMPI_EVLIST_INIT && (ev)->ev_fd != INVALID_HANDLE_VALUE)
|
||||
#else
|
||||
#define lam_event_initialized(ev) ((ev)->ev_flags & LAM_EVLIST_INIT)
|
||||
#define ompi_event_initialized(ev) ((ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -27,11 +27,11 @@
|
||||
#ifndef _EVSIGNAL_H_
|
||||
#define _EVSIGNAL_H_
|
||||
|
||||
void lam_evsignal_init(sigset_t *);
|
||||
void lam_evsignal_process(void);
|
||||
int lam_evsignal_recalc(sigset_t *);
|
||||
int lam_evsignal_deliver(sigset_t *);
|
||||
int lam_evsignal_add(sigset_t *, struct lam_event *);
|
||||
int lam_evsignal_del(sigset_t *, struct lam_event *);
|
||||
void ompi_evsignal_init(sigset_t *);
|
||||
void ompi_evsignal_process(void);
|
||||
int ompi_evsignal_recalc(sigset_t *);
|
||||
int ompi_evsignal_deliver(sigset_t *);
|
||||
int ompi_evsignal_add(sigset_t *, struct ompi_event *);
|
||||
int ompi_evsignal_del(sigset_t *, struct ompi_event *);
|
||||
|
||||
#endif /* _EVSIGNAL_H_ */
|
||||
|
@ -26,7 +26,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 "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
@ -66,7 +66,7 @@
|
||||
extern struct event_list timequeue;
|
||||
extern struct event_list eventqueue;
|
||||
extern struct event_list addqueue;
|
||||
extern lam_mutex_t lam_event_lock;
|
||||
extern ompi_mutex_t ompi_event_lock;
|
||||
|
||||
#define EVLIST_X_KQINKERNEL 0x1000
|
||||
|
||||
@ -81,13 +81,13 @@ struct kqop {
|
||||
} kqueueop;
|
||||
|
||||
static void *kq_init (void);
|
||||
static int kq_add (void *, struct lam_event *);
|
||||
static int kq_del (void *, struct lam_event *);
|
||||
static int kq_add (void *, struct ompi_event *);
|
||||
static int kq_del (void *, struct ompi_event *);
|
||||
static int kq_recalc (void *, int);
|
||||
static int kq_dispatch (void *, struct timeval *);
|
||||
static int kq_insert (struct kqop *, struct kevent *);
|
||||
|
||||
const struct lam_eventop lam_kqops = {
|
||||
const struct ompi_eventop ompi_kqops = {
|
||||
"kqueue",
|
||||
kq_init,
|
||||
kq_add,
|
||||
@ -193,18 +193,18 @@ kq_dispatch(void *arg, struct timeval *tv)
|
||||
struct kqop *kqop = arg;
|
||||
struct kevent *changes = kqop->changes;
|
||||
struct kevent *events = kqop->events;
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
struct timespec ts;
|
||||
int i, res;
|
||||
|
||||
TIMEVAL_TO_TIMESPEC(tv, &ts);
|
||||
|
||||
/* release lock while waiting in kernel */
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
res = kevent(kqop->kq, changes, kqop->nchanges,
|
||||
events, kqop->nevents, &ts);
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
} else {
|
||||
res = kevent(kqop->kq, changes, kqop->nchanges,
|
||||
events, kqop->nevents, &ts);
|
||||
@ -242,26 +242,26 @@ kq_dispatch(void *arg, struct timeval *tv)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
ev = (struct lam_event *)events[i].udata;
|
||||
ev = (struct ompi_event *)events[i].udata;
|
||||
|
||||
if (events[i].filter == EVFILT_READ) {
|
||||
which |= LAM_EV_READ;
|
||||
which |= OMPI_EV_READ;
|
||||
} else if (events[i].filter == EVFILT_WRITE) {
|
||||
which |= LAM_EV_WRITE;
|
||||
which |= OMPI_EV_WRITE;
|
||||
} else if (events[i].filter == EVFILT_SIGNAL) {
|
||||
which |= LAM_EV_SIGNAL;
|
||||
which |= OMPI_EV_SIGNAL;
|
||||
}
|
||||
|
||||
if (!which)
|
||||
continue;
|
||||
|
||||
if (!(ev->ev_events & LAM_EV_PERSIST)) {
|
||||
if (!(ev->ev_events & OMPI_EV_PERSIST)) {
|
||||
ev->ev_flags &= ~EVLIST_X_KQINKERNEL;
|
||||
lam_event_del_i(ev);
|
||||
ompi_event_del_i(ev);
|
||||
}
|
||||
|
||||
lam_event_active_i(ev, which,
|
||||
ev->ev_events & LAM_EV_SIGNAL ? events[i].data : 1);
|
||||
ompi_event_active_i(ev, which,
|
||||
ev->ev_events & OMPI_EV_SIGNAL ? events[i].data : 1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
@ -269,19 +269,19 @@ kq_dispatch(void *arg, struct timeval *tv)
|
||||
|
||||
|
||||
static int
|
||||
kq_add(void *arg, struct lam_event *ev)
|
||||
kq_add(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
struct kqop *kqop = arg;
|
||||
struct kevent kev;
|
||||
|
||||
if (ev->ev_events & LAM_EV_SIGNAL) {
|
||||
int nsignal = LAM_EVENT_SIGNAL(ev);
|
||||
if (ev->ev_events & OMPI_EV_SIGNAL) {
|
||||
int nsignal = OMPI_EVENT_SIGNAL(ev);
|
||||
|
||||
memset(&kev, 0, sizeof(kev));
|
||||
kev.ident = nsignal;
|
||||
kev.filter = EVFILT_SIGNAL;
|
||||
kev.flags = EV_ADD;
|
||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
||||
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||
kev.flags |= EV_ONESHOT;
|
||||
kev.udata = (void *) INTPTR(ev);
|
||||
|
||||
@ -295,12 +295,12 @@ kq_add(void *arg, struct lam_event *ev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (ev->ev_events & LAM_EV_READ) {
|
||||
if (ev->ev_events & OMPI_EV_READ) {
|
||||
memset(&kev, 0, sizeof(kev));
|
||||
kev.ident = ev->ev_fd;
|
||||
kev.filter = EVFILT_READ;
|
||||
kev.flags = EV_ADD;
|
||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
||||
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||
kev.flags |= EV_ONESHOT;
|
||||
kev.udata = (void *) INTPTR(ev);
|
||||
|
||||
@ -310,12 +310,12 @@ kq_add(void *arg, struct lam_event *ev)
|
||||
ev->ev_flags |= EVLIST_X_KQINKERNEL;
|
||||
}
|
||||
|
||||
if (ev->ev_events & LAM_EV_WRITE) {
|
||||
if (ev->ev_events & OMPI_EV_WRITE) {
|
||||
memset(&kev, 0, sizeof(kev));
|
||||
kev.ident = ev->ev_fd;
|
||||
kev.filter = EVFILT_WRITE;
|
||||
kev.flags = EV_ADD;
|
||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
||||
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||
kev.flags |= EV_ONESHOT;
|
||||
kev.udata = (void *) INTPTR(ev);
|
||||
|
||||
@ -329,7 +329,7 @@ kq_add(void *arg, struct lam_event *ev)
|
||||
}
|
||||
|
||||
static int
|
||||
kq_del(void *arg, struct lam_event *ev)
|
||||
kq_del(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
struct kqop *kqop = arg;
|
||||
struct kevent kev;
|
||||
@ -337,8 +337,8 @@ kq_del(void *arg, struct lam_event *ev)
|
||||
if (!(ev->ev_flags & EVLIST_X_KQINKERNEL))
|
||||
return (0);
|
||||
|
||||
if (ev->ev_events & LAM_EV_SIGNAL) {
|
||||
int nsignal = LAM_EVENT_SIGNAL(ev);
|
||||
if (ev->ev_events & OMPI_EV_SIGNAL) {
|
||||
int nsignal = OMPI_EVENT_SIGNAL(ev);
|
||||
|
||||
memset(&kev, 0, sizeof(kev));
|
||||
kev.ident = (int)signal;
|
||||
@ -355,7 +355,7 @@ kq_del(void *arg, struct lam_event *ev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (ev->ev_events & LAM_EV_READ) {
|
||||
if (ev->ev_events & OMPI_EV_READ) {
|
||||
memset(&kev, 0, sizeof(kev));
|
||||
kev.ident = ev->ev_fd;
|
||||
kev.filter = EVFILT_READ;
|
||||
@ -367,7 +367,7 @@ kq_del(void *arg, struct lam_event *ev)
|
||||
ev->ev_flags &= ~EVLIST_X_KQINKERNEL;
|
||||
}
|
||||
|
||||
if (ev->ev_events & LAM_EV_WRITE) {
|
||||
if (ev->ev_events & OMPI_EV_WRITE) {
|
||||
memset(&kev, 0, sizeof(kev));
|
||||
kev.ident = ev->ev_fd;
|
||||
kev.filter = EVFILT_WRITE;
|
||||
|
@ -26,7 +26,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 "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
@ -52,32 +52,32 @@
|
||||
#endif
|
||||
|
||||
#include "event.h"
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
#include "evsignal.h"
|
||||
#endif
|
||||
#include "threads/mutex.h"
|
||||
|
||||
|
||||
extern struct lam_event_list lam_eventqueue;
|
||||
extern volatile sig_atomic_t lam_evsignal_caught;
|
||||
extern lam_mutex_t lam_event_lock;
|
||||
extern struct ompi_event_list ompi_eventqueue;
|
||||
extern volatile sig_atomic_t ompi_evsignal_caught;
|
||||
extern ompi_mutex_t ompi_event_lock;
|
||||
|
||||
struct pollop {
|
||||
int event_count; /* Highest number alloc */
|
||||
struct pollfd *event_set;
|
||||
struct lam_event **event_back;
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
struct ompi_event **event_back;
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
sigset_t evsigmask;
|
||||
#endif
|
||||
} pollop;
|
||||
|
||||
static void *poll_init (void);
|
||||
static int poll_add (void *, struct lam_event *);
|
||||
static int poll_del (void *, struct lam_event *);
|
||||
static int poll_add (void *, struct ompi_event *);
|
||||
static int poll_del (void *, struct ompi_event *);
|
||||
static int poll_recalc (void *, int);
|
||||
static int poll_dispatch (void *, struct timeval *);
|
||||
|
||||
const struct lam_eventop lam_pollops = {
|
||||
const struct ompi_eventop ompi_pollops = {
|
||||
"poll",
|
||||
poll_init,
|
||||
poll_add,
|
||||
@ -94,8 +94,8 @@ poll_init(void)
|
||||
return (NULL);
|
||||
|
||||
memset(&pollop, 0, sizeof(pollop));
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
lam_evsignal_init(&pollop.evsigmask);
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
ompi_evsignal_init(&pollop.evsigmask);
|
||||
#endif
|
||||
return (&pollop);
|
||||
}
|
||||
@ -108,9 +108,9 @@ poll_init(void)
|
||||
static int
|
||||
poll_recalc(void *arg, int max)
|
||||
{
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
struct pollop *pop = arg;
|
||||
return (lam_evsignal_recalc(&pop->evsigmask));
|
||||
return (ompi_evsignal_recalc(&pop->evsigmask));
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
@ -120,12 +120,12 @@ static int
|
||||
poll_dispatch(void *arg, struct timeval *tv)
|
||||
{
|
||||
int res, i, count, sec, nfds;
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
struct pollop *pop = arg;
|
||||
|
||||
count = pop->event_count;
|
||||
nfds = 0;
|
||||
TAILQ_FOREACH(ev, &lam_eventqueue, ev_next) {
|
||||
TAILQ_FOREACH(ev, &ompi_eventqueue, ev_next) {
|
||||
if (nfds + 1 >= count) {
|
||||
if (count < 256)
|
||||
count = 256;
|
||||
@ -140,14 +140,14 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
return (-1);
|
||||
}
|
||||
pop->event_back = realloc(pop->event_back,
|
||||
count * sizeof(struct lam_event *));
|
||||
count * sizeof(struct ompi_event *));
|
||||
if (pop->event_back == NULL) {
|
||||
log_error("realloc");
|
||||
return (-1);
|
||||
}
|
||||
pop->event_count = count;
|
||||
}
|
||||
if (ev->ev_events & LAM_EV_WRITE) {
|
||||
if (ev->ev_events & OMPI_EV_WRITE) {
|
||||
struct pollfd *pfd = &pop->event_set[nfds];
|
||||
pfd->fd = ev->ev_fd;
|
||||
pfd->events = POLLOUT;
|
||||
@ -157,7 +157,7 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
|
||||
nfds++;
|
||||
}
|
||||
if (ev->ev_events & LAM_EV_READ) {
|
||||
if (ev->ev_events & OMPI_EV_READ) {
|
||||
struct pollfd *pfd = &pop->event_set[nfds];
|
||||
|
||||
pfd->fd = ev->ev_fd;
|
||||
@ -170,22 +170,22 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
}
|
||||
}
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
if (lam_evsignal_deliver(&pop->evsigmask) == -1)
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
if (ompi_evsignal_deliver(&pop->evsigmask) == -1)
|
||||
return (-1);
|
||||
#endif
|
||||
|
||||
sec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
res = poll(pop->event_set, nfds, sec);
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
} else {
|
||||
res = poll(pop->event_set, nfds, sec);
|
||||
}
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
if (lam_evsignal_recalc(&pop->evsigmask) == -1)
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
if (ompi_evsignal_recalc(&pop->evsigmask) == -1)
|
||||
return (-1);
|
||||
#endif
|
||||
|
||||
@ -195,15 +195,15 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
lam_evsignal_process();
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
ompi_evsignal_process();
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
else if (lam_evsignal_caught)
|
||||
lam_evsignal_process();
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
else if (ompi_evsignal_caught)
|
||||
ompi_evsignal_process();
|
||||
#endif
|
||||
|
||||
LOG_DBG((LOG_MISC, 80, "%s: poll reports %d", __func__, res));
|
||||
@ -222,9 +222,9 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
if (what & POLLERR)
|
||||
what |= POLLIN|POLLOUT;
|
||||
if (what & POLLIN)
|
||||
res |= LAM_EV_READ;
|
||||
res |= OMPI_EV_READ;
|
||||
if (what & POLLOUT)
|
||||
res |= LAM_EV_WRITE;
|
||||
res |= OMPI_EV_WRITE;
|
||||
if (res == 0)
|
||||
continue;
|
||||
|
||||
@ -232,9 +232,9 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
res &= ev->ev_events;
|
||||
|
||||
if (res) {
|
||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
||||
lam_event_del_i(ev);
|
||||
lam_event_active_i(ev, res, 1);
|
||||
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||
ompi_event_del_i(ev);
|
||||
ompi_event_active_i(ev, res, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,12 +242,12 @@ poll_dispatch(void *arg, struct timeval *tv)
|
||||
}
|
||||
|
||||
static int
|
||||
poll_add(void *arg, struct lam_event *ev)
|
||||
poll_add(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
struct pollop *pop = arg;
|
||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
||||
return (lam_evsignal_add(&pop->evsigmask, ev));
|
||||
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||
return (ompi_evsignal_add(&pop->evsigmask, ev));
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
@ -257,15 +257,15 @@ poll_add(void *arg, struct lam_event *ev)
|
||||
*/
|
||||
|
||||
static int
|
||||
poll_del(void *arg, struct lam_event *ev)
|
||||
poll_del(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
struct pollop *pop = arg;
|
||||
#endif
|
||||
if (!(ev->ev_events & LAM_EV_SIGNAL))
|
||||
if (!(ev->ev_events & OMPI_EV_SIGNAL))
|
||||
return (0);
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
return (lam_evsignal_del(&pop->evsigmask, ev));
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
return (ompi_evsignal_del(&pop->evsigmask, ev));
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
/* Enable F_SETSIG and F_SETOWN */
|
||||
#define _GNU_SOURCE
|
||||
@ -123,7 +123,7 @@ static int rtsig_del(void *, struct event *);
|
||||
static int rtsig_recalc(void *, int);
|
||||
static int rtsig_dispatch(void *, struct timeval *);
|
||||
|
||||
struct lam_eventop rtsigops = {
|
||||
struct ompi_eventop rtsigops = {
|
||||
"rtsig",
|
||||
rtsig_init,
|
||||
rtsig_add,
|
||||
|
@ -25,13 +25,13 @@ fifo_read(int fd, short event, void *arg)
|
||||
{
|
||||
char buf[255];
|
||||
int len;
|
||||
struct lam_event *ev = arg;
|
||||
struct ompi_event *ev = arg;
|
||||
#ifdef WIN32
|
||||
DWORD dwBytesRead;
|
||||
#endif
|
||||
|
||||
/* Reschedule this event */
|
||||
lam_event_add(ev, NULL);
|
||||
ompi_event_add(ev, NULL);
|
||||
|
||||
fprintf(stderr, "fifo_read called with fd: %d, event: %d, arg: %p\n",
|
||||
fd, event, arg);
|
||||
@ -41,7 +41,7 @@ fifo_read(int fd, short event, void *arg)
|
||||
// Check for end of file.
|
||||
if(len && dwBytesRead == 0) {
|
||||
fprintf(stderr, "End Of File");
|
||||
lam_event_del(ev);
|
||||
ompi_event_del(ev);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ fifo_read(int fd, short event, void *arg)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
struct lam_event evfifo;
|
||||
struct ompi_event evfifo;
|
||||
#ifdef WIN32
|
||||
HANDLE socket;
|
||||
// Open a file.
|
||||
@ -114,19 +114,19 @@ main (int argc, char **argv)
|
||||
fprintf(stderr, "Write data to %s\n", fifo);
|
||||
#endif
|
||||
/* Initalize the event library */
|
||||
lam_event_init();
|
||||
ompi_event_init();
|
||||
|
||||
/* Initalize one event */
|
||||
#ifdef WIN32
|
||||
lam_event_set(&evfifo, (int)socket, LAM_EV_READ, fifo_read, &evfifo);
|
||||
ompi_event_set(&evfifo, (int)socket, OMPI_EV_READ, fifo_read, &evfifo);
|
||||
#else
|
||||
lam_event_set(&evfifo, socket, LAM_EV_READ, fifo_read, &evfifo);
|
||||
ompi_event_set(&evfifo, socket, OMPI_EV_READ, fifo_read, &evfifo);
|
||||
#endif
|
||||
|
||||
/* Add it to the active events, without a timeout */
|
||||
lam_event_add(&evfifo, NULL);
|
||||
ompi_event_add(&evfifo, NULL);
|
||||
|
||||
lam_event_dispatch();
|
||||
ompi_event_dispatch();
|
||||
#ifdef WIN32
|
||||
CloseHandle(socket);
|
||||
#endif
|
||||
|
@ -26,12 +26,12 @@ int called = 0;
|
||||
void
|
||||
signal_cb(int fd, short event, void *arg)
|
||||
{
|
||||
struct lam_event *signal = arg;
|
||||
struct ompi_event *signal = arg;
|
||||
|
||||
printf("%s: got signal %d\n", __func__, LAM_EVENT_SIGNAL(signal));
|
||||
printf("%s: got signal %d\n", __func__, OMPI_EVENT_SIGNAL(signal));
|
||||
|
||||
if (called >= 2)
|
||||
lam_event_del(signal);
|
||||
ompi_event_del(signal);
|
||||
|
||||
called++;
|
||||
}
|
||||
@ -39,18 +39,18 @@ signal_cb(int fd, short event, void *arg)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
struct lam_event signal_int;
|
||||
struct ompi_event signal_int;
|
||||
|
||||
/* Initalize the event library */
|
||||
lam_event_init();
|
||||
ompi_event_init();
|
||||
|
||||
/* Initalize one event */
|
||||
lam_event_set(&signal_int, SIGINT, LAM_EV_SIGNAL|LAM_EV_PERSIST, signal_cb,
|
||||
ompi_event_set(&signal_int, SIGINT, OMPI_EV_SIGNAL|OMPI_EV_PERSIST, signal_cb,
|
||||
&signal_int);
|
||||
|
||||
lam_event_add(&signal_int, NULL);
|
||||
ompi_event_add(&signal_int, NULL);
|
||||
|
||||
lam_event_dispatch();
|
||||
ompi_event_dispatch();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ void
|
||||
timeout_cb(int fd, short event, void *arg)
|
||||
{
|
||||
struct timeval tv;
|
||||
struct lam_event *timeout = arg;
|
||||
struct ompi_event *timeout = arg;
|
||||
int newtime = time(NULL);
|
||||
|
||||
printf("%s: called at %d: %d\n", __func__, newtime,
|
||||
@ -35,28 +35,28 @@ timeout_cb(int fd, short event, void *arg)
|
||||
|
||||
timerclear(&tv);
|
||||
tv.tv_sec = 2;
|
||||
lam_event_add(timeout, &tv);
|
||||
ompi_event_add(timeout, &tv);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
struct lam_event timeout;
|
||||
struct ompi_event timeout;
|
||||
struct timeval tv;
|
||||
|
||||
/* Initalize the event library */
|
||||
lam_event_init();
|
||||
ompi_event_init();
|
||||
|
||||
/* Initalize one event */
|
||||
lam_evtimer_set(&timeout, timeout_cb, &timeout);
|
||||
ompi_evtimer_set(&timeout, timeout_cb, &timeout);
|
||||
|
||||
timerclear(&tv);
|
||||
tv.tv_sec = 2;
|
||||
lam_event_add(&timeout, &tv);
|
||||
ompi_event_add(&timeout, &tv);
|
||||
|
||||
lasttime = time(NULL);
|
||||
|
||||
lam_event_dispatch();
|
||||
ompi_event_dispatch();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -26,7 +26,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 "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
#include "util/output.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -55,14 +55,14 @@
|
||||
#include "evsignal.h"
|
||||
#include "threads/mutex.h"
|
||||
|
||||
extern struct lam_event_list lam_eventqueue;
|
||||
extern lam_mutex_t lam_event_lock;
|
||||
extern struct ompi_event_list ompi_eventqueue;
|
||||
extern ompi_mutex_t ompi_event_lock;
|
||||
|
||||
#ifndef howmany
|
||||
#define howmany(x, y) (((x)+((y)-1))/(y))
|
||||
#endif
|
||||
|
||||
extern volatile sig_atomic_t lam_evsignal_caught;
|
||||
extern volatile sig_atomic_t ompi_evsignal_caught;
|
||||
|
||||
struct selectop {
|
||||
int event_fds; /* Highest fd in fd set */
|
||||
@ -73,12 +73,12 @@ struct selectop {
|
||||
} sop;
|
||||
|
||||
static void *select_init (void);
|
||||
static int select_add (void *, struct lam_event *);
|
||||
static int select_del (void *, struct lam_event *);
|
||||
static int select_add (void *, struct ompi_event *);
|
||||
static int select_del (void *, struct ompi_event *);
|
||||
static int select_recalc (void *, int);
|
||||
static int select_dispatch (void *, struct timeval *);
|
||||
|
||||
const struct lam_eventop lam_selectops = {
|
||||
const struct ompi_eventop ompi_selectops = {
|
||||
"select",
|
||||
select_init,
|
||||
select_add,
|
||||
@ -94,7 +94,7 @@ select_init(void)
|
||||
if (getenv("EVENT_NOSELECT"))
|
||||
return (NULL);
|
||||
memset(&sop, 0, sizeof(sop));
|
||||
lam_evsignal_init(&sop.evsigmask);
|
||||
ompi_evsignal_init(&sop.evsigmask);
|
||||
return (&sop);
|
||||
}
|
||||
|
||||
@ -108,14 +108,14 @@ select_recalc(void *arg, int max)
|
||||
{
|
||||
struct selectop *sop = arg;
|
||||
fd_set *readset, *writeset;
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
int fdsz;
|
||||
|
||||
if (sop->event_fds < max)
|
||||
sop->event_fds = max;
|
||||
|
||||
if (!sop->event_fds) {
|
||||
TAILQ_FOREACH(ev, &lam_eventqueue, ev_next)
|
||||
TAILQ_FOREACH(ev, &ompi_eventqueue, ev_next)
|
||||
if (ev->ev_fd > sop->event_fds)
|
||||
sop->event_fds = ev->ev_fd;
|
||||
}
|
||||
@ -142,8 +142,8 @@ select_recalc(void *arg, int max)
|
||||
sop->event_writeset = writeset;
|
||||
sop->event_fdsz = fdsz;
|
||||
}
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
return (lam_evsignal_recalc(&sop->evsigmask));
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
return (ompi_evsignal_recalc(&sop->evsigmask));
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
@ -153,37 +153,37 @@ static int
|
||||
select_dispatch(void *arg, struct timeval *tv)
|
||||
{
|
||||
int maxfd, res;
|
||||
struct lam_event *ev, *next;
|
||||
struct ompi_event *ev, *next;
|
||||
struct selectop *sop = arg;
|
||||
|
||||
memset(sop->event_readset, 0, sop->event_fdsz);
|
||||
memset(sop->event_writeset, 0, sop->event_fdsz);
|
||||
|
||||
TAILQ_FOREACH(ev, &lam_eventqueue, ev_next) {
|
||||
if (ev->ev_events & LAM_EV_WRITE)
|
||||
TAILQ_FOREACH(ev, &ompi_eventqueue, ev_next) {
|
||||
if (ev->ev_events & OMPI_EV_WRITE)
|
||||
FD_SET(ev->ev_fd, sop->event_writeset);
|
||||
if (ev->ev_events & LAM_EV_READ)
|
||||
if (ev->ev_events & OMPI_EV_READ)
|
||||
FD_SET(ev->ev_fd, sop->event_readset);
|
||||
}
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
if (lam_evsignal_deliver(&sop->evsigmask) == -1)
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
if (ompi_evsignal_deliver(&sop->evsigmask) == -1)
|
||||
return (-1);
|
||||
#endif
|
||||
|
||||
/* release lock while waiting in kernel */
|
||||
if(lam_using_threads()) {
|
||||
lam_mutex_unlock(&lam_event_lock);
|
||||
if(ompi_using_threads()) {
|
||||
ompi_mutex_unlock(&ompi_event_lock);
|
||||
res = select(sop->event_fds + 1, sop->event_readset,
|
||||
sop->event_writeset, NULL, tv);
|
||||
lam_mutex_lock(&lam_event_lock);
|
||||
ompi_mutex_lock(&ompi_event_lock);
|
||||
} else {
|
||||
res = select(sop->event_fds + 1, sop->event_readset,
|
||||
sop->event_writeset, NULL, tv);
|
||||
}
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
if (lam_evsignal_recalc(&sop->evsigmask) == -1)
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
if (ompi_evsignal_recalc(&sop->evsigmask) == -1)
|
||||
return (-1);
|
||||
#endif
|
||||
|
||||
@ -193,30 +193,30 @@ select_dispatch(void *arg, struct timeval *tv)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
lam_evsignal_process();
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
ompi_evsignal_process();
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
else if (lam_evsignal_caught)
|
||||
lam_evsignal_process();
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
else if (ompi_evsignal_caught)
|
||||
ompi_evsignal_process();
|
||||
#endif
|
||||
maxfd = 0;
|
||||
for (ev = TAILQ_FIRST(&lam_eventqueue); ev != NULL; ev = next) {
|
||||
for (ev = TAILQ_FIRST(&ompi_eventqueue); ev != NULL; ev = next) {
|
||||
next = TAILQ_NEXT(ev, ev_next);
|
||||
|
||||
res = 0;
|
||||
if (FD_ISSET(ev->ev_fd, sop->event_readset))
|
||||
res |= LAM_EV_READ;
|
||||
res |= OMPI_EV_READ;
|
||||
if (FD_ISSET(ev->ev_fd, sop->event_writeset))
|
||||
res |= LAM_EV_WRITE;
|
||||
res |= OMPI_EV_WRITE;
|
||||
res &= ev->ev_events;
|
||||
|
||||
if (res) {
|
||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
||||
lam_event_del_i(ev);
|
||||
lam_event_active_i(ev, res, 1);
|
||||
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||
ompi_event_del_i(ev);
|
||||
ompi_event_active_i(ev, res, 1);
|
||||
}
|
||||
if (ev->ev_fd > maxfd)
|
||||
maxfd = ev->ev_fd;
|
||||
@ -228,13 +228,13 @@ select_dispatch(void *arg, struct timeval *tv)
|
||||
}
|
||||
|
||||
static int
|
||||
select_add(void *arg, struct lam_event *ev)
|
||||
select_add(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
struct selectop *sop = arg;
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
||||
return (lam_evsignal_add(&sop->evsigmask, ev));
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||
return (ompi_evsignal_add(&sop->evsigmask, ev));
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -252,15 +252,15 @@ select_add(void *arg, struct lam_event *ev)
|
||||
*/
|
||||
|
||||
static int
|
||||
select_del(void *arg, struct lam_event *ev)
|
||||
select_del(void *arg, struct ompi_event *ev)
|
||||
{
|
||||
struct selectop *sop = arg;
|
||||
|
||||
if (!(ev->ev_events & LAM_EV_SIGNAL))
|
||||
if (!(ev->ev_events & OMPI_EV_SIGNAL))
|
||||
return (0);
|
||||
|
||||
#if LAM_EVENT_USE_SIGNALS
|
||||
return (lam_evsignal_del(&sop->evsigmask, ev));
|
||||
#if OMPI_EVENT_USE_SIGNALS
|
||||
return (ompi_evsignal_del(&sop->evsigmask, ev));
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
|
@ -26,7 +26,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 "lam_config.h"
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
@ -53,28 +53,28 @@
|
||||
#include "event.h"
|
||||
#include "evsignal.h"
|
||||
|
||||
extern struct lam_event_list lam_signalqueue;
|
||||
extern struct ompi_event_list ompi_signalqueue;
|
||||
|
||||
static short lam_evsigcaught[NSIG];
|
||||
static int lam_needrecalc;
|
||||
volatile sig_atomic_t lam_evsignal_caught = 0;
|
||||
static short ompi_evsigcaught[NSIG];
|
||||
static int ompi_needrecalc;
|
||||
volatile sig_atomic_t ompi_evsignal_caught = 0;
|
||||
|
||||
void lam_evsignal_handler(int sig);
|
||||
void ompi_evsignal_handler(int sig);
|
||||
|
||||
void
|
||||
lam_evsignal_init(sigset_t *evsigmask)
|
||||
ompi_evsignal_init(sigset_t *evsigmask)
|
||||
{
|
||||
sigemptyset(evsigmask);
|
||||
}
|
||||
|
||||
int
|
||||
lam_evsignal_add(sigset_t *evsigmask, struct lam_event *ev)
|
||||
ompi_evsignal_add(sigset_t *evsigmask, struct ompi_event *ev)
|
||||
{
|
||||
int evsignal;
|
||||
|
||||
if (ev->ev_events & (LAM_EV_READ|LAM_EV_WRITE))
|
||||
errx(1, "%s: LAM_EV_SIGNAL incompatible use", __func__);
|
||||
evsignal = LAM_EVENT_SIGNAL(ev);
|
||||
if (ev->ev_events & (OMPI_EV_READ|OMPI_EV_WRITE))
|
||||
errx(1, "%s: OMPI_EV_SIGNAL incompatible use", __func__);
|
||||
evsignal = OMPI_EVENT_SIGNAL(ev);
|
||||
sigaddset(evsigmask, evsignal);
|
||||
|
||||
return (0);
|
||||
@ -85,54 +85,54 @@ lam_evsignal_add(sigset_t *evsigmask, struct lam_event *ev)
|
||||
*/
|
||||
|
||||
int
|
||||
lam_evsignal_del(sigset_t *evsigmask, struct lam_event *ev)
|
||||
ompi_evsignal_del(sigset_t *evsigmask, struct ompi_event *ev)
|
||||
{
|
||||
int evsignal;
|
||||
|
||||
evsignal = LAM_EVENT_SIGNAL(ev);
|
||||
evsignal = OMPI_EVENT_SIGNAL(ev);
|
||||
sigdelset(evsigmask, evsignal);
|
||||
lam_needrecalc = 1;
|
||||
ompi_needrecalc = 1;
|
||||
|
||||
return (sigaction(LAM_EVENT_SIGNAL(ev),(struct sigaction *)SIG_DFL, NULL));
|
||||
return (sigaction(OMPI_EVENT_SIGNAL(ev),(struct sigaction *)SIG_DFL, NULL));
|
||||
}
|
||||
|
||||
void
|
||||
lam_evsignal_handler(int sig)
|
||||
ompi_evsignal_handler(int sig)
|
||||
{
|
||||
lam_evsigcaught[sig]++;
|
||||
lam_evsignal_caught = 1;
|
||||
ompi_evsigcaught[sig]++;
|
||||
ompi_evsignal_caught = 1;
|
||||
}
|
||||
|
||||
int
|
||||
lam_evsignal_recalc(sigset_t *evsigmask)
|
||||
ompi_evsignal_recalc(sigset_t *evsigmask)
|
||||
{
|
||||
struct sigaction sa;
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
|
||||
if (TAILQ_FIRST(&lam_signalqueue) == NULL && !lam_needrecalc)
|
||||
if (TAILQ_FIRST(&ompi_signalqueue) == NULL && !ompi_needrecalc)
|
||||
return (0);
|
||||
lam_needrecalc = 0;
|
||||
ompi_needrecalc = 0;
|
||||
|
||||
if (sigprocmask(SIG_BLOCK, evsigmask, NULL) == -1)
|
||||
return (-1);
|
||||
|
||||
/* Reinstall our signal handler. */
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = lam_evsignal_handler;
|
||||
sa.sa_handler = ompi_evsignal_handler;
|
||||
sa.sa_mask = *evsigmask;
|
||||
sa.sa_flags |= SA_RESTART;
|
||||
|
||||
TAILQ_FOREACH(ev, &lam_signalqueue, ev_signal_next) {
|
||||
if (sigaction(LAM_EVENT_SIGNAL(ev), &sa, NULL) == -1)
|
||||
TAILQ_FOREACH(ev, &ompi_signalqueue, ev_signal_next) {
|
||||
if (sigaction(OMPI_EVENT_SIGNAL(ev), &sa, NULL) == -1)
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
lam_evsignal_deliver(sigset_t *evsigmask)
|
||||
ompi_evsignal_deliver(sigset_t *evsigmask)
|
||||
{
|
||||
if (TAILQ_FIRST(&lam_signalqueue) == NULL)
|
||||
if (TAILQ_FIRST(&ompi_signalqueue) == NULL)
|
||||
return (0);
|
||||
|
||||
return (sigprocmask(SIG_UNBLOCK, evsigmask, NULL));
|
||||
@ -140,21 +140,21 @@ lam_evsignal_deliver(sigset_t *evsigmask)
|
||||
}
|
||||
|
||||
void
|
||||
lam_evsignal_process(void)
|
||||
ompi_evsignal_process(void)
|
||||
{
|
||||
struct lam_event *ev;
|
||||
struct ompi_event *ev;
|
||||
short ncalls;
|
||||
|
||||
TAILQ_FOREACH(ev, &lam_signalqueue, ev_signal_next) {
|
||||
ncalls = lam_evsigcaught[LAM_EVENT_SIGNAL(ev)];
|
||||
TAILQ_FOREACH(ev, &ompi_signalqueue, ev_signal_next) {
|
||||
ncalls = ompi_evsigcaught[OMPI_EVENT_SIGNAL(ev)];
|
||||
if (ncalls) {
|
||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
||||
lam_event_del_i(ev);
|
||||
lam_event_active_i(ev, LAM_EV_SIGNAL, ncalls);
|
||||
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||
ompi_event_del_i(ev);
|
||||
ompi_event_active_i(ev, OMPI_EV_SIGNAL, ncalls);
|
||||
}
|
||||
}
|
||||
|
||||
memset(lam_evsigcaught, 0, sizeof(lam_evsigcaught));
|
||||
lam_evsignal_caught = 0;
|
||||
memset(ompi_evsigcaught, 0, sizeof(ompi_evsigcaught));
|
||||
ompi_evsignal_caught = 0;
|
||||
}
|
||||
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче
Block a user