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
|
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||||
# by quotes) that should identify the project.
|
# 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.
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||||
# This could be handy for archiving the generated documentation or
|
# 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
|
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
||||||
# certain files from those directories.
|
# 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
|
# The EXAMPLE_PATH tag can be used to specify one or more files or
|
||||||
# directories that contain example code fragments that are included (see
|
# directories that contain example code fragments that are included (see
|
||||||
|
14
HACKING
14
HACKING
@ -1,7 +1,7 @@
|
|||||||
Overview
|
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
|
source code form, most likely through a developer's tree (i.e., a CVS
|
||||||
checkout).
|
checkout).
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ checkout).
|
|||||||
Use of GNU Autoconf, Automake, and Libtool
|
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
|
use fairly recent versions of the GNU tools Autoconf, Automake, and
|
||||||
Libtool. As of this writing, you need at least Autoconf v2.58,
|
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
|
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
|
Autoconf and Automake build and install very quickly; Libtool will
|
||||||
take a minute or two.
|
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
|
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
|
Running autogen.sh typically takes several minutes. It's not very
|
||||||
exciting to watch. :-)
|
exciting to watch. :-)
|
||||||
@ -89,14 +89,14 @@ following advice:
|
|||||||
5a. You generally need to run autogen.sh whenever the file
|
5a. You generally need to run autogen.sh whenever the file
|
||||||
"configure.ac" changes, or any files in the config/ directory
|
"configure.ac" changes, or any files in the config/ directory
|
||||||
change (the config/ directory is where a lot of "include" files
|
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
|
5b. You do *NOT* need to re-run autogen.sh if you modify a
|
||||||
Makefile.am.
|
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
|
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
|
sources, you will come to understand the when you only need to
|
||||||
re-generate the top-level configure script, and when you need
|
re-generate the top-level configure script, and when you need
|
||||||
to re-generate *all* configure scripts (it's complicated -- not
|
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)
|
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_ompi_cofs_job_handle pcm-cofs-job-handle
|
||||||
setenv MCA_common_lam_cofs_comm_dir "/tmp/COFS"
|
setenv MCA_common_ompi_cofs_comm_dir "/tmp/COFS"
|
||||||
setenv MCA_OOB_BASE_VPID 0
|
setenv MCA_OOB_BASE_VPID 0
|
||||||
setenv MCA_REGISTRY_BASE_VPID 0
|
setenv MCA_REGISTRY_BASE_VPID 0
|
||||||
|
|
||||||
|
|
||||||
Then if you need to run say N nodes you need to set
|
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
|
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
|
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)
|
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_alignment.m4)
|
||||||
sinclude(config/f77_get_sizeof.m4)
|
sinclude(config/f77_get_sizeof.m4)
|
||||||
|
|
||||||
sinclude(config/lam_case_sensitive_fs_setup.m4)
|
sinclude(config/ompi_case_sensitive_fs_setup.m4)
|
||||||
sinclude(config/lam_check_optflags.m4)
|
sinclude(config/ompi_check_optflags.m4)
|
||||||
sinclude(config/lam_config_subdir.m4)
|
sinclude(config/ompi_config_subdir.m4)
|
||||||
sinclude(config/lam_config_subdir_args.m4)
|
sinclude(config/ompi_config_subdir_args.m4)
|
||||||
sinclude(config/lam_configure_options.m4)
|
sinclude(config/ompi_configure_options.m4)
|
||||||
sinclude(config/lam_functions.m4)
|
sinclude(config/ompi_functions.m4)
|
||||||
sinclude(config/lam_get_version.m4)
|
sinclude(config/ompi_get_version.m4)
|
||||||
sinclude(config/lam_get_libtool_linker_flags.m4)
|
sinclude(config/ompi_get_libtool_linker_flags.m4)
|
||||||
sinclude(config/lam_mca.m4)
|
sinclude(config/ompi_mca.m4)
|
||||||
sinclude(config/lam_setup_cc.m4)
|
sinclude(config/ompi_setup_cc.m4)
|
||||||
sinclude(config/lam_setup_cxx.m4)
|
sinclude(config/ompi_setup_cxx.m4)
|
||||||
sinclude(config/lam_setup_f77.m4)
|
sinclude(config/ompi_setup_f77.m4)
|
||||||
sinclude(config/lam_setup_f90.m4)
|
sinclude(config/ompi_setup_f90.m4)
|
||||||
sinclude(config/lam_setup_libevent.m4)
|
sinclude(config/ompi_setup_libevent.m4)
|
||||||
|
|
||||||
sinclude(config/lam_check_pthread_pids.m4)
|
sinclude(config/ompi_check_pthread_pids.m4)
|
||||||
sinclude(config/lam_config_pthreads.m4)
|
sinclude(config/ompi_config_pthreads.m4)
|
||||||
sinclude(config/lam_config_solaris_threads.m4)
|
sinclude(config/ompi_config_solaris_threads.m4)
|
||||||
sinclude(config/lam_config_threads.m4)
|
sinclude(config/ompi_config_threads.m4)
|
||||||
|
|
||||||
#
|
#
|
||||||
# The config/mca_no_configure_modules.m4 file is generated by autogen.sh
|
# The config/mca_no_configure_modules.m4 file is generated by autogen.sh
|
||||||
|
142
autogen.sh
142
autogen.sh
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# $HEADER$
|
# $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.
|
# distribution tarballs.
|
||||||
|
|
||||||
|
|
||||||
@ -12,15 +12,15 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
lam_aclocal_search="aclocal"
|
ompi_aclocal_search="aclocal"
|
||||||
lam_autoheader_search="autoheader"
|
ompi_autoheader_search="autoheader"
|
||||||
lam_autoconf_search="autoconf"
|
ompi_autoconf_search="autoconf"
|
||||||
lam_libtoolize_search="libtoolize glibtoolize"
|
ompi_libtoolize_search="libtoolize glibtoolize"
|
||||||
lam_automake_search="automake"
|
ompi_automake_search="automake"
|
||||||
|
|
||||||
lam_automake_version="1.7"
|
ompi_automake_version="1.7"
|
||||||
lam_autoconf_version="2.58"
|
ompi_autoconf_version="2.58"
|
||||||
lam_libtool_version="1.5"
|
ompi_libtool_version="1.5"
|
||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -29,16 +29,16 @@ lam_libtool_version="1.5"
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
lam_aclocal_version="$lam_automake_version"
|
ompi_aclocal_version="$ompi_automake_version"
|
||||||
lam_autoheader_version="$lam_autoconf_version"
|
ompi_autoheader_version="$ompi_autoconf_version"
|
||||||
lam_libtoolize_version="$lam_libtool_version"
|
ompi_libtoolize_version="$ompi_libtool_version"
|
||||||
|
|
||||||
# program names to execute
|
# program names to execute
|
||||||
lam_aclocal=""
|
ompi_aclocal=""
|
||||||
lam_autoheader=""
|
ompi_autoheader=""
|
||||||
lam_autoconf=""
|
ompi_autoconf=""
|
||||||
lam_libtoolize=""
|
ompi_libtoolize=""
|
||||||
lam_automake=""
|
ompi_automake=""
|
||||||
|
|
||||||
mca_no_configure_modules_file="config/mca_no_configure_modules.m4"
|
mca_no_configure_modules_file="config/mca_no_configure_modules.m4"
|
||||||
mca_no_config_list_file="mca_no_config_list"
|
mca_no_config_list_file="mca_no_config_list"
|
||||||
@ -123,9 +123,9 @@ find_app() {
|
|||||||
local min_version="99.99.99"
|
local min_version="99.99.99"
|
||||||
local found=0
|
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
|
for i in $search_path ; do
|
||||||
version="`${i} --version 2>&1`"
|
version="`${i} --version 2>&1`"
|
||||||
if test "$?" != 0 ; then
|
if test "$?" != 0 ; then
|
||||||
@ -136,7 +136,7 @@ find_app() {
|
|||||||
version="`echo $version | cut -f1 -d' '`"
|
version="`echo $version | cut -f1 -d' '`"
|
||||||
|
|
||||||
if check_version $min_version $version ; then
|
if check_version $min_version $version ; then
|
||||||
eval "lam_${app_name}=\"${i}\""
|
eval "ompi_${app_name}=\"${i}\""
|
||||||
found=1
|
found=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -150,9 +150,9 @@ I am gonna abort. :-(
|
|||||||
Please make sure you are using at least the following versions of the
|
Please make sure you are using at least the following versions of the
|
||||||
GNU tools:
|
GNU tools:
|
||||||
|
|
||||||
GNU Autoconf $lam_autoconf_version
|
GNU Autoconf $ompi_autoconf_version
|
||||||
GNU Automake $lam_automake_version
|
GNU Automake $ompi_automake_version
|
||||||
GNU Libtool $lam_libtool_version
|
GNU Libtool $ompi_libtool_version
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
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
|
packages. Please make sure you are using at least the following
|
||||||
versions:
|
versions:
|
||||||
|
|
||||||
GNU Autoconf $lam_autoconf_version
|
GNU Autoconf $ompi_autoconf_version
|
||||||
GNU Automake $lam_automake_version
|
GNU Automake $ompi_automake_version
|
||||||
GNU Libtool $lam_libtool_version
|
GNU Libtool $ompi_libtool_version
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -259,7 +259,7 @@ find_and_delete() {
|
|||||||
#
|
#
|
||||||
# INPUT:
|
# INPUT:
|
||||||
# - directory to run in
|
# - directory to run in
|
||||||
# - LAM top directory
|
# - OMPI top directory
|
||||||
#
|
#
|
||||||
# OUTPUT:
|
# OUTPUT:
|
||||||
# none
|
# none
|
||||||
@ -273,20 +273,20 @@ find_and_delete() {
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
run_gnu_tools() {
|
run_gnu_tools() {
|
||||||
rgt_dir="$1"
|
rgt_dir="$1"
|
||||||
rgt_lam_topdir="$2"
|
rgt_ompi_topdir="$2"
|
||||||
|
|
||||||
# Sanity check to ensure that there's a configure.in or
|
# Sanity check to ensure that there's a configure.in or
|
||||||
# configure.ac file here, or if there's a configure.params
|
# configure.ac file here, or if there's a configure.params
|
||||||
# file and we need to run make_configure.pl.
|
# file and we need to run make_configure.pl.
|
||||||
|
|
||||||
if test -f configure.params -a -f configure.stub -a \
|
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
|
cat <<EOF
|
||||||
*** Found configure.stub
|
*** Found configure.stub
|
||||||
*** Running mca_make_configure.pl
|
*** Running mca_make_configure.pl
|
||||||
EOF
|
EOF
|
||||||
"$rgt_lam_topdir/config/mca_make_configure.pl" \
|
"$rgt_ompi_topdir/config/mca_make_configure.pl" \
|
||||||
--lamdir "$rgt_lam_topdir" \
|
--ompidir "$rgt_ompi_topdir" \
|
||||||
--moduledir "`pwd`"
|
--moduledir "`pwd`"
|
||||||
if test "$?" != "0"; then
|
if test "$?" != "0"; then
|
||||||
echo "*** autogen.sh failed to complete!"
|
echo "*** autogen.sh failed to complete!"
|
||||||
@ -325,22 +325,22 @@ EOF
|
|||||||
|
|
||||||
echo "*** Running GNU tools"
|
echo "*** Running GNU tools"
|
||||||
|
|
||||||
run_and_check $lam_aclocal
|
run_and_check $ompi_aclocal
|
||||||
if test "`grep AC_CONFIG_HEADER $file`" != "" -o \
|
if test "`grep AC_CONFIG_HEADER $file`" != "" -o \
|
||||||
"`grep AM_CONFIG_HEADER $file`" != ""; then
|
"`grep AM_CONFIG_HEADER $file`" != ""; then
|
||||||
run_and_check $lam_autoheader
|
run_and_check $ompi_autoheader
|
||||||
fi
|
fi
|
||||||
run_and_check $lam_autoconf
|
run_and_check $ompi_autoconf
|
||||||
|
|
||||||
# We only need the libltdl stuff for the top-level
|
# We only need the libltdl stuff for the top-level
|
||||||
# configure, not any of the MCA modules.
|
# configure, not any of the MCA modules.
|
||||||
|
|
||||||
if test -f include/mpi.h; then
|
if test -f include/mpi.h; then
|
||||||
rm -rf libltdl src/libltdl src/ltdl.h
|
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
|
mv libltdl src
|
||||||
|
|
||||||
echo "Adjusting libltdl for LAM :-("
|
echo "Adjusting libltdl for OMPI :-("
|
||||||
|
|
||||||
echo " -- patching for argz bugfix in libtool 1.5"
|
echo " -- patching for argz bugfix in libtool 1.5"
|
||||||
cd src/libltdl
|
cd src/libltdl
|
||||||
@ -363,14 +363,14 @@ EOF
|
|||||||
fi
|
fi
|
||||||
cd ../..
|
cd ../..
|
||||||
echo " -- patching configure for broken -c/-o compiler test"
|
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
|
configure > configure.new
|
||||||
mv configure.new configure
|
mv configure.new configure
|
||||||
chmod a+x configure
|
chmod a+x configure
|
||||||
else
|
else
|
||||||
run_and_check $lam_libtoolize --automake --copy
|
run_and_check $ompi_libtoolize --automake --copy
|
||||||
fi
|
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:
|
# INPUT:
|
||||||
# - directory to run in
|
# - directory to run in
|
||||||
# - LAM top directory
|
# - OMPI top directory
|
||||||
#
|
#
|
||||||
# OUTPUT:
|
# OUTPUT:
|
||||||
# none
|
# none
|
||||||
#
|
#
|
||||||
# SIDE EFFECTS:
|
# SIDE EFFECTS:
|
||||||
# - skips directories with .lam_no_gnu .lam_ignore
|
# - skips directories with .ompi_no_gnu .ompi_ignore
|
||||||
# - uses provided autogen.sh if available
|
# - uses provided autogen.sh if available
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
process_dir() {
|
process_dir() {
|
||||||
pd_dir="$1"
|
pd_dir="$1"
|
||||||
pd_lam_topdir="$2"
|
pd_ompi_topdir="$2"
|
||||||
pd_cur_dir="`pwd`"
|
pd_cur_dir="`pwd`"
|
||||||
|
|
||||||
if test -d "$pd_dir"; then
|
if test -d "$pd_dir"; then
|
||||||
@ -405,17 +405,17 @@ process_dir() {
|
|||||||
|
|
||||||
# See if the package doesn't want us to set it up
|
# 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
|
cat <<EOF
|
||||||
|
|
||||||
*** Found .lam_no_gnu file -- skipping GNU setup in:
|
*** Found .ompi_no_gnu file -- skipping GNU setup in:
|
||||||
*** `pwd`
|
*** `pwd`
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
elif test -f .lam_ignore; then
|
elif test -f .ompi_ignore; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
*** Found .lam_ignore file -- skipping entire tree:
|
*** Found .ompi_ignore file -- skipping entire tree:
|
||||||
*** `pwd`
|
*** `pwd`
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -437,7 +437,7 @@ EOF
|
|||||||
*** `pwd`
|
*** `pwd`
|
||||||
|
|
||||||
EOF
|
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
|
elif test -f configure.params -a -f configure.stub; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@ -446,7 +446,7 @@ EOF
|
|||||||
*** `pwd`
|
*** `pwd`
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
run_gnu_tools "$pd_dir" "$pd_lam_topdir"
|
run_gnu_tools "$pd_dir" "$pd_ompi_topdir"
|
||||||
|
|
||||||
elif test -f configure.params; then
|
elif test -f configure.params; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@ -465,7 +465,7 @@ EOF
|
|||||||
pd_module_name="`basename $pd_dir`"
|
pd_module_name="`basename $pd_dir`"
|
||||||
pd_module_type="`dirname $pd_dir`"
|
pd_module_type="`dirname $pd_dir`"
|
||||||
pd_module_type="`basename $pd_module_type`"
|
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`"
|
pd_ver_file="`grep PARAM_VERSION_FILE configure.params`"
|
||||||
if test -z "$pd_ver_file"; then
|
if test -z "$pd_ver_file"; then
|
||||||
pd_ver_file="VERSION"
|
pd_ver_file="VERSION"
|
||||||
@ -475,8 +475,8 @@ EOF
|
|||||||
|
|
||||||
# Write out to two files (they're merged at the end)
|
# Write out to two files (they're merged at the end)
|
||||||
|
|
||||||
pd_list_file="$pd_lam_topdir/$mca_no_config_list_file"
|
pd_list_file="$pd_ompi_topdir/$mca_no_config_list_file"
|
||||||
pd_amc_file="$pd_lam_topdir/$mca_no_config_amc_file"
|
pd_amc_file="$pd_ompi_topdir/$mca_no_config_amc_file"
|
||||||
|
|
||||||
cat >> $pd_list_file <<EOF
|
cat >> $pd_list_file <<EOF
|
||||||
dnl ----------------------------------------------------------------
|
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,
|
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_MAJOR_VERSION,
|
||||||
$pd_ver_major,
|
$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,
|
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_MINOR_VERSION,
|
||||||
$pd_ver_minor,
|
$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,
|
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_RELEASE_VERSION,
|
||||||
$pd_ver_release,
|
$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,
|
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_ALPHA_VERSION,
|
||||||
$pd_ver_alpha,
|
$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,
|
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_BETA_VERSION,
|
||||||
$pd_ver_beta,
|
$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,
|
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_SVN_VERSION,
|
||||||
$pd_ver_svn,
|
$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,
|
AC_DEFINE_UNQUOTED(MCA_${pd_module_type}_${pd_module_name}_FULL_VERSION,
|
||||||
"$pd_ver_full",
|
"$pd_ver_full",
|
||||||
[Full LAM MCA $pd_module_type $pd_module_name version])
|
[Full OMPI MCA $pd_module_type $pd_module_name version])
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
cat >> $pd_amc_file <<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")
|
test "\$BUILD_${pd_module_type}_${pd_module_name}_LOADABLE_MODULE" = "1")
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -566,13 +566,13 @@ EOF
|
|||||||
|
|
||||||
cd "$pd_cur_dir"
|
cd "$pd_cur_dir"
|
||||||
fi
|
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:
|
# INPUT:
|
||||||
# none
|
# none
|
||||||
@ -673,11 +673,11 @@ echo "[Checking] command line parameters"
|
|||||||
# just in this current directory.
|
# just in this current directory.
|
||||||
|
|
||||||
want_local=no
|
want_local=no
|
||||||
lamdir=
|
ompidir=
|
||||||
for arg in $*; do
|
for arg in $*; do
|
||||||
case $arg in
|
case $arg in
|
||||||
-l) want_local=yes ;;
|
-l) want_local=yes ;;
|
||||||
-lamdir|--lamdir|-lam|--lam) lamdir="$1" ;;
|
-ompidir|--ompidir|-ompi|--ompi) ompidir="$1" ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -689,7 +689,7 @@ echo "[Checking] prerequisites"
|
|||||||
if test ! -d .svn ; then
|
if test ! -d .svn ; then
|
||||||
cat <<EOF
|
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
|
want to run autogen.sh - it is normally not needed for a release source
|
||||||
tree. Giving you 5 seconds to reconsider and kill me.
|
tree. Giving you 5 seconds to reconsider and kill me.
|
||||||
|
|
||||||
@ -697,21 +697,21 @@ EOF
|
|||||||
sleep 5
|
sleep 5
|
||||||
fi
|
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.
|
# top-level directory, or somewhere else.
|
||||||
if test -f VERSION -a -f configure.ac -a -f include/mpi.h ; then
|
if test -f VERSION -a -f configure.ac -a -f include/mpi.h ; then
|
||||||
# Top level of LAM tree
|
# Top level of OMPI tree
|
||||||
lamdir="`pwd`"
|
ompidir="`pwd`"
|
||||||
elif test -f configure.in -o -f configure.ac -o -f configure.params ; then
|
elif test -f configure.in -o -f configure.ac -o -f configure.params ; then
|
||||||
# Top level of a module directory
|
# Top level of a module directory
|
||||||
want_local=yes
|
want_local=yes
|
||||||
if test -z "$lamdir"; then
|
if test -z "$ompidir"; then
|
||||||
lamdir="../../../.."
|
ompidir="../../../.."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cat <<EOF
|
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.
|
directory tree or the top-level of an MCA module directory tree.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -727,7 +727,7 @@ find_app "automake"
|
|||||||
|
|
||||||
# do the work
|
# do the work
|
||||||
if test "$want_local" = "yes"; then
|
if test "$want_local" = "yes"; then
|
||||||
process_dir . $lamdir
|
process_dir . $ompidir
|
||||||
else
|
else
|
||||||
run_global
|
run_global
|
||||||
fi
|
fi
|
||||||
|
@ -15,21 +15,21 @@ EXTRA_DIST = \
|
|||||||
f77_find_ext_symbol_convention.m4 \
|
f77_find_ext_symbol_convention.m4 \
|
||||||
f77_get_alignment.m4 \
|
f77_get_alignment.m4 \
|
||||||
f77_get_sizeof.m4 \
|
f77_get_sizeof.m4 \
|
||||||
lam_case_sensitive_fs_setup.m4 \
|
ompi_case_sensitive_fs_setup.m4 \
|
||||||
lam_check_optflags.m4 \
|
ompi_check_optflags.m4 \
|
||||||
lam_check_pthread_pids.m4 \
|
ompi_check_pthread_pids.m4 \
|
||||||
lam_config_subdir.m4 \
|
ompi_config_subdir.m4 \
|
||||||
lam_config_subdir_args.m4 \
|
ompi_config_subdir_args.m4 \
|
||||||
lam_config_pthreads.m4 \
|
ompi_config_pthreads.m4 \
|
||||||
lam_config_solaris_threads.m4 \
|
ompi_config_solaris_threads.m4 \
|
||||||
lam_config_threads.m4 \
|
ompi_config_threads.m4 \
|
||||||
lam_configure_options.m4 \
|
ompi_configure_options.m4 \
|
||||||
lam_functions.m4 \
|
ompi_functions.m4 \
|
||||||
lam_get_version.m4 \
|
ompi_get_version.m4 \
|
||||||
lam_get_version.sh \
|
ompi_get_version.sh \
|
||||||
lam_mca.m4 \
|
ompi_mca.m4 \
|
||||||
lam_setup_cc.m4 \
|
ompi_setup_cc.m4 \
|
||||||
lam_setup_cxx.m4 \
|
ompi_setup_cxx.m4 \
|
||||||
lam_setup_f77.m4 \
|
ompi_setup_f77.m4 \
|
||||||
lam_setup_f90.m4 \
|
ompi_setup_f90.m4 \
|
||||||
mca_no_configure_modules.m4
|
mca_no_configure_modules.m4
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_C_GET_ALIGNMENT],[
|
AC_DEFUN([OMPI_C_GET_ALIGNMENT],[
|
||||||
# Determine datatype alignment.
|
# Determine datatype alignment.
|
||||||
# First arg is type, 2nd arg is config var to define.
|
# First arg is type, 2nd arg is config var to define.
|
||||||
AC_MSG_CHECKING([alignment of $1])
|
AC_MSG_CHECKING([alignment of $1])
|
||||||
@ -22,17 +22,17 @@ int main(int argc, char* argv[])
|
|||||||
diff = ((char *)&p->x) - ((char *)&p->c);
|
diff = ((char *)&p->x) - ((char *)&p->c);
|
||||||
fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
|
fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
|
||||||
return 0;
|
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([*** Problem running configure test!])
|
||||||
AC_MSG_WARN([*** See config.log for details.])
|
AC_MSG_WARN([*** See config.log for details.])
|
||||||
AC_MSG_ERROR([*** Cannot continue.])
|
AC_MSG_ERROR([*** Cannot continue.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_RESULT([$lam_ac_align])
|
AC_MSG_RESULT([$ompi_ac_align])
|
||||||
AC_DEFINE_UNQUOTED($2, $lam_ac_align, [Alignment of type $1])
|
AC_DEFINE_UNQUOTED($2, $ompi_ac_align, [Alignment of type $1])
|
||||||
eval "$2=$lam_ac_align"
|
eval "$2=$ompi_ac_align"
|
||||||
unset lam_ac_align
|
unset ompi_ac_align
|
||||||
|
|
||||||
/bin/rm -f conftest*])dnl
|
/bin/rm -f conftest*])dnl
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
define([LAM_C_WEAK_SYMBOLS],[
|
define([OMPI_C_WEAK_SYMBOLS],[
|
||||||
#
|
#
|
||||||
# Arguments: None
|
# Arguments: None
|
||||||
#
|
#
|
||||||
@ -11,7 +11,7 @@ define([LAM_C_WEAK_SYMBOLS],[
|
|||||||
#
|
#
|
||||||
# Check to see if the C compiler can handle 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.
|
# symbols.
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -22,13 +22,13 @@ int real(int i);
|
|||||||
int real(int i) { return i; }
|
int real(int i) { return i; }
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
return fake(3);
|
return fake(3);
|
||||||
}]]), lam_happy=1, lam_happy=0)
|
}]]), ompi_happy=1, ompi_happy=0)
|
||||||
if test "$lam_happy" = "1"; then
|
if test "$ompi_happy" = "1"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
LAM_C_HAVE_WEAK_SYMBOLS=1
|
OMPI_C_HAVE_WEAK_SYMBOLS=1
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
LAM_C_HAVE_WEAK_SYMBOLS=0
|
OMPI_C_HAVE_WEAK_SYMBOLS=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset lam_happy])dnl
|
unset ompi_happy])dnl
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
define([LAM_CXX_FIND_EXCEPTION_FLAGS],[
|
define([OMPI_CXX_FIND_EXCEPTION_FLAGS],[
|
||||||
#
|
#
|
||||||
# Arguments: none
|
# Arguments: none
|
||||||
#
|
#
|
||||||
@ -13,7 +13,7 @@ define([LAM_CXX_FIND_EXCEPTION_FLAGS],[
|
|||||||
# CXXFLAGS undisturbed.
|
# CXXFLAGS undisturbed.
|
||||||
# Provides --with-exflags command line argument for configure as well.
|
# 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.
|
# appropriate.
|
||||||
# Must call AC_SUBST manually
|
# Must call AC_SUBST manually
|
||||||
#
|
#
|
||||||
@ -23,18 +23,18 @@ define([LAM_CXX_FIND_EXCEPTION_FLAGS],[
|
|||||||
AC_ARG_WITH(exflags,
|
AC_ARG_WITH(exflags,
|
||||||
AC_HELP_STRING([--with-exflags],
|
AC_HELP_STRING([--with-exflags],
|
||||||
[Specify flags necessary to enable C++ exceptions]),
|
[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])
|
AC_MSG_CHECKING([for compiler exception flags])
|
||||||
|
|
||||||
# See which flags to use
|
# See which flags to use
|
||||||
|
|
||||||
if test "$lam_force_exflags" != ""; then
|
if test "$ompi_force_exflags" != ""; then
|
||||||
|
|
||||||
# If the user supplied flags, use those
|
# If the user supplied flags, use those
|
||||||
|
|
||||||
lam_exflags="$lam_force_exflags"
|
ompi_exflags="$ompi_force_exflags"
|
||||||
elif test "$GXX" = "yes"; then
|
elif test "$GXX" = "yes"; then
|
||||||
|
|
||||||
# g++ has changed their flags a few times. Sigh.
|
# g++ has changed their flags a few times. Sigh.
|
||||||
@ -43,15 +43,15 @@ elif test "$GXX" = "yes"; then
|
|||||||
|
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
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
|
if test "$ompi_happy" = "1"; then
|
||||||
lam_exflags="-fexceptions";
|
ompi_exflags="-fexceptions";
|
||||||
else
|
else
|
||||||
CXXFLAGS="$CXXFLAGS_SAVE -fhandle-exceptions"
|
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)
|
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
|
if test "$ompi_happy" = "1"; then
|
||||||
lam_exflags="-fhandle-exceptions";
|
ompi_exflags="-fhandle-exceptions";
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
@ -59,21 +59,21 @@ elif test "`basename $CXX`" = "KCC"; then
|
|||||||
|
|
||||||
# KCC flags
|
# KCC flags
|
||||||
|
|
||||||
lam_exflags="--exceptions"
|
ompi_exflags="--exceptions"
|
||||||
fi
|
fi
|
||||||
CXXFLAGS="$lam_CXXFLAGS_SAVE"
|
CXXFLAGS="$ompi_CXXFLAGS_SAVE"
|
||||||
|
|
||||||
# Save the result
|
# Save the result
|
||||||
|
|
||||||
LAM_CXX_EXCEPTIONS_CXXFLAGS="$lam_exflags"
|
OMPI_CXX_EXCEPTIONS_CXXFLAGS="$ompi_exflags"
|
||||||
LAM_CXX_EXCEPTIONS_LDFLAGS="$lam_exflags"
|
OMPI_CXX_EXCEPTIONS_LDFLAGS="$ompi_exflags"
|
||||||
if test "$lam_exflags" = ""; then
|
if test "$ompi_exflags" = ""; then
|
||||||
AC_MSG_RESULT([none necessary])
|
AC_MSG_RESULT([none necessary])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([$lam_exflags])
|
AC_MSG_RESULT([$ompi_exflags])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean up
|
# 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 $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
define(LAM_CXX_FIND_TEMPLATE_PARAMETERS,[
|
define(OMPI_CXX_FIND_TEMPLATE_PARAMETERS,[
|
||||||
#
|
#
|
||||||
# Arguments: none
|
# Arguments: none
|
||||||
#
|
#
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
define([LAM_CXX_FIND_TEMPLATE_REPOSITORY],[
|
define([OMPI_CXX_FIND_TEMPLATE_REPOSITORY],[
|
||||||
#
|
#
|
||||||
# Arguments: None
|
# Arguments: None
|
||||||
#
|
#
|
||||||
@ -12,7 +12,7 @@ define([LAM_CXX_FIND_TEMPLATE_REPOSITORY],[
|
|||||||
# See if the compiler makes template repository directories
|
# See if the compiler makes template repository directories
|
||||||
# Warning: this is a really screwy example! -JMS
|
# 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
|
# Must call AC_SUBST manually
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
lam_template_failed=
|
ompi_template_failed=
|
||||||
echo configure:__oline__: $CXX $CXXFLAGS -c conftest1.C >&5
|
echo configure:__oline__: $CXX $CXXFLAGS -c conftest1.C >&5
|
||||||
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
|
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
|
||||||
if test ! -f conftest1.o ; then
|
if test ! -f conftest1.o ; then
|
||||||
@ -83,7 +83,7 @@ if test ! -f conftest1.o ; then
|
|||||||
cat conftest1.C >&5
|
cat conftest1.C >&5
|
||||||
echo configure:__oline__: here is conftest.h: >&5
|
echo configure:__oline__: here is conftest.h: >&5
|
||||||
cat conftest.h >&5
|
cat conftest.h >&5
|
||||||
lam_template_failed=1
|
ompi_template_failed=1
|
||||||
else
|
else
|
||||||
echo configure:__oline__: $CXX $CXXFLAGS -c conftest2.C >&5
|
echo configure:__oline__: $CXX $CXXFLAGS -c conftest2.C >&5
|
||||||
$CXX $CXXFLAGS -c conftest2.C >&5 2>&5
|
$CXX $CXXFLAGS -c conftest2.C >&5 2>&5
|
||||||
@ -96,43 +96,43 @@ else
|
|||||||
else
|
else
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
|
|
||||||
for lam_file in `ls`
|
for ompi_file in `ls`
|
||||||
do
|
do
|
||||||
if test "$lam_file" != "." -a "$lam_file" != ".."; then
|
if test "$ompi_file" != "." -a "$ompi_file" != ".."; then
|
||||||
# Is it a directory?
|
# Is it a directory?
|
||||||
if test -d "$lam_file"; then
|
if test -d "$ompi_file"; then
|
||||||
lam_template_dir="$lam_file $lam_template_dir"
|
ompi_template_dir="$ompi_file $ompi_template_dir"
|
||||||
|
|
||||||
# Or is it a file?
|
# Or is it a file?
|
||||||
else
|
else
|
||||||
name="`echo $lam_file | cut -d. -f1`"
|
name="`echo $ompi_file | cut -d. -f1`"
|
||||||
|
|
||||||
temp_mask=
|
temp_mask=
|
||||||
if test "$name" = "main" -o "$name" = "other"; then
|
if test "$name" = "main" -o "$name" = "other"; then
|
||||||
temp_mask="`echo $lam_file | cut -d. -f2`"
|
temp_mask="`echo $ompi_file | cut -d. -f2`"
|
||||||
if test "$lam_template_filemask" = ""; then
|
if test "$ompi_template_filemask" = ""; then
|
||||||
lam_template_filemask="$temp_mask";
|
ompi_template_filemask="$temp_mask";
|
||||||
elif test "`echo $lam_template_filemask | grep $temp_mask`" = ""; then
|
elif test "`echo $ompi_template_filemask | grep $temp_mask`" = ""; then
|
||||||
lam_template_filemask="$lam_template_filemask $temp_mask"
|
ompi_template_filemask="$ompi_template_filemask $temp_mask"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if test "$lam_template_filemask" != ""; then
|
if test "$ompi_template_filemask" != ""; then
|
||||||
temp_mask=
|
temp_mask=
|
||||||
for mask in $lam_template_filemask
|
for mask in $ompi_template_filemask
|
||||||
do
|
do
|
||||||
temp_mask="*.$mask $temp_mask"
|
temp_mask="*.$mask $temp_mask"
|
||||||
done
|
done
|
||||||
lam_template_filemask=$temp_mask
|
ompi_template_filemask=$temp_mask
|
||||||
fi
|
fi
|
||||||
fi
|
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
|
if test "`echo $OMPI_CXX_TEMPLATE_REPOSITORY`" != ""; then
|
||||||
AC_MSG_RESULT([$LAM_CXX_TEMPLATE_REPOSITORY])
|
AC_MSG_RESULT([$OMPI_CXX_TEMPLATE_REPOSITORY])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([not used])
|
AC_MSG_RESULT([not used])
|
||||||
fi
|
fi
|
||||||
@ -140,4 +140,4 @@ cd ..
|
|||||||
rm -rf conf_tmp_$$
|
rm -rf conf_tmp_$$
|
||||||
|
|
||||||
# Clean up
|
# 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 $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
define([LAM_CXX_HAVE_EXCEPTIONS],[
|
define([OMPI_CXX_HAVE_EXCEPTIONS],[
|
||||||
#
|
#
|
||||||
# Arguments: None
|
# Arguments: None
|
||||||
#
|
#
|
||||||
@ -11,15 +11,15 @@ define([LAM_CXX_HAVE_EXCEPTIONS],[
|
|||||||
#
|
#
|
||||||
# Check to see if the C++ compiler can handle 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_MSG_CHECKING([for throw/catch])
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i=1; throw(i);]]),
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i=1; throw(i);]]),
|
||||||
LAM_CXX_EXCEPTIONS=1, LAM_CXX_EXCPTIONS=0)
|
OMPI_CXX_EXCEPTIONS=1, OMPI_CXX_EXCPTIONS=0)
|
||||||
if test "$LAM_CXX_EXCEPTIONS" = "1"; then
|
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
set srcdir="`pwd`"
|
set srcdir="`pwd`"
|
||||||
set distdir="$srcdir/$1"
|
set distdir="$srcdir/$1"
|
||||||
set verfile="$srcdir/VERSION"
|
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 OMPI_VERSION="`sh $verscript $verfile --full`"
|
||||||
set LAM_MAJOR_VERSION="`sh $verscript $verfile --major`"
|
set OMPI_MAJOR_VERSION="`sh $verscript $verfile --major`"
|
||||||
set LAM_MINOR_VERSION="`sh $verscript $verfile --minor`"
|
set OMPI_MINOR_VERSION="`sh $verscript $verfile --minor`"
|
||||||
set LAM_RELEASE_VERSION="`sh $verscript $verfile --release`"
|
set OMPI_RELEASE_VERSION="`sh $verscript $verfile --release`"
|
||||||
set LAM_ALPHA_VERSION="`sh $verscript $verfile --alpha`"
|
set OMPI_ALPHA_VERSION="`sh $verscript $verfile --alpha`"
|
||||||
set LAM_BETA_VERSION="`sh $verscript $verfile --beta`"
|
set OMPI_BETA_VERSION="`sh $verscript $verfile --beta`"
|
||||||
|
|
||||||
if ("$distdir" == "") then
|
if ("$distdir" == "") then
|
||||||
echo "Must supply relative distdir as argv[1] -- aborting"
|
echo "Must supply relative distdir as argv[1] -- aborting"
|
||||||
@ -23,7 +23,7 @@ endif
|
|||||||
set start=`date`
|
set start=`date`
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Creating LAM/MPI distribution
|
Creating OMPI/MPI distribution
|
||||||
In directory: `pwd`
|
In directory: `pwd`
|
||||||
Started: $start
|
Started: $start
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ end
|
|||||||
# JMS don't have man pages yet -- this is a straight copy from LAM7
|
# 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"
|
#echo "*** Updating version date/number in man pages"
|
||||||
#rm -f manfiles
|
#rm -f manfiles
|
||||||
#find man -type f | grep -v Makefile > manfiles
|
#find man -type f | grep -v Makefile > manfiles
|
||||||
@ -158,7 +158,7 @@ echo "*** Updating version number in $files..."
|
|||||||
foreach file ($files)
|
foreach file ($files)
|
||||||
echo " - Setting $file"
|
echo " - Setting $file"
|
||||||
if (-f $file) then
|
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
|
mv -f bar $file
|
||||||
endif
|
endif
|
||||||
end
|
end
|
||||||
@ -168,7 +168,7 @@ end
|
|||||||
#
|
#
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
*** LAM/MPI version $ver distribution created
|
*** OMPI/MPI version $ver distribution created
|
||||||
|
|
||||||
Started: $start
|
Started: $start
|
||||||
Ended: `date`
|
Ended: `date`
|
||||||
|
@ -3,13 +3,13 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
define(LAM_F77_FIND_EXT_SYMBOL_CONVENTION,[
|
define(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION,[
|
||||||
AC_MSG_CHECKING($1 external symbol convention)
|
AC_MSG_CHECKING($1 external symbol convention)
|
||||||
|
|
||||||
lam_fortran_double_underscore=0
|
ompi_fortran_double_underscore=0
|
||||||
lam_fortran_single_underscore=0
|
ompi_fortran_single_underscore=0
|
||||||
lam_fortran_caps=0
|
ompi_fortran_caps=0
|
||||||
lam_fortran_plain=0
|
ompi_fortran_plain=0
|
||||||
|
|
||||||
cat > conftestf.f <<EOF
|
cat > conftestf.f <<EOF
|
||||||
subroutine FOO_bar(a)
|
subroutine FOO_bar(a)
|
||||||
@ -25,14 +25,14 @@ else
|
|||||||
nm conftestf.o | grep foo_bar__ > /dev/null 2>&1
|
nm conftestf.o | grep foo_bar__ > /dev/null 2>&1
|
||||||
if test $? = "0"; then
|
if test $? = "0"; then
|
||||||
AC_MSG_RESULT([double underscore])
|
AC_MSG_RESULT([double underscore])
|
||||||
lam_fortran_double_underscore=1
|
ompi_fortran_double_underscore=1
|
||||||
lam_ac_doubleunder=y
|
ompi_ac_doubleunder=y
|
||||||
else
|
else
|
||||||
nm conftestf.o | grep foo_bar_ > /dev/null 2>&1
|
nm conftestf.o | grep foo_bar_ > /dev/null 2>&1
|
||||||
if test $? = "0"; then
|
if test $? = "0"; then
|
||||||
AC_MSG_RESULT([single underscore])
|
AC_MSG_RESULT([single underscore])
|
||||||
lam_fortran_single_underscore=1
|
ompi_fortran_single_underscore=1
|
||||||
lam_ac_singleunder=y
|
ompi_ac_singleunder=y
|
||||||
else
|
else
|
||||||
# We may get into trouble here if we start accepting mixed
|
# We may get into trouble here if we start accepting mixed
|
||||||
# case compilers -- we may need to have caps underscore,
|
# case compilers -- we may need to have caps underscore,
|
||||||
@ -41,20 +41,20 @@ else
|
|||||||
nm conftestf.o | grep FOO_bar > /dev/null 2>&1
|
nm conftestf.o | grep FOO_bar > /dev/null 2>&1
|
||||||
if test $? = "0"; then
|
if test $? = "0"; then
|
||||||
AC_MSG_RESULT([mixed case, so FORTRANCAPS])
|
AC_MSG_RESULT([mixed case, so FORTRANCAPS])
|
||||||
lam_fortran_caps=1
|
ompi_fortran_caps=1
|
||||||
lam_ac_caps=y
|
ompi_ac_caps=y
|
||||||
else
|
else
|
||||||
nm conftestf.o | grep foo_bar > /dev/null 2>&1
|
nm conftestf.o | grep foo_bar > /dev/null 2>&1
|
||||||
if test $? = "0"; then
|
if test $? = "0"; then
|
||||||
AC_MSG_RESULT([no underscore])
|
AC_MSG_RESULT([no underscore])
|
||||||
lam_fortran_plain=1
|
ompi_fortran_plain=1
|
||||||
lam_ac_nounder=y
|
ompi_ac_nounder=y
|
||||||
else
|
else
|
||||||
nm conftestf.o | grep FOO_BAR > /dev/null 2>&1
|
nm conftestf.o | grep FOO_BAR > /dev/null 2>&1
|
||||||
if test $? = "0"; then
|
if test $? = "0"; then
|
||||||
AC_MSG_RESULT([all upper case])
|
AC_MSG_RESULT([all upper case])
|
||||||
lam_fortran_caps=1
|
ompi_fortran_caps=1
|
||||||
lam_ac_caps=y
|
ompi_ac_caps=y
|
||||||
else
|
else
|
||||||
AC_MSG_WARN([*** Could not find name of subroutine foo_bar])
|
AC_MSG_WARN([*** Could not find name of subroutine foo_bar])
|
||||||
AC_MSG_ERROR([Cannot continue])
|
AC_MSG_ERROR([Cannot continue])
|
||||||
@ -65,14 +65,14 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED(LAM_F77_DOUBLE_UNDERSCORE,
|
AC_DEFINE_UNQUOTED(OMPI_F77_DOUBLE_UNDERSCORE,
|
||||||
$lam_fortran_double_underscore,
|
$ompi_fortran_double_underscore,
|
||||||
[Whether fortran symbols have a trailing double underscore or not])
|
[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])
|
[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])
|
[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])
|
[Whether fortran symbols have no trailing underscore or not])
|
||||||
|
|
||||||
/bin/rm -f conftestf.f conftestf.o])dnl
|
/bin/rm -f conftestf.f conftestf.o])dnl
|
||||||
|
@ -3,19 +3,19 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_F77_GET_ALIGNMENT],[
|
AC_DEFUN([OMPI_F77_GET_ALIGNMENT],[
|
||||||
# Determine FORTRAN datatype size.
|
# Determine FORTRAN datatype size.
|
||||||
# First arg is type, 2nd arg is config var to define.
|
# First arg is type, 2nd arg is config var to define.
|
||||||
AC_MSG_CHECKING(alignment of FORTRAN $1)
|
AC_MSG_CHECKING(alignment of FORTRAN $1)
|
||||||
lam_ac_align_fn=
|
ompi_ac_align_fn=
|
||||||
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
|
if test "x$ompi_ac_doubleunder" = xy || test "x$ompi_ac_singleunder" = xy; then
|
||||||
lam_ac_align_fn=align_
|
ompi_ac_align_fn=align_
|
||||||
else
|
else
|
||||||
if test "x$lam_ac_nounder" = xy; then
|
if test "x$ompi_ac_nounder" = xy; then
|
||||||
lam_ac_align_fn=align
|
ompi_ac_align_fn=align
|
||||||
else
|
else
|
||||||
if test "x$lam_ac_caps" = xy; then
|
if test "x$ompi_ac_caps" = xy; then
|
||||||
lam_ac_align_fn=ALIGN
|
ompi_ac_align_fn=ALIGN
|
||||||
else
|
else
|
||||||
AC_MSG_WARN([*** FORTRAN external naming convention undefined])
|
AC_MSG_WARN([*** FORTRAN external naming convention undefined])
|
||||||
AC_MSG_ERROR([*** Cannot continue.])
|
AC_MSG_ERROR([*** Cannot continue.])
|
||||||
@ -42,9 +42,9 @@ EOF
|
|||||||
#
|
#
|
||||||
|
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
lam_conftest_h="#include \"conftest.h\""
|
ompi_conftest_h="#include \"conftest.h\""
|
||||||
else
|
else
|
||||||
lam_conftest_h=""
|
ompi_conftest_h=""
|
||||||
fi
|
fi
|
||||||
cat > conftest.c <<EOF
|
cat > conftest.c <<EOF
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -54,7 +54,7 @@ $conftest
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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;
|
{ unsigned long aw, ax, ay, az;
|
||||||
FILE *f=fopen("conftestval", "w");
|
FILE *f=fopen("conftestval", "w");
|
||||||
if (!f) exit(1);
|
if (!f) exit(1);
|
||||||
@ -80,36 +80,36 @@ EOF
|
|||||||
# module files.
|
# module files.
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
||||||
LAM_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
OMPI_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
||||||
LAM_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
OMPI_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
||||||
[HAPPY=0]),
|
[HAPPY=0]),
|
||||||
[HAPPY=0])
|
[HAPPY=0])
|
||||||
|
|
||||||
if test "$HAPPY" = "1" -a -f conftestval; then
|
if test "$HAPPY" = "1" -a -f conftestval; then
|
||||||
lam_ac_align=`cat conftestval`
|
ompi_ac_align=`cat conftestval`
|
||||||
AC_MSG_RESULT([$lam_ac_align])
|
AC_MSG_RESULT([$ompi_ac_align])
|
||||||
if test -n "$2"; then
|
if test -n "$2"; then
|
||||||
eval "$2=$lam_ac_align"
|
eval "$2=$ompi_ac_align"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([unknown])
|
AC_MSG_RESULT([unknown])
|
||||||
|
|
||||||
LAM_LOG_MSG([here is the C program:], 1)
|
OMPI_LOG_MSG([here is the C program:], 1)
|
||||||
LAM_LOG_FILE([conftest.c])
|
OMPI_LOG_FILE([conftest.c])
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
LAM_LOG_MSG([here is contest.h:], 1)
|
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||||
LAM_LOG_FILE([conftest.h])
|
OMPI_LOG_FILE([conftest.h])
|
||||||
fi
|
fi
|
||||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||||
LAM_LOG_FILE([conftestf.f])
|
OMPI_LOG_FILE([conftestf.f])
|
||||||
|
|
||||||
AC_MSG_WARN([*** Problem running configure test!])
|
AC_MSG_WARN([*** Problem running configure test!])
|
||||||
AC_MSG_WARN([*** See config.log for details.])
|
AC_MSG_WARN([*** See config.log for details.])
|
||||||
AC_MSG_ERROR([*** Cannot continue.])
|
AC_MSG_ERROR([*** Cannot continue.])
|
||||||
fi
|
fi
|
||||||
str="$2=$lam_ac_align"
|
str="$2=$ompi_ac_align"
|
||||||
eval $str
|
eval $str
|
||||||
|
|
||||||
unset lam_ac_align HAPPY lam_conftest_h
|
unset ompi_ac_align HAPPY ompi_conftest_h
|
||||||
/bin/rm -f conftest*])dnl
|
/bin/rm -f conftest*])dnl
|
||||||
|
@ -3,19 +3,19 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_F77_GET_SIZEOF],[
|
AC_DEFUN([OMPI_F77_GET_SIZEOF],[
|
||||||
# Determine FORTRAN datatype size.
|
# Determine FORTRAN datatype size.
|
||||||
# First arg is type, 2nd arg is config var to define.
|
# First arg is type, 2nd arg is config var to define.
|
||||||
AC_MSG_CHECKING([size of FORTRAN $1])
|
AC_MSG_CHECKING([size of FORTRAN $1])
|
||||||
lam_ac_size_fn=
|
ompi_ac_size_fn=
|
||||||
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
|
if test "x$ompi_ac_doubleunder" = xy || test "x$ompi_ac_singleunder" = xy; then
|
||||||
lam_ac_size_fn=size_
|
ompi_ac_size_fn=size_
|
||||||
else
|
else
|
||||||
if test "x$lam_ac_nounder" = xy; then
|
if test "x$ompi_ac_nounder" = xy; then
|
||||||
lam_ac_size_fn=size
|
ompi_ac_size_fn=size
|
||||||
else
|
else
|
||||||
if test "x$lam_ac_caps" = xy; then
|
if test "x$ompi_ac_caps" = xy; then
|
||||||
lam_ac_size_fn=SIZE
|
ompi_ac_size_fn=SIZE
|
||||||
else
|
else
|
||||||
AC_MSG_WARN([*** FORTRAN external naming convention undefined])
|
AC_MSG_WARN([*** FORTRAN external naming convention undefined])
|
||||||
AC_MSG_ERROR([*** Cannot continue.])
|
AC_MSG_ERROR([*** Cannot continue.])
|
||||||
@ -45,19 +45,19 @@ EOF
|
|||||||
#
|
#
|
||||||
|
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
lam_conftest_h="#include \"conftest.h\""
|
ompi_conftest_h="#include \"conftest.h\""
|
||||||
else
|
else
|
||||||
lam_conftest_h=""
|
ompi_conftest_h=""
|
||||||
fi
|
fi
|
||||||
cat > conftest.c <<EOF
|
cat > conftest.c <<EOF
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
$lam_conftest_h
|
$ompi_conftest_h
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void $lam_ac_size_fn(char *a, char *b)
|
void $ompi_ac_size_fn(char *a, char *b)
|
||||||
{
|
{
|
||||||
int diff = (int) (b - a);
|
int diff = (int) (b - a);
|
||||||
FILE *f=fopen("conftestval", "w");
|
FILE *f=fopen("conftestval", "w");
|
||||||
@ -74,35 +74,35 @@ EOF
|
|||||||
# module files.
|
# module files.
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
|
||||||
LAM_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
OMPI_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest],
|
||||||
LAM_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
OMPI_LOG_COMMAND([./conftest],[HAPPY=1],[HAPPY=0]),
|
||||||
[HAPPY=0]),
|
[HAPPY=0]),
|
||||||
[HAPPY=0])
|
[HAPPY=0])
|
||||||
|
|
||||||
lam_ac_fortsize=-1
|
ompi_ac_fortsize=-1
|
||||||
if test "$HAPPY" = "1" -a -f conftestval; then
|
if test "$HAPPY" = "1" -a -f conftestval; then
|
||||||
lam_ac_fortsize=`cat conftestval`
|
ompi_ac_fortsize=`cat conftestval`
|
||||||
AC_MSG_RESULT([$lam_ac_fortsize])
|
AC_MSG_RESULT([$ompi_ac_fortsize])
|
||||||
eval "$2=$lam_ac_fortsize"
|
eval "$2=$ompi_ac_fortsize"
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([unknown])
|
AC_MSG_RESULT([unknown])
|
||||||
|
|
||||||
LAM_LOG_MSG([here is the C program:], 1)
|
OMPI_LOG_MSG([here is the C program:], 1)
|
||||||
LAM_LOG_FILE([conftest.c])
|
OMPI_LOG_FILE([conftest.c])
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
LAM_LOG_MSG([here is contest.h:], 1)
|
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||||
LAM_LOG_FILE([conftest.h])
|
OMPI_LOG_FILE([conftest.h])
|
||||||
fi
|
fi
|
||||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||||
LAM_LOG_FILE([conftestf.f])
|
OMPI_LOG_FILE([conftestf.f])
|
||||||
|
|
||||||
AC_MSG_WARN([*** Problem running configure test!])
|
AC_MSG_WARN([*** Problem running configure test!])
|
||||||
AC_MSG_WARN([*** See config.log for details.])
|
AC_MSG_WARN([*** See config.log for details.])
|
||||||
AC_MSG_ERROR([*** Cannot continue.])
|
AC_MSG_ERROR([*** Cannot continue.])
|
||||||
fi
|
fi
|
||||||
str="$2=$lam_ac_fortsize"
|
str="$2=$ompi_ac_fortsize"
|
||||||
eval $str
|
eval $str
|
||||||
|
|
||||||
unset lam_ac_fortsize HAPPY lam_conftest_h
|
unset ompi_ac_fortsize HAPPY ompi_conftest_h
|
||||||
/bin/rm -f conftest*])dnl
|
/bin/rm -f conftest*])dnl
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CASE_SENSITIVE_FS_SETUP],[
|
AC_DEFUN([OMPI_CASE_SENSITIVE_FS_SETUP],[
|
||||||
#
|
#
|
||||||
# Arguments: none
|
# 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)]))
|
[Destination FS is case sensitive (default: set to value of the build FS's case sensitivity)]))
|
||||||
|
|
||||||
if test "$with_cs_fs" = "yes"; then
|
if test "$with_cs_fs" = "yes"; then
|
||||||
LAM_WANT_CS_FS=1
|
OMPI_WANT_CS_FS=1
|
||||||
elif test -z "$with_cs_fs"; then
|
elif test -z "$with_cs_fs"; then
|
||||||
LAM_WANT_CS_FS=$have_cs_fs
|
OMPI_WANT_CS_FS=$have_cs_fs
|
||||||
else
|
else
|
||||||
LAM_WANT_CS_FS=0
|
OMPI_WANT_CS_FS=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$LAM_WANT_CS_FS" = "1"; then
|
if test "$OMPI_WANT_CS_FS" = "1"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
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
|
cat <<EOF
|
||||||
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
|
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.
|
C++ wrapper compiler will be named mpic++ instead of the traditional mpiCC.
|
||||||
|
|
||||||
Please update any makefiles appropriately.
|
Please update any makefiles appropriately.
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CHECK_OPTFLAGS],[
|
AC_DEFUN([OMPI_CHECK_OPTFLAGS],[
|
||||||
|
|
||||||
# Modularize this setup so that sub-configure.in scripts can use this
|
# Modularize this setup so that sub-configure.in scripts can use this
|
||||||
# same setup code.
|
# same setup code.
|
||||||
|
@ -2,20 +2,20 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
define(LAM_CHECK_PTHREAD_PIDS,[
|
define(OMPI_CHECK_PTHREAD_PIDS,[
|
||||||
#
|
#
|
||||||
# Arguments: none
|
# Arguments: none
|
||||||
#
|
#
|
||||||
# Dependencies: None
|
# Dependencies: None
|
||||||
#
|
#
|
||||||
# Sets:
|
# 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
|
# 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.
|
# 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)])
|
[Do threads have different pids (pthreads on linux)])
|
||||||
|
|
||||||
AC_MSG_CHECKING([if 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;
|
ret = 1;
|
||||||
pthread_exit((void *) ret);
|
pthread_exit((void *) ret);
|
||||||
}],
|
}],
|
||||||
[MSG=no LAM_THREADS_HAVE_DIFFERENT_PIDS=0],
|
[MSG=no OMPI_THREADS_HAVE_DIFFERENT_PIDS=0],
|
||||||
[MSG=yes LAM_THREADS_HAVE_DIFFERENT_PIDS=1])
|
[MSG=yes OMPI_THREADS_HAVE_DIFFERENT_PIDS=1])
|
||||||
|
|
||||||
CPPFLAGS="$CPPFLAGS_save"
|
CPPFLAGS="$CPPFLAGS_save"
|
||||||
LDFLAGS="$LDFLAGS_save"
|
LDFLAGS="$LDFLAGS_save"
|
||||||
LIBS="$LIBS_save"
|
LIBS="$LIBS_save"
|
||||||
|
|
||||||
AC_MSG_RESULT([$MSG])
|
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
|
# if pthreads is not available, then the system does not have an insane threads
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
dnl
|
dnl
|
||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
dnl LAM_CONFIG_POSIX_THREADS()
|
dnl OMPI_CONFIG_POSIX_THREADS()
|
||||||
dnl
|
dnl
|
||||||
dnl Configure posix threads, setting the following variables (but
|
dnl Configure posix threads, setting the following variables (but
|
||||||
dnl not calling AC_SUBST on them).
|
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], [
|
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK], [
|
||||||
# BEGIN: LAM_INTL_PTHREAD_TRY_LINK
|
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK
|
||||||
#
|
#
|
||||||
# Make sure that we can run a small application in C or C++, which
|
# 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
|
# 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_attr_init(0); pthread_cleanup_push(0, 0);
|
||||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
||||||
[$1], [$2])
|
[$1], [$2])
|
||||||
# END: LAM_INTL_PTHREAD_TRY_LINK
|
# END: OMPI_INTL_PTHREAD_TRY_LINK
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_PTHREAD_TRY_LINK_F77], [
|
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK_F77], [
|
||||||
# BEGIN: LAM_INTL_PTHREAD_TRY_LINK_F77
|
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK_F77
|
||||||
#
|
#
|
||||||
# Make sure that we can run a small application in Fortran, with
|
# Make sure that we can run a small application in Fortran, with
|
||||||
# pthreads living in a C object file
|
# pthreads living in a C object file
|
||||||
@ -44,20 +44,20 @@ EOF
|
|||||||
|
|
||||||
# C module
|
# C module
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
lam_conftest_h="#include \"conftest.h\""
|
ompi_conftest_h="#include \"conftest.h\""
|
||||||
else
|
else
|
||||||
lam_conftest_h=""
|
ompi_conftest_h=""
|
||||||
fi
|
fi
|
||||||
cat > conftest.c <<EOF
|
cat > conftest.c <<EOF
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
$lam_conftest_h
|
$ompi_conftest_h
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void lam_pthread()
|
void ompi_pthread()
|
||||||
{
|
{
|
||||||
pthread_t th;
|
pthread_t th;
|
||||||
pthread_join(th, 0);
|
pthread_join(th, 0);
|
||||||
@ -72,9 +72,9 @@ void lam_pthread()
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Try the compile
|
# Try the compile
|
||||||
LAM_LOG_COMMAND(
|
OMPI_LOG_COMMAND(
|
||||||
[$CC $CFLAGS -I. -c conftest.c],
|
[$CC $CFLAGS -I. -c conftest.c],
|
||||||
LAM_LOG_COMMAND(
|
OMPI_LOG_COMMAND(
|
||||||
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LIBS],
|
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LIBS],
|
||||||
[HAPPY=1],
|
[HAPPY=1],
|
||||||
[HAPPY=0]),
|
[HAPPY=0]),
|
||||||
@ -83,20 +83,20 @@ LAM_LOG_COMMAND(
|
|||||||
if test "$HAPPY" = "1"; then
|
if test "$HAPPY" = "1"; then
|
||||||
$1
|
$1
|
||||||
else
|
else
|
||||||
LAM_LOG_MSG([here is the C program:], 1)
|
OMPI_LOG_MSG([here is the C program:], 1)
|
||||||
LAM_LOG_FILE([conftest.c])
|
OMPI_LOG_FILE([conftest.c])
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
LAM_LOG_MSG([here is contest.h:], 1)
|
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||||
LAM_LOG_FILE([conftest.h])
|
OMPI_LOG_FILE([conftest.h])
|
||||||
fi
|
fi
|
||||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||||
LAM_LOG_FILE([conftestf.f])
|
OMPI_LOG_FILE([conftestf.f])
|
||||||
$2
|
$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset HAPPY lam_conftest_h
|
unset HAPPY ompi_conftest_h
|
||||||
/bin/rm -f conftest*
|
/bin/rm -f conftest*
|
||||||
# END: LAM_INTL_PTHREAD_TRY_LINK_F77
|
# END: OMPI_INTL_PTHREAD_TRY_LINK_F77
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
@ -105,11 +105,11 @@ unset HAPPY lam_conftest_h
|
|||||||
# Try to compile thread support without any special flags
|
# 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
|
# 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])
|
AC_MSG_CHECKING([if C compiler and POSIX threads work as is])
|
||||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||||
run_this_test=1
|
run_this_test=1
|
||||||
@ -138,10 +138,10 @@ if test "$lam_pthread_c_success" = "0"; then
|
|||||||
|
|
||||||
if test "$run_this_test" = "1" ; then
|
if test "$run_this_test" = "1" ; then
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_c_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
|
||||||
lam_pthread_c_success=0)
|
ompi_pthread_c_success=0)
|
||||||
AC_LANG_POP(C)
|
AC_LANG_POP(C)
|
||||||
if test "$lam_pthread_c_success" = "1"; then
|
if test "$ompi_pthread_c_success" = "1"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
PTHREAD_CPPFLAGS=
|
PTHREAD_CPPFLAGS=
|
||||||
@ -153,11 +153,11 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN_CXX], [
|
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_CXX], [
|
||||||
#
|
#
|
||||||
# C++ compiler
|
# 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])
|
AC_MSG_CHECKING([if C++ compiler and POSIX threads work as is])
|
||||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||||
run_this_test=1
|
run_this_test=1
|
||||||
@ -186,10 +186,10 @@ if test "$lam_pthread_cxx_success" = "0"; then
|
|||||||
|
|
||||||
if test "$run_this_test" = "1" ; then
|
if test "$run_this_test" = "1" ; then
|
||||||
AC_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||||
lam_pthread_cxx_success=0)
|
ompi_pthread_cxx_success=0)
|
||||||
AC_LANG_POP(C++)
|
AC_LANG_POP(C++)
|
||||||
if test "$lam_pthread_cxx_success" = "1"; then
|
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
PTHREAD_CXXCPPFLAGS=
|
PTHREAD_CXXCPPFLAGS=
|
||||||
@ -201,11 +201,11 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN_FC], [
|
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_FC], [
|
||||||
#
|
#
|
||||||
# Fortran compiler
|
# 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])
|
AC_MSG_CHECKING([if F77 compiler and POSIX threads work as is])
|
||||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||||
run_this_test=1
|
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
|
if test "$run_this_test" = "1" ; then
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||||
lam_pthread_f77_success=0)
|
ompi_pthread_f77_success=0)
|
||||||
AC_LANG_POP(C)
|
AC_LANG_POP(C)
|
||||||
if test "$lam_pthread_f77_success" = "1"; then
|
if test "$ompi_pthread_f77_success" = "1"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
@ -236,8 +236,8 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN], [
|
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN], [
|
||||||
# BEGIN: LAM_INTL_POSIX_THREADS_PLAIN
|
# BEGIN: OMPI_INTL_POSIX_THREADS_PLAIN
|
||||||
#
|
#
|
||||||
# Check if can compile without any special flags
|
# Check if can compile without any special flags
|
||||||
# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in
|
# 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
|
# Only run C++ and Fortran if those compilers already configured
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||||
[LAM_INTL_POSIX_THREADS_PLAIN_C],
|
[OMPI_INTL_POSIX_THREADS_PLAIN_C],
|
||||||
[lam_pthread_c_success=1])
|
[ompi_pthread_c_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||||
[LAM_INTL_POSIX_THREADS_PLAIN_CXX],
|
[OMPI_INTL_POSIX_THREADS_PLAIN_CXX],
|
||||||
[lam_pthread_cxx_success=1])
|
[ompi_pthread_cxx_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||||
[LAM_INTL_POSIX_THREADS_PLAIN_FC],
|
[OMPI_INTL_POSIX_THREADS_PLAIN_FC],
|
||||||
[lam_pthread_f77_success=1])
|
[ompi_pthread_f77_success=1])
|
||||||
|
|
||||||
# End: LAM_INTL_POSIX_THREADS_PLAIN
|
# End: OMPI_INTL_POSIX_THREADS_PLAIN
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
@ -268,19 +268,19 @@ AC_PROVIDE_IFELSE([AC_PROG_F77],
|
|||||||
# Try to compile thread support with special compiler flags
|
# 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
|
# C compiler
|
||||||
#
|
#
|
||||||
if test "$lam_pthread_c_success" = "0"; then
|
if test "$ompi_pthread_c_success" = "0"; then
|
||||||
for pf in $pflags; do
|
for pf in $pflags; do
|
||||||
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pf])
|
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pf])
|
||||||
CFLAGS="$orig_CFLAGS $pf"
|
CFLAGS="$orig_CFLAGS $pf"
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_c_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
|
||||||
lam_pthread_c_success=0)
|
ompi_pthread_c_success=0)
|
||||||
AC_LANG_POP(C)
|
AC_LANG_POP(C)
|
||||||
if test "$lam_pthread_c_success" = "1"; then
|
if test "$ompi_pthread_c_success" = "1"; then
|
||||||
PTHREAD_CFLAGS="$pf"
|
PTHREAD_CFLAGS="$pf"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
break
|
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
|
# C++ compiler
|
||||||
#
|
#
|
||||||
if test "$lam_pthread_cxx_success" = "0"; then
|
if test "$ompi_pthread_cxx_success" = "0"; then
|
||||||
for pf in $pflags; do
|
for pf in $pflags; do
|
||||||
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $pf])
|
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $pf])
|
||||||
CXXFLAGS="$orig_CXXFLAGS $pf"
|
CXXFLAGS="$orig_CXXFLAGS $pf"
|
||||||
AC_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||||
lam_pthread_cxx_success=0)
|
ompi_pthread_cxx_success=0)
|
||||||
AC_LANG_POP(C++)
|
AC_LANG_POP(C++)
|
||||||
if test "$lam_pthread_cxx_success" = "1"; then
|
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||||
PTHREAD_CXXFLAGS="$pf"
|
PTHREAD_CXXFLAGS="$pf"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
break
|
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
|
# 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
|
for pf in $pflags; do
|
||||||
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pf])
|
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pf])
|
||||||
FFLAGS="$orig_FFLAGS $pf"
|
FFLAGS="$orig_FFLAGS $pf"
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||||
lam_pthread_f77_success=0)
|
ompi_pthread_f77_success=0)
|
||||||
AC_LANG_POP(C)
|
AC_LANG_POP(C)
|
||||||
if test "$lam_pthread_f77_success" = "1"; then
|
if test "$ompi_pthread_f77_success" = "1"; then
|
||||||
PTHREAD_FFLAGS="$pf"
|
PTHREAD_FFLAGS="$pf"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
break
|
break
|
||||||
@ -346,8 +346,8 @@ fi
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS],[
|
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS],[
|
||||||
# Begin: LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
# Begin: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||||
#
|
#
|
||||||
# If above didn't work, try some super-special compiler flags
|
# If above didn't work, try some super-special compiler flags
|
||||||
# that get evaluated to the "right" things.
|
# 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
|
# Only run C++ and Fortran if those compilers already configured
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||||
[LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_C],
|
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_C],
|
||||||
[lam_pthread_c_success=1])
|
[ompi_pthread_c_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||||
[LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
|
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
|
||||||
[lam_pthread_cxx_success=1])
|
[ompi_pthread_cxx_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||||
[LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
|
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
|
||||||
[lam_pthread_f77_success=1])
|
[ompi_pthread_f77_success=1])
|
||||||
|
|
||||||
# End: LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
# End: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
@ -386,11 +386,11 @@ AC_PROVIDE_IFELSE([AC_PROG_F77],
|
|||||||
# Try to compile thread support with extra libs
|
# 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
|
# C compiler
|
||||||
#
|
#
|
||||||
if test "$lam_pthread_c_success" = "0"; then
|
if test "$ompi_pthread_c_success" = "0"; then
|
||||||
for pl in $plibs; do
|
for pl in $plibs; do
|
||||||
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pl])
|
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pl])
|
||||||
case "${host_cpu}-${host-_os}" in
|
case "${host_cpu}-${host-_os}" in
|
||||||
@ -409,10 +409,10 @@ if test "$lam_pthread_c_success" = "0"; then
|
|||||||
esac
|
esac
|
||||||
LIBS="$orig_LIBS $pl"
|
LIBS="$orig_LIBS $pl"
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_c_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
|
||||||
lam_pthread_c_success=0)
|
ompi_pthread_c_success=0)
|
||||||
AC_LANG_POP(C)
|
AC_LANG_POP(C)
|
||||||
if test "$lam_pthread_c_success" = "1"; then
|
if test "$ompi_pthread_c_success" = "1"; then
|
||||||
PTHREAD_LIBS="$pl"
|
PTHREAD_LIBS="$pl"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
@ -426,12 +426,12 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS_CXX],[
|
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_CXX],[
|
||||||
#
|
#
|
||||||
# C++ compiler
|
# C++ compiler
|
||||||
#
|
#
|
||||||
if test "$lam_pthread_cxx_success" = "0"; then
|
if test "$ompi_pthread_cxx_success" = "0"; then
|
||||||
if test ! "$lam_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; 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])
|
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $PTHREAD_LIBS])
|
||||||
case "${host_cpu}-${host-_os}" in
|
case "${host_cpu}-${host-_os}" in
|
||||||
*-aix* | *-freebsd*)
|
*-aix* | *-freebsd*)
|
||||||
@ -449,10 +449,10 @@ if test "$lam_pthread_cxx_success" = "0"; then
|
|||||||
esac
|
esac
|
||||||
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
||||||
AC_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||||
lam_pthread_cxx_success=0)
|
ompi_pthread_cxx_success=0)
|
||||||
AC_LANG_POP(C++)
|
AC_LANG_POP(C++)
|
||||||
if test "$lam_pthread_cxx_success" = "1"; then
|
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||||
PTHREAD_LIBS="$pl"
|
PTHREAD_LIBS="$pl"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
@ -479,10 +479,10 @@ if test "$lam_pthread_cxx_success" = "0"; then
|
|||||||
esac
|
esac
|
||||||
LIBS="$orig_LIBS $pl"
|
LIBS="$orig_LIBS $pl"
|
||||||
AC_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK(lam_pthread_cxx_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
|
||||||
lam_pthread_cxx_success=0)
|
ompi_pthread_cxx_success=0)
|
||||||
AC_LANG_POP(C++)
|
AC_LANG_POP(C++)
|
||||||
if test "$lam_pthread_cxx_success" = "1"; then
|
if test "$ompi_pthread_cxx_success" = "1"; then
|
||||||
PTHREAD_LIBS="$pl"
|
PTHREAD_LIBS="$pl"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
@ -496,20 +496,20 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS_FC],[
|
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_FC],[
|
||||||
#
|
#
|
||||||
# Fortran compiler
|
# 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
|
||||||
if test ! "$lam_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; 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])
|
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $PTHREAD_LIBS])
|
||||||
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||||
lam_pthread_f77_success=0)
|
ompi_pthread_f77_success=0)
|
||||||
AC_LANG_POP(C)
|
AC_LANG_POP(C)
|
||||||
LIBS="$orig_LIBS"
|
LIBS="$orig_LIBS"
|
||||||
if test "$lam_pthread_f77_success" = "1"; then
|
if test "$ompi_pthread_f77_success" = "1"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
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])
|
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pl])
|
||||||
LIBS="$orig_LIBS $pl"
|
LIBS="$orig_LIBS $pl"
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_PTHREAD_TRY_LINK_F77(lam_pthread_f77_success=1,
|
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
|
||||||
lam_pthread_f77_success=0)
|
ompi_pthread_f77_success=0)
|
||||||
AC_LANG_POP(C)
|
AC_LANG_POP(C)
|
||||||
LIBS="$orig_LIBS"
|
LIBS="$orig_LIBS"
|
||||||
if test "$lam_pthread_f77_success" = "1"; then
|
if test "$ompi_pthread_f77_success" = "1"; then
|
||||||
PTHREAD_LIBS="$pl"
|
PTHREAD_LIBS="$pl"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
break
|
break
|
||||||
@ -537,8 +537,8 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS],[
|
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS],[
|
||||||
# Begin: LAM_INTL_POSIX_THREADS_LIBS
|
# Begin: OMPI_INTL_POSIX_THREADS_LIBS
|
||||||
#
|
#
|
||||||
# if we can't find a super-special compiler flags, try some libraries.
|
# 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
|
# 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
|
# Only run C++ and Fortran if those compilers already configured
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||||
[LAM_INTL_POSIX_THREADS_LIBS_C],
|
[OMPI_INTL_POSIX_THREADS_LIBS_C],
|
||||||
[lam_pthread_c_success=1])
|
[ompi_pthread_c_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||||
[LAM_INTL_POSIX_THREADS_LIBS_CXX],
|
[OMPI_INTL_POSIX_THREADS_LIBS_CXX],
|
||||||
[lam_pthread_cxx_success=1])
|
[ompi_pthread_cxx_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||||
[LAM_INTL_POSIX_THREADS_LIBS_FC],
|
[OMPI_INTL_POSIX_THREADS_LIBS_FC],
|
||||||
[lam_pthread_f77_success=1])
|
[ompi_pthread_f77_success=1])
|
||||||
|
|
||||||
# End: LAM_INTL_POSIX_THREADS_LIBS]
|
# End: OMPI_INTL_POSIX_THREADS_LIBS]
|
||||||
)dnl
|
)dnl
|
||||||
|
|
||||||
|
|
||||||
@ -572,10 +572,10 @@ AC_PROVIDE_IFELSE([AC_PROG_F77],
|
|||||||
# External macro (aka, the real thing)
|
# External macro (aka, the real thing)
|
||||||
#
|
#
|
||||||
#********************************************************************
|
#********************************************************************
|
||||||
AC_DEFUN([LAM_CONFIG_POSIX_THREADS],[
|
AC_DEFUN([OMPI_CONFIG_POSIX_THREADS],[
|
||||||
lam_pthread_c_success=0
|
ompi_pthread_c_success=0
|
||||||
lam_pthread_f77_success=0
|
ompi_pthread_f77_success=0
|
||||||
lam_pthread_cxx_success=0
|
ompi_pthread_cxx_success=0
|
||||||
|
|
||||||
orig_CFLAGS="$CFLAGS"
|
orig_CFLAGS="$CFLAGS"
|
||||||
orig_FFLAGS="$FFLAGS"
|
orig_FFLAGS="$FFLAGS"
|
||||||
@ -594,13 +594,13 @@ PTHREAD_LDFLAGS=
|
|||||||
PTHREAD_LIBS=
|
PTHREAD_LIBS=
|
||||||
|
|
||||||
# Try with the basics, mam.
|
# Try with the basics, mam.
|
||||||
LAM_INTL_POSIX_THREADS_PLAIN
|
OMPI_INTL_POSIX_THREADS_PLAIN
|
||||||
|
|
||||||
# Try the super-special compiler flags.
|
# 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)
|
# Try the normal linking methods (that's no fun)
|
||||||
LAM_INTL_POSIX_THREADS_LIBS
|
OMPI_INTL_POSIX_THREADS_LIBS
|
||||||
|
|
||||||
CFLAGS="$orig_CFLAGS"
|
CFLAGS="$orig_CFLAGS"
|
||||||
FFLAGS="$orig_FFLAGS"
|
FFLAGS="$orig_FFLAGS"
|
||||||
@ -610,13 +610,13 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
|||||||
LDFLAGS="$orig_LDFLAGS"
|
LDFLAGS="$orig_LDFLAGS"
|
||||||
LIBS="$orig_LIBS"
|
LIBS="$orig_LIBS"
|
||||||
|
|
||||||
if test "$LAM_WANT_F77_BINDINGS" != "1"; then
|
if test "$OMPI_WANT_F77_BINDINGS" != "1"; then
|
||||||
lam_pthread_f77_success=1
|
ompi_pthread_f77_success=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$lam_pthread_c_success" = "1" -a \
|
if test "$ompi_pthread_c_success" = "1" -a \
|
||||||
"$lam_pthread_cxx_success" = "1" -a \
|
"$ompi_pthread_cxx_success" = "1" -a \
|
||||||
"$lam_pthread_f77_success" = "1"; then
|
"$ompi_pthread_f77_success" = "1"; then
|
||||||
internal_useless=1
|
internal_useless=1
|
||||||
$1
|
$1
|
||||||
else
|
else
|
||||||
@ -624,6 +624,6 @@ else
|
|||||||
$2
|
$2
|
||||||
fi
|
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
|
unset internal_useless
|
||||||
])dnl
|
])dnl
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
dnl
|
dnl
|
||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
dnl LAM_CONFIG_SOLARIS_THREADS()
|
dnl OMPI_CONFIG_SOLARIS_THREADS()
|
||||||
dnl
|
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], [
|
AC_DEFUN([OMPI_INTL_SOLARIS_TRY_LINK], [
|
||||||
# BEGIN: LAM_INTL_SOLARIS_TRY_LINK
|
# BEGIN: OMPI_INTL_SOLARIS_TRY_LINK
|
||||||
#
|
#
|
||||||
# Make sure that we can run a small application in C or C++, which
|
# 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
|
# 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);
|
[thread_t th; thr_join(th, 0, 0);
|
||||||
thr_create(0,0,0,0,0,0); ],
|
thr_create(0,0,0,0,0,0); ],
|
||||||
[$1], [$2])
|
[$1], [$2])
|
||||||
# END: LAM_INTL_SOLARIS_TRY_LINK
|
# END: OMPI_INTL_SOLARIS_TRY_LINK
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_INTL_SOLARIS_TRY_LINK_F77], [
|
AC_DEFUN([OMPI_INTL_SOLARIS_TRY_LINK_F77], [
|
||||||
# BEGIN: LAM_INTL_SOLARIS_TRY_LINK_F77
|
# BEGIN: OMPI_INTL_SOLARIS_TRY_LINK_F77
|
||||||
#
|
#
|
||||||
# Make sure that we can run a small application in Fortran, with
|
# Make sure that we can run a small application in Fortran, with
|
||||||
# pthreads living in a C object file
|
# pthreads living in a C object file
|
||||||
@ -40,20 +40,20 @@ EOF
|
|||||||
|
|
||||||
# C module
|
# C module
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
lam_conftest_h="#include \"conftest.h\""
|
ompi_conftest_h="#include \"conftest.h\""
|
||||||
else
|
else
|
||||||
lam_conftest_h=""
|
ompi_conftest_h=""
|
||||||
fi
|
fi
|
||||||
cat > conftest.c <<EOF
|
cat > conftest.c <<EOF
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
$lam_conftest_h
|
$ompi_conftest_h
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void lam_pthread()
|
void ompi_pthread()
|
||||||
{
|
{
|
||||||
thread_t th;
|
thread_t th;
|
||||||
thr_join(th, 0, 0);
|
thr_join(th, 0, 0);
|
||||||
@ -65,9 +65,9 @@ void lam_pthread()
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Try the compile
|
# Try the compile
|
||||||
LAM_LOG_COMMAND(
|
OMPI_LOG_COMMAND(
|
||||||
[$CC $CFLAGS -I. -c conftest.c],
|
[$CC $CFLAGS -I. -c conftest.c],
|
||||||
LAM_LOG_COMMAND(
|
OMPI_LOG_COMMAND(
|
||||||
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LIBS],
|
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LIBS],
|
||||||
[HAPPY=1],
|
[HAPPY=1],
|
||||||
[HAPPY=0]),
|
[HAPPY=0]),
|
||||||
@ -76,24 +76,24 @@ LAM_LOG_COMMAND(
|
|||||||
if test "$HAPPY" = "1"; then
|
if test "$HAPPY" = "1"; then
|
||||||
$1
|
$1
|
||||||
else
|
else
|
||||||
LAM_LOG_MSG([here is the C program:], 1)
|
OMPI_LOG_MSG([here is the C program:], 1)
|
||||||
LAM_LOG_FILE([conftest.c])
|
OMPI_LOG_FILE([conftest.c])
|
||||||
if test -f conftest.h; then
|
if test -f conftest.h; then
|
||||||
LAM_LOG_MSG([here is contest.h:], 1)
|
OMPI_LOG_MSG([here is contest.h:], 1)
|
||||||
LAM_LOG_FILE([conftest.h])
|
OMPI_LOG_FILE([conftest.h])
|
||||||
fi
|
fi
|
||||||
LAM_LOG_MSG([here is the fortran program:], 1)
|
OMPI_LOG_MSG([here is the fortran program:], 1)
|
||||||
LAM_LOG_FILE([conftestf.f])
|
OMPI_LOG_FILE([conftestf.f])
|
||||||
$2
|
$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset HAPPY lam_conftest_h
|
unset HAPPY ompi_conftest_h
|
||||||
/bin/rm -f conftest*
|
/bin/rm -f conftest*
|
||||||
# END: LAM_INTL_SOLARIS_TRY_LINK_F77
|
# END: OMPI_INTL_SOLARIS_TRY_LINK_F77
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS_C], [
|
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_C], [
|
||||||
if test "$BASECC" = "cc"; then
|
if test "$BASECC" = "cc"; then
|
||||||
STHREAD_CFLAGS="-mt"
|
STHREAD_CFLAGS="-mt"
|
||||||
style="Workshop/Forte"
|
style="Workshop/Forte"
|
||||||
@ -108,10 +108,10 @@ CPPFLAGS="$STHREAD_CPPFLAGS $CPPFLAGS_orig"
|
|||||||
LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
|
LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
|
||||||
LIBS="$STHREAD_LIBS $LIBS_orig"
|
LIBS="$STHREAD_LIBS $LIBS_orig"
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_SOLARIS_TRY_LINK(lam_sthread_c_success=1,
|
OMPI_INTL_SOLARIS_TRY_LINK(ompi_sthread_c_success=1,
|
||||||
lam_sthread_c_success=0)
|
ompi_sthread_c_success=0)
|
||||||
AC_LANG_POP(C)
|
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])
|
AC_MSG_RESULT([yes - $style])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
@ -119,7 +119,7 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS_CXX], [
|
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_CXX], [
|
||||||
if test "$BASECXX" = "CC"; then
|
if test "$BASECXX" = "CC"; then
|
||||||
STHREAD_CXXFLAGS="-mt"
|
STHREAD_CXXFLAGS="-mt"
|
||||||
style="Workshop/Forte"
|
style="Workshop/Forte"
|
||||||
@ -137,10 +137,10 @@ LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
|
|||||||
LIBS="$STHREAD_LIBS $LIBS_orig"
|
LIBS="$STHREAD_LIBS $LIBS_orig"
|
||||||
AC_MSG_CHECKING([if C++ compiler and Solaris threads work])
|
AC_MSG_CHECKING([if C++ compiler and Solaris threads work])
|
||||||
AC_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
LAM_INTL_SOLARIS_TRY_LINK(lam_sthread_cxx_success=1,
|
OMPI_INTL_SOLARIS_TRY_LINK(ompi_sthread_cxx_success=1,
|
||||||
lam_sthread_cxx_success=0)
|
ompi_sthread_cxx_success=0)
|
||||||
AC_LANG_POP(C++)
|
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])
|
AC_MSG_RESULT([yes - $style])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
@ -148,8 +148,8 @@ fi
|
|||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS_FC], [
|
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_FC], [
|
||||||
if test "$LAM_WANT_F77_BINDINGS" = "1"; then
|
if test "$OMPI_WANT_F77_BINDINGS" = "1"; then
|
||||||
if test "$BASEFC" = "f77"; then
|
if test "$BASEFC" = "f77"; then
|
||||||
STHREAD_FFLAGS="-mt"
|
STHREAD_FFLAGS="-mt"
|
||||||
style="Workshop/Forte"
|
style="Workshop/Forte"
|
||||||
@ -164,24 +164,24 @@ if test "$LAM_WANT_F77_BINDINGS" = "1"; then
|
|||||||
LIBS="$STHREAD_LIBS $LIBS_orig"
|
LIBS="$STHREAD_LIBS $LIBS_orig"
|
||||||
AC_MSG_CHECKING([if F77 compiler and Solaris threads work])
|
AC_MSG_CHECKING([if F77 compiler and Solaris threads work])
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
LAM_INTL_SOLARIS_TRY_LINK_F77(lam_sthread_f77_success=1,
|
OMPI_INTL_SOLARIS_TRY_LINK_F77(ompi_sthread_f77_success=1,
|
||||||
lam_sthread_f77_success=0)
|
ompi_sthread_f77_success=0)
|
||||||
AC_LANG_POP(C)
|
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])
|
AC_MSG_RESULT([yes - $style])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
lam_sthread_f77_success=1
|
ompi_sthread_f77_success=1
|
||||||
fi
|
fi
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS],[
|
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS],[
|
||||||
lam_sthread_c_success=0
|
ompi_sthread_c_success=0
|
||||||
lam_sthread_f77_success=0
|
ompi_sthread_f77_success=0
|
||||||
lam_sthread_cxx_success=0
|
ompi_sthread_cxx_success=0
|
||||||
|
|
||||||
orig_CFLAGS="$CFLAGS"
|
orig_CFLAGS="$CFLAGS"
|
||||||
orig_FFLAGS="$FFLAGS"
|
orig_FFLAGS="$FFLAGS"
|
||||||
@ -201,16 +201,16 @@ STHREAD_LIBS=
|
|||||||
|
|
||||||
# Only run C++ and Fortran if those compilers already configured
|
# Only run C++ and Fortran if those compilers already configured
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||||
[LAM_CONFIG_SOLARIS_THREADS_C],
|
[OMPI_CONFIG_SOLARIS_THREADS_C],
|
||||||
[lam_sthread_c_success=1])
|
[ompi_sthread_c_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||||
[LAM_CONFIG_SOLARIS_THREADS_CXX],
|
[OMPI_CONFIG_SOLARIS_THREADS_CXX],
|
||||||
[lam_sthread_cxx_success=1])
|
[ompi_sthread_cxx_success=1])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||||
[LAM_CONFIG_SOLARIS_THREADS_FC],
|
[OMPI_CONFIG_SOLARIS_THREADS_FC],
|
||||||
[lam_sthread_f77_success=1])
|
[ompi_sthread_f77_success=1])
|
||||||
|
|
||||||
CFLAGS="$orig_CFLAGS"
|
CFLAGS="$orig_CFLAGS"
|
||||||
FFLAGS="$orig_FFLAGS"
|
FFLAGS="$orig_FFLAGS"
|
||||||
@ -220,9 +220,9 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
|||||||
LDFLAGS="$orig_LDFLAGS"
|
LDFLAGS="$orig_LDFLAGS"
|
||||||
LIBS="$orig_LIBS"
|
LIBS="$orig_LIBS"
|
||||||
|
|
||||||
if test "$lam_sthread_c_success" = "1" -a \
|
if test "$ompi_sthread_c_success" = "1" -a \
|
||||||
"$lam_sthread_cxx_success" = "1" -a \
|
"$ompi_sthread_cxx_success" = "1" -a \
|
||||||
"$lam_sthread_f77_success" = "1"; then
|
"$ompi_sthread_f77_success" = "1"; then
|
||||||
internal_useless=1
|
internal_useless=1
|
||||||
$1
|
$1
|
||||||
else
|
else
|
||||||
@ -230,7 +230,7 @@ else
|
|||||||
$2
|
$2
|
||||||
fi
|
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
|
unset internal_useless
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIG_SUBDIR],[
|
AC_DEFUN([OMPI_CONFIG_SUBDIR],[
|
||||||
#
|
#
|
||||||
# Invoke configure in a specific subdirectory.
|
# Invoke configure in a specific subdirectory.
|
||||||
#
|
#
|
||||||
@ -22,7 +22,7 @@ subdir_failure="$4"
|
|||||||
#
|
#
|
||||||
|
|
||||||
if test "$subdir_dir" != ":" -a -d $srcdir/$subdir_dir; then
|
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
|
# Gotta check where srcdir is for VPATH builds. If srcdir is not
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIG_SUBDIR_ARGS],[
|
AC_DEFUN([OMPI_CONFIG_SUBDIR_ARGS],[
|
||||||
#
|
#
|
||||||
# Invoke configure in subdirectories.
|
# Invoke configure in subdirectories.
|
||||||
#
|
#
|
||||||
|
@ -2,7 +2,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIG_THREADS],[
|
AC_DEFUN([OMPI_CONFIG_THREADS],[
|
||||||
#
|
#
|
||||||
# Arguments: none
|
# Arguments: none
|
||||||
#
|
#
|
||||||
@ -15,15 +15,15 @@ AC_DEFUN([LAM_CONFIG_THREADS],[
|
|||||||
#
|
#
|
||||||
|
|
||||||
# create templates
|
# create templates
|
||||||
AH_TEMPLATE([LAM_HAVE_SOLARIS_THREADS],
|
AH_TEMPLATE([OMPI_HAVE_SOLARIS_THREADS],
|
||||||
[Do we have native 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])
|
[Do we have POSIX threads])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for thread types - add your type here...
|
# 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])
|
AC_MSG_CHECKING([for working POSIX threads package])
|
||||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@ -32,7 +32,7 @@ else
|
|||||||
fi
|
fi
|
||||||
export HAVE_POSIX_THREADS
|
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])
|
AC_MSG_CHECKING([for working Solaris threads package])
|
||||||
if test "$HAVE_SOLARIS_THREADS" = "1" ; then
|
if test "$HAVE_SOLARIS_THREADS" = "1" ; then
|
||||||
AC_MSG_RESULT([yes])
|
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...
|
# Blah - this should be made better, but I don't know how...
|
||||||
#
|
#
|
||||||
if test "$THREAD_TYPE" = "solaris"; then
|
if test "$THREAD_TYPE" = "solaris"; then
|
||||||
AC_DEFINE(LAM_HAVE_SOLARIS_THREADS, 1)
|
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 1)
|
||||||
AC_DEFINE(LAM_HAVE_POSIX_THREADS, 0)
|
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
|
||||||
AC_DEFINE(LAM_THREADS_HAVE_DIFFERENT_PIDS, 0)
|
AC_DEFINE(OMPI_THREADS_HAVE_DIFFERENT_PIDS, 0)
|
||||||
|
|
||||||
THREAD_CFLAGS="$STHREAD_CFLAGS"
|
THREAD_CFLAGS="$STHREAD_CFLAGS"
|
||||||
THREAD_FFLAGS="$STHREAD_FFLAGS"
|
THREAD_FFLAGS="$STHREAD_FFLAGS"
|
||||||
@ -115,8 +115,8 @@ if test "$THREAD_TYPE" = "solaris"; then
|
|||||||
THREAD_LDFLAGS="$STHREAD_LDFLAGS"
|
THREAD_LDFLAGS="$STHREAD_LDFLAGS"
|
||||||
THREAD_LIBS="$STHREAD_LIBS"
|
THREAD_LIBS="$STHREAD_LIBS"
|
||||||
elif test "$THREAD_TYPE" = "posix"; then
|
elif test "$THREAD_TYPE" = "posix"; then
|
||||||
AC_DEFINE(LAM_HAVE_SOLARIS_THREADS, 0)
|
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
|
||||||
AC_DEFINE(LAM_HAVE_POSIX_THREADS, 1)
|
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 1)
|
||||||
|
|
||||||
THREAD_CFLAGS="$PTHREAD_CFLAGS"
|
THREAD_CFLAGS="$PTHREAD_CFLAGS"
|
||||||
THREAD_FFLAGS="$PTHREAD_FFLAGS"
|
THREAD_FFLAGS="$PTHREAD_FFLAGS"
|
||||||
@ -126,10 +126,10 @@ elif test "$THREAD_TYPE" = "posix"; then
|
|||||||
THREAD_LDFLAGS="$PTHREAD_LDFLAGS"
|
THREAD_LDFLAGS="$PTHREAD_LDFLAGS"
|
||||||
THREAD_LIBS="$PTHREAD_LIBS"
|
THREAD_LIBS="$PTHREAD_LIBS"
|
||||||
|
|
||||||
LAM_CHECK_PTHREAD_PIDS
|
OMPI_CHECK_PTHREAD_PIDS
|
||||||
elif test "$THREAD_TYPE" = "none"; then
|
elif test "$THREAD_TYPE" = "none"; then
|
||||||
AC_DEFINE(LAM_HAVE_SOLARIS_THREADS, 0)
|
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
|
||||||
AC_DEFINE(LAM_HAVE_POSIX_THREADS, 0)
|
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
|
||||||
|
|
||||||
TRHEAD_CFLAGS=
|
TRHEAD_CFLAGS=
|
||||||
THREAD_FFLAGS=
|
THREAD_FFLAGS=
|
||||||
@ -143,14 +143,14 @@ else
|
|||||||
|
|
||||||
************************************************************************
|
************************************************************************
|
||||||
|
|
||||||
LAM/MPI was unable to find threading support on your system. In the
|
OMPI/MPI was unable to find threading support on your system. In the
|
||||||
near future, the LAM development team is considering requiring
|
near future, the OMPI development team is considering requiring
|
||||||
threading support for proper LAM execution. This is in part because
|
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
|
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.
|
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.
|
configure with the '--without-threads' option.
|
||||||
|
|
||||||
************************************************************************
|
************************************************************************
|
||||||
|
@ -3,8 +3,8 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIGURE_OPTIONS],[
|
AC_DEFUN([OMPI_CONFIGURE_OPTIONS],[
|
||||||
lam_show_subtitle "Configuration options"
|
ompi_show_subtitle "Configuration options"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Memory debugging
|
# 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"
|
echo "--> developer override: enable mem profiling by default"
|
||||||
fi
|
fi
|
||||||
#################### Early development override ####################
|
#################### 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])
|
[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"
|
echo "--> developer override: enable mem profiling by default"
|
||||||
fi
|
fi
|
||||||
#################### Early development override ####################
|
#################### 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])
|
[Whether we want the memory profiling or not])
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -101,7 +101,7 @@ if test "$WANT_DEBUG" = "0"; then
|
|||||||
CFLAGS="-DNDEBUG $CFLAGS"
|
CFLAGS="-DNDEBUG $CFLAGS"
|
||||||
CXXFLAGS="-DNDEBUG $CFLAGS"
|
CXXFLAGS="-DNDEBUG $CFLAGS"
|
||||||
fi
|
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])
|
[Whether we want developer-level debugging code or not])
|
||||||
|
|
||||||
|
|
||||||
@ -115,10 +115,10 @@ AC_ARG_ENABLE(f77,
|
|||||||
[enable f77 MPI bindings (default: enabled)]))
|
[enable f77 MPI bindings (default: enabled)]))
|
||||||
if test "$enable_f77" != "no"; then
|
if test "$enable_f77" != "no"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
LAM_WANT_F77_BINDINGS=1
|
OMPI_WANT_F77_BINDINGS=1
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
LAM_WANT_F77_BINDINGS=0
|
OMPI_WANT_F77_BINDINGS=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -132,10 +132,10 @@ AC_ARG_ENABLE(f90,
|
|||||||
[enable f90 MPI bindings (default: enabled)]))
|
[enable f90 MPI bindings (default: enabled)]))
|
||||||
if test "$enable_f90" != "no"; then
|
if test "$enable_f90" != "no"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
LAM_WANT_F90_BINDINGS=1
|
OMPI_WANT_F90_BINDINGS=1
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
LAM_WANT_F90_BINDINGS=0
|
OMPI_WANT_F90_BINDINGS=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ AC_MSG_CHECKING([if want run-time MPI parameter checking])
|
|||||||
AC_ARG_ENABLE(mpi-param-check,
|
AC_ARG_ENABLE(mpi-param-check,
|
||||||
AC_HELP_STRING([--with-mpi-param-check],
|
AC_HELP_STRING([--with-mpi-param-check],
|
||||||
[behavior of MPI function parameter checking. Valid values are: always, never, runtime (default: runtime)]))
|
[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 \
|
if test "$with_mpi_param_check" = "no" -o \
|
||||||
"$with_mpi_param_check" = "never"; then
|
"$with_mpi_param_check" = "never"; then
|
||||||
mpi_param_check=0
|
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_ARG_WITH(devel-headers,
|
||||||
AC_HELP_STRING([--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).]))
|
[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
|
# amorphous, seem-to-be-good-idea options
|
||||||
# --with-lam=maintainer_options
|
# --with-ompi=maintainer_options
|
||||||
# --with-mca-*
|
# --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_MSG_CHECKING(if want deprecated executable names)
|
||||||
AC_ARG_ENABLE(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
|
if test "$enable_deprecated_executable_names" = "yes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
WANT_DEN=1
|
WANT_DEN=1
|
||||||
|
@ -3,13 +3,13 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CONFIGURE_SETUP],[
|
AC_DEFUN([OMPI_CONFIGURE_SETUP],[
|
||||||
|
|
||||||
# Some helper script functions. Unfortunately, we cannot use $1 kinds
|
# Some helper script functions. Unfortunately, we cannot use $1 kinds
|
||||||
# of arugments here because of the m4 substitution. So we have to set
|
# of arugments here because of the m4 substitution. So we have to set
|
||||||
# special variable names before invoking the function. :-\
|
# special variable names before invoking the function. :-\
|
||||||
|
|
||||||
lam_show_title() {
|
ompi_show_title() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
============================================================================
|
============================================================================
|
||||||
@ -19,7 +19,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lam_show_subtitle() {
|
ompi_show_subtitle() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
*** ${1}
|
*** ${1}
|
||||||
@ -29,29 +29,29 @@ EOF
|
|||||||
# Save some stats about this build
|
# Save some stats about this build
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_CONFIGURE_USER="`whoami`"
|
OMPI_CONFIGURE_USER="`whoami`"
|
||||||
LAM_CONFIGURE_HOST="`hostname | head -n 1`"
|
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
|
||||||
LAM_CONFIGURE_DATE="`date`"
|
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(OMPI_CONFIGURE_USER)
|
||||||
AC_SUBST(LAM_CONFIGURE_HOST)
|
AC_SUBST(OMPI_CONFIGURE_HOST)
|
||||||
AC_SUBST(LAM_CONFIGURE_DATE)])dnl
|
AC_SUBST(OMPI_CONFIGURE_DATE)])dnl
|
||||||
|
|
||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
|
|
||||||
AC_DEFUN([LAM_BASIC_SETUP],[
|
AC_DEFUN([OMPI_BASIC_SETUP],[
|
||||||
#
|
#
|
||||||
# Save some stats about this build
|
# Save some stats about this build
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_CONFIGURE_USER="`whoami`"
|
OMPI_CONFIGURE_USER="`whoami`"
|
||||||
LAM_CONFIGURE_HOST="`hostname | head -n 1`"
|
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
|
||||||
LAM_CONFIGURE_DATE="`date`"
|
OMPI_CONFIGURE_DATE="`date`"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Make automake clean emacs ~ files for "make clean"
|
# Make automake clean emacs ~ files for "make clean"
|
||||||
@ -61,26 +61,26 @@ CLEANFILES="*~ .\#*"
|
|||||||
AC_SUBST(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_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,
|
# is not found in the path and the user did not specify --prefix,
|
||||||
# we'll get a $prefix of "."
|
# we'll get a $prefix of "."
|
||||||
|
|
||||||
lam_prefix_save="$prefix"
|
ompi_prefix_save="$prefix"
|
||||||
AC_PREFIX_PROGRAM(lamclean)
|
AC_PREFIX_PROGRAM(ompi_clean)
|
||||||
if test "$prefix" = "."; then
|
if test "$prefix" = "."; then
|
||||||
prefix="$lam_prefix_save"
|
prefix="$ompi_prefix_save"
|
||||||
fi
|
fi
|
||||||
unset lam_prefix_save
|
unset ompi_prefix_save
|
||||||
|
|
||||||
#
|
#
|
||||||
# Basic sanity checking; we can't install to a relative path
|
# Basic sanity checking; we can't install to a relative path
|
||||||
@ -107,9 +107,9 @@ esac
|
|||||||
AC_ARG_ENABLE(dist,
|
AC_ARG_ENABLE(dist,
|
||||||
AC_HELP_STRING([--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.]),
|
[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([Configuring in 'make dist' mode])
|
||||||
AC_MSG_WARN([Most make targets may be non-functional!])
|
AC_MSG_WARN([Most make targets may be non-functional!])
|
||||||
fi])dnl
|
fi])dnl
|
||||||
@ -118,7 +118,7 @@ dnl #######################################################################
|
|||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
|
|
||||||
AC_DEFUN([LAM_LOG_MSG],[
|
AC_DEFUN([OMPI_LOG_MSG],[
|
||||||
# 1 is the message
|
# 1 is the message
|
||||||
# 2 is whether to put a prefix or not
|
# 2 is whether to put a prefix or not
|
||||||
if test -n "$2"; then
|
if test -n "$2"; then
|
||||||
@ -131,7 +131,7 @@ dnl #######################################################################
|
|||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
|
|
||||||
AC_DEFUN([LAM_LOG_FILE],[
|
AC_DEFUN([OMPI_LOG_FILE],[
|
||||||
# 1 is the filename
|
# 1 is the filename
|
||||||
if test -n "$1" -a -f "$1"; then
|
if test -n "$1" -a -f "$1"; then
|
||||||
cat $1 >&5
|
cat $1 >&5
|
||||||
@ -141,19 +141,19 @@ dnl #######################################################################
|
|||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
|
|
||||||
AC_DEFUN([LAM_LOG_COMMAND],[
|
AC_DEFUN([OMPI_LOG_COMMAND],[
|
||||||
# 1 is the command
|
# 1 is the command
|
||||||
# 2 is actions to do if success
|
# 2 is actions to do if success
|
||||||
# 3 is actions to do if fail
|
# 3 is actions to do if fail
|
||||||
echo "configure:__oline__: $1" >&5
|
echo "configure:__oline__: $1" >&5
|
||||||
$1 1>&5 2>&1
|
$1 1>&5 2>&1
|
||||||
lam_status=$?
|
ompi_status=$?
|
||||||
LAM_LOG_MSG([\$? = $lam_status], 1)
|
OMPI_LOG_MSG([\$? = $ompi_status], 1)
|
||||||
if test "$lam_status" = "0"; then
|
if test "$ompi_status" = "0"; then
|
||||||
unset lam_status
|
unset ompi_status
|
||||||
$2
|
$2
|
||||||
else
|
else
|
||||||
unset lam_status
|
unset ompi_status
|
||||||
$3
|
$3
|
||||||
fi])dnl
|
fi])dnl
|
||||||
|
|
||||||
@ -161,73 +161,73 @@ dnl #######################################################################
|
|||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
dnl #######################################################################
|
dnl #######################################################################
|
||||||
|
|
||||||
AC_DEFUN([LAM_UNIQ],[
|
AC_DEFUN([OMPI_UNIQ],[
|
||||||
# 1 is the variable name to be uniq-ized
|
# 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
|
# Go through each item in the variable and only keep the unique ones
|
||||||
|
|
||||||
lam_count=0
|
ompi_count=0
|
||||||
for val in ${$1}; do
|
for val in ${$1}; do
|
||||||
lam_done=0
|
ompi_done=0
|
||||||
lam_i=1
|
ompi_i=1
|
||||||
lam_found=0
|
ompi_found=0
|
||||||
|
|
||||||
# Loop over every token we've seen so far
|
# Loop over every token we've seen so far
|
||||||
|
|
||||||
lam_done="`expr $lam_i \> $lam_count`"
|
ompi_done="`expr $ompi_i \> $ompi_count`"
|
||||||
while test "$lam_found" = "0" -a "$lam_done" = "0"; do
|
while test "$ompi_found" = "0" -a "$ompi_done" = "0"; do
|
||||||
|
|
||||||
# Have we seen this token already? Prefix the comparison with
|
# Have we seen this token already? Prefix the comparison with
|
||||||
# "x" so that "-Lfoo" values won't be cause an error.
|
# "x" so that "-Lfoo" values won't be cause an error.
|
||||||
|
|
||||||
lam_eval="expr x$val = x\$lam_array_$lam_i"
|
ompi_eval="expr x$val = x\$ompi_array_$ompi_i"
|
||||||
lam_found=`eval $lam_eval`
|
ompi_found=`eval $ompi_eval`
|
||||||
|
|
||||||
# Check the ending condition
|
# Check the ending condition
|
||||||
|
|
||||||
lam_done="`expr $lam_i \>= $lam_count`"
|
ompi_done="`expr $ompi_i \>= $ompi_count`"
|
||||||
|
|
||||||
# Increment the counter
|
# Increment the counter
|
||||||
|
|
||||||
lam_i="`expr $lam_i + 1`"
|
ompi_i="`expr $ompi_i + 1`"
|
||||||
done
|
done
|
||||||
|
|
||||||
# If we didn't find the token, add it to the "array"
|
# If we didn't find the token, add it to the "array"
|
||||||
|
|
||||||
if test "$lam_found" = "0"; then
|
if test "$ompi_found" = "0"; then
|
||||||
lam_eval="lam_array_$lam_i=$val"
|
ompi_eval="ompi_array_$ompi_i=$val"
|
||||||
eval $lam_eval
|
eval $ompi_eval
|
||||||
lam_count="`expr $lam_count + 1`"
|
ompi_count="`expr $ompi_count + 1`"
|
||||||
else
|
else
|
||||||
lam_i="`expr $lam_i - 1`"
|
ompi_i="`expr $ompi_i - 1`"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Take all the items in the "array" and assemble them back into a
|
# Take all the items in the "array" and assemble them back into a
|
||||||
# single variable
|
# single variable
|
||||||
|
|
||||||
lam_i=1
|
ompi_i=1
|
||||||
lam_done="`expr $lam_i \> $lam_count`"
|
ompi_done="`expr $ompi_i \> $ompi_count`"
|
||||||
lam_newval=
|
ompi_newval=
|
||||||
while test "$lam_done" = "0"; do
|
while test "$ompi_done" = "0"; do
|
||||||
lam_eval="lam_newval=\"$lam_newval \$lam_array_$lam_i\""
|
ompi_eval="ompi_newval=\"$ompi_newval \$ompi_array_$ompi_i\""
|
||||||
eval $lam_eval
|
eval $ompi_eval
|
||||||
|
|
||||||
lam_eval="unset lam_array_$lam_i"
|
ompi_eval="unset ompi_array_$ompi_i"
|
||||||
eval $lam_eval
|
eval $ompi_eval
|
||||||
|
|
||||||
lam_done="`expr $lam_i \>= $lam_count`"
|
ompi_done="`expr $ompi_i \>= $ompi_count`"
|
||||||
lam_i="`expr $lam_i + 1`"
|
ompi_i="`expr $ompi_i + 1`"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Done; do the assignment
|
# Done; do the assignment
|
||||||
|
|
||||||
lam_newval="`echo $lam_newval`"
|
ompi_newval="`echo $ompi_newval`"
|
||||||
lam_eval="$lam_name=\"$lam_newval\""
|
ompi_eval="$ompi_name=\"$ompi_newval\""
|
||||||
eval $lam_eval
|
eval $ompi_eval
|
||||||
|
|
||||||
# Clean up
|
# 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
|
dnl $HEADER
|
||||||
denl
|
denl
|
||||||
|
|
||||||
AC_DEFUN([LAM_CHECK_LINKER_FLAGS],[
|
AC_DEFUN([OMPI_CHECK_LINKER_FLAGS],[
|
||||||
#
|
#
|
||||||
# libtool has been created by this point
|
# libtool has been created by this point
|
||||||
# Try to see if it will add any additional flags for dependant libraries
|
# 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; }
|
int foo(void) { return 0; }
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
lam_check_linker_flags_work() {
|
ompi_check_linker_flags_work() {
|
||||||
LAM_LOG_MSG([$cmd], [yes])
|
OMPI_LOG_MSG([$cmd], [yes])
|
||||||
eval $cmd >&5 2>&5
|
eval $cmd >&5 2>&5
|
||||||
if test -n "[$]1"; then
|
if test -n "[$]1"; then
|
||||||
output="`eval $cmd 2>/dev/null`"
|
output="`eval $cmd 2>/dev/null`"
|
||||||
fi
|
fi
|
||||||
status="$?"
|
status="$?"
|
||||||
LAM_LOG_MSG([\$? = $status], [yes])
|
OMPI_LOG_MSG([\$? = $status], [yes])
|
||||||
if test "$status" != "0"; then
|
if test "$status" != "0"; then
|
||||||
AC_MSG_RESULT([libtool error!])
|
AC_MSG_RESULT([libtool error!])
|
||||||
AC_MSG_ERROR([Cannot continue])
|
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"
|
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"
|
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
|
# 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"
|
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"
|
eval "set $output"
|
||||||
extra_ldflags=
|
extra_ldflags=
|
||||||
|
@ -3,14 +3,14 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_GET_VERSION],[
|
AC_DEFUN([OMPI_GET_VERSION],[
|
||||||
gv_glv_dir="$1"
|
gv_glv_dir="$1"
|
||||||
gv_ver_file="$2"
|
gv_ver_file="$2"
|
||||||
gv_prefix="$3"
|
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
|
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
|
# Since we do this in multiple places, it's worth putting in a
|
||||||
# separate shell script. Very primitive script to get the version
|
# 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.
|
# individual parts of the version number, too.
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -14,33 +14,33 @@ option="$2"
|
|||||||
if test "$srcfile" = ""; then
|
if test "$srcfile" = ""; then
|
||||||
option="--help"
|
option="--help"
|
||||||
else
|
else
|
||||||
LAM_MAJOR_VERSION="`cat $srcfile | grep major | cut -d= -f2`"
|
OMPI_MAJOR_VERSION="`cat $srcfile | grep major | cut -d= -f2`"
|
||||||
LAM_MINOR_VERSION="`cat $srcfile | grep minor | cut -d= -f2`"
|
OMPI_MINOR_VERSION="`cat $srcfile | grep minor | cut -d= -f2`"
|
||||||
LAM_RELEASE_VERSION="`cat $srcfile | grep release | cut -d= -f2`"
|
OMPI_RELEASE_VERSION="`cat $srcfile | grep release | cut -d= -f2`"
|
||||||
LAM_ALPHA_VERSION="`cat $srcfile | grep alpha | cut -d= -f2`"
|
OMPI_ALPHA_VERSION="`cat $srcfile | grep alpha | cut -d= -f2`"
|
||||||
LAM_BETA_VERSION="`cat $srcfile | grep beta | cut -d= -f2`"
|
OMPI_BETA_VERSION="`cat $srcfile | grep beta | cut -d= -f2`"
|
||||||
LAM_SVN_VERSION="`cat $srcfile | grep svn | cut -d= -f2`"
|
OMPI_SVN_VERSION="`cat $srcfile | grep svn | cut -d= -f2`"
|
||||||
if test "$LAM_RELEASE_VERSION" != "0" -a "$LAM_RELEASE_VERSION" != ""; then
|
if test "$OMPI_RELEASE_VERSION" != "0" -a "$OMPI_RELEASE_VERSION" != ""; then
|
||||||
LAM_VERSION="$LAM_MAJOR_VERSION.$LAM_MINOR_VERSION.$LAM_RELEASE_VERSION"
|
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION.$OMPI_RELEASE_VERSION"
|
||||||
else
|
else
|
||||||
LAM_VERSION="$LAM_MAJOR_VERSION.$LAM_MINOR_VERSION"
|
OMPI_VERSION="$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "`expr $LAM_ALPHA_VERSION \> 0`" = "1"; then
|
if test "`expr $OMPI_ALPHA_VERSION \> 0`" = "1"; then
|
||||||
LAM_VERSION="${LAM_VERSION}a$LAM_ALPHA_VERSION"
|
OMPI_VERSION="${OMPI_VERSION}a$OMPI_ALPHA_VERSION"
|
||||||
elif test "`expr $LAM_BETA_VERSION \> 0`" = "1"; then
|
elif test "`expr $OMPI_BETA_VERSION \> 0`" = "1"; then
|
||||||
LAM_VERSION="${LAM_VERSION}b$LAM_BETA_VERSION"
|
OMPI_VERSION="${OMPI_VERSION}b$OMPI_BETA_VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$LAM_SVN_VERSION" = "1"; then
|
if test "$OMPI_SVN_VERSION" = "1"; then
|
||||||
LAM_VERSION="${LAM_VERSION}svn"
|
OMPI_VERSION="${OMPI_VERSION}svn"
|
||||||
elif test "`expr $LAM_SVN_VERSION \> 0`" = "1"; then
|
elif test "`expr $OMPI_SVN_VERSION \> 0`" = "1"; then
|
||||||
if test -d .svn; then
|
if test -d .svn; then
|
||||||
ver="r`svn info . | grep Revision | cut -d\ -f 2`"
|
ver="r`svn info . | grep Revision | cut -d\ -f 2`"
|
||||||
else
|
else
|
||||||
ver="svn`date '+%m%d%Y'`"
|
ver="svn`date '+%m%d%Y'`"
|
||||||
fi
|
fi
|
||||||
LAM_VERSION="${LAM_VERSION}$ver"
|
OMPI_VERSION="${OMPI_VERSION}$ver"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$option" = ""; then
|
if test "$option" = ""; then
|
||||||
@ -50,28 +50,28 @@ fi
|
|||||||
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
--full|-v|--version)
|
--full|-v|--version)
|
||||||
echo $LAM_VERSION
|
echo $OMPI_VERSION
|
||||||
;;
|
;;
|
||||||
--major)
|
--major)
|
||||||
echo $LAM_MAJOR_VERSION
|
echo $OMPI_MAJOR_VERSION
|
||||||
;;
|
;;
|
||||||
--minor)
|
--minor)
|
||||||
echo $LAM_MINOR_VERSION
|
echo $OMPI_MINOR_VERSION
|
||||||
;;
|
;;
|
||||||
--release)
|
--release)
|
||||||
echo $LAM_RELEASE_VERSION
|
echo $OMPI_RELEASE_VERSION
|
||||||
;;
|
;;
|
||||||
--alpha)
|
--alpha)
|
||||||
echo $LAM_ALPHA_VERSION
|
echo $OMPI_ALPHA_VERSION
|
||||||
;;
|
;;
|
||||||
--beta)
|
--beta)
|
||||||
echo $LAM_BETA_VERSION
|
echo $OMPI_BETA_VERSION
|
||||||
;;
|
;;
|
||||||
--svn)
|
--svn)
|
||||||
echo $LAM_SVN_VERSION
|
echo $OMPI_SVN_VERSION
|
||||||
;;
|
;;
|
||||||
--all)
|
--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)
|
-h|--help)
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_MCA],[
|
AC_DEFUN([OMPI_MCA],[
|
||||||
|
|
||||||
# Find which modules should be built as run-time loadable modules
|
# Find which modules should be built as run-time loadable modules
|
||||||
# Acceptable combinations:
|
# Acceptable combinations:
|
||||||
@ -17,7 +17,7 @@ AC_DEFUN([LAM_MCA],[
|
|||||||
AC_MSG_CHECKING([which modules should be run-time loadable])
|
AC_MSG_CHECKING([which modules should be run-time loadable])
|
||||||
AC_ARG_WITH(modules,
|
AC_ARG_WITH(modules,
|
||||||
AC_HELP_STRING([--with-modules=LIST],
|
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
|
if test "$with_modules" = "" -o "$with_modules" = "no"; then
|
||||||
LOADABLE_MODULE_all=0
|
LOADABLE_MODULE_all=0
|
||||||
@ -97,14 +97,14 @@ for type in $found_types; do
|
|||||||
$outfile.all $outfile.static $outfile.dynamic
|
$outfile.all $outfile.static $outfile.dynamic
|
||||||
|
|
||||||
# Manual conversion of $type to its generic name (e.g., crmpi->cr,
|
# Manual conversion of $type to its generic name (e.g., crmpi->cr,
|
||||||
# crlam->cr).
|
# crompi->cr).
|
||||||
# JMS Fix this
|
# JMS Fix this
|
||||||
|
|
||||||
case "$type" in
|
case "$type" in
|
||||||
crmpi)
|
crmpi)
|
||||||
generic_type="cr"
|
generic_type="cr"
|
||||||
;;
|
;;
|
||||||
crlam)
|
crompi)
|
||||||
generic_type="cr"
|
generic_type="cr"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -120,8 +120,8 @@ for type in $found_types; do
|
|||||||
for module in $found_modules; do
|
for module in $found_modules; do
|
||||||
m=`basename "$module"`
|
m=`basename "$module"`
|
||||||
|
|
||||||
if test -d $srcdir/$module -a ! -f $srcdir/$module/.lam_ignore; then
|
if test -d $srcdir/$module -a ! -f $srcdir/$module/.ompi_ignore; then
|
||||||
lam_show_subtitle "MCA module $type:$m (no configure script)"
|
ompi_show_subtitle "MCA module $type:$m (no configure script)"
|
||||||
|
|
||||||
# Remove any possible sym link in the mca-dynamic tree
|
# Remove any possible sym link in the mca-dynamic tree
|
||||||
|
|
||||||
@ -157,8 +157,8 @@ for type in $found_types; do
|
|||||||
HAPPY=0
|
HAPPY=0
|
||||||
m="`basename $module`"
|
m="`basename $module`"
|
||||||
if test -d $module -a -x $module/configure -a \
|
if test -d $module -a -x $module/configure -a \
|
||||||
! -f $module/.lam_ignore; then
|
! -f $module/.ompi_ignore; then
|
||||||
lam_show_subtitle "MCA module $type:$m (need to configure)"
|
ompi_show_subtitle "MCA module $type:$m (need to configure)"
|
||||||
|
|
||||||
# We found one!
|
# We found one!
|
||||||
|
|
||||||
@ -170,8 +170,8 @@ for type in $found_types; do
|
|||||||
|
|
||||||
# Configure the module subdirectory
|
# Configure the module subdirectory
|
||||||
|
|
||||||
LAM_CONFIG_SUBDIR([src/mca/$type/$m],
|
OMPI_CONFIG_SUBDIR([src/mca/$type/$m],
|
||||||
[$lam_subdir_args],
|
[$ompi_subdir_args],
|
||||||
[HAPPY=1], [HAPPY=0])
|
[HAPPY=1], [HAPPY=0])
|
||||||
fi
|
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
|
# Grumble. It seems that AC_SUBST and AC_DEFINE don't let you
|
||||||
# substitue on a variable name that contains a variable (e.g.,
|
# 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_ALL_SUBDIRS)
|
||||||
AC_SUBST(MCA_oob_STATIC_SUBDIRS)
|
AC_SUBST(MCA_oob_STATIC_SUBDIRS)
|
||||||
@ -329,7 +329,7 @@ if test "$HAPPY" = "1"; then
|
|||||||
compile_mode="dynamic"
|
compile_mode="dynamic"
|
||||||
echo $m >> $outfile.dynamic
|
echo $m >> $outfile.dynamic
|
||||||
ls -l "src/mca/dynamic/$type/$m"
|
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"
|
"src/mca/dynamic/$type/$m"
|
||||||
ls -l "src/mca/dynamic/$type/$m"
|
ls -l "src/mca/dynamic/$type/$m"
|
||||||
else
|
else
|
||||||
@ -362,7 +362,7 @@ if test "$HAPPY" = "1"; then
|
|||||||
|
|
||||||
# Now check for the rest of the tags
|
# 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
|
for flags in CFLAGS CXXFLAGS FFLAGS LDFLAGS LIBS; do
|
||||||
var="${scope}_EXTRA_${flags}"
|
var="${scope}_EXTRA_${flags}"
|
||||||
line="`grep $var= $infile | cut -d= -f2-`"
|
line="`grep $var= $infile | cut -d= -f2-`"
|
||||||
|
@ -3,12 +3,12 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_SETUP_CC],[
|
AC_DEFUN([OMPI_SETUP_CC],[
|
||||||
|
|
||||||
# Modularize this setup so that sub-configure.in scripts can use this
|
# Modularize this setup so that sub-configure.in scripts can use this
|
||||||
# same setup code.
|
# 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
|
# $%@#!@#% AIX!! This has to be called before anything invokes the C
|
||||||
# compiler.
|
# compiler.
|
||||||
@ -19,25 +19,25 @@ dnl AC_AIX
|
|||||||
# Check for the compiler
|
# Check for the compiler
|
||||||
#
|
#
|
||||||
|
|
||||||
lam_cflags_save="$CFLAGS"
|
ompi_cflags_save="$CFLAGS"
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
BASECC="`basename $CC`"
|
BASECC="`basename $CC`"
|
||||||
CFLAGS="$lam_cflags_save"
|
CFLAGS="$ompi_cflags_save"
|
||||||
AC_DEFINE_UNQUOTED(LAM_CC, "$CC", [LAM underlying C compiler])
|
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?
|
# Do we want debugging?
|
||||||
|
|
||||||
if test "$WANT_DEBUG" = "1"; then
|
if test "$WANT_DEBUG" = "1"; then
|
||||||
CFLAGS="$CFLAGS -g"
|
CFLAGS="$CFLAGS -g"
|
||||||
LAM_UNIQ(CFLAGS)
|
OMPI_UNIQ(CFLAGS)
|
||||||
AC_MSG_WARN([-g has been added to CFLAGS (--enable-debug)])
|
AC_MSG_WARN([-g has been added to CFLAGS (--enable-debug)])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LAM_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
OMPI_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
||||||
if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||||
add="-Wall -Wundef -Wno-long-long"
|
add="-Wall -Wundef -Wno-long-long"
|
||||||
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
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 "
|
add="$add -Werror-implicit-function-declaration "
|
||||||
|
|
||||||
CFLAGS="$CFLAGS $add"
|
CFLAGS="$CFLAGS $add"
|
||||||
LAM_UNIQ(CFLAGS)
|
OMPI_UNIQ(CFLAGS)
|
||||||
AC_MSG_WARN([$add has been added to CFLAGS (developer copy)])
|
AC_MSG_WARN([$add has been added to CFLAGS (developer copy)])
|
||||||
unset add
|
unset add
|
||||||
fi
|
fi
|
||||||
@ -64,7 +64,7 @@ if test "$GCC" = "yes"; then
|
|||||||
add=
|
add=
|
||||||
AC_TRY_COMPILE([], [], add=" -finline-functions")
|
AC_TRY_COMPILE([], [], add=" -finline-functions")
|
||||||
CFLAGS="$CFLAGS_orig$add"
|
CFLAGS="$CFLAGS_orig$add"
|
||||||
LAM_UNIQ(CFLAGS)
|
OMPI_UNIQ(CFLAGS)
|
||||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
AC_MSG_WARN([$add has been added to CFLAGS])
|
||||||
unset add
|
unset add
|
||||||
fi
|
fi
|
||||||
@ -82,10 +82,10 @@ else
|
|||||||
OPTFLAGS="-O"
|
OPTFLAGS="-O"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LAM_CHECK_OPTFLAGS("$LAM_CFLAGS_BEFORE_PICKY")
|
OMPI_CHECK_OPTFLAGS("$OMPI_CFLAGS_BEFORE_PICKY")
|
||||||
LAM_CFLAGS_BEFORE_PICKY="$co_result"
|
OMPI_CFLAGS_BEFORE_PICKY="$co_result"
|
||||||
|
|
||||||
AC_MSG_CHECKING([for C optimization flags])
|
AC_MSG_CHECKING([for C optimization flags])
|
||||||
LAM_CHECK_OPTFLAGS("$CFLAGS")
|
OMPI_CHECK_OPTFLAGS("$CFLAGS")
|
||||||
AC_MSG_RESULT([$co_result])
|
AC_MSG_RESULT([$co_result])
|
||||||
CFLAGS="$co_result"])
|
CFLAGS="$co_result"])
|
||||||
|
@ -3,29 +3,29 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([LAM_SETUP_CXX],[
|
AC_DEFUN([OMPI_SETUP_CXX],[
|
||||||
|
|
||||||
# Modularize this setup so that sub-configure.in scripts can use this
|
# Modularize this setup so that sub-configure.in scripts can use this
|
||||||
# same setup code.
|
# 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_CXX
|
||||||
AC_PROG_CXXCPP
|
AC_PROG_CXXCPP
|
||||||
BASECXX="`basename $CXX`"
|
BASECXX="`basename $CXX`"
|
||||||
CXXFLAGS="$lam_cxxflags_save"
|
CXXFLAGS="$ompi_cxxflags_save"
|
||||||
AC_DEFINE_UNQUOTED(LAM_CXX, "$CXX", [LAM underlying C++ compiler])
|
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
|
||||||
|
|
||||||
# Do we want debugging?
|
# Do we want debugging?
|
||||||
|
|
||||||
if test "$WANT_DEBUG" = "1"; then
|
if test "$WANT_DEBUG" = "1"; then
|
||||||
CXXFLAGS="$CXXFLAGS -g"
|
CXXFLAGS="$CXXFLAGS -g"
|
||||||
LAM_UNIQ(CXXFLAGS)
|
OMPI_UNIQ(CXXFLAGS)
|
||||||
AC_MSG_WARN([-g has been added to CXXFLAGS (--enable-debug)])
|
AC_MSG_WARN([-g has been added to CXXFLAGS (--enable-debug)])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LAM_CXXFLAGS_BEFORE_PICKY="$CXXFLAGS"
|
OMPI_CXXFLAGS_BEFORE_PICKY="$CXXFLAGS"
|
||||||
if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||||
add="-g -Wall -Wundef -Wno-long-long"
|
add="-g -Wall -Wundef -Wno-long-long"
|
||||||
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
||||||
@ -39,7 +39,7 @@ if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
|||||||
AC_LANG_POP(C++)
|
AC_LANG_POP(C++)
|
||||||
|
|
||||||
CXXFLAGS="$CXXFLAGS $add"
|
CXXFLAGS="$CXXFLAGS $add"
|
||||||
LAM_UNIQ(CXXFLAGS)
|
OMPI_UNIQ(CXXFLAGS)
|
||||||
AC_MSG_WARN([$add has been added to CXXFLAGS (developer copy)])
|
AC_MSG_WARN([$add has been added to CXXFLAGS (developer copy)])
|
||||||
unset add
|
unset add
|
||||||
fi
|
fi
|
||||||
@ -51,7 +51,7 @@ if test "$GCC" = "yes"; then
|
|||||||
add=
|
add=
|
||||||
AC_TRY_COMPILE([], [], add=" -finline-functions")
|
AC_TRY_COMPILE([], [], add=" -finline-functions")
|
||||||
CXXFLAGS="$CXXFLAGS_orig$add"
|
CXXFLAGS="$CXXFLAGS_orig$add"
|
||||||
LAM_UNIQ(CXXFLAGS)
|
OMPI_UNIQ(CXXFLAGS)
|
||||||
AC_MSG_WARN([$add has been added to CXXFLAGS])
|
AC_MSG_WARN([$add has been added to CXXFLAGS])
|
||||||
unset add
|
unset add
|
||||||
fi
|
fi
|
||||||
@ -74,30 +74,30 @@ AC_MSG_CHECKING([if want C++ exception handling])
|
|||||||
AC_MSG_RESULT([$ENABLE_CXX_EXCEPTIONS])
|
AC_MSG_RESULT([$ENABLE_CXX_EXCEPTIONS])
|
||||||
if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
||||||
# config/cxx_have_exceptions.m4
|
# config/cxx_have_exceptions.m4
|
||||||
LAM_CXX_HAVE_EXCEPTIONS
|
OMPI_CXX_HAVE_EXCEPTIONS
|
||||||
# config/cxx_find_exception_flags.m4
|
# config/cxx_find_exception_flags.m4
|
||||||
LAM_CXX_FIND_EXCEPTION_FLAGS
|
OMPI_CXX_FIND_EXCEPTION_FLAGS
|
||||||
if test "$LAM_CXX_EXCEPTIONS" = "1"; then
|
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
|
||||||
HAVE_CXX_EXCEPTIONS=1
|
HAVE_CXX_EXCEPTIONS=1
|
||||||
CFLAGS="$CFLAGS $LAM_CXX_EXCEPTIONS_CFLAGS"
|
CFLAGS="$CFLAGS $OMPI_CXX_EXCEPTIONS_CFLAGS"
|
||||||
FFLAGS="$FFLAGS $LAM_CXX_EXCEPTIONS_FFLAGS"
|
FFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_FFLAGS"
|
||||||
CXXFLAGS="$CXXFLAGS $LAM_CXX_EXCEPTIONS_CXXFLAGS"
|
CXXFLAGS="$CXXFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||||
LDFLAGS="$LDFLAGS $LAM_CXX_EXCEPTIONS_LDFLAGS"
|
LDFLAGS="$LDFLAGS $OMPI_CXX_EXCEPTIONS_LDFLAGS"
|
||||||
|
|
||||||
WRAPPER_EXTRA_CFLAGS="$LAM_CXX_EXCEPTIONS_CFLAGS"
|
WRAPPER_EXTRA_CFLAGS="$OMPI_CXX_EXCEPTIONS_CFLAGS"
|
||||||
WRAPPER_EXTRA_FFLAGS="$LAM_CXX_EXCEPTIONS_FFLAGS"
|
WRAPPER_EXTRA_FFLAGS="$OMPI_CXX_EXCEPTIONS_FFLAGS"
|
||||||
WRAPPER_EXTRA_CXXFLAGS="$LAM_CXX_EXCEPTIONS_CXXFLAGS"
|
WRAPPER_EXTRA_CXXFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||||
fi
|
fi
|
||||||
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])
|
[Whether or not we have compiled with C++ exceptions support])
|
||||||
|
|
||||||
# Find some more characteristics of the C++ compiler
|
# Find some more characteristics of the C++ compiler
|
||||||
|
|
||||||
# config/cxx_find_template_repository.m4
|
# config/cxx_find_template_repository.m4
|
||||||
LAM_CXX_FIND_TEMPLATE_REPOSITORY
|
OMPI_CXX_FIND_TEMPLATE_REPOSITORY
|
||||||
# config/cxx_find_template_parameters.m4
|
# 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
|
# If we are on HP-UX, ensure that we're using aCC
|
||||||
case "$host" in
|
case "$host" in
|
||||||
@ -111,15 +111,15 @@ case "$host" in
|
|||||||
;;
|
;;
|
||||||
esac
|
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
|
if test "$GXX" = yes; then
|
||||||
OPTFLAGS="-O3"
|
OPTFLAGS="-O3"
|
||||||
else
|
else
|
||||||
OPTFLAGS="-O"
|
OPTFLAGS="-O"
|
||||||
fi
|
fi
|
||||||
# config/lam_check_optflags.m4
|
# config/ompi_check_optflags.m4
|
||||||
LAM_CHECK_OPTFLAGS("$CXXFLAGS")
|
OMPI_CHECK_OPTFLAGS("$CXXFLAGS")
|
||||||
AC_MSG_CHECKING([for C++ optimization flags])
|
AC_MSG_CHECKING([for C++ optimization flags])
|
||||||
AC_MSG_RESULT([$co_result])
|
AC_MSG_RESULT([$co_result])
|
||||||
CXXFLAGS="$co_result"
|
CXXFLAGS="$co_result"
|
||||||
|
@ -5,57 +5,57 @@ dnl
|
|||||||
dnl sets:
|
dnl sets:
|
||||||
dnl F77 : full pathname to compiler
|
dnl F77 : full pathname to compiler
|
||||||
dnl BASEF77 : compiler name (no path)
|
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 redefined here)
|
||||||
dnl FC : Same as F77. Side effect of AC_PROG_FC. Should
|
dnl FC : Same as F77. Side effect of AC_PROG_FC. Should
|
||||||
dnl not be used
|
dnl not be used
|
||||||
dnl defines:
|
dnl defines:
|
||||||
dnl LAM_F77 : same as F77
|
dnl OMPI_F77 : same as F77
|
||||||
dnl LAM_WANT_F77_BINDINGS :
|
dnl OMPI_WANT_F77_BINDINGS :
|
||||||
dnl am_conditional:
|
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
|
# Modularize this setup so that sub-configure.in scripts can use this
|
||||||
# same setup code.
|
# same setup code.
|
||||||
|
|
||||||
lam_show_subtitle "Fortran 77 compiler"
|
ompi_show_subtitle "Fortran 77 compiler"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for the compiler
|
# Check for the compiler
|
||||||
#
|
#
|
||||||
# Note that we don't actually *use* the fortran compiler to build
|
# 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
|
# symbol conventions, type sizes, etc. We also pass it down to
|
||||||
# the wrapper compiler mpif77.
|
# the wrapper compiler mpif77.
|
||||||
#
|
#
|
||||||
# Always run this test, even if fortran isn't wanted so that F77 has
|
# Always run this test, even if fortran isn't wanted so that F77 has
|
||||||
# value for the Fint tests
|
# value for the Fint tests
|
||||||
#
|
#
|
||||||
lam_fflags_save="$FFLAGS"
|
ompi_fflags_save="$FFLAGS"
|
||||||
AC_PROG_F77
|
AC_PROG_F77
|
||||||
FFLAGS="$lam_fflags_save"
|
FFLAGS="$ompi_fflags_save"
|
||||||
if test -z "$F77"; then
|
if test -z "$F77"; then
|
||||||
AC_MSG_WARN([*** Fortran 77 bindings disabled (could not find compiler)])
|
AC_MSG_WARN([*** Fortran 77 bindings disabled (could not find compiler)])
|
||||||
LAM_WANT_F77_BINDINGS=0
|
OMPI_WANT_F77_BINDINGS=0
|
||||||
LAM_F77="none"
|
OMPI_F77="none"
|
||||||
BASEF77="none"
|
BASEF77="none"
|
||||||
else
|
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])
|
AC_MSG_WARN([*** Fortran 77 bindings disabled by user])
|
||||||
LAM_WANT_F77_BINDINGS=0
|
OMPI_WANT_F77_BINDINGS=0
|
||||||
LAM_F77="$F77"
|
OMPI_F77="$F77"
|
||||||
BASEF77="`basename $LAM_F77`"
|
BASEF77="`basename $OMPI_F77`"
|
||||||
else
|
else
|
||||||
LAM_WANT_F77_BINDINGS=1
|
OMPI_WANT_F77_BINDINGS=1
|
||||||
LAM_F77="$F77"
|
OMPI_F77="$F77"
|
||||||
BASEF77="`basename $LAM_F77`"
|
BASEF77="`basename $OMPI_F77`"
|
||||||
fi
|
fi
|
||||||
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])
|
[Whether we want the MPI f77 bindings or not])
|
||||||
AC_DEFINE_UNQUOTED(LAM_F77, "$LAM_F77", [LAM underlying F77 compiler])
|
AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])
|
||||||
AM_CONDITIONAL(LAM_WANT_F77_BINDINGS, test "$LAM_WANT_F77_BINDINGS" = "1")
|
AM_CONDITIONAL(OMPI_WANT_F77_BINDINGS, test "$OMPI_WANT_F77_BINDINGS" = "1")
|
||||||
])
|
])
|
||||||
|
@ -2,37 +2,37 @@ dnl -*- shell-script -*-
|
|||||||
dnl
|
dnl
|
||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
dnl
|
||||||
dnl LAM_SETUP_F90
|
dnl OMPI_SETUP_F90
|
||||||
dnl
|
dnl
|
||||||
dnl sets:
|
dnl sets:
|
||||||
dnl F90 : full pathname to compiler
|
dnl F90 : full pathname to compiler
|
||||||
dnl BASEF90 : compiler name (no path)
|
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 redefined here)
|
||||||
dnl FC : Same as F90. Side effect of AC_PROG_FC. Should
|
dnl FC : Same as F90. Side effect of AC_PROG_FC. Should
|
||||||
dnl not be used
|
dnl not be used
|
||||||
dnl defines:
|
dnl defines:
|
||||||
dnl LAM_F90 : same as F90
|
dnl OMPI_F90 : same as F90
|
||||||
dnl LAM_WANT_F90_BINDINGS :
|
dnl OMPI_WANT_F90_BINDINGS :
|
||||||
dnl am_conditional:
|
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
|
# Modularize this setup so that sub-configure.in scripts can use this
|
||||||
# same setup code.
|
# 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)])
|
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (Fortran 77 was disabled)])
|
||||||
LAM_WANT_F90_BINDINGS=0
|
OMPI_WANT_F90_BINDINGS=0
|
||||||
LAM_F90="none"
|
OMPI_F90="none"
|
||||||
BASEF90="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])
|
AC_MSG_WARN([*** Fortran 90/95 bindings disabled by user])
|
||||||
LAM_WANT_F90_BINDINGS=0
|
OMPI_WANT_F90_BINDINGS=0
|
||||||
LAM_F90="none"
|
OMPI_F90="none"
|
||||||
BASEF90="none"
|
BASEF90="none"
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -40,28 +40,28 @@ else
|
|||||||
# Check for the compiler
|
# Check for the compiler
|
||||||
#
|
#
|
||||||
# Note that we don't actually *use* the fortran compiler to build
|
# 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
|
# symbol conventions, type sizes, etc. We also pass it down to
|
||||||
# the wrapper compiler mpif90.
|
# the wrapper compiler mpif90.
|
||||||
#
|
#
|
||||||
|
|
||||||
lam_fcflags_save="$FCFLAGS"
|
ompi_fcflags_save="$FCFLAGS"
|
||||||
AC_PROG_FC
|
AC_PROG_FC
|
||||||
FCFLAGS="$lam_fcflags_save"
|
FCFLAGS="$ompi_fcflags_save"
|
||||||
if test -z "$FC"; then
|
if test -z "$FC"; then
|
||||||
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (could not find compiler)])
|
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (could not find compiler)])
|
||||||
LAM_WANT_F90_BINDINGS=0
|
OMPI_WANT_F90_BINDINGS=0
|
||||||
LAM_F90="none"
|
OMPI_F90="none"
|
||||||
BASEF90="none"
|
BASEF90="none"
|
||||||
elif test "$FC" = "$F77"; then
|
elif test "$FC" = "$F77"; then
|
||||||
AC_MSG_WARN([*** Found same compiler for Fortran 77 and 90/95.])
|
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([*** Assuming no Fortran 90/95 compiler; disabling])
|
||||||
AC_MSG_WARN([*** Fortran 90/95 MPI bindings.])
|
AC_MSG_WARN([*** Fortran 90/95 MPI bindings.])
|
||||||
LAM_WANT_F90_BINDINGS=0
|
OMPI_WANT_F90_BINDINGS=0
|
||||||
LAM_F90="none"
|
OMPI_F90="none"
|
||||||
BASEF90="none"
|
BASEF90="none"
|
||||||
else
|
else
|
||||||
LAM_F90="$FC"
|
OMPI_F90="$FC"
|
||||||
BASEF90="`basename $FC`"
|
BASEF90="`basename $FC`"
|
||||||
|
|
||||||
AC_LANG_PUSH(Fortran)
|
AC_LANG_PUSH(Fortran)
|
||||||
@ -70,29 +70,29 @@ else
|
|||||||
AC_FC_SRCEXT(f95)
|
AC_FC_SRCEXT(f95)
|
||||||
AC_LANG_POP(Fortran)
|
AC_LANG_POP(Fortran)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether $LAM_F77 and $LAM_F90 compilers are compatible])
|
AC_MSG_CHECKING([whether $OMPI_F77 and $OMPI_F90 compilers are compatible])
|
||||||
LAM_INTL_F90_F77_INTERACTION(fortran_goodness=1, fortran_goodness=0)
|
OMPI_INTL_F90_F77_INTERACTION(fortran_goodness=1, fortran_goodness=0)
|
||||||
if test "$fortran_goodness" = "0" ; then
|
if test "$fortran_goodness" = "0" ; then
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
AC_MSG_WARN([*** Fortran 77 and Fortran 90 compilers are not link compatible])
|
AC_MSG_WARN([*** Fortran 77 and Fortran 90 compilers are not link compatible])
|
||||||
AC_MSG_WARN([*** Disabling Fortran 90/95 bindings])
|
AC_MSG_WARN([*** Disabling Fortran 90/95 bindings])
|
||||||
LAM_WANT_F90_BINDINGS=0
|
OMPI_WANT_F90_BINDINGS=0
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
LAM_WANT_F90_BINDINGS=1
|
OMPI_WANT_F90_BINDINGS=1
|
||||||
fi
|
fi
|
||||||
fi
|
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])
|
[Whether we want the MPI f90 bindings or not])
|
||||||
AC_DEFINE_UNQUOTED(LAM_F90, "$LAM_F90", [LAM underlying F90 compiler])
|
AC_DEFINE_UNQUOTED(OMPI_F90, "$OMPI_F90", [OMPI underlying F90 compiler])
|
||||||
AM_CONDITIONAL(LAM_WANT_F90_BINDINGS, test "$LAM_WANT_F90_BINDINGS" = "1")
|
AM_CONDITIONAL(OMPI_WANT_F90_BINDINGS, test "$OMPI_WANT_F90_BINDINGS" = "1")
|
||||||
unset fortran_goodness
|
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
|
# make sure that we can combine F90 and F77 code
|
||||||
AC_LANG_PUSH(Fortran)
|
AC_LANG_PUSH(Fortran)
|
||||||
# Fortran module
|
# Fortran module
|
||||||
@ -107,12 +107,12 @@ cat > conftestf90.f <<EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Try the compile
|
# Try the compile
|
||||||
LAM_LOG_COMMAND(
|
OMPI_LOG_COMMAND(
|
||||||
[$LAM_F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
|
[$OMPI_F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
|
||||||
LAM_LOG_COMMAND(
|
OMPI_LOG_COMMAND(
|
||||||
[$LAM_F77 $FFLAGS -c conftestf77.f],
|
[$OMPI_F77 $FFLAGS -c conftestf77.f],
|
||||||
LAM_LOG_COMMAND(
|
OMPI_LOG_COMMAND(
|
||||||
[$LAM_F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LIBS],
|
[$OMPI_F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LIBS],
|
||||||
[HAPPY=1],
|
[HAPPY=1],
|
||||||
[HAPPY=0]),
|
[HAPPY=0]),
|
||||||
[HAPPY=0]),
|
[HAPPY=0]),
|
||||||
@ -121,14 +121,14 @@ LAM_LOG_COMMAND(
|
|||||||
if test "$HAPPY" = "1"; then
|
if test "$HAPPY" = "1"; then
|
||||||
$1
|
$1
|
||||||
else
|
else
|
||||||
LAM_LOG_MSG([here is the F77 program:], 1)
|
OMPI_LOG_MSG([here is the F77 program:], 1)
|
||||||
LAM_LOG_FILE([conftestf77.f])
|
OMPI_LOG_FILE([conftestf77.f])
|
||||||
LAM_LOG_MSG([here is the F90 program:], 1)
|
OMPI_LOG_MSG([here is the F90 program:], 1)
|
||||||
LAM_LOG_FILE([conftestf90.f90])
|
OMPI_LOG_FILE([conftestf90.f90])
|
||||||
$2
|
$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset HAPPY lam_conftest_h
|
unset HAPPY ompi_conftest_h
|
||||||
/bin/rm -f conftest*
|
/bin/rm -f conftest*
|
||||||
|
|
||||||
AC_LANG_POP(Fortran)
|
AC_LANG_POP(Fortran)
|
||||||
|
@ -2,9 +2,9 @@ dnl
|
|||||||
dnl $HEADER$
|
dnl $HEADER$
|
||||||
dnl
|
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=
|
sources=
|
||||||
|
|
||||||
dnl Check for optional stuff
|
dnl Check for optional stuff
|
||||||
@ -58,7 +58,7 @@ needsignal=no
|
|||||||
haveselect=no
|
haveselect=no
|
||||||
AC_CHECK_FUNCS(select, [haveselect=yes], )
|
AC_CHECK_FUNCS(select, [haveselect=yes], )
|
||||||
if test "x$haveselect" = "xyes" ; then
|
if test "x$haveselect" = "xyes" ; then
|
||||||
# LAM: Don't use AC_LIBOBJ
|
# OMPI: Don't use AC_LIBOBJ
|
||||||
sources="select.c $sources"
|
sources="select.c $sources"
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
fi
|
fi
|
||||||
@ -67,7 +67,7 @@ havepoll=no
|
|||||||
havertsig=no
|
havertsig=no
|
||||||
AC_CHECK_FUNCS(poll, [havepoll=yes], )
|
AC_CHECK_FUNCS(poll, [havepoll=yes], )
|
||||||
if test "x$havepoll" = "xyes" ; then
|
if test "x$havepoll" = "xyes" ; then
|
||||||
# LAM: Don't use AC_LIBOBJ
|
# OMPI: Don't use AC_LIBOBJ
|
||||||
sources="poll.c $sources"
|
sources="poll.c $sources"
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ yes
|
|||||||
fi
|
fi
|
||||||
if test "x$havertsig" = "xyes" ; then
|
if test "x$havertsig" = "xyes" ; then
|
||||||
AC_DEFINE(HAVE_RTSIG, 1, [Define if your system supports POSIX realtime signals])
|
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"
|
sources="rtsig.c $sources"
|
||||||
AC_MSG_CHECKING(for working rtsig on pipes)
|
AC_MSG_CHECKING(for working rtsig on pipes)
|
||||||
AC_TRY_RUN(
|
AC_TRY_RUN(
|
||||||
@ -125,7 +125,7 @@ AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
|
|||||||
if test "x$haveepoll" = "xyes" ; then
|
if test "x$haveepoll" = "xyes" ; then
|
||||||
AC_DEFINE(HAVE_EPOLL, 1,
|
AC_DEFINE(HAVE_EPOLL, 1,
|
||||||
[Define if your system supports the epoll system calls])
|
[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"
|
sources="epoll.c $sources"
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
fi
|
fi
|
||||||
@ -184,7 +184,7 @@ main(int argc, char **argv)
|
|||||||
AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
|
AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
|
||||||
[Define if kqueue works correctly with pipes])
|
[Define if kqueue works correctly with pipes])
|
||||||
sources="kqueue.c $sources"], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -217,14 +217,14 @@ main(int argc, char **argv)
|
|||||||
AC_DEFINE(HAVE_EPOLL, 1,
|
AC_DEFINE(HAVE_EPOLL, 1,
|
||||||
[Define if your system supports the epoll system calls])
|
[Define if your system supports the epoll system calls])
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
# LAM: don't use AC_LIBOBJ
|
# OMPI: don't use AC_LIBOBJ
|
||||||
sources="epoll_sub.c epoll.c $sources"
|
sources="epoll_sub.c epoll.c $sources"
|
||||||
], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$needsignal" = "xyes" ; then
|
if test "x$needsignal" = "xyes" ; then
|
||||||
# LAM: don't use AC_LIBOBJ
|
# OMPI: don't use AC_LIBOBJ
|
||||||
sources="signal.c $sources"
|
sources="signal.c $sources"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -249,9 +249,9 @@ AC_TRY_COMPILE([
|
|||||||
[Define to unsigned int if you dont have it])]
|
[Define to unsigned int if you dont have it])]
|
||||||
)
|
)
|
||||||
|
|
||||||
# LAM: Save the libobj sources
|
# OMPI: Save the libobj sources
|
||||||
LAM_LIBEVENT_SOURCES="$sources"
|
OMPI_LIBEVENT_SOURCES="$sources"
|
||||||
AC_SUBST(LAM_LIBEVENT_SOURCES)
|
AC_SUBST(OMPI_LIBEVENT_SOURCES)
|
||||||
|
|
||||||
# LAM: All done
|
# OMPI: All done
|
||||||
unset sources])dnl
|
unset sources])dnl
|
||||||
|
@ -4,25 +4,25 @@ dnl $HEADER$
|
|||||||
dnl
|
dnl
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Tests provided by LAM
|
dnl Tests provided by OMPI
|
||||||
dnl General tests
|
dnl General tests
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
sinclude(../../../../../config/lam_functions.m4)
|
sinclude(../../../../../config/ompi_functions.m4)
|
||||||
sinclude(../../../../../config/lam_get_version.m4)
|
sinclude(../../../../../config/ompi_get_version.m4)
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl C compiler tests
|
dnl C compiler tests
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
sinclude(../../../../../config/lam_setup_cc.m4)
|
sinclude(../../../../../config/ompi_setup_cc.m4)
|
||||||
sinclude(../../../../../config/lam_check_optflags.m4)
|
sinclude(../../../../../config/ompi_check_optflags.m4)
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl C++ compiler tests
|
dnl C++ compiler tests
|
||||||
dnl
|
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_repository.m4)
|
||||||
sinclude(../../../../../config/cxx_find_template_parameters.m4)
|
sinclude(../../../../../config/cxx_find_template_parameters.m4)
|
||||||
|
|
||||||
|
@ -14,41 +14,41 @@ AC_INIT(@PARAM_INIT_FILE@)
|
|||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_CONFIG_AUX_DIR(@PARAM_CONFIG_AUX_DIR@)
|
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_ompi_srcdir='$(top_srcdir)/../../../../..'
|
||||||
top_lam_builddir='$(top_builddir)/../../../../..'
|
top_ompi_builddir='$(top_builddir)/../../../../..'
|
||||||
|
|
||||||
AC_SUBST(top_lam_srcdir)
|
AC_SUBST(top_ompi_srcdir)
|
||||||
AC_SUBST(top_lam_builddir)
|
AC_SUBST(top_ompi_builddir)
|
||||||
|
|
||||||
# Get the version of @MCA_TYPE@ @MCA_MODULE_NAME@ that we are installing.
|
# 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
|
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@)
|
@PARAM_VAR_PREFIX@)
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_MAJOR_VERSION,
|
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_MAJOR_VERSION,
|
||||||
$@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,
|
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_MINOR_VERSION,
|
||||||
$@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,
|
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_RELEASE_VERSION,
|
||||||
$@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,
|
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_ALPHA_VERSION,
|
||||||
$@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,
|
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_BETA_VERSION,
|
||||||
$@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,
|
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_CVS_VERSION,
|
||||||
$@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,
|
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_VERSION,
|
||||||
"$@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"
|
version_string="version $@PARAM_VAR_PREFIX@_VERSION"
|
||||||
else
|
else
|
||||||
version_string=""
|
version_string=""
|
||||||
@ -58,9 +58,9 @@ fi
|
|||||||
# Start it up
|
# Start it up
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_CONFIGURE_SETUP
|
OMPI_CONFIGURE_SETUP
|
||||||
lam_show_title "Configuring MCA @MCA_TYPE@ @MCA_MODULE_NAME@ module $version_string"
|
ompi_show_title "Configuring MCA @MCA_TYPE@ @MCA_MODULE_NAME@ module $version_string"
|
||||||
lam_show_subtitle "Initialization, setup"
|
ompi_show_subtitle "Initialization, setup"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Init automake
|
# Init automake
|
||||||
@ -76,7 +76,7 @@ AH_TOP([/* -*- c -*-
|
|||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*
|
*
|
||||||
* LAM/MPI configuation header file.
|
* OMPI/MPI configuation header file.
|
||||||
* MCA @MCA_TYPE@: @MCA_MODULE_NAME@ module
|
* MCA @MCA_TYPE@: @MCA_MODULE_NAME@ module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ AH_BOTTOM([#endif /* _@PARAM_VAR_PREFIX@_CONFIG_H */])
|
|||||||
# - figure out the host type
|
# - figure out the host type
|
||||||
# - set the default prefix
|
# - 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@"]))
|
[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,
|
# Manual conversion of $kind to its generic name (e.g., crmpi->cr,
|
||||||
# crlam->cr).
|
# crompi->cr).
|
||||||
|
|
||||||
case "@MCA_TYPE@" in
|
case "@MCA_TYPE@" in
|
||||||
crmpi)
|
crmpi)
|
||||||
generic_type="cr"
|
generic_type="cr"
|
||||||
;;
|
;;
|
||||||
crlam)
|
crompi)
|
||||||
generic_type="cr"
|
generic_type="cr"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -198,7 +198,7 @@ fi
|
|||||||
# @MCA_TYPE@ @MCA_MODULE_NAME@ module specific setup
|
# @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@
|
@CONFIGURE_STUB_MACRO@
|
||||||
else
|
else
|
||||||
@CONFIGURE_DIST_STUB_MACRO@
|
@CONFIGURE_DIST_STUB_MACRO@
|
||||||
@ -212,7 +212,7 @@ fi
|
|||||||
# purely aesthetic.
|
# 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
|
# Delayed the substitution of these until now because they may have
|
||||||
@ -226,10 +226,10 @@ AC_SUBST(CPPFLAGS)
|
|||||||
# libtool magic
|
# libtool magic
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
lam_show_subtitle "GNU libtool setup"
|
ompi_show_subtitle "GNU libtool setup"
|
||||||
|
|
||||||
AM_PROG_LIBTOOL
|
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")
|
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
|
# Party on
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
lam_show_subtitle "Final output"
|
ompi_show_subtitle "Final output"
|
||||||
|
|
||||||
AM_CONFIG_HEADER([@PARAM_CONFIG_HEADER_FILE@])
|
AM_CONFIG_HEADER([@PARAM_CONFIG_HEADER_FILE@])
|
||||||
AC_CONFIG_FILES([@PARAM_CONFIG_FILES@])
|
AC_CONFIG_FILES([@PARAM_CONFIG_FILES@])
|
||||||
|
@ -13,13 +13,13 @@ use File::Basename;
|
|||||||
# Local variables
|
# Local variables
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
my $lam_topdir;
|
my $ompi_topdir;
|
||||||
my $module_topdir;
|
my $module_topdir;
|
||||||
my %config_values;
|
my %config_values;
|
||||||
my %config_params;
|
my %config_params;
|
||||||
|
|
||||||
my $initial_cwd = cwd();
|
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",
|
my %config_param_names = (PIFILE => "PARAM_INIT_FILE",
|
||||||
PCFGAUXDIR => "PARAM_CONFIG_AUX_DIR",
|
PCFGAUXDIR => "PARAM_CONFIG_AUX_DIR",
|
||||||
PC => "PARAM_WANT_C",
|
PC => "PARAM_WANT_C",
|
||||||
@ -36,45 +36,45 @@ my %config_param_names = (PIFILE => "PARAM_INIT_FILE",
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
Getopt::Long::Configure("bundling", "require_order");
|
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);
|
"moduledir|m=s" => \$module_topdir);
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
print "Usage: $0 [--lamdir=DIR] [--moduledir=DIR]\n";
|
print "Usage: $0 [--ompidir=DIR] [--moduledir=DIR]\n";
|
||||||
exit(1);
|
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";
|
print "$announce_str starting\n";
|
||||||
|
|
||||||
if (!$lam_topdir) {
|
if (!$ompi_topdir) {
|
||||||
$lam_topdir = dirname($0);
|
$ompi_topdir = dirname($0);
|
||||||
}
|
}
|
||||||
chdir($lam_topdir);
|
chdir($ompi_topdir);
|
||||||
$lam_topdir = cwd();
|
$ompi_topdir = cwd();
|
||||||
chdir($initial_cwd);
|
chdir($initial_cwd);
|
||||||
if (!$lam_topdir || ! -f "$lam_topdir/autogen.sh") {
|
if (!$ompi_topdir || ! -f "$ompi_topdir/autogen.sh") {
|
||||||
croak("Unable to find LAM base directory (try using --lamdir)");
|
croak("Unable to find OMPI base directory (try using --ompidir)");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$module_topdir) {
|
if (!$module_topdir) {
|
||||||
$module_topdir = $initial_cwd;
|
$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");
|
croak("Unable to determine which module to operate on");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chdir($module_topdir);
|
chdir($module_topdir);
|
||||||
$module_topdir = cwd();
|
$module_topdir = cwd();
|
||||||
chdir($initial_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)");
|
croak("Unable to find module directory (try using --moduledir)");
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print them out
|
# 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";
|
print "--> Found module top dir: $module_topdir\n";
|
||||||
|
|
||||||
# If we have a configure.params file in the module topdir, we're good to
|
# 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"} = dirname($module_topdir);
|
||||||
$config_values{"MCA_TYPE"} = basename($config_values{"MCA_TYPE"});
|
$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".
|
# "crmpi".
|
||||||
|
|
||||||
$config_values{"PROCESSED_MCA_TYPE"} = $config_values{"MCA_TYPE"};
|
$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"} eq "crmpi") {
|
||||||
$config_values{"PROCESSED_MCA_TYPE"} = "cr";
|
$config_values{"PROCESSED_MCA_TYPE"} = "cr";
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ if (-f "$module_topdir/configure.stub") {
|
|||||||
|
|
||||||
sinclude(configure.stub)\n";
|
sinclude(configure.stub)\n";
|
||||||
$config_values{CONFIGURE_STUB_MACRO} =
|
$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\"
|
$config_values{"MCA_MODULE_NAME"} . "-specific setup\"
|
||||||
MCA_CONFIGURE_STUB";
|
MCA_CONFIGURE_STUB";
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ MCA_CONFIGURE_STUB";
|
|||||||
close(STUB);
|
close(STUB);
|
||||||
if ($found == 1) {
|
if ($found == 1) {
|
||||||
$config_values{CONFIGURE_DIST_STUB_MACRO} =
|
$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"} .
|
$config_values{"MCA_MODULE_NAME"} .
|
||||||
"-specific setup (dist specific!)\"
|
"-specific setup (dist specific!)\"
|
||||||
MCA_CONFIGURE_DIST_STUB";
|
MCA_CONFIGURE_DIST_STUB";
|
||||||
@ -320,12 +320,12 @@ sub make_template {
|
|||||||
|
|
||||||
$search = "\@C_COMPILER_SETUP\@";
|
$search = "\@C_COMPILER_SETUP\@";
|
||||||
$replace = $config_params{$config_param_names{"PC"}} ?
|
$replace = $config_params{$config_param_names{"PC"}} ?
|
||||||
"LAM_SETUP_CC" : "";
|
"OMPI_SETUP_CC" : "";
|
||||||
$template =~ s/$search/$replace/;
|
$template =~ s/$search/$replace/;
|
||||||
|
|
||||||
$search = "\@CXX_COMPILER_SETUP\@";
|
$search = "\@CXX_COMPILER_SETUP\@";
|
||||||
$replace = $config_params{$config_param_names{"PCXX"}} ?
|
$replace = $config_params{$config_param_names{"PCXX"}} ?
|
||||||
"LAM_SETUP_CXX" : "";
|
"OMPI_SETUP_CXX" : "";
|
||||||
$template =~ s/$search/$replace/;
|
$template =~ s/$search/$replace/;
|
||||||
|
|
||||||
print "--> Writing output file: $dest\n";
|
print "--> Writing output file: $dest\n";
|
||||||
@ -339,9 +339,9 @@ sub make_template {
|
|||||||
|
|
||||||
# Read and fill in the templates
|
# 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);
|
"$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);
|
"$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_PREREQ(2.58)
|
||||||
AC_CONFIG_AUX_DIR(./config)
|
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,
|
AC_DEFINE_UNQUOTED(OMPI_MAJOR_VERSION, $OMPI_MAJOR_VERSION,
|
||||||
[Major LAM version])
|
[Major OMPI version])
|
||||||
AC_DEFINE_UNQUOTED(LAM_MINOR_VERSION, $LAM_MINOR_VERSION,
|
AC_DEFINE_UNQUOTED(OMPI_MINOR_VERSION, $OMPI_MINOR_VERSION,
|
||||||
[Minor LAM version])
|
[Minor OMPI version])
|
||||||
AC_DEFINE_UNQUOTED(LAM_RELEASE_VERSION, $LAM_RELEASE_VERSION,
|
AC_DEFINE_UNQUOTED(OMPI_RELEASE_VERSION, $OMPI_RELEASE_VERSION,
|
||||||
[Release LAM version])
|
[Release OMPI version])
|
||||||
AC_DEFINE_UNQUOTED(LAM_ALPHA_VERSION, $LAM_ALPHA_VERSION,
|
AC_DEFINE_UNQUOTED(OMPI_ALPHA_VERSION, $OMPI_ALPHA_VERSION,
|
||||||
[Alpha LAM version])
|
[Alpha OMPI version])
|
||||||
AC_DEFINE_UNQUOTED(LAM_BETA_VERSION, $LAM_BETA_VERSION,
|
AC_DEFINE_UNQUOTED(OMPI_BETA_VERSION, $OMPI_BETA_VERSION,
|
||||||
[Beta LAM version])
|
[Beta OMPI version])
|
||||||
AC_DEFINE_UNQUOTED(LAM_SVN_VERSION, $LAM_SVN_VERSION,
|
AC_DEFINE_UNQUOTED(OMPI_SVN_VERSION, $OMPI_SVN_VERSION,
|
||||||
[CVS LAM version])
|
[CVS OMPI version])
|
||||||
AC_DEFINE_UNQUOTED(LAM_VERSION, "$LAM_VERSION",
|
AC_DEFINE_UNQUOTED(OMPI_VERSION, "$OMPI_VERSION",
|
||||||
[Overall LAM version number])
|
[Overall OMPI version number])
|
||||||
|
|
||||||
AC_SUBST(LAM_MAJOR_VERSION)
|
AC_SUBST(OMPI_MAJOR_VERSION)
|
||||||
AC_SUBST(LAM_MINOR_VERSION)
|
AC_SUBST(OMPI_MINOR_VERSION)
|
||||||
AC_SUBST(LAM_RELEASE_VERSION)
|
AC_SUBST(OMPI_RELEASE_VERSION)
|
||||||
AC_SUBST(LAM_ALPHA_VERSION)
|
AC_SUBST(OMPI_ALPHA_VERSION)
|
||||||
AC_SUBST(LAM_BETA_VERSION)
|
AC_SUBST(OMPI_BETA_VERSION)
|
||||||
AC_SUBST(LAM_CVS_VERSION)
|
AC_SUBST(OMPI_CVS_VERSION)
|
||||||
AC_SUBST(LAM_VERSION)
|
AC_SUBST(OMPI_VERSION)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start it up
|
# Start it up
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_CONFIGURE_SETUP
|
OMPI_CONFIGURE_SETUP
|
||||||
lam_show_title "Configuring LAM version $LAM_VERSION"
|
ompi_show_title "Configuring OMPI version $OMPI_VERSION"
|
||||||
lam_show_subtitle "Initialization, setup"
|
ompi_show_subtitle "Initialization, setup"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Init automake
|
# Init automake
|
||||||
@ -55,22 +55,22 @@ lam_show_subtitle "Initialization, setup"
|
|||||||
# VERSION macors
|
# VERSION macors
|
||||||
#
|
#
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE(lam, $LAM_VERSION, 'no')
|
AM_INIT_AUTOMAKE(ompi, $OMPI_VERSION, 'no')
|
||||||
|
|
||||||
LAM_TOP_BUILDDIR="`pwd`"
|
OMPI_TOP_BUILDDIR="`pwd`"
|
||||||
AC_SUBST(LAM_TOP_BUILDDIR)
|
AC_SUBST(OMPI_TOP_BUILDDIR)
|
||||||
cd "$srcdir"
|
cd "$srcdir"
|
||||||
LAM_TOP_SRCDIR="`pwd`"
|
OMPI_TOP_SRCDIR="`pwd`"
|
||||||
AC_SUBST(LAM_TOP_SRCDIR)
|
AC_SUBST(OMPI_TOP_SRCDIR)
|
||||||
cd "$LAM_TOP_BUILDDIR"
|
cd "$OMPI_TOP_BUILDDIR"
|
||||||
|
|
||||||
AC_MSG_NOTICE([builddir: $LAM_TOP_BUILDDIR])
|
AC_MSG_NOTICE([builddir: $OMPI_TOP_BUILDDIR])
|
||||||
AC_MSG_NOTICE([srcdir: $LAM_TOP_SRCDIR])
|
AC_MSG_NOTICE([srcdir: $OMPI_TOP_SRCDIR])
|
||||||
if test "$LAM_TOP_BUILDDIR" != "$LAM_TOP_SRCDIR"; then
|
if test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"; then
|
||||||
AC_MSG_NOTICE([Detected VPATH build])
|
AC_MSG_NOTICE([Detected VPATH build])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup the top of the include/lam_config.h file
|
# Setup the top of the include/ompi_config.h file
|
||||||
|
|
||||||
AH_TOP([/* -*- c -*-
|
AH_TOP([/* -*- c -*-
|
||||||
*
|
*
|
||||||
@ -79,28 +79,28 @@ AH_TOP([/* -*- c -*-
|
|||||||
* Function: - OS, CPU and compiler dependent configuration
|
* Function: - OS, CPU and compiler dependent configuration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_CONFIG_H
|
#ifndef OMPI_CONFIG_H
|
||||||
#define LAM_CONFIG_H
|
#define OMPI_CONFIG_H
|
||||||
])
|
])
|
||||||
AH_BOTTOM([
|
AH_BOTTOM([
|
||||||
#include "lam_config_bottom.h"
|
#include "ompi_config_bottom.h"
|
||||||
#endif /* LAM_CONFIG_H */
|
#endif /* OMPI_CONFIG_H */
|
||||||
])
|
])
|
||||||
|
|
||||||
# Other basic setup stuff (shared with modules)
|
# Other basic setup stuff (shared with modules)
|
||||||
|
|
||||||
LAM_BASIC_SETUP
|
OMPI_BASIC_SETUP
|
||||||
|
|
||||||
top_lam_srcdir="$LAM_TOP_SRCDIR"
|
top_ompi_srcdir="$OMPI_TOP_SRCDIR"
|
||||||
AC_SUBST(top_lam_srcdir)
|
AC_SUBST(top_ompi_srcdir)
|
||||||
top_lam_builddir="$LAM_TOP_BUILDDIR"
|
top_ompi_builddir="$OMPI_TOP_BUILDDIR"
|
||||||
AC_SUBST(top_lam_builddir)
|
AC_SUBST(top_ompi_builddir)
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Configuration options
|
# Configuration options
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
LAM_CONFIGURE_OPTIONS
|
OMPI_CONFIGURE_OPTIONS
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Libtool: part one
|
# Libtool: part one
|
||||||
@ -116,8 +116,8 @@ LAM_CONFIGURE_OPTIONS
|
|||||||
# the user requested something or if the default was set here.
|
# the user requested something or if the default was set here.
|
||||||
#
|
#
|
||||||
|
|
||||||
lam_enable_shared="$enable_shared"
|
ompi_enable_shared="$enable_shared"
|
||||||
lam_enable_static="$enable_static"
|
ompi_enable_static="$enable_static"
|
||||||
AM_DISABLE_SHARED
|
AM_DISABLE_SHARED
|
||||||
AM_ENABLE_STATIC
|
AM_ENABLE_STATIC
|
||||||
|
|
||||||
@ -125,13 +125,13 @@ AM_ENABLE_STATIC
|
|||||||
############################################################################
|
############################################################################
|
||||||
# Check for compilers and preprocessors
|
# Check for compilers and preprocessors
|
||||||
############################################################################
|
############################################################################
|
||||||
lam_show_title "Compiler and preprocessor tests"
|
ompi_show_title "Compiler and preprocessor tests"
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
# C compiler characteristics
|
# C compiler characteristics
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
LAM_SETUP_CC
|
OMPI_SETUP_CC
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for some types
|
# Check for some types
|
||||||
@ -170,20 +170,20 @@ AC_CHECK_SIZEOF(void *)
|
|||||||
# Check for type alignments
|
# Check for type alignments
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_C_GET_ALIGNMENT(char, LAM_ALIGNMENT_CHAR)
|
OMPI_C_GET_ALIGNMENT(char, OMPI_ALIGNMENT_CHAR)
|
||||||
LAM_C_GET_ALIGNMENT(short, LAM_ALIGNMENT_SHORT)
|
OMPI_C_GET_ALIGNMENT(short, OMPI_ALIGNMENT_SHORT)
|
||||||
LAM_C_GET_ALIGNMENT(wchar_t, LAM_ALIGNMENT_WCHAR)
|
OMPI_C_GET_ALIGNMENT(wchar_t, OMPI_ALIGNMENT_WCHAR)
|
||||||
LAM_C_GET_ALIGNMENT(int, LAM_ALIGNMENT_INT)
|
OMPI_C_GET_ALIGNMENT(int, OMPI_ALIGNMENT_INT)
|
||||||
LAM_C_GET_ALIGNMENT(long, LAM_ALIGNMENT_LONG)
|
OMPI_C_GET_ALIGNMENT(long, OMPI_ALIGNMENT_LONG)
|
||||||
if test $ac_cv_type_long_long = yes; then
|
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
|
fi
|
||||||
LAM_C_GET_ALIGNMENT(float, LAM_ALIGNMENT_FLOAT)
|
OMPI_C_GET_ALIGNMENT(float, OMPI_ALIGNMENT_FLOAT)
|
||||||
LAM_C_GET_ALIGNMENT(double, LAM_ALIGNMENT_DOUBLE)
|
OMPI_C_GET_ALIGNMENT(double, OMPI_ALIGNMENT_DOUBLE)
|
||||||
if test $ac_cv_type_long_double = yes; then
|
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
|
fi
|
||||||
LAM_C_GET_ALIGNMENT(void *, LAM_ALIGNMENT_VOID_P)
|
OMPI_C_GET_ALIGNMENT(void *, OMPI_ALIGNMENT_VOID_P)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for other compiler characteristics
|
# Check for other compiler characteristics
|
||||||
@ -191,7 +191,7 @@ LAM_C_GET_ALIGNMENT(void *, LAM_ALIGNMENT_VOID_P)
|
|||||||
|
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
AC_C_RESTRICT
|
AC_C_RESTRICT
|
||||||
LAM_C_WEAK_SYMBOLS
|
OMPI_C_WEAK_SYMBOLS
|
||||||
|
|
||||||
# If we want the profiling layer:
|
# If we want the profiling layer:
|
||||||
# - If the C compiler has weak symbols, use those.
|
# - If the C compiler has weak symbols, use those.
|
||||||
@ -199,16 +199,16 @@ LAM_C_WEAK_SYMBOLS
|
|||||||
# separate directory.
|
# separate directory.
|
||||||
|
|
||||||
if test "$WANT_WEAK_SYMBOLS" = "0"; then
|
if test "$WANT_WEAK_SYMBOLS" = "0"; then
|
||||||
LAM_C_HAVE_WEAK_SYMBOLS=0
|
OMPI_C_HAVE_WEAK_SYMBOLS=0
|
||||||
fi
|
fi
|
||||||
if test "$WANT_MPI_PROFILING" = "1"; then
|
if test "$WANT_MPI_PROFILING" = "1"; then
|
||||||
if test "$LAM_C_HAVE_WEAK_SYMBOLS" = "1"; then
|
if test "$OMPI_C_HAVE_WEAK_SYMBOLS" = "1"; then
|
||||||
LAM_PROFILING_COMPILE_SEPARATELY=0
|
OMPI_PROFILING_COMPILE_SEPARATELY=0
|
||||||
else
|
else
|
||||||
LAM_PROFILING_COMPILE_SEPARATELY=1
|
OMPI_PROFILING_COMPILE_SEPARATELY=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LAM_PROFILING_COMPILE_SEPARATELY=0
|
OMPI_PROFILING_COMPILE_SEPARATELY=0
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# There are 2 layers to the MPI Language binidings
|
# There are 2 layers to the MPI Language binidings
|
||||||
@ -225,15 +225,15 @@ fi
|
|||||||
# each of these layers need to be built or NOT
|
# each of these layers need to be built or NOT
|
||||||
#
|
#
|
||||||
AM_CONDITIONAL(WANT_MPI_BINDINGS_LAYER,
|
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,
|
AM_CONDITIONAL(WANT_PMPI_BINDINGS_LAYER,
|
||||||
test "$WANT_MPI_PROFILING" = 1)
|
test "$WANT_MPI_PROFILING" = 1)
|
||||||
AM_CONDITIONAL(COMPILE_PROFILING_SEPARATELY,
|
AM_CONDITIONAL(COMPILE_PROFILING_SEPARATELY,
|
||||||
test "$LAM_PROFILING_COMPILE_SEPARATELY" = 1)
|
test "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)
|
||||||
AC_DEFINE_UNQUOTED(LAM_ENABLE_MPI_PROFILING, $WANT_MPI_PROFILING,
|
AC_DEFINE_UNQUOTED(OMPI_ENABLE_MPI_PROFILING, $WANT_MPI_PROFILING,
|
||||||
[Whether we want MPI profiling or not])
|
[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])
|
[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
|
# C++ compiler characteristics
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
LAM_SETUP_CXX
|
OMPI_SETUP_CXX
|
||||||
|
|
||||||
# check for type sizes
|
# check for type sizes
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ AC_CHECK_SIZEOF(bool)
|
|||||||
|
|
||||||
# check for type alignments
|
# 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
|
AC_LANG_RESTORE
|
||||||
|
|
||||||
|
|
||||||
@ -259,70 +259,70 @@ AC_LANG_RESTORE
|
|||||||
# Fortran
|
# Fortran
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
LAM_SIZEOF_FORTRAN_INT=0
|
OMPI_SIZEOF_FORTRAN_INT=0
|
||||||
LAM_SIZEOF_FORTRAN_REAL=0
|
OMPI_SIZEOF_FORTRAN_REAL=0
|
||||||
LAM_SIZEOF_FORTRAN_DBLPREC=0
|
OMPI_SIZEOF_FORTRAN_DBLPREC=0
|
||||||
LAM_SIZEOF_FORTRAN_COMPLEX=0
|
OMPI_SIZEOF_FORTRAN_COMPLEX=0
|
||||||
LAM_SIZEOF_FORTRAN_DBLCOMPLEX=0
|
OMPI_SIZEOF_FORTRAN_DBLCOMPLEX=0
|
||||||
|
|
||||||
LAM_ALIGNMENT_FORTRAN_INT=0
|
OMPI_ALIGNMENT_FORTRAN_INT=0
|
||||||
LAM_ALIGNMENT_FORTRAN_REAL=0
|
OMPI_ALIGNMENT_FORTRAN_REAL=0
|
||||||
LAM_ALIGNMENT_FORTRAN_DBLPREC=0
|
OMPI_ALIGNMENT_FORTRAN_DBLPREC=0
|
||||||
LAM_ALIGNMENT_FORTRAN_COMPLEX=0
|
OMPI_ALIGNMENT_FORTRAN_COMPLEX=0
|
||||||
LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX=0
|
OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX=0
|
||||||
|
|
||||||
LAM_SETUP_F77
|
OMPI_SETUP_F77
|
||||||
if test "$LAM_F77" != "none" ; then
|
if test "$OMPI_F77" != "none" ; then
|
||||||
LAM_F77_FIND_EXT_SYMBOL_CONVENTION($LAM_F77)
|
OMPI_F77_FIND_EXT_SYMBOL_CONVENTION($OMPI_F77)
|
||||||
|
|
||||||
# checking the sizeof fortran interger. This is needed to define
|
# checking the sizeof fortran interger. This is needed to define
|
||||||
# MPI_Fint. This is needed for C bindings and hence there is no
|
# MPI_Fint. This is needed for C bindings and hence there is no
|
||||||
# bearing of --enable-fortran flag on this test.
|
# 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
|
fi
|
||||||
|
|
||||||
# If we want fortran support, then get the sizes and alignments of all
|
# If we want fortran support, then get the sizes and alignments of all
|
||||||
# the rest of the fortran types
|
# 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
|
# INTEGER is already done, per above
|
||||||
LAM_F77_GET_SIZEOF(REAL, LAM_SIZEOF_FORTRAN_REAL)
|
OMPI_F77_GET_SIZEOF(REAL, OMPI_SIZEOF_FORTRAN_REAL)
|
||||||
LAM_F77_GET_SIZEOF(DOUBLE PRECISION, LAM_SIZEOF_FORTRAN_DBLPREC)
|
OMPI_F77_GET_SIZEOF(DOUBLE PRECISION, OMPI_SIZEOF_FORTRAN_DBLPREC)
|
||||||
LAM_F77_GET_SIZEOF(COMPLEX, LAM_SIZEOF_FORTRAN_COMPLEX)
|
OMPI_F77_GET_SIZEOF(COMPLEX, OMPI_SIZEOF_FORTRAN_COMPLEX)
|
||||||
LAM_F77_GET_SIZEOF(DOUBLE COMPLEX, LAM_SIZEOF_FORTRAN_DBLCOMPLEX)
|
OMPI_F77_GET_SIZEOF(DOUBLE COMPLEX, OMPI_SIZEOF_FORTRAN_DBLCOMPLEX)
|
||||||
|
|
||||||
LAM_F77_GET_ALIGNMENT(INTEGER, LAM_ALIGNMENT_FORTRAN_INT)
|
OMPI_F77_GET_ALIGNMENT(INTEGER, OMPI_ALIGNMENT_FORTRAN_INT)
|
||||||
LAM_F77_GET_ALIGNMENT(REAL, LAM_ALIGNMENT_FORTRAN_REAL)
|
OMPI_F77_GET_ALIGNMENT(REAL, OMPI_ALIGNMENT_FORTRAN_REAL)
|
||||||
LAM_F77_GET_ALIGNMENT(DOUBLE PRECISION, LAM_ALIGNMENT_FORTRAN_DBLPREC)
|
OMPI_F77_GET_ALIGNMENT(DOUBLE PRECISION, OMPI_ALIGNMENT_FORTRAN_DBLPREC)
|
||||||
LAM_F77_GET_ALIGNMENT(COMPLEX, LAM_ALIGNMENT_FORTRAN_COMPLEX)
|
OMPI_F77_GET_ALIGNMENT(COMPLEX, OMPI_ALIGNMENT_FORTRAN_COMPLEX)
|
||||||
LAM_F77_GET_ALIGNMENT(DOUBLE COMPLEX, LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX)
|
OMPI_F77_GET_ALIGNMENT(DOUBLE COMPLEX, OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX)
|
||||||
fi
|
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])
|
[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])
|
[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])
|
[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])
|
[Size of fortran complex])
|
||||||
AC_DEFINE_UNQUOTED(LAM_SIZEOF_FORTRAN_DBLCOMPLEX,
|
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_DBLCOMPLEX,
|
||||||
$LAM_SIZEOF_FORTRAN_DBLCOMPLEX,
|
$OMPI_SIZEOF_FORTRAN_DBLCOMPLEX,
|
||||||
[Size of fortran double complex])
|
[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])
|
[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])
|
[Size of fortran real])
|
||||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_DBLPREC,
|
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLPREC,
|
||||||
$LAM_ALIGNMENT_FORTRAN_DBLPREC,
|
$OMPI_ALIGNMENT_FORTRAN_DBLPREC,
|
||||||
[Size of fortran double precision])
|
[Size of fortran double precision])
|
||||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_COMPLEX,
|
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_COMPLEX,
|
||||||
$LAM_ALIGNMENT_FORTRAN_COMPLEX,
|
$OMPI_ALIGNMENT_FORTRAN_COMPLEX,
|
||||||
[Size of fortran complex])
|
[Size of fortran complex])
|
||||||
AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
||||||
$LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
$OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX,
|
||||||
[Size of fortran double complex])
|
[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
|
# each of these layers need to be built or NOT
|
||||||
#
|
#
|
||||||
AM_CONDITIONAL(WANT_MPI_F77_BINDINGS_LAYER,
|
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,
|
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
|
# Fortran 90 setup
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_SETUP_F90
|
OMPI_SETUP_F90
|
||||||
|
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
# Header files
|
# Header files
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
lam_show_title "Header file tests"
|
ompi_show_title "Header file tests"
|
||||||
|
|
||||||
# snprintf declaration
|
# snprintf declaration
|
||||||
# gethostname declaration
|
# gethostname declaration
|
||||||
@ -379,7 +379,7 @@ AC_CHECK_HEADERS([stdbool.h alloca.h])
|
|||||||
# Libraries
|
# Libraries
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
lam_show_title "Library and Function tests"
|
ompi_show_title "Library and Function tests"
|
||||||
|
|
||||||
# -lsocket
|
# -lsocket
|
||||||
# -lnsl
|
# -lnsl
|
||||||
@ -398,14 +398,14 @@ lam_show_title "Library and Function tests"
|
|||||||
# Make sure we can copy va_lists (need check declared, not linkable)
|
# 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>])
|
[#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])
|
[Whether we have va_copy or not])
|
||||||
|
|
||||||
AC_CHECK_DECL(__va_copy, LAM_HAVE_UNDERSCORE_VA_COPY=1,
|
AC_CHECK_DECL(__va_copy, OMPI_HAVE_UNDERSCORE_VA_COPY=1,
|
||||||
LAM_HAVE_UNDERSCORE_VA_COPY=0, [#include <stdarg.h>])
|
OMPI_HAVE_UNDERSCORE_VA_COPY=0, [#include <stdarg.h>])
|
||||||
AC_DEFINE_UNQUOTED(LAM_HAVE_UNDERSCORE_VA_COPY, $LAM_HAVE_UNDERSCORE_VA_COPY,
|
AC_DEFINE_UNQUOTED(OMPI_HAVE_UNDERSCORE_VA_COPY, $OMPI_HAVE_UNDERSCORE_VA_COPY,
|
||||||
[Whether we have __va_copy or not])
|
[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
|
# 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
|
# Determine what MPI_Fint shout be defined as. If the size of
|
||||||
# fortran integer is 4 then it is defined to either
|
# 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
|
# This test should be carried out ONLY if there is a f77 compiler
|
||||||
# available. Else we should default to MPI_Fint being an int.
|
# 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"
|
MPI_FINT_TYPE="not found"
|
||||||
AC_MSG_CHECKING([checking for type of MPI_Fint])
|
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
|
if test "$ac_cv_type_int32_t" = "yes"; then
|
||||||
MPI_FINT_TYPE=int32_t
|
MPI_FINT_TYPE=int32_t
|
||||||
elif test "$ac_cv_sizeof_int" = 4 ; then
|
elif test "$ac_cv_sizeof_int" = 4 ; then
|
||||||
MPI_FINT_TYPE=int
|
MPI_FINT_TYPE=int
|
||||||
fi
|
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
|
if test "$ac_cv_type_int64_t" = "yes"; then
|
||||||
MPI_FINT_TYPE=int64_t
|
MPI_FINT_TYPE=int64_t
|
||||||
elif test "$ac_cv_type_long_long" = "yes" -a "$ac_cv_sizeof_long_long" = 8; then
|
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
|
# Check out what thread support we have
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_CONFIG_THREADS
|
OMPI_CONFIG_THREADS
|
||||||
CFLAGS="$CFLAGS $THREAD_CFLAGS"
|
CFLAGS="$CFLAGS $THREAD_CFLAGS"
|
||||||
CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS"
|
CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS"
|
||||||
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
|
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
|
||||||
@ -532,7 +532,7 @@ AC_PROG_LN_S
|
|||||||
# File system case sensitivity
|
# File system case sensitivity
|
||||||
#
|
#
|
||||||
|
|
||||||
LAM_CASE_SENSITIVE_FS_SETUP
|
OMPI_CASE_SENSITIVE_FS_SETUP
|
||||||
|
|
||||||
# AIX: FIONBIO in sys/ioctl.h
|
# AIX: FIONBIO in sys/ioctl.h
|
||||||
# glibc: memcpy
|
# glibc: memcpy
|
||||||
@ -542,29 +542,29 @@ LAM_CASE_SENSITIVE_FS_SETUP
|
|||||||
# MCA
|
# MCA
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
lam_show_title "MPI Component Architecture (MCA) setup"
|
ompi_show_title "MPI Component Architecture (MCA) setup"
|
||||||
|
|
||||||
AC_MSG_CHECKING([for subdir args])
|
AC_MSG_CHECKING([for subdir args])
|
||||||
LAM_CONFIG_SUBDIR_ARGS([lam_subdir_args])
|
OMPI_CONFIG_SUBDIR_ARGS([ompi_subdir_args])
|
||||||
AC_MSG_RESULT([$lam_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
|
# Libevent setup
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
lam_show_subtitle "Libevent 3rd party event handler"
|
ompi_show_subtitle "Libevent 3rd party event handler"
|
||||||
CFLAGS_save="$CFLAGS"
|
CFLAGS_save="$CFLAGS"
|
||||||
CFLAGS="$LAM_CFLAGS_BEFORE_PICKY"
|
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY"
|
||||||
LAM_SETUP_LIBEVENT
|
OMPI_SETUP_LIBEVENT
|
||||||
CFLAGS="$CFLAGS_save"
|
CFLAGS="$CFLAGS_save"
|
||||||
|
|
||||||
|
|
||||||
@ -573,7 +573,7 @@ CFLAGS="$CFLAGS_save"
|
|||||||
# (after C compiler setup)
|
# (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 convenience libltdl for the moment, because we need to force the
|
||||||
# use of the newest libltdl (i.e., the one that ships with libtool
|
# 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).
|
# passing precious variables down to the sub-configure).
|
||||||
#
|
#
|
||||||
# Note that we also did some magic scripty-foo in autogen.sh to rename
|
# 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
|
# 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
|
# 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
|
# 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
|
# it's older -- or just not matching the version that we need, Bad
|
||||||
# Things happen. [sigh]
|
# Things happen. [sigh]
|
||||||
#
|
#
|
||||||
# Finally, make liblamltdl follow the same shared/static convention
|
# Finally, make libompi_ltdl follow the same shared/static convention
|
||||||
# that was user for the main LAM libraries. So manually examine
|
# that was user for the main OMPI libraries. So manually examine
|
||||||
# $enable_shared and $enable_static and pass down the corresponding
|
# $enable_shared and $enable_static and pass down the corresponding
|
||||||
# flags.
|
# 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
|
if test "$enable_shared" = "yes"; then
|
||||||
lam_subdir_args="$lam_subdir_args --enable-shared"
|
ompi_subdir_args="$ompi_subdir_args --enable-shared"
|
||||||
else
|
else
|
||||||
lam_subdir_args="$lam_subdir_args --disable-shared"
|
ompi_subdir_args="$ompi_subdir_args --disable-shared"
|
||||||
fi
|
fi
|
||||||
if test "$enable_static" = "yes"; then
|
if test "$enable_static" = "yes"; then
|
||||||
lam_subdir_args="$lam_subdir_args --enable-static"
|
ompi_subdir_args="$ompi_subdir_args --enable-static"
|
||||||
else
|
else
|
||||||
lam_subdir_args="$lam_subdir_args --disable-static"
|
ompi_subdir_args="$ompi_subdir_args --disable-static"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CFLAGS_save="$CFLAGS"
|
CFLAGS_save="$CFLAGS"
|
||||||
CFLAGS="$LAM_CFLAGS_BEFORE_PICKY"
|
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY"
|
||||||
LAM_CONFIG_SUBDIR(src/libltdl, [$lam_subdir_args], [HAPPY=1], [HAPPY=0])
|
OMPI_CONFIG_SUBDIR(src/libltdl, [$ompi_subdir_args], [HAPPY=1], [HAPPY=0])
|
||||||
if test "$HAPPY" = "1"; then
|
if test "$HAPPY" = "1"; then
|
||||||
LIBLTDL_SUBDIR=libltdl
|
LIBLTDL_SUBDIR=libltdl
|
||||||
LIBLTDL_LTLIB=libltdl/libltdlc.la
|
LIBLTDL_LTLIB=libltdl/libltdlc.la
|
||||||
@ -629,7 +629,7 @@ if test "$HAPPY" = "1"; then
|
|||||||
# it. :-(
|
# it. :-(
|
||||||
|
|
||||||
flags="`egrep ^LIBADD_DL src/libltdl/Makefile | cut -d= -f2-`"
|
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"
|
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $extra_ldflags"
|
||||||
LDFLAGS="-export-dynamic $LDFLAGS"
|
LDFLAGS="-export-dynamic $LDFLAGS"
|
||||||
else
|
else
|
||||||
@ -641,7 +641,7 @@ CFLAGS="$CFLAGS_save"
|
|||||||
AC_SUBST(LIBLTDL_SUBDIR)
|
AC_SUBST(LIBLTDL_SUBDIR)
|
||||||
AC_SUBST(LIBLTDL_LTLIB)
|
AC_SUBST(LIBLTDL_LTLIB)
|
||||||
AM_CONDITIONAL(WANT_LIBLTDL, test "$WANT_LIBLTDL" = "1")
|
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])
|
[Whether to include support for libltdl or not])
|
||||||
|
|
||||||
|
|
||||||
@ -649,7 +649,7 @@ AC_DEFINE_UNQUOTED(LAM_WANT_LIBLTDL, $WANT_LIBLTDL,
|
|||||||
# final wrapper compiler config
|
# 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
|
# 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
|
# WRAPPER_EXTRA_CFLAGS
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([for mpicc CFLAGS])
|
AC_MSG_CHECKING([for mpicc CFLAGS])
|
||||||
LAM_UNIQ(WRAPPER_EXTRA_CFLAGS)
|
OMPI_UNIQ(WRAPPER_EXTRA_CFLAGS)
|
||||||
AC_SUBST(WRAPPER_EXTRA_CFLAGS)
|
AC_SUBST(WRAPPER_EXTRA_CFLAGS)
|
||||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$WRAPPER_EXTRA_CFLAGS",
|
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$WRAPPER_EXTRA_CFLAGS",
|
||||||
[Additional CFLAGS to pass through the wrapper compilers])
|
[Additional CFLAGS to pass through the wrapper compilers])
|
||||||
@ -678,7 +678,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_CFLAGS])
|
|||||||
# WRAPPER_EXTRA_CXXFLAGS
|
# WRAPPER_EXTRA_CXXFLAGS
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([for mpiCC CXXFLAGS])
|
AC_MSG_CHECKING([for mpiCC CXXFLAGS])
|
||||||
LAM_UNIQ(WRAPPER_EXTRA_CXXFLAGS)
|
OMPI_UNIQ(WRAPPER_EXTRA_CXXFLAGS)
|
||||||
AC_SUBST(WRAPPER_EXTRA_CXXFLAGS)
|
AC_SUBST(WRAPPER_EXTRA_CXXFLAGS)
|
||||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS, "$WRAPPER_EXTRA_CXXFLAGS",
|
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS, "$WRAPPER_EXTRA_CXXFLAGS",
|
||||||
[Additional CXXFLAGS to pass through the wrapper compilers])
|
[Additional CXXFLAGS to pass through the wrapper compilers])
|
||||||
@ -688,7 +688,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_CXXFLAGS])
|
|||||||
# WRAPPER_EXTRA_FFLAGS
|
# WRAPPER_EXTRA_FFLAGS
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([for mpif77/mpif90 FFLAGS])
|
AC_MSG_CHECKING([for mpif77/mpif90 FFLAGS])
|
||||||
LAM_UNIQ(WRAPPER_EXTRA_FFLAGS)
|
OMPI_UNIQ(WRAPPER_EXTRA_FFLAGS)
|
||||||
AC_SUBST(WRAPPER_EXTRA_FFLAGS)
|
AC_SUBST(WRAPPER_EXTRA_FFLAGS)
|
||||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS, "$WRAPPER_EXTRA_FFLAGS",
|
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS, "$WRAPPER_EXTRA_FFLAGS",
|
||||||
[Additional FFLAGS to pass through the wrapper compilers])
|
[Additional FFLAGS to pass through the wrapper compilers])
|
||||||
@ -698,7 +698,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_FFLAGS])
|
|||||||
# WRAPPER_EXTRA_FCFLAGS
|
# WRAPPER_EXTRA_FCFLAGS
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([for mpif77/mpif90 FCFLAGS])
|
AC_MSG_CHECKING([for mpif77/mpif90 FCFLAGS])
|
||||||
LAM_UNIQ(WRAPPER_EXTRA_FCFLAGS)
|
OMPI_UNIQ(WRAPPER_EXTRA_FCFLAGS)
|
||||||
AC_SUBST(WRAPPER_EXTRA_FCFLAGS)
|
AC_SUBST(WRAPPER_EXTRA_FCFLAGS)
|
||||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS",
|
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS",
|
||||||
[Additional FCFLAGS to pass through the wrapper compilers])
|
[Additional FCFLAGS to pass through the wrapper compilers])
|
||||||
@ -708,7 +708,7 @@ AC_MSG_RESULT([$WRAPPER_EXTRA_FCFLAGS])
|
|||||||
# WRAPPER_EXTRA_LDFLAGS
|
# WRAPPER_EXTRA_LDFLAGS
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([for wrapper compiler LDFLAGS])
|
AC_MSG_CHECKING([for wrapper compiler LDFLAGS])
|
||||||
LAM_UNIQ(WRAPPER_EXTRA_LDFLAGS)
|
OMPI_UNIQ(WRAPPER_EXTRA_LDFLAGS)
|
||||||
AC_SUBST(WRAPPER_EXTRA_LDFLAGS)
|
AC_SUBST(WRAPPER_EXTRA_LDFLAGS)
|
||||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LDFLAGS, "$WRAPPER_EXTRA_LDFLAGS",
|
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LDFLAGS, "$WRAPPER_EXTRA_LDFLAGS",
|
||||||
[Additional LDFLAGS to pass through the wrapper compilers])
|
[Additional LDFLAGS to pass through the wrapper compilers])
|
||||||
@ -740,9 +740,9 @@ AC_SUBST(FCFLAGS)
|
|||||||
# Party on
|
# 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([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
|
|
||||||
@ -755,7 +755,7 @@ AC_CONFIG_FILES([
|
|||||||
src/include/Makefile
|
src/include/Makefile
|
||||||
|
|
||||||
src/ctnetwork/Makefile
|
src/ctnetwork/Makefile
|
||||||
src/lfc/Makefile
|
src/class/Makefile
|
||||||
src/mem/Makefile
|
src/mem/Makefile
|
||||||
src/os/Makefile
|
src/os/Makefile
|
||||||
src/os/cygwin/Makefile
|
src/os/cygwin/Makefile
|
||||||
@ -824,7 +824,7 @@ AC_CONFIG_FILES([
|
|||||||
src/mpi/f90/Makefile
|
src/mpi/f90/Makefile
|
||||||
|
|
||||||
src/tools/Makefile
|
src/tools/Makefile
|
||||||
src/tools/laminfo/Makefile
|
src/tools/ompi_info/Makefile
|
||||||
src/tools/mpirun/Makefile
|
src/tools/mpirun/Makefile
|
||||||
src/tools/wrappers/Makefile
|
src/tools/wrappers/Makefile
|
||||||
|
|
||||||
@ -833,7 +833,7 @@ AC_CONFIG_FILES([
|
|||||||
|
|
||||||
test/Makefile
|
test/Makefile
|
||||||
test/support/Makefile
|
test/support/Makefile
|
||||||
test/lfc/Makefile
|
test/class/Makefile
|
||||||
test/threads/Makefile
|
test/threads/Makefile
|
||||||
test/util/Makefile
|
test/util/Makefile
|
||||||
test/rte/Makefile
|
test/rte/Makefile
|
||||||
|
@ -6,20 +6,20 @@
|
|||||||
include $(top_srcdir)/config/Makefile.options
|
include $(top_srcdir)/config/Makefile.options
|
||||||
|
|
||||||
include_HEADERS = \
|
include_HEADERS = \
|
||||||
lam_config.h \
|
ompi_config.h \
|
||||||
lam_config_bottom.h \
|
ompi_config_bottom.h \
|
||||||
mpi.h \
|
mpi.h \
|
||||||
mpif.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
|
# out to the target location. It changes the pesky PACKAGE_* macros
|
||||||
# that autoconf automatically generates (and there is no way of
|
# 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.
|
# include with other files.
|
||||||
|
|
||||||
install-data-hook:
|
install-data-hook:
|
||||||
sed -e 's/define PACKAGE/define LAM_MPI_PACKAGE/' \
|
sed -e 's/define PACKAGE/define OMPI_MPI_PACKAGE/' \
|
||||||
$(DESTDIR)$(includedir)/lam_config.h \
|
$(DESTDIR)$(includedir)/ompi_config.h \
|
||||||
> $(DESTDIR)$(includedir)/lam_config.h.install
|
> $(DESTDIR)$(includedir)/ompi_config.h.install
|
||||||
mv $(DESTDIR)$(includedir)/lam_config.h.install \
|
mv $(DESTDIR)$(includedir)/ompi_config.h.install \
|
||||||
$(DESTDIR)$(includedir)/lam_config.h
|
$(DESTDIR)$(includedir)/ompi_config.h
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* $HEADER$
|
* $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
|
* 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
|
* Since this file is *only* ever included by ompi_config.h, and
|
||||||
* lam_config.h already has #ifndef/#endif protection, there is no
|
* ompi_config.h already has #ifndef/#endif protection, there is no
|
||||||
* need to #ifndef/#endif protection here.
|
* need to #ifndef/#endif protection here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -27,20 +27,20 @@ typedef enum { false, true } bool;
|
|||||||
*/
|
*/
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#if defined(PATH_MAX)
|
#if defined(PATH_MAX)
|
||||||
#define LAM_PATH_MAX (PATH_MAX + 1)
|
#define OMPI_PATH_MAX (PATH_MAX + 1)
|
||||||
#elif defined(_POSIX_PATH_MAX)
|
#elif defined(_POSIX_PATH_MAX)
|
||||||
#define LAM_PATH_MAX (_POSIX_PATH_MAX + 1)
|
#define OMPI_PATH_MAX (_POSIX_PATH_MAX + 1)
|
||||||
#else
|
#else
|
||||||
#define LAM_PATH_MAX 256
|
#define OMPI_PATH_MAX 256
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do we have thread support?
|
* 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 */
|
/* parameter indicating if to check MPI arguments */
|
||||||
extern bool lam_mpi_param_check;
|
extern bool ompi_mpi_param_check;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do we have <stdint.h>?
|
* Do we have <stdint.h>?
|
||||||
@ -48,30 +48,30 @@ extern bool lam_mpi_param_check;
|
|||||||
#if HAVE_STDINT_H
|
#if HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#else
|
#else
|
||||||
#include "lam_stdint.h"
|
#include "ompi_stdint.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do we want memory debugging?
|
* 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
|
/* 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
|
source tree [including headers] available, and b) we guaranteed to
|
||||||
*not* to include anything else via mem/malloc.h, so we won't
|
*not* to include anything else via mem/malloc.h, so we won't
|
||||||
have Cascading Includes Of Death. */
|
have Cascading Includes Of Death. */
|
||||||
#include "mem/malloc.h"
|
#include "mem/malloc.h"
|
||||||
#define malloc(size) lam_malloc((size), __FILE__, __LINE__)
|
#define malloc(size) ompi_malloc((size), __FILE__, __LINE__)
|
||||||
#define realloc(ptr, size) lam_realloc((ptr), (size), __FILE__, __LINE__)
|
#define realloc(ptr, size) ompi_realloc((ptr), (size), __FILE__, __LINE__)
|
||||||
#define free(ptr) lam_free((ptr), __FILE__, __LINE__)
|
#define free(ptr) ompi_free((ptr), __FILE__, __LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do we want to override debugging controls?
|
* Do we want to override debugging controls?
|
||||||
*/
|
*/
|
||||||
#if defined(LAM_ENABLE_DEBUG_OVERRIDE) && LAM_ENABLE_DEBUG_OVERRIDE
|
#if defined(OMPI_ENABLE_DEBUG_OVERRIDE) && OMPI_ENABLE_DEBUG_OVERRIDE
|
||||||
#undef LAM_ENABLE_DEBUG
|
#undef OMPI_ENABLE_DEBUG
|
||||||
#define LAM_ENABLE_DEBUG 1
|
#define OMPI_ENABLE_DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
* gathered by configure.
|
* gathered by configure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_STDINT_H
|
#ifndef OMPI_STDINT_H
|
||||||
#define LAM_STDINT_H 1
|
#define OMPI_STDINT_H 1
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#ifdef HAVE_STDINT_H
|
#ifdef HAVE_STDINT_H
|
||||||
|
|
||||||
@ -170,5 +170,5 @@ typedef unsigned long long uintptr_t;
|
|||||||
|
|
||||||
#endif /* HAVE_STDINT_H */
|
#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$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_MPI_H
|
#ifndef OMPI_MPI_H
|
||||||
#define LAM_MPI_H
|
#define OMPI_MPI_H
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Just in case you need it. :-)
|
* Just in case you need it. :-)
|
||||||
*/
|
*/
|
||||||
#define LAM_MPI 1
|
#define OMPI_MPI 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MPI version
|
* MPI version
|
||||||
@ -22,27 +22,27 @@
|
|||||||
* Typedefs
|
* Typedefs
|
||||||
*/
|
*/
|
||||||
typedef long MPI_Aint;
|
typedef long MPI_Aint;
|
||||||
typedef struct lam_communicator_t *MPI_Comm;
|
typedef struct ompi_communicator_t *MPI_Comm;
|
||||||
typedef struct lam_datatype_t *MPI_Datatype;
|
typedef struct ompi_datatype_t *MPI_Datatype;
|
||||||
typedef struct lam_errhandler_t *MPI_Errhandler;
|
typedef struct ompi_errhandler_t *MPI_Errhandler;
|
||||||
typedef struct lam_file_t *MPI_File;
|
typedef struct ompi_file_t *MPI_File;
|
||||||
typedef struct lam_group_t *MPI_Group;
|
typedef struct ompi_group_t *MPI_Group;
|
||||||
typedef struct lam_info_t *MPI_Info;
|
typedef struct ompi_info_t *MPI_Info;
|
||||||
typedef struct lam_op_t *MPI_Op;
|
typedef struct ompi_op_t *MPI_Op;
|
||||||
typedef struct lam_request_t *MPI_Request;
|
typedef struct ompi_request_t *MPI_Request;
|
||||||
typedef struct lam_status_public_t MPI_Status;
|
typedef struct ompi_status_public_t MPI_Status;
|
||||||
typedef struct lam_win_t *MPI_Win;
|
typedef struct ompi_win_t *MPI_Win;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MPI_Status
|
* MPI_Status
|
||||||
*/
|
*/
|
||||||
struct lam_status_public_t {
|
struct ompi_status_public_t {
|
||||||
int MPI_SOURCE;
|
int MPI_SOURCE;
|
||||||
int MPI_TAG;
|
int MPI_TAG;
|
||||||
int MPI_ERROR;
|
int MPI_ERROR;
|
||||||
int _count;
|
int _count;
|
||||||
};
|
};
|
||||||
typedef struct lam_status_public_t lam_status_public_t;
|
typedef struct ompi_status_public_t ompi_status_public_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User typedefs
|
* User typedefs
|
||||||
@ -148,18 +148,18 @@ enum {
|
|||||||
IMPI_HOST_COLOR,
|
IMPI_HOST_COLOR,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Predefined attribute keyvals, but LAM-specific
|
* Predefined attribute keyvals, but OMPI-specific
|
||||||
*/
|
*/
|
||||||
LAM_UNIVERSE_NCPUS,
|
OMPI_UNIVERSE_NCPUS,
|
||||||
LAM_UNIVERSE_NNODES,
|
OMPI_UNIVERSE_NNODES,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Predefined attribute keyvals, but LAM/MPI-specific
|
* Predefined attribute keyvals, but OMPI/MPI-specific
|
||||||
*/
|
*/
|
||||||
LAM_MPI_SSI_COLL,
|
OMPI_MPI_SSI_COLL,
|
||||||
LAM_MPI_SSI_COLL_CROSSOVER,
|
OMPI_MPI_SSI_COLL_CROSSOVER,
|
||||||
LAM_MPI_SSI_COLL_ASSOCIATIVE,
|
OMPI_MPI_SSI_COLL_ASSOCIATIVE,
|
||||||
LAM_MPI_SSI_COLL_REDUCE_CROSSOVER
|
OMPI_MPI_SSI_COLL_REDUCE_CROSSOVER
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -181,7 +181,7 @@ enum {
|
|||||||
MPI_ERR_ARG, /* invalid argument */
|
MPI_ERR_ARG, /* invalid argument */
|
||||||
MPI_ERR_UNKNOWN, /* unknown error */
|
MPI_ERR_UNKNOWN, /* unknown error */
|
||||||
MPI_ERR_TRUNCATE, /* message truncated on receive */
|
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_INTERN, /* internal MPI error */
|
||||||
MPI_ERR_IN_STATUS, /* error code is in status */
|
MPI_ERR_IN_STATUS, /* error code is in status */
|
||||||
MPI_ERR_PENDING, /* pending request */
|
MPI_ERR_PENDING, /* pending request */
|
||||||
@ -254,12 +254,12 @@ enum {
|
|||||||
/*
|
/*
|
||||||
* NULL handles
|
* NULL handles
|
||||||
*/
|
*/
|
||||||
#define MPI_GROUP_NULL (&lam_mpi_group_null)
|
#define MPI_GROUP_NULL (&ompi_mpi_group_null)
|
||||||
#define MPI_COMM_NULL (&lam_mpi_comm_null)
|
#define MPI_COMM_NULL (&ompi_mpi_comm_null)
|
||||||
#define MPI_DATATYPE_NULL ((MPI_Datatype) 0)
|
#define MPI_DATATYPE_NULL ((MPI_Datatype) 0)
|
||||||
#define MPI_REQUEST_NULL ((MPI_Request) 0)
|
#define MPI_REQUEST_NULL ((MPI_Request) 0)
|
||||||
#define MPI_OP_NULL (&lam_mpi_op_null)
|
#define MPI_OP_NULL (&ompi_mpi_op_null)
|
||||||
#define MPI_ERRHANDLER_NULL (&lam_mpi_errhandler_null)
|
#define MPI_ERRHANDLER_NULL (&ompi_mpi_errhandler_null)
|
||||||
#define MPI_INFO_NULL ((MPI_Info) 0)
|
#define MPI_INFO_NULL ((MPI_Info) 0)
|
||||||
#define MPI_WIN_NULL ((MPI_Win) 0)
|
#define MPI_WIN_NULL ((MPI_Win) 0)
|
||||||
#define MPI_FILE_NULL ((MPI_File) 0)
|
#define MPI_FILE_NULL ((MPI_File) 0)
|
||||||
@ -279,50 +279,50 @@ enum {
|
|||||||
/*
|
/*
|
||||||
* External variables
|
* External variables
|
||||||
*/
|
*/
|
||||||
extern struct lam_communicator_t lam_mpi_comm_world;
|
extern struct ompi_communicator_t ompi_mpi_comm_world;
|
||||||
extern struct lam_communicator_t lam_mpi_comm_self;
|
extern struct ompi_communicator_t ompi_mpi_comm_self;
|
||||||
extern struct lam_communicator_t lam_mpi_comm_null;
|
extern struct ompi_communicator_t ompi_mpi_comm_null;
|
||||||
|
|
||||||
extern struct lam_group_t lam_mpi_group_empty;
|
extern struct ompi_group_t ompi_mpi_group_empty;
|
||||||
extern struct lam_group_t lam_mpi_group_null;
|
extern struct ompi_group_t ompi_mpi_group_null;
|
||||||
|
|
||||||
extern struct lam_op_t lam_mpi_op_null;
|
extern struct ompi_op_t ompi_mpi_op_null;
|
||||||
extern struct lam_op_t lam_mpi_op_max, lam_mpi_op_min;
|
extern struct ompi_op_t ompi_mpi_op_max, ompi_mpi_op_min;
|
||||||
extern struct lam_op_t lam_mpi_op_sum, lam_mpi_op_prod;
|
extern struct ompi_op_t ompi_mpi_op_sum, ompi_mpi_op_prod;
|
||||||
extern struct lam_op_t lam_mpi_op_land, lam_mpi_op_band;
|
extern struct ompi_op_t ompi_mpi_op_land, ompi_mpi_op_band;
|
||||||
extern struct lam_op_t lam_mpi_op_lor, lam_mpi_op_bor;
|
extern struct ompi_op_t ompi_mpi_op_lor, ompi_mpi_op_bor;
|
||||||
extern struct lam_op_t lam_mpi_op_lxor, lam_mpi_op_bxor;
|
extern struct ompi_op_t ompi_mpi_op_lxor, ompi_mpi_op_bxor;
|
||||||
extern struct lam_op_t lam_mpi_op_maxloc, lam_mpi_op_minloc;
|
extern struct ompi_op_t ompi_mpi_op_maxloc, ompi_mpi_op_minloc;
|
||||||
extern struct lam_op_t lam_mpi_op_replace;
|
extern struct ompi_op_t ompi_mpi_op_replace;
|
||||||
|
|
||||||
extern struct lam_datatype_t *lam_mpi_char, *lam_mpi_byte;
|
extern struct ompi_datatype_t *ompi_mpi_char, *ompi_mpi_byte;
|
||||||
extern struct lam_datatype_t *lam_mpi_int, *lam_mpi_logic;
|
extern struct ompi_datatype_t *ompi_mpi_int, *ompi_mpi_logic;
|
||||||
extern struct lam_datatype_t *lam_mpi_short, *lam_mpi_long;
|
extern struct ompi_datatype_t *ompi_mpi_short, *ompi_mpi_long;
|
||||||
extern struct lam_datatype_t *lam_mpi_float, *lam_mpi_double;
|
extern struct ompi_datatype_t *ompi_mpi_float, *ompi_mpi_double;
|
||||||
extern struct lam_datatype_t *lam_mpi_long_double;
|
extern struct ompi_datatype_t *ompi_mpi_long_double;
|
||||||
extern struct lam_datatype_t *lam_mpi_cplex, *lam_mpi_packed;
|
extern struct ompi_datatype_t *ompi_mpi_cplex, *ompi_mpi_packed;
|
||||||
extern struct lam_datatype_t *lam_mpi_unsigned_char;
|
extern struct ompi_datatype_t *ompi_mpi_unsigned_char;
|
||||||
extern struct lam_datatype_t *lam_mpi_unsigned_short;
|
extern struct ompi_datatype_t *ompi_mpi_unsigned_short;
|
||||||
extern struct lam_datatype_t *lam_mpi_unsigned;
|
extern struct ompi_datatype_t *ompi_mpi_unsigned;
|
||||||
extern struct lam_datatype_t *lam_mpi_unsigned_long;
|
extern struct ompi_datatype_t *ompi_mpi_unsigned_long;
|
||||||
extern struct lam_datatype_t *lam_mpi_ub, *lam_mpi_lb;
|
extern struct ompi_datatype_t *ompi_mpi_ub, *ompi_mpi_lb;
|
||||||
extern struct lam_datatype_t *lam_mpi_float_int, *lam_mpi_double_int;
|
extern struct ompi_datatype_t *ompi_mpi_float_int, *ompi_mpi_double_int;
|
||||||
extern struct lam_datatype_t *lam_mpi_long_int, *lam_mpi_2int;
|
extern struct ompi_datatype_t *ompi_mpi_long_int, *ompi_mpi_2int;
|
||||||
extern struct lam_datatype_t *lam_mpi_short_int, *lam_mpi_dblcplex;
|
extern struct ompi_datatype_t *ompi_mpi_short_int, *ompi_mpi_dblcplex;
|
||||||
extern struct lam_datatype_t *lam_mpi_integer, *lam_mpi_real;
|
extern struct ompi_datatype_t *ompi_mpi_integer, *ompi_mpi_real;
|
||||||
extern struct lam_datatype_t *lam_mpi_dblprec, *lam_mpi_character;
|
extern struct ompi_datatype_t *ompi_mpi_dblprec, *ompi_mpi_character;
|
||||||
extern struct lam_datatype_t *lam_mpi_2real, *lam_mpi_2dblprec;
|
extern struct ompi_datatype_t *ompi_mpi_2real, *ompi_mpi_2dblprec;
|
||||||
extern struct lam_datatype_t *lam_mpi_2integer, *lam_mpi_longdbl_int;
|
extern struct ompi_datatype_t *ompi_mpi_2integer, *ompi_mpi_longdbl_int;
|
||||||
extern struct lam_datatype_t *lam_mpi_wchar, *lam_mpi_long_long_int;
|
extern struct ompi_datatype_t *ompi_mpi_wchar, *ompi_mpi_long_long_int;
|
||||||
extern struct lam_datatype_t *lam_mpi_long_long, *lam_mpi_unsigned_long_long;
|
extern struct ompi_datatype_t *ompi_mpi_long_long, *ompi_mpi_unsigned_long_long;
|
||||||
extern struct lam_datatype_t *lam_mpi_cxx_cplex, *lam_mpi_cxx_dblcplex;
|
extern struct ompi_datatype_t *ompi_mpi_cxx_cplex, *ompi_mpi_cxx_dblcplex;
|
||||||
extern struct lam_datatype_t *lam_mpi_cxx_ldblcplex;
|
extern struct ompi_datatype_t *ompi_mpi_cxx_ldblcplex;
|
||||||
extern struct lam_datatype_t *lam_mpi_cxx_bool;
|
extern struct ompi_datatype_t *ompi_mpi_cxx_bool;
|
||||||
extern struct lam_datatype_t *lam_mpi_2cplex, *lam_mpi_2dblcplex;
|
extern struct ompi_datatype_t *ompi_mpi_2cplex, *ompi_mpi_2dblcplex;
|
||||||
|
|
||||||
extern struct lam_errhandler_t lam_mpi_errhandler_null;
|
extern struct ompi_errhandler_t ompi_mpi_errhandler_null;
|
||||||
extern struct lam_errhandler_t lam_mpi_errors_are_fatal;
|
extern struct ompi_errhandler_t ompi_mpi_errors_are_fatal;
|
||||||
extern struct lam_errhandler_t lam_mpi_errors_return;
|
extern struct ompi_errhandler_t ompi_mpi_errors_return;
|
||||||
|
|
||||||
extern MPI_Fint *MPI_F_STATUS_IGNORE;
|
extern MPI_Fint *MPI_F_STATUS_IGNORE;
|
||||||
extern MPI_Fint *MPI_F_STATUSES_IGNORE;
|
extern MPI_Fint *MPI_F_STATUSES_IGNORE;
|
||||||
@ -330,55 +330,55 @@ extern MPI_Fint *MPI_F_STATUSES_IGNORE;
|
|||||||
/*
|
/*
|
||||||
* MPI predefined handles
|
* MPI predefined handles
|
||||||
*/
|
*/
|
||||||
#define MPI_COMM_WORLD (&lam_mpi_comm_world)
|
#define MPI_COMM_WORLD (&ompi_mpi_comm_world)
|
||||||
#define MPI_COMM_SELF (&lam_mpi_comm_self)
|
#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_MAX (&ompi_mpi_op_max)
|
||||||
#define MPI_MIN (&lam_mpi_op_min)
|
#define MPI_MIN (&ompi_mpi_op_min)
|
||||||
#define MPI_SUM (&lam_mpi_op_sum)
|
#define MPI_SUM (&ompi_mpi_op_sum)
|
||||||
#define MPI_PROD (&lam_mpi_op_prod)
|
#define MPI_PROD (&ompi_mpi_op_prod)
|
||||||
#define MPI_LAND (&lam_mpi_op_land)
|
#define MPI_LAND (&ompi_mpi_op_land)
|
||||||
#define MPI_BAND (&lam_mpi_op_band)
|
#define MPI_BAND (&ompi_mpi_op_band)
|
||||||
#define MPI_LOR (&lam_mpi_op_lor)
|
#define MPI_LOR (&ompi_mpi_op_lor)
|
||||||
#define MPI_BOR (&lam_mpi_op_bor)
|
#define MPI_BOR (&ompi_mpi_op_bor)
|
||||||
#define MPI_LXOR (&lam_mpi_op_lxor)
|
#define MPI_LXOR (&ompi_mpi_op_lxor)
|
||||||
#define MPI_BXOR (&lam_mpi_op_bxor)
|
#define MPI_BXOR (&ompi_mpi_op_bxor)
|
||||||
#define MPI_MAXLOC (&lam_mpi_op_maxloc)
|
#define MPI_MAXLOC (&ompi_mpi_op_maxloc)
|
||||||
#define MPI_MINLOC (&lam_mpi_op_minloc)
|
#define MPI_MINLOC (&ompi_mpi_op_minloc)
|
||||||
#define MPI_REPLACE (&lam_mpi_op_replace)
|
#define MPI_REPLACE (&ompi_mpi_op_replace)
|
||||||
|
|
||||||
#define MPI_BYTE (lam_mpi_byte)
|
#define MPI_BYTE (ompi_mpi_byte)
|
||||||
#define MPI_PACKED (lam_mpi_packed)
|
#define MPI_PACKED (ompi_mpi_packed)
|
||||||
#define MPI_CHAR (lam_mpi_char)
|
#define MPI_CHAR (ompi_mpi_char)
|
||||||
#define MPI_SHORT (lam_mpi_short)
|
#define MPI_SHORT (ompi_mpi_short)
|
||||||
#define MPI_INT (lam_mpi_int)
|
#define MPI_INT (ompi_mpi_int)
|
||||||
#define MPI_LONG (lam_mpi_long)
|
#define MPI_LONG (ompi_mpi_long)
|
||||||
#define MPI_FLOAT (lam_mpi_float)
|
#define MPI_FLOAT (ompi_mpi_float)
|
||||||
#define MPI_DOUBLE (lam_mpi_double)
|
#define MPI_DOUBLE (ompi_mpi_double)
|
||||||
#define MPI_LONG_DOUBLE (lam_mpi_long_double)
|
#define MPI_LONG_DOUBLE (ompi_mpi_long_double)
|
||||||
#define MPI_UNSIGNED_CHAR (lam_mpi_unsigned_char)
|
#define MPI_UNSIGNED_CHAR (ompi_mpi_unsigned_char)
|
||||||
#define MPI_UNSIGNED_SHORT (lam_mpi_unsigned_short)
|
#define MPI_UNSIGNED_SHORT (ompi_mpi_unsigned_short)
|
||||||
#define MPI_UNSIGNED_LONG (lam_mpi_unsigned_long)
|
#define MPI_UNSIGNED_LONG (ompi_mpi_unsigned_long)
|
||||||
#define MPI_UNSIGNED (lam_mpi_unsigned)
|
#define MPI_UNSIGNED (ompi_mpi_unsigned)
|
||||||
#define MPI_FLOAT_INT (lam_mpi_float_int)
|
#define MPI_FLOAT_INT (ompi_mpi_float_int)
|
||||||
#define MPI_DOUBLE_INT (lam_mpi_double_int)
|
#define MPI_DOUBLE_INT (ompi_mpi_double_int)
|
||||||
#define MPI_LONG_DOUBLE_INT (lam_mpi_longdbl_int)
|
#define MPI_LONG_DOUBLE_INT (ompi_mpi_longdbl_int)
|
||||||
#define MPI_LONG_INT (lam_mpi_long_int)
|
#define MPI_LONG_INT (ompi_mpi_long_int)
|
||||||
#define MPI_SHORT_INT (lam_mpi_short_int)
|
#define MPI_SHORT_INT (ompi_mpi_short_int)
|
||||||
#define MPI_2INT (lam_mpi_2int)
|
#define MPI_2INT (ompi_mpi_2int)
|
||||||
#define MPI_UB (lam_mpi_ub)
|
#define MPI_UB (ompi_mpi_ub)
|
||||||
#define MPI_LB (lam_mpi_lb)
|
#define MPI_LB (ompi_mpi_lb)
|
||||||
#define MPI_WCHAR (lam_mpi_wchar)
|
#define MPI_WCHAR (ompi_mpi_wchar)
|
||||||
#if HAVE_LONG_LONG
|
#if HAVE_LONG_LONG
|
||||||
#define MPI_LONG_LONG_INT (lam_mpi_long_long_int)
|
#define MPI_LONG_LONG_INT (ompi_mpi_long_long_int)
|
||||||
#define MPI_LONG_LONG (lam_mpi_long_long)
|
#define MPI_LONG_LONG (ompi_mpi_long_long)
|
||||||
#define MPI_UNSIGNED_LONG_LONG (lam_mpi_unsigned_long_long)
|
#define MPI_UNSIGNED_LONG_LONG (ompi_mpi_unsigned_long_long)
|
||||||
#endif /* HAVE_LONG_LONG */
|
#endif /* HAVE_LONG_LONG */
|
||||||
|
|
||||||
#define MPI_ERRORS_ARE_FATAL (&lam_mpi_errors_are_fatal)
|
#define MPI_ERRORS_ARE_FATAL (&ompi_mpi_errors_are_fatal)
|
||||||
#define MPI_ERRORS_RETURN (&lam_mpi_errors_return)
|
#define MPI_ERRORS_RETURN (&ompi_mpi_errors_return)
|
||||||
|
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
@ -1413,4 +1413,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
! tells the compiler where to find .h files (specifically, this one). For
|
||||||
! example:
|
! 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).
|
! 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
|
! automatically include the -I option for you. The following command
|
||||||
! should be equivalent to the command listed above:
|
! should be equivalent to the command listed above:
|
||||||
!
|
!
|
||||||
! shell$ mpif77 foo.f -o foo
|
! shell$ mpif77 foo.f -o foo
|
||||||
!
|
!
|
||||||
! You should not copy this file to your local directory because it is
|
! 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
|
! Indeed, this mpif.h is incompatible with the mpif.f of other
|
||||||
! implementations of MPI. Using this mpif.h with other implementations
|
! 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,
|
! behavior (to include incorrect results, segmentation faults,
|
||||||
! unexplainable "hanging" in your application, etc.). Always use the
|
! unexplainable "hanging" in your application, etc.). Always use the
|
||||||
! -I command line option instead (or let mpif77 do it for you).
|
! -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.
|
! This file is generated from configure; do not edit it manually.
|
||||||
!
|
!
|
||||||
integer LAM_MAJOR_VERSION, LAM_MINOR_VERSION
|
integer OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION
|
||||||
integer LAM_RELEASE_VERSION
|
integer OMPI_RELEASE_VERSION
|
||||||
integer LAM_ALPHA_VERSION, LAM_BETA_VERSION
|
integer OMPI_ALPHA_VERSION, OMPI_BETA_VERSION
|
||||||
integer LAM_SVN_VERSION
|
integer OMPI_SVN_VERSION
|
||||||
parameter (LAM_MAJOR_VERSION=@LAM_MAJOR_VERSION@)
|
parameter (OMPI_MAJOR_VERSION=@OMPI_MAJOR_VERSION@)
|
||||||
parameter (LAM_MINOR_VERSION=@LAM_MINOR_VERSION@)
|
parameter (OMPI_MINOR_VERSION=@OMPI_MINOR_VERSION@)
|
||||||
parameter (LAM_RELEASE_VERSION=@LAM_RELEASE_VERSION@)
|
parameter (OMPI_RELEASE_VERSION=@OMPI_RELEASE_VERSION@)
|
||||||
parameter (LAM_ALPHA_VERSION=@LAM_ALPHA_VERSION@)
|
parameter (OMPI_ALPHA_VERSION=@OMPI_ALPHA_VERSION@)
|
||||||
parameter (LAM_BETA_VERSION=@LAM_BETA_VERSION@)
|
parameter (OMPI_BETA_VERSION=@OMPI_BETA_VERSION@)
|
||||||
parameter (LAM_SVN_VERSION=@LAM_SVN_VERSION@)
|
parameter (OMPI_SVN_VERSION=@OMPI_SVN_VERSION@)
|
||||||
!
|
!
|
||||||
! MPI version
|
! MPI version
|
||||||
!
|
!
|
||||||
@ -240,12 +240,12 @@
|
|||||||
parameter (MPI_INTEGER1=12)
|
parameter (MPI_INTEGER1=12)
|
||||||
parameter (MPI_INTEGER2=13)
|
parameter (MPI_INTEGER2=13)
|
||||||
parameter (MPI_INTEGER4=14)
|
parameter (MPI_INTEGER4=14)
|
||||||
parameter (MPI_INTEGER8=@LAM_INDEXOF_FORTRAN_INTEGER8@)
|
parameter (MPI_INTEGER8=@OMPI_INDEXOF_FORTRAN_INTEGER8@)
|
||||||
parameter (MPI_REAL=16)
|
parameter (MPI_REAL=16)
|
||||||
parameter (MPI_REAL2=17)
|
parameter (MPI_REAL2=17)
|
||||||
parameter (MPI_REAL4=18)
|
parameter (MPI_REAL4=18)
|
||||||
parameter (MPI_REAL8=19)
|
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_DOUBLE_PRECISION=21)
|
||||||
parameter (MPI_COMPLEX=22)
|
parameter (MPI_COMPLEX=22)
|
||||||
parameter (MPI_DOUBLE_COMPLEX=23)
|
parameter (MPI_DOUBLE_COMPLEX=23)
|
||||||
|
@ -17,7 +17,7 @@ SUBDIRS = \
|
|||||||
file \
|
file \
|
||||||
group \
|
group \
|
||||||
info \
|
info \
|
||||||
lfc \
|
class \
|
||||||
mca \
|
mca \
|
||||||
mem \
|
mem \
|
||||||
mpi \
|
mpi \
|
||||||
@ -44,7 +44,7 @@ libmpi_la_LIBADD = \
|
|||||||
event/libevent.la \
|
event/libevent.la \
|
||||||
group/libgroup.la \
|
group/libgroup.la \
|
||||||
info/libinfo.la \
|
info/libinfo.la \
|
||||||
lfc/liblfc.la \
|
class/liblfc.la \
|
||||||
mca/libmca.la \
|
mca/libmca.la \
|
||||||
mem/libmem.la \
|
mem/libmem.la \
|
||||||
mpi/libmpi_bindings.la \
|
mpi/libmpi_bindings.la \
|
||||||
|
@ -19,8 +19,8 @@ libattribute_la_SOURCES = \
|
|||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
|
||||||
if WANT_INSTALL_HEADERS
|
if WANT_INSTALL_HEADERS
|
||||||
lamdir = $(includedir)/lam/attribute
|
ompidir = $(includedir)/ompi/attribute
|
||||||
lam_HEADERS = $(headers)
|
ompi_HEADERS = $(headers)
|
||||||
else
|
else
|
||||||
lamdir = $(includedir)
|
ompidir = $(includedir)
|
||||||
endif
|
endif
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
#define MPI_DATATYPE_NULL_COPY_FN MPI_TYPE_NULL_COPY_FN
|
#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
|
/* Not checking for NULL_DELETE_FN here, since according to the
|
||||||
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#define DELETE_ATTR_OBJECT(type, attribute) \
|
#define DELETE_ATTR_OBJECT(type, attribute) \
|
||||||
if ((err = (*((key_item->delete_attr_fn).attr_##type##_delete_fn)) \
|
if ((err = (*((key_item->delete_attr_fn).attr_##type##_delete_fn)) \
|
||||||
((lam_##type##_t *)object, \
|
((ompi_##type##_t *)object, \
|
||||||
key, attribute, \
|
key, attribute, \
|
||||||
key_item->extra_state)) != MPI_SUCCESS) {\
|
key_item->extra_state)) != MPI_SUCCESS) {\
|
||||||
return err;\
|
return err;\
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#define COPY_ATTR_OBJECT(type, old_object, hash_value) \
|
#define COPY_ATTR_OBJECT(type, old_object, hash_value) \
|
||||||
if ((err = (*((hash_value->copy_attr_fn).attr_##type##_copy_fn)) \
|
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) { \
|
old_attr, &new_attr, &flag)) != MPI_SUCCESS) { \
|
||||||
return err; \
|
return err; \
|
||||||
}
|
}
|
||||||
@ -45,74 +45,74 @@
|
|||||||
/*
|
/*
|
||||||
* Static
|
* Static
|
||||||
*/
|
*/
|
||||||
static void lam_attribute_construct(lam_attrkey_t *attribute);
|
static void ompi_attribute_construct(ompi_attrkey_t *attribute);
|
||||||
static void lam_attribute_destruct(lam_attrkey_t *attribute);
|
static void ompi_attribute_destruct(ompi_attrkey_t *attribute);
|
||||||
static void lam_attrkey_item_construct(lam_attrkey_item_t *item);
|
static void ompi_attrkey_item_construct(ompi_attrkey_item_t *item);
|
||||||
static void lam_attrkey_item_destruct(lam_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,
|
OBJ_CLASS_INSTANCE(ompi_attrkey_t,
|
||||||
lam_list_t,
|
ompi_list_t,
|
||||||
lam_attribute_construct,
|
ompi_attribute_construct,
|
||||||
lam_attribute_destruct);
|
ompi_attribute_destruct);
|
||||||
/*
|
/*
|
||||||
* lam_attribute_entry_t classes
|
* ompi_attribute_entry_t classes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OBJ_CLASS_INSTANCE(lam_attrkey_item_t,
|
OBJ_CLASS_INSTANCE(ompi_attrkey_item_t,
|
||||||
lam_object_t,
|
ompi_object_t,
|
||||||
lam_attrkey_item_construct,
|
ompi_attrkey_item_construct,
|
||||||
lam_attrkey_item_destruct);
|
ompi_attrkey_item_destruct);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Static variables
|
* Static variables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static lam_attrkey_t *attr_hash;
|
static ompi_attrkey_t *attr_hash;
|
||||||
static lam_bitmap_t *key_bitmap;
|
static ompi_bitmap_t *key_bitmap;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* lam_attrkey_t interface functions
|
* ompi_attrkey_t interface functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lam_attribute_construct(lam_attrkey_t *attribute)
|
ompi_attribute_construct(ompi_attrkey_t *attribute)
|
||||||
{
|
{
|
||||||
attribute->a_fhandle = -1;
|
attribute->a_fhandle = -1;
|
||||||
OBJ_CONSTRUCT(&(attribute->super), lam_hash_table_t);
|
OBJ_CONSTRUCT(&(attribute->super), ompi_hash_table_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lam_attribute_destruct(lam_attrkey_t *attribute)
|
ompi_attribute_destruct(ompi_attrkey_t *attribute)
|
||||||
{
|
{
|
||||||
OBJ_DESTRUCT(&(attribute->super));
|
OBJ_DESTRUCT(&(attribute->super));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* lam_attrkey_item_t interface functions
|
* ompi_attrkey_item_t interface functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
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,
|
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
|
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 */
|
/* 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);
|
FREE_KEY(item->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,22 +123,22 @@ lam_attrkey_item_destruct(lam_attrkey_item_t *item)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
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) {
|
if (NULL == attr_hash) {
|
||||||
fprintf(stderr, "Error while creating the main attribute list\n");
|
fprintf(stderr, "Error while creating the main attribute list\n");
|
||||||
return MPI_ERR_SYSRESOURCE;
|
return MPI_ERR_SYSRESOURCE;
|
||||||
}
|
}
|
||||||
key_bitmap = OBJ_NEW(lam_bitmap_t);
|
key_bitmap = OBJ_NEW(ompi_bitmap_t);
|
||||||
if (0 != lam_bitmap_init(key_bitmap, 10)) {
|
if (0 != ompi_bitmap_init(key_bitmap, 10)) {
|
||||||
return MPI_ERR_SYSRESOURCE;
|
return MPI_ERR_SYSRESOURCE;
|
||||||
}
|
}
|
||||||
if (lam_hash_table_init(&attr_hash->super,
|
if (ompi_hash_table_init(&attr_hash->super,
|
||||||
ATTR_TABLE_SIZE) != LAM_SUCCESS)
|
ATTR_TABLE_SIZE) != OMPI_SUCCESS)
|
||||||
return MPI_ERR_SYSRESOURCE;
|
return MPI_ERR_SYSRESOURCE;
|
||||||
|
|
||||||
return LAM_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ lam_attr_init()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
lam_attr_destroy()
|
ompi_attr_destroy()
|
||||||
{
|
{
|
||||||
OBJ_RELEASE(attr_hash);
|
OBJ_RELEASE(attr_hash);
|
||||||
OBJ_RELEASE(key_bitmap);
|
OBJ_RELEASE(key_bitmap);
|
||||||
@ -155,22 +155,22 @@ lam_attr_destroy()
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_attr_create_keyval(lam_attribute_type_t type,
|
ompi_attr_create_keyval(ompi_attribute_type_t type,
|
||||||
lam_attribute_fn_ptr_union_t copy_attr_fn,
|
ompi_attribute_fn_ptr_union_t copy_attr_fn,
|
||||||
lam_attribute_fn_ptr_union_t delete_attr_fn,
|
ompi_attribute_fn_ptr_union_t delete_attr_fn,
|
||||||
int *key, void *extra_state, int predefined)
|
int *key, void *extra_state, int predefined)
|
||||||
{
|
{
|
||||||
lam_attrkey_item_t *attr;
|
ompi_attrkey_item_t *attr;
|
||||||
int ret;
|
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 */
|
calling any of the functions which use it */
|
||||||
if (NULL == attr_hash)
|
if (NULL == attr_hash)
|
||||||
return MPI_ERR_INTERN;
|
return MPI_ERR_INTERN;
|
||||||
|
|
||||||
/* Allocate space for the list item */
|
/* Allocate space for the list item */
|
||||||
|
|
||||||
attr = OBJ_NEW(lam_attrkey_item_t);
|
attr = OBJ_NEW(ompi_attrkey_item_t);
|
||||||
if (NULL == attr) {
|
if (NULL == attr) {
|
||||||
fprintf(stderr, "Error during new object creation for attribute \n");
|
fprintf(stderr, "Error during new object creation for attribute \n");
|
||||||
return MPI_ERR_SYSRESOURCE;
|
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 */
|
/* Create a new unique key and fill the hash */
|
||||||
|
|
||||||
*key = CREATE_KEY();
|
*key = CREATE_KEY();
|
||||||
ret = lam_hash_table_set_value_uint32(&attr_hash->super, *key, attr);
|
ret = ompi_hash_table_set_value_uint32(&attr_hash->super, *key, attr);
|
||||||
if (ret != LAM_SUCCESS)
|
if (ret != OMPI_SUCCESS)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Fill in the list item */
|
/* Fill in the list item */
|
||||||
@ -190,7 +190,7 @@ lam_attr_create_keyval(lam_attribute_type_t type,
|
|||||||
attr->extra_state = extra_state;
|
attr->extra_state = extra_state;
|
||||||
attr->attr_type = type;
|
attr->attr_type = type;
|
||||||
attr->key = *key;
|
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
|
/* Bump up the reference count, since we want the object to be
|
||||||
destroyed only when free_keyval is called and not when all
|
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
|
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 */
|
calling any of the functions which use it */
|
||||||
if (NULL == attr_hash)
|
if (NULL == attr_hash)
|
||||||
return MPI_ERR_INTERN;
|
return MPI_ERR_INTERN;
|
||||||
|
|
||||||
/* Find the key-value pair */
|
/* Find the key-value pair */
|
||||||
|
|
||||||
key_item = (lam_attrkey_item_t*)
|
key_item = (ompi_attrkey_item_t*)
|
||||||
lam_hash_table_get_value_uint32(&attr_hash->super, *key);
|
ompi_hash_table_get_value_uint32(&attr_hash->super, *key);
|
||||||
|
|
||||||
if ((NULL == key_item) || (key_item->attr_type != type) ||
|
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;
|
return MPI_INVALID_ATTR_KEYVAL;
|
||||||
|
|
||||||
/* Not releasing the object here, it will be done in MPI_*_attr_delete */
|
/* 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
|
int
|
||||||
lam_attr_delete(lam_attribute_type_t type, void *object,
|
ompi_attr_delete(ompi_attribute_type_t type, void *object,
|
||||||
lam_hash_table_t *keyhash, int key,
|
ompi_hash_table_t *keyhash, int key,
|
||||||
int predefined)
|
int predefined)
|
||||||
{
|
{
|
||||||
lam_attrkey_item_t *key_item;
|
ompi_attrkey_item_t *key_item;
|
||||||
int ret, err;
|
int ret, err;
|
||||||
void *attr;
|
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 */
|
calling any of the functions which use it */
|
||||||
if (NULL == attr_hash)
|
if (NULL == attr_hash)
|
||||||
return MPI_ERR_INTERN;
|
return MPI_ERR_INTERN;
|
||||||
|
|
||||||
/* Check if the key is valid in the key-attribute hash */
|
/* Check if the key is valid in the key-attribute hash */
|
||||||
|
|
||||||
key_item = (lam_attrkey_item_t*)
|
key_item = (ompi_attrkey_item_t*)
|
||||||
lam_hash_table_get_value_uint32(&attr_hash->super, key);
|
ompi_hash_table_get_value_uint32(&attr_hash->super, key);
|
||||||
|
|
||||||
if ((NULL == key_item) || (key_item->attr_type!= type) ||
|
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;
|
return MPI_INVALID_ATTR_KEYVAL;
|
||||||
|
|
||||||
/* Check if the key is valid for the communicator/window/dtype. If
|
/* Check if the key is valid for the communicator/window/dtype. If
|
||||||
yes, then delete the attribute and key entry from the CWD hash */
|
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) {
|
switch(type) {
|
||||||
|
|
||||||
@ -281,13 +281,13 @@ lam_attr_delete(lam_attribute_type_t type, void *object,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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");
|
" Should be one of COMM/WIN/TYPE \n");
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = lam_hash_table_remove_value_uint32(keyhash, key);
|
ret = ompi_hash_table_remove_value_uint32(keyhash, key);
|
||||||
if (ret != LAM_SUCCESS) {
|
if (ret != OMPI_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,34 +301,34 @@ lam_attr_delete(lam_attribute_type_t type, void *object,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_attr_set(lam_attribute_type_t type, void *object,
|
ompi_attr_set(ompi_attribute_type_t type, void *object,
|
||||||
lam_hash_table_t *keyhash, int key, void *attribute,
|
ompi_hash_table_t *keyhash, int key, void *attribute,
|
||||||
int predefined)
|
int predefined)
|
||||||
{
|
{
|
||||||
lam_attrkey_item_t *key_item;
|
ompi_attrkey_item_t *key_item;
|
||||||
int ret, err;
|
int ret, err;
|
||||||
void *oldattr;
|
void *oldattr;
|
||||||
int had_old = 0;
|
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 */
|
calling any of the functions which use it */
|
||||||
if (NULL == attr_hash)
|
if (NULL == attr_hash)
|
||||||
return MPI_ERR_INTERN;
|
return MPI_ERR_INTERN;
|
||||||
|
|
||||||
key_item = (lam_attrkey_item_t *)
|
key_item = (ompi_attrkey_item_t *)
|
||||||
lam_hash_table_get_value_uint32(&(attr_hash->super), key);
|
ompi_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||||
|
|
||||||
/* If key not found */
|
/* If key not found */
|
||||||
|
|
||||||
if ((NULL == key_item) || (key_item->attr_type != type) ||
|
if ((NULL == key_item) || (key_item->attr_type != type) ||
|
||||||
((!predefined) && (key_item->attr_flag & LAM_PREDEFINED))) {
|
((!predefined) && (key_item->attr_flag & OMPI_PREDEFINED))) {
|
||||||
fprintf(stderr, "lam_attribute: lam_attr_set: key not found \n");
|
fprintf(stderr, "ompi_attribute: ompi_attr_set: key not found \n");
|
||||||
return MPI_INVALID_ATTR_KEYVAL;
|
return MPI_INVALID_ATTR_KEYVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now see if the key is present in the CWD object. If so, delete
|
/* Now see if the key is present in the CWD object. If so, delete
|
||||||
the old attribute in the key */
|
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) {
|
if (oldattr != NULL) {
|
||||||
|
|
||||||
@ -347,15 +347,15 @@ lam_attr_set(lam_attribute_type_t type, void *object,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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");
|
" Should be one of COMM/WIN/TYPE \n");
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
had_old = 1;
|
had_old = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = lam_hash_table_set_value_uint32(keyhash, key, attribute);
|
ret = ompi_hash_table_set_value_uint32(keyhash, key, attribute);
|
||||||
if (ret != LAM_SUCCESS) {
|
if (ret != OMPI_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,25 +370,25 @@ lam_attr_set(lam_attribute_type_t type, void *object,
|
|||||||
|
|
||||||
|
|
||||||
int
|
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)
|
int *flag)
|
||||||
{
|
{
|
||||||
void *attr;
|
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
|
/* According to MPI specs, the call is invalid if key is not
|
||||||
present in the main hash at all. If no attribute is associated
|
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
|
with the key, then the call is valid and returns FALSE in the
|
||||||
flag argument */
|
flag argument */
|
||||||
|
|
||||||
key_item = (lam_attrkey_item_t *)
|
key_item = (ompi_attrkey_item_t *)
|
||||||
lam_hash_table_get_value_uint32(&(attr_hash->super), key);
|
ompi_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||||
|
|
||||||
if (NULL == key_item) {
|
if (NULL == key_item) {
|
||||||
return MPI_KEYVAL_INVALID;
|
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) {
|
if (NULL == attr) {
|
||||||
*flag = 0;
|
*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
|
/* There is too much of code copy/paste in here, see if some other
|
||||||
logic could work here */
|
logic could work here */
|
||||||
int
|
int
|
||||||
lam_attr_copy_all(lam_attribute_type_t type, void *old_object,
|
ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
|
||||||
void *new_object, lam_hash_table_t *oldkeyhash,
|
void *new_object, ompi_hash_table_t *oldkeyhash,
|
||||||
lam_hash_table_t *newkeyhash)
|
ompi_hash_table_t *newkeyhash)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int err;
|
int err;
|
||||||
uint32_t key;
|
uint32_t key;
|
||||||
int flag;
|
int flag;
|
||||||
void *node, *in_node, *old_attr, *new_attr;
|
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 */
|
calling any of the functions which use it */
|
||||||
if (NULL == attr_hash)
|
if (NULL == attr_hash)
|
||||||
return MPI_ERR_INTERN;
|
return MPI_ERR_INTERN;
|
||||||
|
|
||||||
/* Get the first key-attr in the CWD hash */
|
/* 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);
|
&node);
|
||||||
|
|
||||||
/* While we still have some key-attr pair in the CWD hash */
|
/* While we still have some key-attr pair in the CWD hash */
|
||||||
while (ret != LAM_ERROR) {
|
while (ret != OMPI_ERROR) {
|
||||||
in_node = node;
|
in_node = node;
|
||||||
|
|
||||||
/* Get the attr_item in the main hash - so that we know
|
/* Get the attr_item in the main hash - so that we know
|
||||||
what the copy_attr_fn is */
|
what the copy_attr_fn is */
|
||||||
|
|
||||||
hash_value = (lam_attrkey_item_t *)
|
hash_value = (ompi_attrkey_item_t *)
|
||||||
lam_hash_table_get_value_uint32(&(attr_hash->super), key);
|
ompi_hash_table_get_value_uint32(&(attr_hash->super), key);
|
||||||
|
|
||||||
assert (hash_value != NULL);
|
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
|
assuming that new_attr should have actually been a
|
||||||
double pointer in the copy fn, but since its a pointer
|
double pointer in the copy fn, but since its a pointer
|
||||||
in that MPI specs, we need to pass *new_attr here */
|
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);
|
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,
|
&old_attr, in_node,
|
||||||
&node);
|
&node);
|
||||||
}
|
}
|
||||||
@ -485,23 +485,23 @@ lam_attr_copy_all(lam_attribute_type_t type, void *old_object,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_attr_delete_all(lam_attribute_type_t type, void *object,
|
ompi_attr_delete_all(ompi_attribute_type_t type, void *object,
|
||||||
lam_hash_table_t *keyhash)
|
ompi_hash_table_t *keyhash)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t key, oldkey;
|
uint32_t key, oldkey;
|
||||||
void *node, *in_node, *old_attr;
|
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 */
|
calling any of the functions which use it */
|
||||||
if (NULL == attr_hash)
|
if (NULL == attr_hash)
|
||||||
return MPI_ERR_INTERN;
|
return MPI_ERR_INTERN;
|
||||||
|
|
||||||
/* Get the first key in local CWD hash */
|
/* 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,
|
&key, &old_attr,
|
||||||
&node);
|
&node);
|
||||||
while (ret != LAM_ERROR) {
|
while (ret != OMPI_ERROR) {
|
||||||
|
|
||||||
/* Save this node info for deletion, before we move onto the
|
/* Save this node info for deletion, before we move onto the
|
||||||
next node */
|
next node */
|
||||||
@ -511,12 +511,12 @@ lam_attr_delete_all(lam_attribute_type_t type, void *object,
|
|||||||
|
|
||||||
/* Move to the next node */
|
/* 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,
|
&key, &old_attr,
|
||||||
in_node, &node);
|
in_node, &node);
|
||||||
/* Now delete this attribute */
|
/* 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.
|
* win or datatype.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_ATTRIBUTE_H
|
#ifndef OMPI_ATTRIBUTE_H
|
||||||
#define LAM_ATTRIBUTE_H
|
#define OMPI_ATTRIBUTE_H
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "lfc/lam_bitmap.h"
|
#include "class/ompi_bitmap.h"
|
||||||
#include "lfc/lam_hash_table.h"
|
#include "class/ompi_hash_table.h"
|
||||||
#include "communicator/communicator.h"
|
#include "communicator/communicator.h"
|
||||||
#include "datatype/datatype.h"
|
#include "datatype/datatype.h"
|
||||||
#include "win/win.h"
|
#include "win/win.h"
|
||||||
@ -29,15 +29,15 @@
|
|||||||
just to make things compile now, should take other value in a
|
just to make things compile now, should take other value in a
|
||||||
different enum later */
|
different enum later */
|
||||||
|
|
||||||
enum lam_consts{
|
enum ompi_consts{
|
||||||
LAM_PREDEFINED = 1,
|
OMPI_PREDEFINED = 1,
|
||||||
MPI_ERROR,
|
MPI_ERROR,
|
||||||
MPI_INVALID_ATTR_KEYVAL
|
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
|
COMM_ATTR = 1, /**< The attribute belongs to a comm object. Starts
|
||||||
with 1 so that we can have it initialized to 0
|
with 1 so that we can have it initialized to 0
|
||||||
using memset in the constructor */
|
using memset in the constructor */
|
||||||
@ -45,13 +45,13 @@ enum lam_attribute_type_t{
|
|||||||
TYPE_ATTR /**< The attribute belongs to datatype object */
|
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
|
/* Union to take care of proper casting of the function pointers
|
||||||
passed from the front end functions depending on the type. This
|
passed from the front end functions depending on the type. This
|
||||||
will avoid casting function pointers to void* */
|
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_Comm_delete_attr_function *attr_communicator_delete_fn;
|
||||||
MPI_Type_delete_attr_function *attr_datatype_delete_fn;
|
MPI_Type_delete_attr_function *attr_datatype_delete_fn;
|
||||||
MPI_Win_delete_attr_function *attr_win_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;
|
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 {
|
struct ompi_attrkey_t {
|
||||||
lam_hash_table_t super; /**< hash table pointer which will contain
|
ompi_hash_table_t super; /**< hash table pointer which will contain
|
||||||
<key,attr_meta_data> pair */
|
<key,attr_meta_data> pair */
|
||||||
int a_fhandle; /**<Fortran handle for language interoperability */
|
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 {
|
struct ompi_attrkey_item_t {
|
||||||
lam_object_t super;
|
ompi_object_t super;
|
||||||
lam_attribute_type_t attr_type; /**< One of COMM/WIN/DTYPE. This
|
ompi_attribute_type_t attr_type; /**< One of COMM/WIN/DTYPE. This
|
||||||
will be used to cast the
|
will be used to cast the
|
||||||
copy/delete attribute functions
|
copy/delete attribute functions
|
||||||
properly and error checking */
|
properly and error checking */
|
||||||
int attr_flag; /**< flag field to denote if its predefined */
|
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 */
|
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 */
|
attribute */
|
||||||
void *extra_state; /**< Extra state of the attribute */
|
void *extra_state; /**< Extra state of the attribute */
|
||||||
int key; /**< Keep a track of which key this item belongs to, so that
|
int key; /**< Keep a track of which key this item belongs to, so that
|
||||||
the key can be deleted when this object is destroyed */
|
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 */
|
/* Functions */
|
||||||
@ -104,14 +104,14 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static inline
|
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) {
|
if (NULL == keyhash) {
|
||||||
fprintf(stderr, "Error while creating the local attribute list\n");
|
fprintf(stderr, "Error while creating the local attribute list\n");
|
||||||
return MPI_ERR_SYSRESOURCE;
|
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_ERR_SYSRESOURCE;
|
||||||
|
|
||||||
return MPI_SUCCESS;
|
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
|
* 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
|
* 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,
|
* any predefined keys or the attributes attached. To accomplish this,
|
||||||
* all MPI* calls will have predefined argument set as 0. MPI
|
* all MPI* calls will have predefined argument set as 0. MPI
|
||||||
* implementors who will need to play with the predefined keys and
|
* 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.
|
* functions, with predefined argument set to 1.
|
||||||
* END OF NOTE
|
* END OF NOTE
|
||||||
*
|
*
|
||||||
* NOTE: For the function pointers, you need to create a variable of the
|
* 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
|
* to be passed into this function
|
||||||
* END OF NOTE
|
* END OF NOTE
|
||||||
*
|
*
|
||||||
* @return LAM return code
|
* @return OMPI return code
|
||||||
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int lam_attr_create_keyval(lam_attribute_type_t type,
|
int ompi_attr_create_keyval(ompi_attribute_type_t type,
|
||||||
lam_attribute_fn_ptr_union_t copy_attr_fn,
|
ompi_attribute_fn_ptr_union_t copy_attr_fn,
|
||||||
lam_attribute_fn_ptr_union_t delete_attr_fn,
|
ompi_attribute_fn_ptr_union_t delete_attr_fn,
|
||||||
int *key, void *extra_state, int predefined);
|
int *key, void *extra_state, int predefined);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free an attribute keyval
|
* Free an attribute keyval
|
||||||
* @param type Type of attribute (COMM/WIN/DTYPE) (IN)
|
* @param type Type of attribute (COMM/WIN/DTYPE) (IN)
|
||||||
* @param key key, which is set to MPI_KEY_INVALID (IN/OUT)
|
* @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
|
* 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 key Key val for the attribute (IN)
|
||||||
* @param attribute The actual attribute pointer (IN)
|
* @param attribute The actual attribute pointer (IN)
|
||||||
* @param predefined Whether the key is predefined or not 0/1 (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,
|
int ompi_attr_set(ompi_attribute_type_t type, void *object,
|
||||||
lam_hash_table_t *keyhash,
|
ompi_hash_table_t *keyhash,
|
||||||
int key, void *attribute, int predefined);
|
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 attribute The actual attribute pointer (OUT)
|
||||||
* @param flag Flag whether an attribute is associated
|
* @param flag Flag whether an attribute is associated
|
||||||
* with the key (OUT)
|
* 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);
|
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 keyhash The attribute hash table hanging on the object(IN)
|
||||||
* @param key Key val for the attribute (IN)
|
* @param key Key val for the attribute (IN)
|
||||||
* @param predefined Whether the key is predefined or not 0/1 (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,
|
int ompi_attr_delete(ompi_attribute_type_t type, void *object,
|
||||||
lam_hash_table_t *keyhash , int key,
|
ompi_hash_table_t *keyhash , int key,
|
||||||
int predefined);
|
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 new_object The new COMM/WIN/DTYPE object (IN)
|
||||||
* @param keyhash The attribute hash table hanging on old object(IN)
|
* @param keyhash The attribute hash table hanging on old object(IN)
|
||||||
* @param newkeyhash The attribute hash table hanging on new 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,
|
int ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
|
||||||
void *new_object, lam_hash_table_t *oldkeyhash,
|
void *new_object, ompi_hash_table_t *oldkeyhash,
|
||||||
lam_hash_table_t *newkeyhash);
|
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 type Type of attribute (COMM/WIN/DTYPE) (IN)
|
||||||
* @param object The COMM/WIN/DTYPE object (IN)
|
* @param object The COMM/WIN/DTYPE object (IN)
|
||||||
* @param keyhash The attribute hash table hanging on the 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,
|
int ompi_attr_delete_all(ompi_attribute_type_t type, void *object,
|
||||||
lam_hash_table_t *keyhash);
|
ompi_hash_table_t *keyhash);
|
||||||
|
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
@ -261,4 +261,4 @@ int lam_attr_delete_all(lam_attribute_type_t type, void *object,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* LAM_ATTRIBUTE_H */
|
#endif /* OMPI_ATTRIBUTE_H */
|
||||||
|
@ -14,15 +14,15 @@ headers = \
|
|||||||
|
|
||||||
libcommunicator_la_SOURCES = \
|
libcommunicator_la_SOURCES = \
|
||||||
$(headers) \
|
$(headers) \
|
||||||
lam_comm_init.c \
|
ompi_comm_init.c \
|
||||||
comm.c \
|
comm.c \
|
||||||
comm_cid.c
|
comm_cid.c
|
||||||
|
|
||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
|
||||||
if WANT_INSTALL_HEADERS
|
if WANT_INSTALL_HEADERS
|
||||||
lamdir = $(includedir)/lam/communicator
|
ompidir = $(includedir)/ompi/communicator
|
||||||
lam_HEADERS = $(headers)
|
ompi_HEADERS = $(headers)
|
||||||
else
|
else
|
||||||
lamdir = $(includedir)
|
ompidir = $(includedir)
|
||||||
endif
|
endif
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mpi.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.
|
* This is the function setting all elements of a communicator.
|
||||||
* All other routines are just used to determine these elements.
|
* All other routines are just used to determine these elements.
|
||||||
*/
|
*/
|
||||||
lam_communicator_t * lam_comm_set ( int mode,
|
ompi_communicator_t * ompi_comm_set ( int mode,
|
||||||
lam_communicator_t* oldcomm,
|
ompi_communicator_t* oldcomm,
|
||||||
lam_communicator_t* bridgecomm,
|
ompi_communicator_t* bridgecomm,
|
||||||
int local_size,
|
int local_size,
|
||||||
lam_proc_t **local_procs,
|
ompi_proc_t **local_procs,
|
||||||
int remote_size,
|
int remote_size,
|
||||||
lam_proc_t **remote_procs,
|
ompi_proc_t **remote_procs,
|
||||||
lam_hash_table_t *attr,
|
ompi_hash_table_t *attr,
|
||||||
lam_errhandler_t *errh,
|
ompi_errhandler_t *errh,
|
||||||
mca_base_module_t *collmodule,
|
mca_base_module_t *collmodule,
|
||||||
mca_base_module_t *topomodule,
|
mca_base_module_t *topomodule,
|
||||||
int local_leader,
|
int local_leader,
|
||||||
int remote_leader
|
int remote_leader
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
lam_communicator_t *newcomm;
|
ompi_communicator_t *newcomm;
|
||||||
lam_proc_t *my_gpointer;
|
ompi_proc_t *my_gpointer;
|
||||||
int my_grank;
|
int my_grank;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Allocate comm structure */
|
/* Allocate comm structure */
|
||||||
newcomm = lam_comm_allocate ( local_size, remote_size );
|
newcomm = ompi_comm_allocate ( local_size, remote_size );
|
||||||
|
|
||||||
/* Set local_group information */
|
/* Set local_group information */
|
||||||
memcpy ( newcomm->c_local_group->grp_proc_pointers,
|
memcpy ( newcomm->c_local_group->grp_proc_pointers,
|
||||||
local_procs, local_size * sizeof(lam_proc_t *));
|
local_procs, local_size * sizeof(ompi_proc_t *));
|
||||||
lam_group_increment_proc_count(newcomm->c_local_group);
|
ompi_group_increment_proc_count(newcomm->c_local_group);
|
||||||
|
|
||||||
/* determine my rank */
|
/* determine my rank */
|
||||||
my_grank = oldcomm->c_local_group->grp_my_rank;
|
my_grank = oldcomm->c_local_group->grp_my_rank;
|
||||||
my_gpointer = oldcomm->c_local_group->grp_proc_pointers[my_grank];
|
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;
|
newcomm->c_my_rank = newcomm->c_local_group->grp_my_rank;
|
||||||
|
|
||||||
/* Set remote group, if applicable */
|
/* Set remote group, if applicable */
|
||||||
if ( 0 < remote_size) {
|
if ( 0 < remote_size) {
|
||||||
memcpy ( newcomm->c_remote_group->grp_proc_pointers,
|
memcpy ( newcomm->c_remote_group->grp_proc_pointers,
|
||||||
remote_procs, remote_size * sizeof(lam_proc_t *));
|
remote_procs, remote_size * sizeof(ompi_proc_t *));
|
||||||
lam_group_increment_proc_count(newcomm->c_remote_group);
|
ompi_group_increment_proc_count(newcomm->c_remote_group);
|
||||||
newcomm->c_flags |= LAM_COMM_INTER;
|
newcomm->c_flags |= OMPI_COMM_INTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine context id. It is identical to f_2_c_handle */
|
/* Determine context id. It is identical to f_2_c_handle */
|
||||||
#ifdef HAVE_COLLECTIVES
|
#ifdef HAVE_COLLECTIVES
|
||||||
newcomm->c_contextid = lam_comm_nextcid ( oldcomm,
|
newcomm->c_contextid = ompi_comm_nextcid ( oldcomm,
|
||||||
bridgecomm,
|
bridgecomm,
|
||||||
local_leader,
|
local_leader,
|
||||||
remote_leader,
|
remote_leader,
|
||||||
@ -87,7 +87,7 @@ lam_communicator_t * lam_comm_set ( int mode,
|
|||||||
#else
|
#else
|
||||||
/* just for now */
|
/* just for now */
|
||||||
newcomm->c_contextid = oldcomm->c_contextid + 10;
|
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 );
|
newcomm );
|
||||||
#endif
|
#endif
|
||||||
newcomm->c_f_to_c_index = newcomm->c_contextid;
|
newcomm->c_f_to_c_index = newcomm->c_contextid;
|
||||||
@ -101,14 +101,14 @@ lam_communicator_t * lam_comm_set ( int mode,
|
|||||||
newcomm->c_contextid);
|
newcomm->c_contextid);
|
||||||
|
|
||||||
/* Determine cube_dim */
|
/* 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 */
|
/* Set Topology, if required */
|
||||||
if ( NULL != topomodule ) {
|
if ( NULL != topomodule ) {
|
||||||
if (LAM_COMM_IS_CART ( oldcomm ) )
|
if (OMPI_COMM_IS_CART ( oldcomm ) )
|
||||||
newcomm->c_flags |= LAM_COMM_CART;
|
newcomm->c_flags |= OMPI_COMM_CART;
|
||||||
if (LAM_COMM_IS_GRAPH ( oldcomm ) )
|
if (OMPI_COMM_IS_GRAPH ( oldcomm ) )
|
||||||
newcomm->c_flags |= LAM_COMM_GRAPH;
|
newcomm->c_flags |= OMPI_COMM_GRAPH;
|
||||||
|
|
||||||
/* set the topo-module */
|
/* set the topo-module */
|
||||||
}
|
}
|
||||||
@ -119,29 +119,29 @@ lam_communicator_t * lam_comm_set ( int mode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the PML stuff in the newcomm */
|
/* 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;
|
goto err_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the coll modules */
|
/* Initialize the coll modules */
|
||||||
/* Let the collectives modules fight over who will do
|
/* Let the collectives modules fight over who will do
|
||||||
collective on this new comm. */
|
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;
|
goto err_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******* VPS: Remove this later -- need to be in coll module ****** */
|
/* ******* VPS: Remove this later -- need to be in coll module ****** */
|
||||||
/* VPS: Cache the reqs for bcast */
|
/* VPS: Cache the reqs for bcast */
|
||||||
newcomm->bcast_lin_reqs =
|
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) {
|
if (NULL == newcomm->bcast_lin_reqs) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
}
|
}
|
||||||
newcomm->bcast_log_reqs =
|
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) {
|
if (NULL == newcomm->bcast_log_reqs) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto err_exit;
|
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 */
|
/* increment proc reference counters */
|
||||||
OBJ_RETAIN(comm->c_local_group);
|
OBJ_RETAIN(comm->c_local_group);
|
||||||
|
|
||||||
*group = 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,
|
int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
|
||||||
lam_communicator_t **newcomm )
|
ompi_communicator_t **newcomm )
|
||||||
{
|
{
|
||||||
lam_communicator_t *newcomp;
|
ompi_communicator_t *newcomp;
|
||||||
int rsize;
|
int rsize;
|
||||||
int mode;
|
int mode;
|
||||||
int *allranks=NULL;
|
int *allranks=NULL;
|
||||||
lam_proc_t **rprocs=NULL;
|
ompi_proc_t **rprocs=NULL;
|
||||||
int rc = LAM_SUCCESS;
|
int rc = OMPI_SUCCESS;
|
||||||
|
|
||||||
if ( LAM_COMM_IS_INTER(comm) ) {
|
if ( OMPI_COMM_IS_INTER(comm) ) {
|
||||||
#ifdef HAVE_COMM_CREATE_FOR_INTERCOMMS
|
#ifdef HAVE_COMM_CREATE_FOR_INTERCOMMS
|
||||||
int tsize, i, j;
|
int tsize, i, j;
|
||||||
|
|
||||||
tsize = comm->c_remote_group->grp_proc_count;
|
tsize = comm->c_remote_group->grp_proc_count;
|
||||||
allranks = (int *) malloc ( tsize * sizeof(int));
|
allranks = (int *) malloc ( tsize * sizeof(int));
|
||||||
if ( NULL == allranks ) {
|
if ( NULL == allranks ) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = comm->c_coll.coll_allgather_inter ( &group->grp_my_rank,
|
rc = comm->c_coll.coll_allgather_inter ( &group->grp_my_rank,
|
||||||
1, MPI_INT, allranks,
|
1, MPI_INT, allranks,
|
||||||
1, MPI_INT, comm );
|
1, MPI_INT, comm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,14 +214,14 @@ int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
|||||||
MPI_COMM_NULL */
|
MPI_COMM_NULL */
|
||||||
if ( 0 == rsize || 0 == group->grp_proc_count ) {
|
if ( 0 == rsize || 0 == group->grp_proc_count ) {
|
||||||
*newcomm = MPI_COMM_NULL;
|
*newcomm = MPI_COMM_NULL;
|
||||||
rc = LAM_SUCCESS;
|
rc = OMPI_SUCCESS;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set proc-pointers for remote group */
|
/* 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 ) {
|
if ( NULL == rprocs ) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
for ( j = 0, i = 0; i < rsize; i++ ) {
|
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++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mode = LAM_COMM_INTER_INTER;
|
mode = OMPI_COMM_INTER_INTER;
|
||||||
#else
|
#else
|
||||||
return ( MPI_ERR_COMM );
|
return ( MPI_ERR_COMM );
|
||||||
#endif
|
#endif
|
||||||
@ -238,10 +238,10 @@ int lam_comm_create ( lam_communicator_t *comm, lam_group_t *group,
|
|||||||
else {
|
else {
|
||||||
rsize = 0;
|
rsize = 0;
|
||||||
rprocs = NULL;
|
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 */
|
comm, /* old comm */
|
||||||
NULL, /* bridge comm */
|
NULL, /* bridge comm */
|
||||||
group->grp_proc_count, /* local_size */
|
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
|
However, we could not avoid the comm_nextcid step, since
|
||||||
all processes of the original comm have to participate in
|
all processes of the original comm have to participate in
|
||||||
that function call. Additionally, all errhandler stuff etc.
|
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 ) {
|
if ( MPI_PROC_NULL == newcomp->c_local_group->grp_my_rank ) {
|
||||||
lam_comm_free ( &newcomp );
|
ompi_comm_free ( &newcomp );
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
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,
|
int ompi_comm_split ( ompi_communicator_t* comm, int color, int key,
|
||||||
lam_communicator_t **newcomm )
|
ompi_communicator_t **newcomm )
|
||||||
{
|
{
|
||||||
int myinfo[2];
|
int myinfo[2];
|
||||||
int size, my_size;
|
int size, my_size;
|
||||||
@ -303,9 +303,9 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
|||||||
int i, loc;
|
int i, loc;
|
||||||
int *results=NULL, *sorted=NULL;
|
int *results=NULL, *sorted=NULL;
|
||||||
int *rresults=NULL, *rsorted=NULL;
|
int *rresults=NULL, *rsorted=NULL;
|
||||||
int rc=LAM_SUCCESS;
|
int rc=OMPI_SUCCESS;
|
||||||
lam_proc_t **procs=NULL, **rprocs=NULL;
|
ompi_proc_t **procs=NULL, **rprocs=NULL;
|
||||||
lam_communicator_t *newcomp;
|
ompi_communicator_t *newcomp;
|
||||||
|
|
||||||
/* Step 1: determine all the information for the local group */
|
/* 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[0] = color;
|
||||||
myinfo[1] = key;
|
myinfo[1] = key;
|
||||||
|
|
||||||
size = lam_comm_size ( comm );
|
size = ompi_comm_size ( comm );
|
||||||
results = (int*) malloc ( 2 * size * sizeof(int));
|
results = (int*) malloc ( 2 * size * sizeof(int));
|
||||||
if ( NULL == results ) {
|
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,
|
rc = comm->c_coll.coll_allgather_intra ( myinfo, 2, MPI_INT,
|
||||||
results, 2, MPI_INT, comm );
|
results, 2, MPI_INT, comm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
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);
|
sorted = (int *) malloc ( sizeof( int ) * my_size * 2);
|
||||||
if ( NULL == sorted) {
|
if ( NULL == sorted) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,9 +353,9 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* put group elements in a list */
|
/* 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 ) {
|
if ( NULL == procs ) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
for (i = 0; i < my_size; i++) {
|
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 */
|
/* 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
|
#ifdef HAVE_COMM_SPLIT_FOR_INTERCOMMS
|
||||||
rsize = comm->c_remote_group->grp_proc_count;
|
rsize = comm->c_remote_group->grp_proc_count;
|
||||||
rresults = (int *) malloc ( rsize * 2 * sizeof(int));
|
rresults = (int *) malloc ( rsize * 2 * sizeof(int));
|
||||||
if ( NULL == rresults ) {
|
if ( NULL == rresults ) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = comm->c_coll.coll_allgather_inter ( myinfo, 2, MPI_INT,
|
rc = comm->c_coll.coll_allgather_inter ( myinfo, 2, MPI_INT,
|
||||||
rresults, 2, MPI_INT,
|
rresults, 2, MPI_INT,
|
||||||
comm );
|
comm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
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);
|
rsorted = (int *) malloc ( sizeof( int ) * my_rsize * 2);
|
||||||
if ( NULL == rsorted) {
|
if ( NULL == rsorted) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,16 +406,16 @@ int lam_comm_split ( lam_communicator_t* comm, int color, int key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* put group elements in a list */
|
/* 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 ) {
|
if ( NULL == procs ) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
for (i = 0; i < my_rsize; i++) {
|
for (i = 0; i < my_rsize; i++) {
|
||||||
rprocs[i] = comm->c_remote_group->grp_proc_pointers[rsorted[i*2]];
|
rprocs[i] = comm->c_remote_group->grp_proc_pointers[rsorted[i*2]];
|
||||||
}
|
}
|
||||||
|
|
||||||
mode = LAM_COMM_INTER_INTER;
|
mode = OMPI_COMM_INTER_INTER;
|
||||||
#else
|
#else
|
||||||
/* creating an inter-communicator using MPI_Comm_create will
|
/* creating an inter-communicator using MPI_Comm_create will
|
||||||
be supported soon, but not in this version */
|
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 {
|
else {
|
||||||
my_rsize = 0;
|
my_rsize = 0;
|
||||||
rprocs = NULL;
|
rprocs = NULL;
|
||||||
mode = LAM_COMM_INTRA_INTRA;
|
mode = OMPI_COMM_INTRA_INTRA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Step 3: set up the communicator */
|
/* Step 3: set up the communicator */
|
||||||
/* --------------------------------------------------------- */
|
/* --------------------------------------------------------- */
|
||||||
/* Create the communicator finally */
|
/* Create the communicator finally */
|
||||||
newcomp = lam_comm_set ( mode, /* mode */
|
newcomp = ompi_comm_set ( mode, /* mode */
|
||||||
comm, /* old comm */
|
comm, /* old comm */
|
||||||
NULL, /* bridge comm */
|
NULL, /* bridge comm */
|
||||||
my_size, /* local_size */
|
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 */
|
/* Step 4: if we are not part of the comm, free the struct */
|
||||||
/* --------------------------------------------------------- */
|
/* --------------------------------------------------------- */
|
||||||
if ( MPI_UNDEFINED == color ) {
|
if ( MPI_UNDEFINED == color ) {
|
||||||
lam_comm_free ( &newcomp );
|
ompi_comm_free ( &newcomp );
|
||||||
}
|
}
|
||||||
|
|
||||||
*newcomm = 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
|
** The freeing of all attached objects (groups, errhandlers
|
||||||
** etc. ) has moved to the destructor.
|
** etc. ) has moved to the destructor.
|
||||||
*/
|
*/
|
||||||
int lam_comm_free ( lam_communicator_t **comm )
|
int ompi_comm_free ( ompi_communicator_t **comm )
|
||||||
{
|
{
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Release attributes */
|
/* Release attributes */
|
||||||
lam_attr_delete_all ( COMM_ATTR, comm );
|
ompi_attr_delete_all ( COMM_ATTR, comm );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Release the communicator */
|
/* Release the communicator */
|
||||||
OBJ_RELEASE ( comm );
|
OBJ_RELEASE ( comm );
|
||||||
|
|
||||||
*comm = MPI_COMM_NULL;
|
*comm = MPI_COMM_NULL;
|
||||||
return LAM_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
lam_proc_t **lam_comm_get_rprocs ( lam_communicator_t *local_comm,
|
ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
|
||||||
lam_communicator_t *bridge_comm,
|
ompi_communicator_t *bridge_comm,
|
||||||
int local_leader,
|
int local_leader,
|
||||||
int remote_leader,
|
int remote_leader,
|
||||||
int tag,
|
int tag,
|
||||||
int rsize)
|
int rsize)
|
||||||
{
|
{
|
||||||
int local_rank, local_size;
|
int local_rank, local_size;
|
||||||
lam_proc_t **rprocs;
|
ompi_proc_t **rprocs;
|
||||||
lam_job_handle_t job;
|
ompi_job_handle_t job;
|
||||||
uint32_t *rvpids=NULL, *vpids=NULL;
|
uint32_t *rvpids=NULL, *vpids=NULL;
|
||||||
int rc, i;
|
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));
|
vpids = (uint32_t *) malloc ( local_size * sizeof(uint32_t));
|
||||||
rvpids = (uint32_t *) malloc ( rsize * 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 ) {
|
if ( NULL == vpids || NULL == rvpids || NULL == rprocs ) {
|
||||||
rc = LAM_ERR_OUT_OF_RESOURCE;
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
goto err_exit;
|
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++ ) {
|
for ( i = 0; i < rsize; i++ ) {
|
||||||
rprocs[i] = lam_proc_find ( job, rvpids[i] );
|
rprocs[i] = ompi_proc_find ( job, rvpids[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
err_exit:
|
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 flag, rhigh;
|
||||||
int local_rank, rc;
|
int local_rank, rc;
|
||||||
lam_proc_t *lvpid, *rvpid;
|
ompi_proc_t *lvpid, *rvpid;
|
||||||
|
|
||||||
lvpid = intercomm->c_local_group->grp_proc_pointers[0];
|
lvpid = intercomm->c_local_group->grp_proc_pointers[0];
|
||||||
rvpid = intercomm->c_remote_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
|
* 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_pml_ptl_comm_t *pml_comm;
|
||||||
mca_ptl_sequence_t *seq;
|
mca_ptl_sequence_t *seq;
|
||||||
lam_list_t *list;
|
ompi_list_t *list;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf("Dumping information for comm_cid %d\n", comm->c_contextid);
|
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:");
|
printf(" Communicator is:");
|
||||||
/* Display flags */
|
/* Display flags */
|
||||||
if ( LAM_COMM_IS_INTER(comm) )
|
if ( OMPI_COMM_IS_INTER(comm) )
|
||||||
printf(" inter-comm,");
|
printf(" inter-comm,");
|
||||||
if ( LAM_COMM_IS_CART(comm))
|
if ( OMPI_COMM_IS_CART(comm))
|
||||||
printf(" topo-cart,");
|
printf(" topo-cart,");
|
||||||
if ( LAM_COMM_IS_GRAPH(comm))
|
if ( OMPI_COMM_IS_GRAPH(comm))
|
||||||
printf(" topo-graph");
|
printf(" topo-graph");
|
||||||
printf("\n");
|
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);
|
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;
|
pml_comm = (mca_pml_ptl_comm_t *)comm->c_pml_comm;
|
||||||
seq = (mca_ptl_sequence_t *) pml_comm->c_frags_cant_match;
|
seq = (mca_ptl_sequence_t *) pml_comm->c_frags_cant_match;
|
||||||
for ( i = 0; i < comm->c_local_group->grp_proc_count; i++ ){
|
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"
|
printf("%d: head->list_next:%p head->list_prev:%p"
|
||||||
" tail->list_next:%p tail->list_next:%p\n",
|
" tail->list_next:%p tail->list_next:%p\n",
|
||||||
i,
|
i,
|
||||||
(char*)list->lam_list_head.lam_list_next,
|
(char*)list->ompi_list_head.ompi_list_next,
|
||||||
(char*)list->lam_list_head.lam_list_prev,
|
(char*)list->ompi_list_head.ompi_list_prev,
|
||||||
(char*)list->lam_list_tail.lam_list_next,
|
(char*)list->ompi_list_tail.ompi_list_next,
|
||||||
(char*)list->lam_list_tail.lam_list_prev );
|
(char*)list->ompi_list_tail.ompi_list_prev );
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
@ -11,7 +11,7 @@
|
|||||||
#include "op/op.h"
|
#include "op/op.h"
|
||||||
#include "proc/proc.h"
|
#include "proc/proc.h"
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "lfc/lam_pointer_array.h"
|
#include "class/ompi_pointer_array.h"
|
||||||
#include "mca/pcm/pcm.h"
|
#include "mca/pcm/pcm.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/coll/coll.h"
|
#include "mca/coll/coll.h"
|
||||||
@ -30,28 +30,28 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef int ompi_comm_cid_allredfct (int *inbuf, int* outbuf, int count,
|
typedef int ompi_comm_cid_allredfct (int *inbuf, int* outbuf, int count,
|
||||||
lam_op_t *op, lam_communicator_t *comm,
|
ompi_op_t *op, ompi_communicator_t *comm,
|
||||||
lam_communicator_t *bridgecomm,
|
ompi_communicator_t *bridgecomm,
|
||||||
int lleader, int rleader );
|
int lleader, int rleader );
|
||||||
|
|
||||||
static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||||
lam_op_t *op, lam_communicator_t *intercomm,
|
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||||
lam_communicator_t *bridgecomm,
|
ompi_communicator_t *bridgecomm,
|
||||||
int local_leader, int remote_leader );
|
int local_leader, int remote_leader );
|
||||||
|
|
||||||
static int ompi_comm_allreduce_emulate_inter ( int *inbuf, int* outbuf, int count,
|
static int ompi_comm_allreduce_emulate_inter ( int *inbuf, int* outbuf, int count,
|
||||||
lam_op_t *op, lam_communicator_t *intercomm,
|
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||||
lam_communicator_t *bridgecomm,
|
ompi_communicator_t *bridgecomm,
|
||||||
int local_leader, int remote_leader );
|
int local_leader, int remote_leader );
|
||||||
|
|
||||||
static int ompi_comm_allreduce_intra ( int *inbuf, int* outbuf, int count,
|
static int ompi_comm_allreduce_intra ( int *inbuf, int* outbuf, int count,
|
||||||
lam_op_t *op, lam_communicator_t *intercomm,
|
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||||
lam_communicator_t *bridgecomm,
|
ompi_communicator_t *bridgecomm,
|
||||||
int local_leader, int remote_ledaer );
|
int local_leader, int remote_ledaer );
|
||||||
|
|
||||||
|
|
||||||
int lam_comm_nextcid ( lam_communicator_t* comm,
|
int ompi_comm_nextcid ( ompi_communicator_t* comm,
|
||||||
lam_communicator_t* bridgecomm,
|
ompi_communicator_t* bridgecomm,
|
||||||
int local_leader,
|
int local_leader,
|
||||||
int remote_leader,
|
int remote_leader,
|
||||||
int mode )
|
int mode )
|
||||||
@ -62,7 +62,7 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
|||||||
int done=0;
|
int done=0;
|
||||||
int response=0, glresponse=0;
|
int response=0, glresponse=0;
|
||||||
int flag;
|
int flag;
|
||||||
int start=lam_mpi_communicators.lowest_free;
|
int start=ompi_mpi_communicators.lowest_free;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ompi_comm_cid_allredfct* allredfnct;
|
ompi_comm_cid_allredfct* allredfnct;
|
||||||
@ -73,14 +73,14 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
|||||||
*/
|
*/
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case LAM_COMM_INTRA_INTRA:
|
case OMPI_COMM_INTRA_INTRA:
|
||||||
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_intra;
|
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_intra;
|
||||||
break;
|
break;
|
||||||
case LAM_COMM_INTRA_INTER:
|
case OMPI_COMM_INTRA_INTER:
|
||||||
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_emulate_inter;
|
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_emulate_inter;
|
||||||
break;
|
break;
|
||||||
case LAM_COMM_INTER_INTER:
|
case OMPI_COMM_INTER_INTER:
|
||||||
case LAM_COMM_INTER_INTRA:
|
case OMPI_COMM_INTER_INTRA:
|
||||||
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_inter;
|
allredfnct = (ompi_comm_cid_allredfct*)ompi_comm_allreduce_inter;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -94,7 +94,7 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
|||||||
while ( !done ){
|
while ( !done ){
|
||||||
sleep ( 30 );
|
sleep ( 30 );
|
||||||
for (i=start; i<OMPI_MAX_COMM ;i++) {
|
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) {
|
if (true == flag) {
|
||||||
nextlocal_cid = i;
|
nextlocal_cid = i;
|
||||||
break;
|
break;
|
||||||
@ -107,8 +107,8 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
|||||||
response = 1; /* fine with me */
|
response = 1; /* fine with me */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lam_pointer_array_set_item ( &lam_mpi_communicators, nextlocal_cid, NULL);
|
ompi_pointer_array_set_item ( &ompi_mpi_communicators, nextlocal_cid, NULL);
|
||||||
flag = lam_pointer_array_test_and_set_item ( &lam_mpi_communicators,
|
flag = ompi_pointer_array_test_and_set_item ( &ompi_mpi_communicators,
|
||||||
nextcid, comm );
|
nextcid, comm );
|
||||||
if (true == flag) {
|
if (true == flag) {
|
||||||
response = 1; /* works as well */
|
response = 1; /* works as well */
|
||||||
@ -139,8 +139,8 @@ int lam_comm_nextcid ( lam_communicator_t* comm,
|
|||||||
- remote_leader
|
- remote_leader
|
||||||
*/
|
*/
|
||||||
static int ompi_comm_allreduce_intra ( int *inbuf, int *outbuf, int count,
|
static int ompi_comm_allreduce_intra ( int *inbuf, int *outbuf, int count,
|
||||||
lam_op_t *op, lam_communicator_t *comm,
|
ompi_op_t *op, ompi_communicator_t *comm,
|
||||||
lam_communicator_t *bridgecomm,
|
ompi_communicator_t *bridgecomm,
|
||||||
int local_leader, int remote_leader )
|
int local_leader, int remote_leader )
|
||||||
{
|
{
|
||||||
return comm->c_coll.coll_allreduce_intra ( inbuf, outbuf, count, MPI_INT, op,
|
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
|
- remote_leader
|
||||||
*/
|
*/
|
||||||
static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
||||||
lam_op_t *op, lam_communicator_t *intercomm,
|
ompi_op_t *op, ompi_communicator_t *intercomm,
|
||||||
lam_communicator_t *bridgecomm,
|
ompi_communicator_t *bridgecomm,
|
||||||
int local_leader, int remote_leader )
|
int local_leader, int remote_leader )
|
||||||
{
|
{
|
||||||
int local_rank;
|
int local_rank;
|
||||||
lam_proc_t *lvpid, *rvpid;
|
ompi_proc_t *lvpid, *rvpid;
|
||||||
int i;
|
int i;
|
||||||
int *tmpbuf;
|
int *tmpbuf;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if ( &lam_mpi_op_sum != op && &lam_mpi_op_prod != op &&
|
if ( &ompi_mpi_op_sum != op && &ompi_mpi_op_prod != op &&
|
||||||
&lam_mpi_op_max != op && &lam_mpi_op_min != op ) {
|
&ompi_mpi_op_max != op && &ompi_mpi_op_min != op ) {
|
||||||
return MPI_ERR_OP;
|
return MPI_ERR_OP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !LAM_COMM_IS_INTER (intercomm)) {
|
if ( !OMPI_COMM_IS_INTER (intercomm)) {
|
||||||
return MPI_ERR_COMM;
|
return MPI_ERR_COMM;
|
||||||
}
|
}
|
||||||
|
|
||||||
local_rank = lam_comm_rank ( intercomm );
|
local_rank = ompi_comm_rank ( intercomm );
|
||||||
tmpbuf = (int *) malloc ( count * sizeof(int));
|
tmpbuf = (int *) malloc ( count * sizeof(int));
|
||||||
if ( NULL == tmpbuf ) {
|
if ( NULL == tmpbuf ) {
|
||||||
return MPI_ERR_INTERN;
|
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,
|
rc = intercomm->c_coll.coll_allreduce_inter ( inbuf, tmpbuf, count, MPI_INT,
|
||||||
op, intercomm );
|
op, intercomm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,35 +194,35 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
|||||||
/* local leader exchange data */
|
/* local leader exchange data */
|
||||||
rc = mca_pml.pml_irecv (outbuf, count, MPI_INT, 0, OMPI_COMM_CID_TAG,
|
rc = mca_pml.pml_irecv (outbuf, count, MPI_INT, 0, OMPI_COMM_CID_TAG,
|
||||||
intercomm, &req );
|
intercomm, &req );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
rc = mca_pml.pml_send (tmpbuf, count, MPI_INT, 0, OMPI_COMM_CID_TAG,
|
rc = mca_pml.pml_send (tmpbuf, count, MPI_INT, 0, OMPI_COMM_CID_TAG,
|
||||||
MCA_PML_BASE_SEND_STANDARD, intercomm );
|
MCA_PML_BASE_SEND_STANDARD, intercomm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
rc = mca_pml.pml_wait ( 1, &req, NULL, &status);
|
rc = mca_pml.pml_wait ( 1, &req, NULL, &status);
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( &lam_mpi_op_max == op ) {
|
if ( &ompi_mpi_op_max == op ) {
|
||||||
for ( i = 0 ; i < count; i++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
if (tmpbuf[i] > outbuf[i]) outbuf[i] = tmpbuf[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++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
if (tmpbuf[i] < outbuf[i]) outbuf[i] = tmpbuf[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++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
outbuf[i] += tmpbuf[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++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
outbuf[i] *= tmpbuf[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 ) {
|
if ( 0 == local_rank ) {
|
||||||
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, MPI_ROOT,
|
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, MPI_ROOT,
|
||||||
intercomm );
|
intercomm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, MPI_PROC_NULL,
|
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, MPI_PROC_NULL,
|
||||||
intercomm );
|
intercomm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, 0, intercomm );
|
rc = intercomm->c_coll.coll_bcast_inter ( &outbuf, count, MPI_INT, 0, intercomm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +273,8 @@ static int ompi_comm_allreduce_inter (int *inbuf, int *outbuf, int count,
|
|||||||
all arguments are in use.
|
all arguments are in use.
|
||||||
*/
|
*/
|
||||||
static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count,
|
static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count,
|
||||||
lam_op_t *op, lam_communicator_t *comm,
|
ompi_op_t *op, ompi_communicator_t *comm,
|
||||||
lam_communicator_t *bridgecomm,
|
ompi_communicator_t *bridgecomm,
|
||||||
int local_leader, int remote_leader )
|
int local_leader, int remote_leader )
|
||||||
{
|
{
|
||||||
int *tmpbuf=NULL;
|
int *tmpbuf=NULL;
|
||||||
@ -282,12 +282,12 @@ static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count
|
|||||||
int i;
|
int i;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if ( &lam_mpi_op_sum != op && &lam_mpi_op_prod != op &&
|
if ( &ompi_mpi_op_sum != op && &ompi_mpi_op_prod != op &&
|
||||||
&lam_mpi_op_max != op && &lam_mpi_op_min != op ) {
|
&ompi_mpi_op_max != op && &ompi_mpi_op_min != op ) {
|
||||||
return MPI_ERR_OP;
|
return MPI_ERR_OP;
|
||||||
}
|
}
|
||||||
|
|
||||||
local_rank = lam_comm_rank ( comm );
|
local_rank = ompi_comm_rank ( comm );
|
||||||
tmpbuf = (int *) malloc ( count * sizeof(int));
|
tmpbuf = (int *) malloc ( count * sizeof(int));
|
||||||
if ( NULL == tmpbuf ) {
|
if ( NULL == tmpbuf ) {
|
||||||
return MPI_ERR_INTERN;
|
return MPI_ERR_INTERN;
|
||||||
@ -296,7 +296,7 @@ static int ompi_comm_allreduce_emulate_inter (int *inbuf, int *outbuf, int count
|
|||||||
/* Intercomm_create */
|
/* Intercomm_create */
|
||||||
rc = comm->c_coll.coll_allreduce_intra ( inbuf, tmpbuf, count, MPI_INT,
|
rc = comm->c_coll.coll_allreduce_intra ( inbuf, tmpbuf, count, MPI_INT,
|
||||||
op, comm );
|
op, comm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
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,
|
rc = mca_pml.pml_irecv ( outbuf, count, MPI_INT, remote_leader,
|
||||||
OMPI_COMM_CID_TAG, bridgecomm, &req );
|
OMPI_COMM_CID_TAG, bridgecomm, &req );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
rc = mca_pml.pml_send (tmpbuf, count, MPI_INT, remote_leader,
|
rc = mca_pml.pml_send (tmpbuf, count, MPI_INT, remote_leader,
|
||||||
OMPI_COMM_CID_TAG, MCA_PML_BASE_SEND_STANDARD,
|
OMPI_COMM_CID_TAG, MCA_PML_BASE_SEND_STANDARD,
|
||||||
bridgecomm );
|
bridgecomm );
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
rc = mca_pml.pml_wait ( 1, &req, NULL, &status);
|
rc = mca_pml.pml_wait ( 1, &req, NULL, &status);
|
||||||
if ( LAM_SUCCESS != rc ) {
|
if ( OMPI_SUCCESS != rc ) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( &lam_mpi_op_max == op ) {
|
if ( &ompi_mpi_op_max == op ) {
|
||||||
for ( i = 0 ; i < count; i++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
if (tmpbuf[i] > outbuf[i]) outbuf[i] = tmpbuf[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++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
if (tmpbuf[i] < outbuf[i]) outbuf[i] = tmpbuf[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++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
outbuf[i] += tmpbuf[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++ ) {
|
for ( i = 0 ; i < count; i++ ) {
|
||||||
outbuf[i] *= tmpbuf[i];
|
outbuf[i] *= tmpbuf[i];
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_COMMUNICATOR_H
|
#ifndef OMPI_COMMUNICATOR_H
|
||||||
#define LAM_COMMUNICATOR_H
|
#define OMPI_COMMUNICATOR_H
|
||||||
|
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "errhandler/errhandler.h"
|
#include "errhandler/errhandler.h"
|
||||||
#include "threads/mutex.h"
|
#include "threads/mutex.h"
|
||||||
#include "util/output.h"
|
#include "util/output.h"
|
||||||
@ -13,23 +13,23 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "mca/coll/coll.h"
|
#include "mca/coll/coll.h"
|
||||||
#include "mca/topo/topo.h"
|
#include "mca/topo/topo.h"
|
||||||
#include "lfc/lam_hash_table.h"
|
#include "class/ompi_hash_table.h"
|
||||||
#include "attribute/attribute.h"
|
#include "attribute/attribute.h"
|
||||||
#include "request/request.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 OMPI_COMM_INTER 0x00000001
|
||||||
#define LAM_COMM_CART 0x00000002
|
#define OMPI_COMM_CART 0x00000002
|
||||||
#define LAM_COMM_GRAPH 0x00000004
|
#define OMPI_COMM_GRAPH 0x00000004
|
||||||
#define LAM_COMM_NAMEISSET 0x00000008
|
#define OMPI_COMM_NAMEISSET 0x00000008
|
||||||
#define LAM_COMM_ISFREED 0x00000010
|
#define OMPI_COMM_ISFREED 0x00000010
|
||||||
|
|
||||||
/* some utility #defines */
|
/* some utility #defines */
|
||||||
#define LAM_COMM_IS_INTER(comm) ((comm)->c_flags & LAM_COMM_INTER)
|
#define OMPI_COMM_IS_INTER(comm) ((comm)->c_flags & OMPI_COMM_INTER)
|
||||||
#define LAM_COMM_IS_INTRA(comm) (!((comm)->c_flags & LAM_COMM_INTER))
|
#define OMPI_COMM_IS_INTRA(comm) (!((comm)->c_flags & OMPI_COMM_INTER))
|
||||||
#define LAM_COMM_IS_CART(comm) ((comm)->c_flags & LAM_COMM_CART)
|
#define OMPI_COMM_IS_CART(comm) ((comm)->c_flags & OMPI_COMM_CART)
|
||||||
#define LAM_COMM_IS_GRAPH(comm) ((comm)->c_flags & LAM_COMM_GRAPH)
|
#define OMPI_COMM_IS_GRAPH(comm) ((comm)->c_flags & OMPI_COMM_GRAPH)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modes reqquired for accquiring the new comm-id.
|
* 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
|
* whether the new communicator will be an inter/intra
|
||||||
*comm
|
*comm
|
||||||
*/
|
*/
|
||||||
#define LAM_COMM_INTRA_INTRA 0x00000020
|
#define OMPI_COMM_INTRA_INTRA 0x00000020
|
||||||
#define LAM_COMM_INTRA_INTER 0x00000040
|
#define OMPI_COMM_INTRA_INTER 0x00000040
|
||||||
#define LAM_COMM_INTER_INTRA 0x00000080
|
#define OMPI_COMM_INTER_INTRA 0x00000080
|
||||||
#define LAM_COMM_INTER_INTER 0x00000100
|
#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 {
|
struct ompi_communicator_t {
|
||||||
lam_object_t c_base;
|
ompi_object_t c_base;
|
||||||
char c_name[MPI_MAX_OBJECT_NAME];
|
char c_name[MPI_MAX_OBJECT_NAME];
|
||||||
uint32_t c_contextid;
|
uint32_t c_contextid;
|
||||||
int c_my_rank;
|
int c_my_rank;
|
||||||
uint32_t c_flags; /* flags, e.g. intercomm,
|
uint32_t c_flags; /* flags, e.g. intercomm,
|
||||||
topology, etc. */
|
topology, etc. */
|
||||||
|
|
||||||
lam_group_t *c_local_group;
|
ompi_group_t *c_local_group;
|
||||||
lam_group_t *c_remote_group;
|
ompi_group_t *c_remote_group;
|
||||||
|
|
||||||
/* Attributes */
|
/* Attributes */
|
||||||
lam_hash_table_t *c_keyhash;
|
ompi_hash_table_t *c_keyhash;
|
||||||
|
|
||||||
int c_cube_dim; /**< inscribing cube dimension */
|
int c_cube_dim; /**< inscribing cube dimension */
|
||||||
|
|
||||||
@ -71,10 +71,10 @@ struct lam_communicator_t {
|
|||||||
int c_f_to_c_index;
|
int c_f_to_c_index;
|
||||||
|
|
||||||
/* Error handling. This field does not have the "c_" prefix so
|
/* 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. */
|
it's a comm, window, or file. */
|
||||||
|
|
||||||
lam_errhandler_t *error_handler;
|
ompi_errhandler_t *error_handler;
|
||||||
|
|
||||||
/* Hooks for PML to hang things */
|
/* Hooks for PML to hang things */
|
||||||
struct mca_pml_comm_t* c_pml_comm;
|
struct mca_pml_comm_t* c_pml_comm;
|
||||||
@ -85,19 +85,19 @@ struct lam_communicator_t {
|
|||||||
struct mca_coll_comm_t* c_coll_comm;
|
struct mca_coll_comm_t* c_coll_comm;
|
||||||
|
|
||||||
/* VPS: This will be moved in the coll module later on */
|
/* VPS: This will be moved in the coll module later on */
|
||||||
lam_request_t **bcast_lin_reqs;
|
ompi_request_t **bcast_lin_reqs;
|
||||||
lam_request_t **bcast_log_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
|
* 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;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
@ -106,14 +106,14 @@ static inline int lam_comm_invalid(lam_communicator_t* comm)
|
|||||||
/**
|
/**
|
||||||
* rank w/in the communicator
|
* 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;
|
return comm->c_my_rank;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* size of the communicator
|
* 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;
|
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.
|
* size of the remote group for inter-communicators.
|
||||||
* returns zero for an intra-communicator
|
* 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;
|
return comm->c_remote_group->grp_proc_count;
|
||||||
else
|
else
|
||||||
return 0;
|
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,
|
/* return pointer to communicator associated with context id cid,
|
||||||
* No error checking is done*/
|
* 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 */
|
/* array of pointers to communicators, indexed by context ID */
|
||||||
extern lam_pointer_array_t lam_mpi_communicators;
|
extern ompi_pointer_array_t ompi_mpi_communicators;
|
||||||
return (lam_communicator_t*)lam_pointer_array_get_item(&lam_mpi_communicators, cid);
|
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) {
|
if(peer_id >= comm->c_remote_group->grp_proc_count) {
|
||||||
lam_output(0, "lam_comm_lookup_peer: invalid peer index (%d)", peer_id);
|
ompi_output(0, "ompi_comm_lookup_peer: invalid peer index (%d)", peer_id);
|
||||||
return (lam_proc_t *) NULL;
|
return (ompi_proc_t *) NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return comm->c_remote_group->grp_proc_pointers[peer_id];
|
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) {
|
if(peer_id < 0 || peer_id >= comm->c_remote_group->grp_proc_count) {
|
||||||
return true;
|
return true;
|
||||||
@ -158,11 +158,11 @@ static inline bool lam_comm_peer_invalid(lam_communicator_t* comm, int peer_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int lam_cube_dim(int nprocs) {
|
static inline int ompi_cube_dim(int nprocs) {
|
||||||
int dim;
|
int dim;
|
||||||
size_t size;
|
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);
|
for(dim = 0, size = 1; size < (size_t)nprocs; ++dim, size <<= 1);
|
||||||
|
|
||||||
return dim;
|
return dim;
|
||||||
@ -176,19 +176,19 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* Initialise MPI_COMM_WORLD and MPI_COMM_SELF
|
* Initialise MPI_COMM_WORLD and MPI_COMM_SELF
|
||||||
*/
|
*/
|
||||||
int lam_comm_init(void);
|
int ompi_comm_init(void);
|
||||||
int lam_comm_link_function(void);
|
int ompi_comm_link_function(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* extract the local group from a communicator
|
* 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
|
* create a communicator based on a group
|
||||||
*/
|
*/
|
||||||
int lam_comm_create ( lam_communicator_t* comm, lam_group_t *group,
|
int ompi_comm_create ( ompi_communicator_t* comm, ompi_group_t *group,
|
||||||
lam_communicator_t** newcomm );
|
ompi_communicator_t** newcomm );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* split a communicator based on color and key. Parameters
|
* 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,
|
int ompi_comm_split ( ompi_communicator_t *comm, int color, int key,
|
||||||
lam_communicator_t** newcomm );
|
ompi_communicator_t** newcomm );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* free a communicator
|
* free a communicator
|
||||||
*/
|
*/
|
||||||
int lam_comm_free ( lam_communicator_t **comm );
|
int ompi_comm_free ( ompi_communicator_t **comm );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allocate a new communicator structure
|
* allocate a new communicator structure
|
||||||
@ -218,7 +218,7 @@ extern "C" {
|
|||||||
* It furthermore sets the fortran index correctly,
|
* It furthermore sets the fortran index correctly,
|
||||||
* and sets all other elements to zero.
|
* 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 );
|
int remote_group_size );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -226,13 +226,13 @@ extern "C" {
|
|||||||
* @param comm: original comm
|
* @param comm: original comm
|
||||||
* @param bridgecomm: bridge comm for intercomm_create
|
* @param bridgecomm: bridge comm for intercomm_create
|
||||||
* @param mode: combination of input and output communicator
|
* @param mode: combination of input and output communicator
|
||||||
* LAM_COMM_INTRA_INTRA, LAM_COMM_INTRA_INTER,
|
* OMPI_COMM_INTRA_INTRA, OMPI_COMM_INTRA_INTER,
|
||||||
* LAM_COMM_INTER_INTRA, LAM_COMM_INTER_INTER
|
* OMPI_COMM_INTER_INTRA, OMPI_COMM_INTER_INTER
|
||||||
*
|
*
|
||||||
* This routine has to be thread safe in the final version.
|
* This routine has to be thread safe in the final version.
|
||||||
*/
|
*/
|
||||||
int lam_comm_nextcid ( lam_communicator_t* comm,
|
int ompi_comm_nextcid ( ompi_communicator_t* comm,
|
||||||
lam_communicator_t* bridgecomm,
|
ompi_communicator_t* bridgecomm,
|
||||||
int local_leader,
|
int local_leader,
|
||||||
int remote_leader,
|
int remote_leader,
|
||||||
int mode);
|
int mode);
|
||||||
@ -241,21 +241,21 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* shut down the communicator infrastructure.
|
* shut down the communicator infrastructure.
|
||||||
*/
|
*/
|
||||||
int lam_comm_finalize (void);
|
int ompi_comm_finalize (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is THE routine, where all the communicator stuff
|
* This is THE routine, where all the communicator stuff
|
||||||
* is really set.
|
* is really set.
|
||||||
*/
|
*/
|
||||||
lam_communicator_t* lam_comm_set ( int mode,
|
ompi_communicator_t* ompi_comm_set ( int mode,
|
||||||
lam_communicator_t* oldcomm,
|
ompi_communicator_t* oldcomm,
|
||||||
lam_communicator_t* bridgecomm,
|
ompi_communicator_t* bridgecomm,
|
||||||
int local_size,
|
int local_size,
|
||||||
lam_proc_t **local_procs,
|
ompi_proc_t **local_procs,
|
||||||
int remote_size,
|
int remote_size,
|
||||||
lam_proc_t **remote_procs,
|
ompi_proc_t **remote_procs,
|
||||||
lam_hash_table_t *attr,
|
ompi_hash_table_t *attr,
|
||||||
lam_errhandler_t *errh,
|
ompi_errhandler_t *errh,
|
||||||
mca_base_module_t *collmodule,
|
mca_base_module_t *collmodule,
|
||||||
mca_base_module_t *topomodule,
|
mca_base_module_t *topomodule,
|
||||||
int local_leader,
|
int local_leader,
|
||||||
@ -263,10 +263,10 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* This is a short-hand routine used in intercomm_create.
|
* This is a short-hand routine used in intercomm_create.
|
||||||
* The routine makes sure, that all processes have afterwards
|
* 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,
|
ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
|
||||||
lam_communicator_t *bridge_comm,
|
ompi_communicator_t *bridge_comm,
|
||||||
int local_leader,
|
int local_leader,
|
||||||
int remote_leader,
|
int remote_leader,
|
||||||
int tag,
|
int tag,
|
||||||
@ -277,11 +277,11 @@ extern "C" {
|
|||||||
* remote group will be first in the new intra-comm.
|
* remote group will be first in the new intra-comm.
|
||||||
* Just used from within MPI_Intercomm_merge.
|
* 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 );
|
int high );
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LAM_COMMUNICATOR_H */
|
#endif /* OMPI_COMMUNICATOR_H */
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
@ -20,143 +20,143 @@
|
|||||||
** on cid.
|
** on cid.
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
lam_pointer_array_t lam_mpi_communicators;
|
ompi_pointer_array_t ompi_mpi_communicators;
|
||||||
|
|
||||||
lam_communicator_t lam_mpi_comm_world;
|
ompi_communicator_t ompi_mpi_comm_world;
|
||||||
lam_communicator_t lam_mpi_comm_self;
|
ompi_communicator_t ompi_mpi_comm_self;
|
||||||
lam_communicator_t lam_mpi_comm_null;
|
ompi_communicator_t ompi_mpi_comm_null;
|
||||||
|
|
||||||
static void lam_comm_construct(lam_communicator_t* comm);
|
static void ompi_comm_construct(ompi_communicator_t* comm);
|
||||||
static void lam_comm_destruct(lam_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.
|
* 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;
|
size_t size;
|
||||||
|
|
||||||
/* Setup communicator array */
|
/* 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 */
|
/* Setup MPI_COMM_WORLD */
|
||||||
OBJ_CONSTRUCT(&lam_mpi_comm_world, lam_communicator_t);
|
OBJ_CONSTRUCT(&ompi_mpi_comm_world, ompi_communicator_t);
|
||||||
group = OBJ_NEW(lam_group_t);
|
group = OBJ_NEW(ompi_group_t);
|
||||||
group->grp_proc_pointers = lam_proc_world(&size);
|
group->grp_proc_pointers = ompi_proc_world(&size);
|
||||||
group->grp_my_rank = lam_proc_local()->proc_vpid ;
|
group->grp_my_rank = ompi_proc_local()->proc_vpid ;
|
||||||
group->grp_proc_count = size;
|
group->grp_proc_count = size;
|
||||||
group->grp_ok_to_free = false;
|
group->grp_ok_to_free = false;
|
||||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||||
|
|
||||||
lam_mpi_comm_world.c_contextid = 0;
|
ompi_mpi_comm_world.c_contextid = 0;
|
||||||
lam_mpi_comm_world.c_f_to_c_index = 0;
|
ompi_mpi_comm_world.c_f_to_c_index = 0;
|
||||||
lam_mpi_comm_world.c_my_rank = group->grp_my_rank;
|
ompi_mpi_comm_world.c_my_rank = group->grp_my_rank;
|
||||||
lam_mpi_comm_world.c_local_group = group;
|
ompi_mpi_comm_world.c_local_group = group;
|
||||||
lam_mpi_comm_world.c_remote_group = group;
|
ompi_mpi_comm_world.c_remote_group = group;
|
||||||
lam_mpi_comm_world.c_cube_dim = lam_cube_dim(size);
|
ompi_mpi_comm_world.c_cube_dim = ompi_cube_dim(size);
|
||||||
lam_mpi_comm_world.error_handler = &lam_mpi_errors_are_fatal;
|
ompi_mpi_comm_world.error_handler = &ompi_mpi_errors_are_fatal;
|
||||||
OBJ_RETAIN( &lam_mpi_errors_are_fatal );
|
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
|
||||||
mca_pml.pml_add_comm(&lam_mpi_comm_world);
|
mca_pml.pml_add_comm(&ompi_mpi_comm_world);
|
||||||
lam_pointer_array_set_item (&lam_mpi_communicators, 0, &lam_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 );
|
strlen("MPI_COMM_WORLD")+1 );
|
||||||
lam_mpi_comm_world.c_flags |= LAM_COMM_NAMEISSET;
|
ompi_mpi_comm_world.c_flags |= OMPI_COMM_NAMEISSET;
|
||||||
lam_attr_hash_init(&lam_mpi_comm_world.c_keyhash);
|
ompi_attr_hash_init(&ompi_mpi_comm_world.c_keyhash);
|
||||||
|
|
||||||
/* VPS: Remove this later */
|
/* VPS: Remove this later */
|
||||||
lam_mpi_comm_world.bcast_lin_reqs =
|
ompi_mpi_comm_world.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 == lam_mpi_comm_world.bcast_lin_reqs) {
|
if (NULL == ompi_mpi_comm_world.bcast_lin_reqs) {
|
||||||
return LAM_ERR_OUT_OF_RESOURCE;
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
lam_mpi_comm_world.bcast_log_reqs =
|
ompi_mpi_comm_world.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 == lam_mpi_comm_world.bcast_log_reqs) {
|
if (NULL == ompi_mpi_comm_world.bcast_log_reqs) {
|
||||||
return LAM_ERR_OUT_OF_RESOURCE;
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Setup MPI_COMM_SELF */
|
/* Setup MPI_COMM_SELF */
|
||||||
OBJ_CONSTRUCT(&lam_mpi_comm_self, lam_communicator_t);
|
OBJ_CONSTRUCT(&ompi_mpi_comm_self, ompi_communicator_t);
|
||||||
group = OBJ_NEW(lam_group_t);
|
group = OBJ_NEW(ompi_group_t);
|
||||||
group->grp_proc_pointers = lam_proc_self(&size);
|
group->grp_proc_pointers = ompi_proc_self(&size);
|
||||||
group->grp_my_rank = 0;
|
group->grp_my_rank = 0;
|
||||||
group->grp_proc_count = size;
|
group->grp_proc_count = size;
|
||||||
group->grp_ok_to_free = false;
|
group->grp_ok_to_free = false;
|
||||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||||
|
|
||||||
lam_mpi_comm_self.c_contextid = 1;
|
ompi_mpi_comm_self.c_contextid = 1;
|
||||||
lam_mpi_comm_self.c_f_to_c_index = 1;
|
ompi_mpi_comm_self.c_f_to_c_index = 1;
|
||||||
lam_mpi_comm_self.c_my_rank = group->grp_my_rank;
|
ompi_mpi_comm_self.c_my_rank = group->grp_my_rank;
|
||||||
lam_mpi_comm_self.c_local_group = group;
|
ompi_mpi_comm_self.c_local_group = group;
|
||||||
lam_mpi_comm_self.c_remote_group = group;
|
ompi_mpi_comm_self.c_remote_group = group;
|
||||||
lam_mpi_comm_self.error_handler = &lam_mpi_errors_are_fatal;
|
ompi_mpi_comm_self.error_handler = &ompi_mpi_errors_are_fatal;
|
||||||
OBJ_RETAIN( &lam_mpi_errors_are_fatal );
|
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
|
||||||
mca_pml.pml_add_comm(&lam_mpi_comm_self);
|
mca_pml.pml_add_comm(&ompi_mpi_comm_self);
|
||||||
lam_pointer_array_set_item (&lam_mpi_communicators, 1, &lam_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);
|
strncpy(ompi_mpi_comm_self.c_name,"MPI_COMM_SELF",strlen("MPI_COMM_SELF")+1);
|
||||||
lam_mpi_comm_self.c_flags |= LAM_COMM_NAMEISSET;
|
ompi_mpi_comm_self.c_flags |= OMPI_COMM_NAMEISSET;
|
||||||
lam_attr_hash_init(&lam_mpi_comm_self.c_keyhash);
|
ompi_attr_hash_init(&ompi_mpi_comm_self.c_keyhash);
|
||||||
|
|
||||||
/* VPS: Remove this later */
|
/* VPS: Remove this later */
|
||||||
lam_mpi_comm_self.bcast_lin_reqs =
|
ompi_mpi_comm_self.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 == lam_mpi_comm_self.bcast_lin_reqs) {
|
if (NULL == ompi_mpi_comm_self.bcast_lin_reqs) {
|
||||||
return LAM_ERR_OUT_OF_RESOURCE;
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
lam_mpi_comm_self.bcast_log_reqs =
|
ompi_mpi_comm_self.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 == lam_mpi_comm_self.bcast_log_reqs) {
|
if (NULL == ompi_mpi_comm_self.bcast_log_reqs) {
|
||||||
return LAM_ERR_OUT_OF_RESOURCE;
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Setup MPI_COMM_NULL */
|
/* Setup MPI_COMM_NULL */
|
||||||
OBJ_CONSTRUCT(&lam_mpi_comm_null, lam_communicator_t);
|
OBJ_CONSTRUCT(&ompi_mpi_comm_null, ompi_communicator_t);
|
||||||
group = OBJ_NEW(lam_group_t);
|
group = OBJ_NEW(ompi_group_t);
|
||||||
group->grp_proc_pointers = NULL;
|
group->grp_proc_pointers = NULL;
|
||||||
group->grp_my_rank = MPI_PROC_NULL;
|
group->grp_my_rank = MPI_PROC_NULL;
|
||||||
group->grp_proc_count = 0;
|
group->grp_proc_count = 0;
|
||||||
group->grp_ok_to_free = false;
|
group->grp_ok_to_free = false;
|
||||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||||
|
|
||||||
lam_mpi_comm_null.c_contextid = 2;
|
ompi_mpi_comm_null.c_contextid = 2;
|
||||||
lam_mpi_comm_null.c_f_to_c_index = 2;
|
ompi_mpi_comm_null.c_f_to_c_index = 2;
|
||||||
lam_mpi_comm_null.c_my_rank = MPI_PROC_NULL;
|
ompi_mpi_comm_null.c_my_rank = MPI_PROC_NULL;
|
||||||
lam_mpi_comm_null.c_local_group = group;
|
ompi_mpi_comm_null.c_local_group = group;
|
||||||
lam_mpi_comm_null.c_remote_group = group;
|
ompi_mpi_comm_null.c_remote_group = group;
|
||||||
lam_mpi_comm_null.error_handler = &lam_mpi_errors_are_fatal;
|
ompi_mpi_comm_null.error_handler = &ompi_mpi_errors_are_fatal;
|
||||||
OBJ_RETAIN( &lam_mpi_errors_are_fatal );
|
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
|
||||||
lam_pointer_array_set_item (&lam_mpi_communicators, 2, &lam_mpi_comm_null);
|
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);
|
strncpy(ompi_mpi_comm_null.c_name,"MPI_COMM_NULL",strlen("MPI_COMM_NULL")+1);
|
||||||
lam_mpi_comm_null.c_flags |= LAM_COMM_NAMEISSET;
|
ompi_mpi_comm_null.c_flags |= OMPI_COMM_NAMEISSET;
|
||||||
|
|
||||||
/* VPS: Remove this later */
|
/* VPS: Remove this later */
|
||||||
lam_mpi_comm_null.bcast_lin_reqs = NULL;
|
ompi_mpi_comm_null.bcast_lin_reqs = NULL;
|
||||||
lam_mpi_comm_null.bcast_log_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 */
|
/* create new communicator element */
|
||||||
new_comm = OBJ_NEW(lam_communicator_t);
|
new_comm = OBJ_NEW(ompi_communicator_t);
|
||||||
new_comm->c_local_group = lam_group_allocate ( local_size );
|
new_comm->c_local_group = ompi_group_allocate ( local_size );
|
||||||
if ( 0 < remote_size ) {
|
if ( 0 < remote_size ) {
|
||||||
new_comm->c_remote_group = lam_group_allocate (remote_size);
|
new_comm->c_remote_group = ompi_group_allocate (remote_size);
|
||||||
new_comm->c_flags |= LAM_COMM_INTER;
|
new_comm->c_flags |= OMPI_COMM_INTER;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
@ -167,8 +167,8 @@ lam_communicator_t *lam_comm_allocate ( int local_size, int remote_size )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* fill in the inscribing hyper-cube dimensions */
|
/* fill in the inscribing hyper-cube dimensions */
|
||||||
new_comm->c_cube_dim = lam_cube_dim(local_size);
|
new_comm->c_cube_dim = ompi_cube_dim(local_size);
|
||||||
if ( LAM_ERROR == new_comm->c_cube_dim ) {
|
if ( OMPI_ERROR == new_comm->c_cube_dim ) {
|
||||||
OBJ_RELEASE(new_comm);
|
OBJ_RELEASE(new_comm);
|
||||||
new_comm = NULL;
|
new_comm = NULL;
|
||||||
}
|
}
|
||||||
@ -176,24 +176,24 @@ lam_communicator_t *lam_comm_allocate ( int local_size, int remote_size )
|
|||||||
return new_comm;
|
return new_comm;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lam_comm_finalize(void)
|
int ompi_comm_finalize(void)
|
||||||
{
|
{
|
||||||
/* Destroy all predefined communicators */
|
/* Destroy all predefined communicators */
|
||||||
OBJ_DESTRUCT( &lam_mpi_comm_null );
|
OBJ_DESTRUCT( &ompi_mpi_comm_null );
|
||||||
OBJ_DESTRUCT( &lam_mpi_comm_world );
|
OBJ_DESTRUCT( &ompi_mpi_comm_world );
|
||||||
OBJ_DESTRUCT( &lam_mpi_comm_self );
|
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.
|
* 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 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_f_to_c_index = MPI_UNDEFINED;
|
||||||
comm->c_name[0] = '\0';
|
comm->c_name[0] = '\0';
|
||||||
@ -219,17 +219,17 @@ static void lam_comm_construct(lam_communicator_t* comm)
|
|||||||
return;
|
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_local_group );
|
||||||
OBJ_RELEASE ( comm->c_remote_group );
|
OBJ_RELEASE ( comm->c_remote_group );
|
||||||
|
|
||||||
OBJ_RELEASE ( comm->error_handler );
|
OBJ_RELEASE ( comm->error_handler );
|
||||||
|
|
||||||
/* reset the lam_comm_f_to_c_table entry */
|
/* reset the ompi_comm_f_to_c_table entry */
|
||||||
if ( NULL != lam_pointer_array_get_item ( &lam_mpi_communicators,
|
if ( NULL != ompi_pointer_array_get_item ( &ompi_mpi_communicators,
|
||||||
comm->c_f_to_c_index )) {
|
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);
|
comm->c_f_to_c_index, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,8 +33,8 @@ bogus = \
|
|||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
|
||||||
if WANT_INSTALL_HEADERS
|
if WANT_INSTALL_HEADERS
|
||||||
lamdir = $(includedir)/lam/ctnetwork
|
ompidir = $(includedir)/ompi/ctnetwork
|
||||||
lam_HEADERS = $(headers)
|
ompi_HEADERS = $(headers)
|
||||||
else
|
else
|
||||||
lamdir = $(includedir)
|
ompidir = $(includedir)
|
||||||
endif
|
endif
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
#include "ctnetwork/ctchannel.h"
|
#include "ctnetwork/ctchannel.h"
|
||||||
|
|
||||||
#define CHANNEL_CLS(chnl) \
|
#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_status = CT_CHNL_CLOSED;
|
||||||
channel->cth_id = 0;
|
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",
|
"ompi_ct_channel_t",
|
||||||
OBJ_CLASS(lam_object_t),
|
OBJ_CLASS(ompi_object_t),
|
||||||
(lam_construct_t) lam_cth_construct,
|
(ompi_construct_t) ompi_cth_construct,
|
||||||
(lam_destruct_t) lam_object_destruct
|
(ompi_destruct_t) ompi_object_destruct
|
||||||
},
|
},
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL
|
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) */
|
/* 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)
|
uint32_t data_len, uint32_t *bytes_sent)
|
||||||
{
|
{
|
||||||
return CHANNEL_CLS(channel)->cth_send(channel, data, data_len,
|
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) */
|
/* 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)
|
uint32_t buff_len, uint32_t *bytes_recvd)
|
||||||
{
|
{
|
||||||
return CHANNEL_CLS(channel)->cth_recv(channel, buffer,
|
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) */
|
/* 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 CHANNEL_CLS(channel)->cth_get_msg(channel, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return: error code args: (channel, recv buffer ptr, bytes received) */
|
/* 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,
|
const uint8_t **buffer,
|
||||||
uint32_t *bytes_recvd)
|
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) */
|
/* 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 CHANNEL_CLS(channel)->cth_send_msg(channel, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* return: error code args: (channel, msg ptr, msg len) */
|
/* 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,
|
const uint8_t *packed_msg,
|
||||||
uint32_t msg_len)
|
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;
|
channel->tcp_sockfd = 0;
|
||||||
memset(&(channel->tcp_addr), 0, sizeof(channel->tcp_addr));
|
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",
|
"ompi_tcp_chnl_t",
|
||||||
OBJ_CLASS(lam_ctchannel_t),
|
OBJ_CLASS(ompi_ctchannel_t),
|
||||||
(lam_construct_t) lam_tcpch_construct,
|
(ompi_construct_t) ompi_tcpch_construct,
|
||||||
(lam_destruct_t) lam_tcpch_destruct
|
(ompi_destruct_t) ompi_tcpch_destruct
|
||||||
},
|
},
|
||||||
lam_tcpch_send,
|
ompi_tcpch_send,
|
||||||
lam_tcpch_recv,
|
ompi_tcpch_recv,
|
||||||
lam_tcpch_get_msg,
|
ompi_tcpch_get_msg,
|
||||||
lam_tcpch_get_packed_msg,
|
ompi_tcpch_get_packed_msg,
|
||||||
lam_tcpch_send_msg,
|
ompi_tcpch_send_msg,
|
||||||
lam_tcpch_send_packed_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 data_len, uint32_t *bytes_sent)
|
||||||
{
|
{
|
||||||
uint32_t ret = CT_CHNL_ERR_OK;
|
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 buff_len, uint32_t *bytes_recvd)
|
||||||
{
|
{
|
||||||
uint32_t ret = CT_CHNL_ERR_OK;
|
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;
|
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,
|
const uint8_t **buffer,
|
||||||
uint32_t *bytes_recvd)
|
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;
|
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,
|
const uint8_t *packed_msg,
|
||||||
uint32_t msg_len)
|
uint32_t msg_len)
|
||||||
{
|
{
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_CT_CHANNEL_H
|
#ifndef OMPI_CT_CHANNEL_H
|
||||||
#define LAM_CT_CHANNEL_H
|
#define OMPI_CT_CHANNEL_H
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "ctnetwork/ctmessage.h"
|
#include "ctnetwork/ctmessage.h"
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ typedef enum
|
|||||||
CT_CHNL_ERR_CONN_LOST, /* lost connection */
|
CT_CHNL_ERR_CONN_LOST, /* lost connection */
|
||||||
CT_CHNL_ERR_INVALID_MSG, /* unable to pack/unpack msg or msg is NULL */
|
CT_CHNL_ERR_INVALID_MSG, /* unable to pack/unpack msg or msg is NULL */
|
||||||
CT_CHNL_ERR_TIMED_OUT /* channel operation timed out. */
|
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_CLOSED = 0,
|
||||||
CT_CHNL_CONNECTED,
|
CT_CHNL_CONNECTED,
|
||||||
CT_CHNL_FAILED
|
CT_CHNL_FAILED
|
||||||
} lam_ctchnl_status_t;
|
} ompi_ctchnl_status_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -47,66 +47,66 @@ typedef enum
|
|||||||
* communicate in the network.
|
* 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) */
|
/* 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 *);
|
const uint8_t *, uint32_t, uint32_t *);
|
||||||
|
|
||||||
/* return: error code args: (channel, recv buffer, buffer length, bytes received) */
|
/* 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 *);
|
const uint8_t *, uint32_t, uint32_t *);
|
||||||
|
|
||||||
/* return: error code args: (channel, msg ptr) */
|
/* return: error code args: (channel, msg ptr) */
|
||||||
typedef uint32_t (*lam_cth_get_msg_fn_t)(struct lam_ctchannel *,
|
typedef uint32_t (*ompi_cth_get_msg_fn_t)(struct ompi_ctchannel *,
|
||||||
lam_ctmsg_t **);
|
ompi_ctmsg_t **);
|
||||||
|
|
||||||
/* return: error code args: (channel, recv buffer ptr, bytes received) */
|
/* 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 *);
|
const uint8_t **, uint32_t *);
|
||||||
|
|
||||||
/* return: error code args: (channel, msg) */
|
/* return: error code args: (channel, msg) */
|
||||||
typedef uint32_t (*lam_cth_send_msg_fn_t)(struct lam_ctchannel *,
|
typedef uint32_t (*ompi_cth_send_msg_fn_t)(struct ompi_ctchannel *,
|
||||||
lam_ctmsg_t *);
|
ompi_ctmsg_t *);
|
||||||
|
|
||||||
/* return: error code args: (channel, msg ptr, msg len) */
|
/* 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);
|
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) */
|
/* 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) */
|
/* 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) */
|
/* 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) */
|
/* 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) */
|
/* 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) */
|
/* return: error code args: (channel, msg ptr, msg len) */
|
||||||
lam_cth_send_packed_msg_fn_t *send_packed_msg;
|
ompi_cth_send_packed_msg_fn_t *send_packed_msg;
|
||||||
} lam_ctchannel_class_t;
|
} 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;
|
int cth_status;
|
||||||
uint32_t cth_id;
|
uint32_t cth_id;
|
||||||
uint32_t cth_timeout_secs;
|
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);
|
int ompi_cth_is_connected(ompi_ctchannel_t *channel);
|
||||||
inline int lam_cth_is_connected(lam_ctchannel_t *channel)
|
inline int ompi_cth_is_connected(ompi_ctchannel_t *channel)
|
||||||
{
|
{
|
||||||
return (CT_CHNL_CONNECTED == channel->cth_status);
|
return (CT_CHNL_CONNECTED == channel->cth_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t lam_cth_get_id(lam_ctchannel_t *channel);
|
uint32_t ompi_cth_get_id(ompi_ctchannel_t *channel);
|
||||||
inline uint32_t lam_cth_get_id(lam_ctchannel_t *channel)
|
inline uint32_t ompi_cth_get_id(ompi_ctchannel_t *channel)
|
||||||
{
|
{
|
||||||
return channel->cth_id;
|
return channel->cth_id;
|
||||||
}
|
}
|
||||||
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 lam_cth_set_id(lam_ctchannel_t *channel, uint32_t cid)
|
inline void ompi_cth_set_id(ompi_ctchannel_t *channel, uint32_t cid)
|
||||||
{
|
{
|
||||||
channel->cth_id = cid;
|
channel->cth_id = cid;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t lam_cth_get_timeout(lam_ctchannel_t *channel);
|
uint32_t ompi_cth_get_timeout(ompi_ctchannel_t *channel);
|
||||||
inline uint32_t lam_cth_get_timeout(lam_ctchannel_t *channel)
|
inline uint32_t ompi_cth_get_timeout(ompi_ctchannel_t *channel)
|
||||||
{
|
{
|
||||||
return channel->cth_timeout_secs;
|
return channel->cth_timeout_secs;
|
||||||
}
|
}
|
||||||
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 lam_cth_set_timeout(lam_ctchannel_t *channel, uint32_t timeout)
|
inline void ompi_cth_set_timeout(ompi_ctchannel_t *channel, uint32_t timeout)
|
||||||
{
|
{
|
||||||
channel->cth_timeout_secs = 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) */
|
/* 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);
|
uint32_t data_len, uint32_t *bytes_sent);
|
||||||
|
|
||||||
/* return: error code args: (channel, recv buffer, buffer length, bytes received) */
|
/* 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);
|
uint32_t buff_len, uint32_t *bytes_recvd);
|
||||||
|
|
||||||
/* return: error code args: (channel, msg ptr) */
|
/* 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) */
|
/* 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);
|
uint32_t *bytes_recvd);
|
||||||
|
|
||||||
/* return: error code args: (channel, msg) */
|
/* 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) */
|
/* 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);
|
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;
|
int tcp_sockfd;
|
||||||
struct sockaddr_in tcp_addr;
|
struct sockaddr_in tcp_addr;
|
||||||
int tcp_blocking;
|
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 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 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 *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,
|
const uint8_t *packed_msg,
|
||||||
uint32_t msg_len);
|
uint32_t msg_len);
|
||||||
|
|
||||||
|
|
||||||
#endif /* LAM_CT_CHANNEL_H */
|
#endif /* OMPI_CT_CHANNEL_H */
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_CT_CLIENT_H
|
#ifndef OMPI_CT_CLIENT_H
|
||||||
#define LAM_CT_CLIENT_H
|
#define OMPI_CT_CLIENT_H
|
||||||
|
|
||||||
#endif /* LAM_CT_CLIENT_H */
|
#endif /* OMPI_CT_CLIENT_H */
|
||||||
|
|
||||||
|
@ -2,42 +2,42 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_CT_CONTROLLER_H
|
#ifndef OMPI_CT_CONTROLLER_H
|
||||||
#define LAM_CT_CONTROLLER_H
|
#define OMPI_CT_CONTROLLER_H
|
||||||
|
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "ctnetwork/ctnode.h"
|
#include "ctnetwork/ctnode.h"
|
||||||
|
|
||||||
typedef void (*lam_ctmsg_recvd_fn)(struct lam_ctcontroller *,
|
typedef void (*ompi_ctmsg_recvd_fn)(struct ompi_ctcontroller *,
|
||||||
lam_ctmsg_t *,
|
ompi_ctmsg_t *,
|
||||||
void *);
|
void *);
|
||||||
|
|
||||||
typedef void (*lam_ctnode_failed_fn)(struct lam_ctcontroller *,
|
typedef void (*ompi_ctnode_failed_fn)(struct ompi_ctcontroller *,
|
||||||
lam_ctnode_t *,
|
ompi_ctnode_t *,
|
||||||
void *);
|
void *);
|
||||||
|
|
||||||
typedef struct lam_ctcontroller
|
typedef struct ompi_ctcontroller
|
||||||
{
|
{
|
||||||
lam_object_t super;
|
ompi_object_t super;
|
||||||
lam_ctnode_t ctl_node;
|
ompi_ctnode_t ctl_node;
|
||||||
void *ctl_user_info;
|
void *ctl_user_info;
|
||||||
lam_ctmsg_recvd_fn ctl_msg_recvd_callback;
|
ompi_ctmsg_recvd_fn ctl_msg_recvd_callback;
|
||||||
lam_ctnode_failed_fn ctl_node_failed_callback;
|
ompi_ctnode_failed_fn ctl_node_failed_callback;
|
||||||
} lam_ctctrl_t;
|
} ompi_ctctrl_t;
|
||||||
|
|
||||||
void lam_ctl_construct(lam_ctctrl_t *ctrl);
|
void ompi_ctl_construct(ompi_ctctrl_t *ctrl);
|
||||||
void lam_ctl_destruct(lam_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;
|
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;
|
ctrl->ctl_node_failed_callback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* LAM_CT_CONTROLLER_H */
|
#endif /* OMPI_CT_CONTROLLER_H */
|
||||||
|
@ -5,29 +5,29 @@
|
|||||||
#include "ctnetwork/ctmessage.h"
|
#include "ctnetwork/ctmessage.h"
|
||||||
|
|
||||||
|
|
||||||
lam_class_t lam_ct_ctrl_t_class = {
|
ompi_class_t ompi_ct_ctrl_t_class = {
|
||||||
"lam_ct_ctrl_t",
|
"ompi_ct_ctrl_t",
|
||||||
OBJ_CLASS(lam_object_t),
|
OBJ_CLASS(ompi_object_t),
|
||||||
(lam_construct_t) lam_ctc_construct,
|
(ompi_construct_t) ompi_ctc_construct,
|
||||||
(lam_destruct_t) lam_ctc_destruct
|
(ompi_destruct_t) ompi_ctc_destruct
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
lam_class_t lam_ctmsg_t_class = {
|
ompi_class_t ompi_ctmsg_t_class = {
|
||||||
"lam_ctmsg_t",
|
"ompi_ctmsg_t",
|
||||||
OBJ_CLASS(lam_object_t),
|
OBJ_CLASS(ompi_object_t),
|
||||||
(lam_construct_t) lam_ctm_construct,
|
(ompi_construct_t) ompi_ctm_construct,
|
||||||
(lam_destruct_t) lam_ctm_destruct
|
(ompi_destruct_t) ompi_ctm_destruct
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const uint32_t ctrl_alloc_len = sizeof(lam_ct_ctrl_t) -
|
static const uint32_t ctrl_alloc_len = sizeof(ompi_ct_ctrl_t) -
|
||||||
sizeof(lam_object_t) - sizeof(ctrl->ctc_info);
|
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_is_user_msg = 0;
|
||||||
ctrl->ctc_routing_type = LAM_CT_PT2PT;
|
ctrl->ctc_routing_type = OMPI_CT_PT2PT;
|
||||||
ctrl->ctc_sender = 0;
|
ctrl->ctc_sender = 0;
|
||||||
ctrl->ctc_dest = 0;
|
ctrl->ctc_dest = 0;
|
||||||
ctrl->ctc_forwarding = 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)
|
uint32_t sender, uint32_t dest)
|
||||||
{
|
{
|
||||||
ctrl->ctc_routing_type = routing_type;
|
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;
|
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
|
/* ASSERT: packed control struct looks like
|
||||||
<ctc_is_user_msg (uint16_t)><ctc_routing_type (uint16_t)>
|
<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;
|
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) {
|
if (0 == buffer) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
lam_ctc_pack_buffer(ctrl, buffer, len);
|
ompi_ctc_pack_buffer(ctrl, buffer, len);
|
||||||
|
|
||||||
return buffer;
|
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
|
/* ASSERT: packed control struct looks like
|
||||||
<ctc_is_user_msg (uint16_t)><ctc_routing_type (uint16_t)>
|
<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_forwarding (uint32_t)><ctc_client_tag (uint32_t)>
|
||||||
<ctc_info_len (uint32_t)><ctc_info (uint8_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) {
|
if (0 == ctrl) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&(ctrl->ctc_is_user_msg), buffer, ctrl_alloc_len);
|
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) {
|
if (0 == ctrl->ctc_info) {
|
||||||
OBJ_RELEASE(ctrl);
|
OBJ_RELEASE(ctrl);
|
||||||
return 0;
|
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)
|
uint32_t *len)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
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)
|
uint32_t *len)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -137,47 +137,47 @@ int lam_ctc_unpack_buffer(lam_ct_ctrl_t *ctrl, uint8_t *buffer,
|
|||||||
* control struct.
|
* 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);
|
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));
|
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));
|
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) +
|
return *(uint32_t *) (buffer + 2 * sizeof(uint16_t) +
|
||||||
sizeof(uint32_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)
|
return *(uint32_t *) (buffer + 2 * sizeof(uint16_t)
|
||||||
+ 2 * sizeof(uint32_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),
|
memcpy(buffer + 2 * sizeof(uint16_t) + 2 * sizeof(uint32_t),
|
||||||
&node, sizeof(node));
|
&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),
|
memcpy(len, buffer + ctrl_alloc_len - sizeof(uint32_t),
|
||||||
sizeof(uint32_t));
|
sizeof(uint32_t));
|
||||||
return buffer + ctrl_alloc_len;
|
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;
|
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_len = 0;
|
||||||
msg->ctm_data = 0;
|
msg->ctm_data = 0;
|
||||||
msg->ctm_should_free = 1;
|
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) {
|
if (msg->ctm_should_free) {
|
||||||
lam_free(msg->ctm_data);
|
ompi_free(msg->ctm_data);
|
||||||
}
|
}
|
||||||
OBJECT_RELEASE(msg->ctm_ctrl);
|
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 sender,
|
||||||
uint32_t dest, uint8_t *data,
|
uint32_t dest, uint8_t *data,
|
||||||
uint32_t data_len, int should_free)
|
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) {
|
if (0 == msg) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJ_CONSTRUCT(&msg->ctm_ctrl, lam_ct_ctrl_t);
|
OBJ_CONSTRUCT(&msg->ctm_ctrl, ompi_ct_ctrl_t);
|
||||||
lam_ctc_construct_with(&(msg->ctm_ctrl), sender, dest);
|
ompi_ctc_construct_with(&(msg->ctm_ctrl), sender, dest);
|
||||||
msg->ctm_should_free = should_free;
|
msg->ctm_should_free = should_free;
|
||||||
msg->ctm_data = data;
|
msg->ctm_data = data;
|
||||||
msg->ctm_len = data_len;
|
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;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *lam_ctm_pack(lam_ctmsg_t *msg)
|
uint8_t *ompi_ctm_pack(ompi_ctmsg_t *msg)
|
||||||
{
|
{
|
||||||
/* packed msg layout
|
/* packed msg layout
|
||||||
<msg len (uint32_t)><packed ctrl><data len (uint32_t)>
|
<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
|
/* packed msg layout
|
||||||
<msg len (uint32_t)><packed ctrl><data len (uint32_t)>
|
<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.
|
* 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$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_CT_MESSAGE_H
|
#ifndef OMPI_CT_MESSAGE_H
|
||||||
#define LAM_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 ompi_class_t ompi_ct_ctrl_t_class;
|
||||||
extern lam_class_t lam_ctmsg_t_class;
|
extern ompi_class_t ompi_ctmsg_t_class;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -34,10 +34,10 @@ extern lam_class_t lam_ctmsg_t_class;
|
|||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
LAM_CT_BCAST = 1,
|
OMPI_CT_BCAST = 1,
|
||||||
LAM_CT_ALLGATHER,
|
OMPI_CT_ALLGATHER,
|
||||||
LAM_CT_SCATTER,
|
OMPI_CT_SCATTER,
|
||||||
LAM_CT_PT2PT
|
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_is_user_msg; /* 1 -> msg is for user app. */
|
||||||
uint16_t ctc_routing_type; /* broadcast, scatter, pt2pt, etc. */
|
uint16_t ctc_routing_type; /* broadcast, scatter, pt2pt, etc. */
|
||||||
uint32_t ctc_sender; /* node that initiated send. */
|
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_client_tag; /* tag if client sent msg. */
|
||||||
uint32_t ctc_info_len;
|
uint32_t ctc_info_len;
|
||||||
uint8_t *ctc_info;
|
uint8_t *ctc_info;
|
||||||
} lam_ct_ctrl_t;
|
} ompi_ct_ctrl_t;
|
||||||
|
|
||||||
|
|
||||||
void lam_ctc_construct(lam_ct_ctrl_t *ctrl);
|
void ompi_ctc_construct(ompi_ct_ctrl_t *ctrl);
|
||||||
void lam_ctc_destruct(lam_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 sender,
|
||||||
uint32_t dest);
|
uint32_t dest);
|
||||||
|
|
||||||
uint32_t lam_ctc_pack_size(lam_ct_ctrl_t *ctrl);
|
uint32_t ompi_ctc_pack_size(ompi_ct_ctrl_t *ctrl);
|
||||||
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);
|
||||||
lam_ct_ctrl_t *lam_ctc_unpack(uint8_t *buffer);
|
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 ompi_ctc_pack_buffer(ompi_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_unpack_buffer(ompi_ct_ctrl_t *ctrl, uint8_t *buffer, uint32_t *len);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functions for accessing data in packed
|
* Functions for accessing data in packed
|
||||||
* control struct.
|
* 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);
|
uint32_t ompi_pk_ctc_get_forwarding(uint8_t *buffer);
|
||||||
void lam_pk_ctc_set_forwarding(uint8_t *buffer, uint32_t node);
|
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);
|
uint8_t *ompi_pk_ctc_get_info(uint8_t *buffer, uint32_t *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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Accessor functions
|
* Accessor functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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 lam_ctc_get_is_user_msg(lam_ct_ctrl_t *ctrl)
|
inline bool ompi_ctc_get_is_user_msg(ompi_ct_ctrl_t *ctrl)
|
||||||
{
|
{
|
||||||
return ctrl->ctc_is_user_msg;
|
return ctrl->ctc_is_user_msg;
|
||||||
}
|
}
|
||||||
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 lam_ctc_set_is_user_msg(lam_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;
|
ctrl->ctc_is_user_msg = yn;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 lam_ctc_get_routing_type(lam_ct_ctrl_t *ctrl)
|
inline uint16_t ompi_ctc_get_routing_type(ompi_ct_ctrl_t *ctrl)
|
||||||
{
|
{
|
||||||
return ctrl->ctc_routing_type;
|
return ctrl->ctc_routing_type;
|
||||||
}
|
}
|
||||||
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 lam_ctc_set_routing_type(lam_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;
|
ctrl->ctc_routing_type = rtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 lam_ctc_get_sender(lam_ct_ctrl_t *ctrl)
|
inline uint32_t ompi_ctc_get_sender(ompi_ct_ctrl_t *ctrl)
|
||||||
{
|
{
|
||||||
return ctrl->ctc_sender;
|
return ctrl->ctc_sender;
|
||||||
}
|
}
|
||||||
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 lam_ctc_set_sender(lam_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;
|
ctrl->ctc_sender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 lam_ctc_get_dest(lam_ct_ctrl_t *ctrl)
|
inline uint32_t ompi_ctc_get_dest(ompi_ct_ctrl_t *ctrl)
|
||||||
{
|
{
|
||||||
return ctrl->ctc_dest;
|
return ctrl->ctc_dest;
|
||||||
}
|
}
|
||||||
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 lam_ctc_set_dest(lam_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;
|
ctrl->ctc_dest = dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 lam_ctc_get_forwarding(lam_ct_ctrl_t *ctrl)
|
inline uint32_t ompi_ctc_get_forwarding(ompi_ct_ctrl_t *ctrl)
|
||||||
{
|
{
|
||||||
return ctrl->ctc_forwarding;
|
return ctrl->ctc_forwarding;
|
||||||
}
|
}
|
||||||
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 lam_ctc_set_forwarding(lam_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;
|
ctrl->ctc_forwarding = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 *lam_ctc_get_info(lam_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;
|
*len = ctrl->ctc_info_len;
|
||||||
return ctrl->ctc_info;
|
return ctrl->ctc_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 lam_ctc_set_info(lam_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_len = len;
|
||||||
ctrl->ctc_info = info;
|
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;
|
ompi_object_t super;
|
||||||
lam_ct_ctrl_t *ctm_ctrl;
|
ompi_ct_ctrl_t *ctm_ctrl;
|
||||||
uint32_t ctm_len;
|
uint32_t ctm_len;
|
||||||
uint8_t *ctm_data;
|
uint8_t *ctm_data;
|
||||||
int ctm_should_free;
|
int ctm_should_free;
|
||||||
} lam_ctmsg_t;
|
} ompi_ctmsg_t;
|
||||||
|
|
||||||
|
|
||||||
void lam_ctm_construct(lam_ctmsg_t *msg);
|
void ompi_ctm_construct(ompi_ctmsg_t *msg);
|
||||||
void lam_ctm_destruct(lam_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 sender,
|
||||||
uint32_t dest, uint8_t *data,
|
uint32_t dest, uint8_t *data,
|
||||||
uint32_t data_len,
|
uint32_t data_len,
|
||||||
int should_free);
|
int should_free);
|
||||||
|
|
||||||
uint8_t *lam_ctm_pack(lam_ctmsg_t *msg);
|
uint8_t *ompi_ctm_pack(ompi_ctmsg_t *msg);
|
||||||
lam_ctmsg_t *lam_ctm_unpack(uint8_t *buffer);
|
ompi_ctmsg_t *ompi_ctm_unpack(uint8_t *buffer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functions for accessing data in packed
|
* Functions for accessing data in packed
|
||||||
* msg struct.
|
* 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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -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);
|
ompi_ct_ctrl_t *ompi_ctm_get_control(ompi_ctmsg_t *msg);
|
||||||
inline lam_ct_ctrl_t *lam_ctm_get_control(lam_ctmsg_t *msg)
|
inline ompi_ct_ctrl_t *ompi_ctm_get_control(ompi_ctmsg_t *msg)
|
||||||
{
|
{
|
||||||
return msg->ctm_ctrl;
|
return msg->ctm_ctrl;
|
||||||
}
|
}
|
||||||
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 lam_ctm_set_control(lam_ctmsg_t *msg, lam_ct_ctrl_t *ctrl)
|
inline void ompi_ctm_set_control(ompi_ctmsg_t *msg, ompi_ct_ctrl_t *ctrl)
|
||||||
{
|
{
|
||||||
msg->ctm_ctrl = ctrl;
|
msg->ctm_ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* LAM_CT_MESSAGE_H */
|
#endif /* OMPI_CT_MESSAGE_H */
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_CT_NODE_H
|
#ifndef OMPI_CT_NODE_H
|
||||||
#define LAM_CT_NODE_H
|
#define OMPI_CT_NODE_H
|
||||||
|
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "lfc/hash_table.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 uint32_t (*ompi_ctl_label_for_link_fn_t)(struct ompi_ctnode *, uint32_t);
|
||||||
typedef char *(*lam_ctl_isa_neighbor_fn_t)(struct lam_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;
|
ompi_class_t super;
|
||||||
lam_ctl_label_for_link_fn_t *ctl_label_for_link;
|
ompi_ctl_label_for_link_fn_t *ctl_label_for_link;
|
||||||
lam_ctl_isa_neighbor_fn_t *ctl_isa_neighbor;
|
ompi_ctl_isa_neighbor_fn_t *ctl_isa_neighbor;
|
||||||
} lam_ctnode_class_t;
|
} 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_label;
|
||||||
uint32_t ctn_num_nodes; /* total # of nodes in network */
|
uint32_t ctn_num_nodes; /* total # of nodes in network */
|
||||||
void *ctn_user_info;
|
void *ctn_user_info;
|
||||||
lam_fast_hash_t ctn_neighbors;
|
ompi_fast_hash_t ctn_neighbors;
|
||||||
lam_fast_hash_t ctn_scatter_cache;
|
ompi_fast_hash_t ctn_scatter_cache;
|
||||||
lam_fast_hash_t ctn_bcast_cache;
|
ompi_fast_hash_t ctn_bcast_cache;
|
||||||
} lam_ctnode_t;
|
} ompi_ctnode_t;
|
||||||
|
|
||||||
|
|
||||||
void lam_ctn_construct(lam_ctnode_t *node);
|
void ompi_ctn_construct(ompi_ctnode_t *node);
|
||||||
void lam_ctn_destruct(lam_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
|
PRE: neighbor_label is the label of the node's neighbor
|
||||||
POST: returns a pointer to 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.
|
PRE: label represents the label for a valid neighbor.
|
||||||
POST: Adds a link to a neighbor with specified label.
|
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 uint32_t ompi_ctn_get_label(ompi_ctnode_t *node) {return node->ctn_label;}
|
||||||
inline void lam_ctn_set_label(lam_ctnode_t *node, uint32_t label)
|
inline void ompi_ctn_set_label(ompi_ctnode_t *node, uint32_t label)
|
||||||
{node->ctn_label = 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
|
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
|
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
|
PRE: The graph edges connecting node to its neighbors are oriented
|
||||||
so that the links (edges) are numbered starting from 1.
|
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
|
POST: Returns pointer to byte array for control data for routing
|
||||||
messages. The length of the control array is stored in
|
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) */
|
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$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_CT_PEER_H
|
#ifndef OMPI_CT_PEER_H
|
||||||
#define LAM_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
|
# Conditionally install the header files
|
||||||
|
|
||||||
if WANT_INSTALL_HEADERS
|
if WANT_INSTALL_HEADERS
|
||||||
lamdir = $(includedir)/lam/datatype
|
ompidir = $(includedir)/ompi/datatype
|
||||||
lam_HEADERS = $(headers)
|
ompi_HEADERS = $(headers)
|
||||||
else
|
else
|
||||||
lamdir = $(includedir)
|
ompidir = $(includedir)
|
||||||
endif
|
endif
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
/* -*- 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
|
* non-contiguous data together with constituent type-related
|
||||||
* information.
|
* information.
|
||||||
*/
|
*/
|
||||||
@ -11,15 +11,15 @@
|
|||||||
#ifndef DATATYPE_H_HAS_BEEN_INCLUDED
|
#ifndef DATATYPE_H_HAS_BEEN_INCLUDED
|
||||||
#define 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/types.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "errhandler/errhandler.h"
|
#include "errhandler/errhandler.h"
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "lfc/lam_hash_table.h"
|
#include "class/ompi_hash_table.h"
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
|
||||||
/* if there are more basic datatypes than the number of bytes in the int type
|
/* 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.
|
/* the data description.
|
||||||
*/
|
*/
|
||||||
typedef struct lam_datatype_t {
|
typedef struct ompi_datatype_t {
|
||||||
lam_object_t super; /**< basic superclass */
|
ompi_object_t super; /**< basic superclass */
|
||||||
u_int32_t size; /**< total size in bytes of the memory used by the data if
|
u_int32_t size; /**< total size in bytes of the memory used by the data if
|
||||||
* the data is put on a contiguous buffer */
|
* the data is put on a contiguous buffer */
|
||||||
long true_lb;
|
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 */
|
u_int64_t bdt_used; /**< which basic datatypes are used in the data description */
|
||||||
|
|
||||||
/* Attribute fields */
|
/* Attribute fields */
|
||||||
lam_hash_table_t *d_keyhash;
|
ompi_hash_table_t *d_keyhash;
|
||||||
char name[MPI_MAX_OBJECT_NAME];
|
char name[MPI_MAX_OBJECT_NAME];
|
||||||
dt_type_desc_t desc; /**< the data description */
|
dt_type_desc_t desc; /**< the data description */
|
||||||
dt_type_desc_t opt_desc; /**< short description of the data used when conversion is useless
|
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
|
/* basic elements count used to compute the size of the datatype for
|
||||||
* remote nodes */
|
* remote nodes */
|
||||||
u_int32_t btypes[DT_MAX_PREDEFINED];
|
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 ompi_ddt_init( void );
|
||||||
int lam_ddt_finalize( void );
|
int ompi_ddt_finalize( void );
|
||||||
dt_desc_t* lam_ddt_create( int expectedSize );
|
dt_desc_t* ompi_ddt_create( int expectedSize );
|
||||||
int lam_ddt_commit( dt_desc_t** );
|
int ompi_ddt_commit( dt_desc_t** );
|
||||||
int lam_ddt_destroy( dt_desc_t** );
|
int ompi_ddt_destroy( dt_desc_t** );
|
||||||
void lam_ddt_dump( dt_desc_t* pData );
|
void ompi_ddt_dump( dt_desc_t* pData );
|
||||||
void lam_ddt_dump_complete( dt_desc_t* pData );
|
void ompi_ddt_dump_complete( dt_desc_t* pData );
|
||||||
/* data creation functions */
|
/* data creation functions */
|
||||||
int lam_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType );
|
int ompi_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 ompi_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_create_vector( int count, int bLength, long stride,
|
||||||
dt_desc_t* oldType, dt_desc_t** newType );
|
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 );
|
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 );
|
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 );
|
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 );
|
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 );
|
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 ompi_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_subarray( int ndims, int* pSizes, int* pSubSizes, int* pStarts,
|
||||||
int order, dt_desc_t* oldType, dt_desc_t** newType );
|
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,
|
int* pDArgs, int* pPSizes, int order, dt_desc_t* oldType,
|
||||||
dt_desc_t** newType );
|
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; }
|
{ *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; }
|
{ *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; }
|
{ *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; }
|
{ *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; }
|
{ /* 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; }
|
{ *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; }
|
{ *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 ompi_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_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 */
|
/* flags for the datatypes */
|
||||||
|
|
||||||
@ -137,14 +137,14 @@ typedef int (*conversion_fct_t)( unsigned int count,
|
|||||||
unsigned int* used );
|
unsigned int* used );
|
||||||
|
|
||||||
typedef struct __dt_stack dt_stack_t;
|
typedef struct __dt_stack dt_stack_t;
|
||||||
typedef struct lam_convertor_t lam_convertor_t;
|
typedef struct ompi_convertor_t ompi_convertor_t;
|
||||||
typedef int (*convertor_advance_fct_t)( lam_convertor_t* pConvertor,
|
typedef int (*convertor_advance_fct_t)( ompi_convertor_t* pConvertor,
|
||||||
struct iovec* pInputv,
|
struct iovec* pInputv,
|
||||||
unsigned int inputCount );
|
unsigned int inputCount );
|
||||||
|
|
||||||
/* and now the convertor stuff */
|
/* and now the convertor stuff */
|
||||||
struct lam_convertor_t {
|
struct ompi_convertor_t {
|
||||||
lam_object_t super; /**< basic superclass */
|
ompi_object_t super; /**< basic superclass */
|
||||||
dt_desc_t* pDesc;
|
dt_desc_t* pDesc;
|
||||||
long remoteArch;
|
long remoteArch;
|
||||||
dt_stack_t* pStack;
|
dt_stack_t* pStack;
|
||||||
@ -161,42 +161,42 @@ struct lam_convertor_t {
|
|||||||
convertor_advance_fct_t fAdvance;
|
convertor_advance_fct_t fAdvance;
|
||||||
conversion_fct_t* pFunctions;
|
conversion_fct_t* pFunctions;
|
||||||
};
|
};
|
||||||
OBJ_CLASS_DECLARATION( lam_convertor_t );
|
OBJ_CLASS_DECLARATION( ompi_convertor_t );
|
||||||
|
|
||||||
/* some convertor flags */
|
/* some convertor flags */
|
||||||
#define lam_convertor_progress( PCONV, IOVEC, COUNT ) \
|
#define ompi_convertor_progress( PCONV, IOVEC, COUNT ) \
|
||||||
(PCONV)->fAdvance( (PCONV), (IOVEC), (COUNT) );
|
(PCONV)->fAdvance( (PCONV), (IOVEC), (COUNT) );
|
||||||
|
|
||||||
/* and finally the convertor functions */
|
/* and finally the convertor functions */
|
||||||
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* lam_convertor_get_copy( lam_convertor_t* pConvertor );
|
ompi_convertor_t* ompi_convertor_get_copy( ompi_convertor_t* pConvertor );
|
||||||
int lam_convertor_copy( lam_convertor_t* pSrcConv, lam_convertor_t* pDestConv );
|
int ompi_convertor_copy( ompi_convertor_t* pSrcConv, ompi_convertor_t* pDestConv );
|
||||||
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* pData, int count,
|
dt_desc_t* pData, int count,
|
||||||
void* pUserBuf, int local_starting_point );
|
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,
|
dt_desc_t* pData, int count,
|
||||||
void* pUserBuf, int remote_starting_point );
|
void* pUserBuf, int remote_starting_point );
|
||||||
int lam_convertor_need_buffers( lam_convertor_t* pConvertor );
|
int ompi_convertor_need_buffers( ompi_convertor_t* pConvertor );
|
||||||
int lam_convertor_pack( lam_convertor_t* pConv, struct iovec* in, unsigned int in_size );
|
int ompi_convertor_pack( ompi_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 ompi_convertor_unpack( ompi_convertor_t* pConv, struct iovec* out, unsigned int out_size );
|
||||||
int lam_convertor_get_packed_size( lam_convertor_t* pConv, int* pSize );
|
int ompi_convertor_get_packed_size( ompi_convertor_t* pConv, int* pSize );
|
||||||
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 lam_create_stack_with_pos( lam_convertor_t* pConv,
|
int ompi_create_stack_with_pos( ompi_convertor_t* pConv,
|
||||||
int local_starting_point,
|
int local_starting_point,
|
||||||
int* local_sizes );
|
int* local_sizes );
|
||||||
|
|
||||||
/* temporary function prototypes. They should move in other place later. */
|
/* 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 * ci, int * i,
|
||||||
int * ca, MPI_Aint * a,
|
int * ca, MPI_Aint * a,
|
||||||
int * cd, MPI_Datatype * d, int * type);
|
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 ci, int ** i,
|
||||||
int ca, MPI_Aint* a,
|
int ca, MPI_Aint* a,
|
||||||
int cd, MPI_Datatype* d,int type);
|
int cd, MPI_Datatype* d,int type);
|
||||||
/* VPS: Added */
|
/* 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);
|
int rcount, MPI_Datatype rdtype, int tag, MPI_Comm comm);
|
||||||
|
|
||||||
#endif /* DATATYPE_H_HAS_BEEN_INCLUDED */
|
#endif /* DATATYPE_H_HAS_BEEN_INCLUDED */
|
||||||
|
@ -131,17 +131,17 @@ typedef struct __dt_endloop_desc {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
float r;
|
float r;
|
||||||
float i;
|
float i;
|
||||||
} lam_complex_float_t;
|
} ompi_complex_float_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
double r;
|
double r;
|
||||||
double i;
|
double i;
|
||||||
} lam_complex_double_t;
|
} ompi_complex_double_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
long double r;
|
long double r;
|
||||||
long double i;
|
long double i;
|
||||||
} lam_complex_long_double_t;
|
} ompi_complex_long_double_t;
|
||||||
|
|
||||||
extern dt_desc_t basicDatatypes[DT_MAX_PREDEFINED];
|
extern dt_desc_t basicDatatypes[DT_MAX_PREDEFINED];
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ int mpich_typeub( void )
|
|||||||
int blens[2];
|
int blens[2];
|
||||||
dt_desc_t *type1, *type2, *type3, *types[2];
|
dt_desc_t *type1, *type2, *type3, *types[2];
|
||||||
|
|
||||||
lam_ddt_create_vector( 2, 1, 4, &(basicDatatypes[DT_INT]), &type1 );
|
ompi_ddt_create_vector( 2, 1, 4, &(basicDatatypes[DT_INT]), &type1 );
|
||||||
lam_ddt_commit( &type1 );
|
ompi_ddt_commit( &type1 );
|
||||||
lam_ddt_get_extent( type1, &lb, &extent );
|
ompi_ddt_get_extent( type1, &lb, &extent );
|
||||||
extent1 = 5 * sizeof(int);
|
extent1 = 5 * sizeof(int);
|
||||||
if (extent != extent1) {
|
if (extent != extent1) {
|
||||||
printf("EXTENT 1 %ld != %ld\n",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
|
/* using MPI_UB and Type_struct, monkey with the extent, making it 16
|
||||||
*/
|
*/
|
||||||
lam_ddt_create_struct( 2, blens, displ, types, &type2 );
|
ompi_ddt_create_struct( 2, blens, displ, types, &type2 );
|
||||||
lam_ddt_commit( &type2 );
|
ompi_ddt_commit( &type2 );
|
||||||
lam_ddt_get_extent( type2, &lb, &extent );
|
ompi_ddt_get_extent( type2, &lb, &extent );
|
||||||
if (extent != extent2) {
|
if (extent != extent2) {
|
||||||
printf("EXTENT 2 %ld != %ld\n",extent,extent2);
|
printf("EXTENT 2 %ld != %ld\n",extent,extent2);
|
||||||
errs++;
|
errs++;
|
||||||
@ -57,10 +57,10 @@ int mpich_typeub( void )
|
|||||||
types[1]=&(basicDatatypes[DT_UB]);
|
types[1]=&(basicDatatypes[DT_UB]);
|
||||||
extent3 = extent2;
|
extent3 = extent2;
|
||||||
|
|
||||||
lam_ddt_create_struct( 2, blens, displ, types, &type3 );
|
ompi_ddt_create_struct( 2, blens, displ, types, &type3 );
|
||||||
lam_ddt_commit( &type3 );
|
ompi_ddt_commit( &type3 );
|
||||||
|
|
||||||
lam_ddt_get_extent( type3, &lb, &extent );
|
ompi_ddt_get_extent( type3, &lb, &extent );
|
||||||
if (extent != extent3) {
|
if (extent != extent3) {
|
||||||
printf("EXTENT 3 %ld != %ld\n",extent,extent3);
|
printf("EXTENT 3 %ld != %ld\n",extent,extent3);
|
||||||
errs++;
|
errs++;
|
||||||
@ -92,11 +92,11 @@ int mpich_typeub2( void )
|
|||||||
types[1] = &(basicDatatypes[DT_INT]);
|
types[1] = &(basicDatatypes[DT_INT]);
|
||||||
types[2] = &(basicDatatypes[DT_UB]);
|
types[2] = &(basicDatatypes[DT_UB]);
|
||||||
|
|
||||||
lam_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
ompi_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
||||||
lam_ddt_commit(&dt1);
|
ompi_ddt_commit(&dt1);
|
||||||
|
|
||||||
lam_ddt_type_lb(dt1, &lb); lam_ddt_type_ub(dt1, &ub);
|
ompi_ddt_type_lb(dt1, &lb); ompi_ddt_type_ub(dt1, &ub);
|
||||||
lam_ddt_type_extent(dt1,&ex1); lam_ddt_type_size(dt1,&sz1);
|
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 */
|
/* Values should be lb = -3, ub = 6 extent 9; size depends on implementation */
|
||||||
if (lb != -3 || ub != 6 || ex1 != 9) {
|
if (lb != -3 || ub != 6 || ex1 != 9) {
|
||||||
@ -106,9 +106,9 @@ int mpich_typeub2( void )
|
|||||||
else
|
else
|
||||||
printf("Example 3.26 type1 correct\n" );
|
printf("Example 3.26 type1 correct\n" );
|
||||||
|
|
||||||
lam_ddt_create_contiguous(2,dt1,&dt2);
|
ompi_ddt_create_contiguous(2,dt1,&dt2);
|
||||||
lam_ddt_type_lb(dt2, &lb); lam_ddt_type_ub(dt2, &ub);
|
ompi_ddt_type_lb(dt2, &lb); ompi_ddt_type_ub(dt2, &ub);
|
||||||
lam_ddt_type_extent(dt2,&ex2); lam_ddt_type_size(dt2,&sz2);
|
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 */
|
/* Values should be lb = -3, ub = 15, extent = 18, size depends on implementation */
|
||||||
if (lb != -3 || ub != 15 || ex2 != 18) {
|
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);
|
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
|
else
|
||||||
printf("Example 3.26 type1 correct\n" );
|
printf("Example 3.26 type1 correct\n" );
|
||||||
OBJ_RELEASE( dt2 ); assert( dt2 == NULL );
|
OBJ_RELEASE( dt2 ); assert( dt2 == NULL );
|
||||||
lam_ddt_create_contiguous(2,dt1,&dt2);
|
ompi_ddt_create_contiguous(2,dt1,&dt2);
|
||||||
lam_ddt_type_lb(dt2, &lb); lam_ddt_type_ub(dt2, &ub);
|
ompi_ddt_type_lb(dt2, &lb); ompi_ddt_type_ub(dt2, &ub);
|
||||||
lam_ddt_type_extent(dt2,&ex2); lam_ddt_type_size(dt2,&sz2);
|
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 */
|
/* Values should be lb = -3, ub = 15, extent = 18, size depends on implementation */
|
||||||
if (lb != -3 || ub != 15 || ex2 != 18) {
|
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);
|
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;
|
blocklen[0]=1; blocklen[1]=1;
|
||||||
disp[0]=0; disp[1]=ex1;
|
disp[0]=0; disp[1]=ex1;
|
||||||
|
|
||||||
lam_ddt_create_struct(2, blocklen, disp, types, &dt3);
|
ompi_ddt_create_struct(2, blocklen, disp, types, &dt3);
|
||||||
lam_ddt_commit(&dt3);
|
ompi_ddt_commit(&dt3);
|
||||||
|
|
||||||
lam_ddt_type_lb(dt3, &lb); lam_ddt_type_ub(dt3, &ub);
|
ompi_ddt_type_lb(dt3, &lb); ompi_ddt_type_ub(dt3, &ub);
|
||||||
lam_ddt_type_extent(dt3,&ex3); lam_ddt_type_size(dt3,&sz3);
|
ompi_ddt_type_extent(dt3,&ex3); ompi_ddt_type_size(dt3,&sz3);
|
||||||
/* Another way to express type2 */
|
/* Another way to express type2 */
|
||||||
if (lb != -3 || ub != 15 || ex3 != 18) {
|
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);
|
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]);
|
types[2] = &(basicDatatypes[DT_UB]);
|
||||||
|
|
||||||
/* Generate samples for contiguous, hindexed, hvector, indexed, and vector (struct and contiguous tested in typeub2) */
|
/* Generate samples for contiguous, hindexed, hvector, indexed, and vector (struct and contiguous tested in typeub2) */
|
||||||
lam_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
ompi_ddt_create_struct(3,blocklen,disp, types,&dt1);
|
||||||
lam_ddt_commit(&dt1);
|
ompi_ddt_commit(&dt1);
|
||||||
|
|
||||||
/* This type is the same as in typeub2, and is tested there */
|
/* This type is the same as in typeub2, and is tested there */
|
||||||
types[0]=dt1; types[1]=dt1;
|
types[0]=dt1; types[1]=dt1;
|
||||||
@ -181,11 +181,11 @@ int mpich_typeub3( void )
|
|||||||
disp[0]=-4; disp[1]=7;
|
disp[0]=-4; disp[1]=7;
|
||||||
idisp[0]=-4; idisp[1]=7;
|
idisp[0]=-4; idisp[1]=7;
|
||||||
|
|
||||||
lam_ddt_create_hindexed( 2, blocklen, disp, dt1, &dt2 );
|
ompi_ddt_create_hindexed( 2, blocklen, disp, dt1, &dt2 );
|
||||||
lam_ddt_commit( &dt2 );
|
ompi_ddt_commit( &dt2 );
|
||||||
|
|
||||||
lam_ddt_type_lb( dt2, &lb ); lam_ddt_type_ub( dt2, &ub );
|
ompi_ddt_type_lb( dt2, &lb ); ompi_ddt_type_ub( dt2, &ub );
|
||||||
lam_ddt_type_extent( dt2, &ex ); lam_ddt_type_size( dt2, &sz );
|
ompi_ddt_type_extent( dt2, &ex ); ompi_ddt_type_size( dt2, &sz );
|
||||||
|
|
||||||
if (lb != -7 || ub != 13 || ex != 20) {
|
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);
|
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
|
else
|
||||||
printf( "hindexed ok\n" );
|
printf( "hindexed ok\n" );
|
||||||
|
|
||||||
lam_ddt_create_indexed( 2, blocklen, idisp, dt1, &dt3 );
|
ompi_ddt_create_indexed( 2, blocklen, idisp, dt1, &dt3 );
|
||||||
lam_ddt_commit( &dt3 );
|
ompi_ddt_commit( &dt3 );
|
||||||
|
|
||||||
lam_ddt_type_lb( dt3, &lb ); lam_ddt_type_ub( dt3, &ub );
|
ompi_ddt_type_lb( dt3, &lb ); ompi_ddt_type_ub( dt3, &ub );
|
||||||
lam_ddt_type_extent( dt3, &ex ); lam_ddt_type_size( dt3, &sz );
|
ompi_ddt_type_extent( dt3, &ex ); ompi_ddt_type_size( dt3, &sz );
|
||||||
|
|
||||||
if (lb != -39 || ub != 69 || ex != 108) {
|
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);
|
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
|
else
|
||||||
printf( "indexed ok\n" );
|
printf( "indexed ok\n" );
|
||||||
|
|
||||||
lam_ddt_create_hvector( 2, 1, 14, dt1, &dt4 );
|
ompi_ddt_create_hvector( 2, 1, 14, dt1, &dt4 );
|
||||||
lam_ddt_commit( &dt4 );
|
ompi_ddt_commit( &dt4 );
|
||||||
|
|
||||||
lam_ddt_type_lb( dt4, &lb ); lam_ddt_type_ub( dt4, &ub );
|
ompi_ddt_type_lb( dt4, &lb ); ompi_ddt_type_ub( dt4, &ub );
|
||||||
lam_ddt_type_extent( dt4, &ex ); lam_ddt_type_size( dt4, &sz );
|
ompi_ddt_type_extent( dt4, &ex ); ompi_ddt_type_size( dt4, &sz );
|
||||||
|
|
||||||
if (lb != -3 || ub != 20 || ex != 23) {
|
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);
|
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
|
else
|
||||||
printf( "hvector ok\n" );
|
printf( "hvector ok\n" );
|
||||||
|
|
||||||
lam_ddt_create_vector( 2, 1, 14, dt1, &dt5 );
|
ompi_ddt_create_vector( 2, 1, 14, dt1, &dt5 );
|
||||||
lam_ddt_commit( &dt5 );
|
ompi_ddt_commit( &dt5 );
|
||||||
|
|
||||||
lam_ddt_type_lb( dt5, &lb ); lam_ddt_type_ub( dt5, &ub );
|
ompi_ddt_type_lb( dt5, &lb ); ompi_ddt_type_ub( dt5, &ub );
|
||||||
lam_ddt_type_extent( dt5, &ex ); lam_ddt_type_size( dt5, &sz );
|
ompi_ddt_type_extent( dt5, &ex ); ompi_ddt_type_size( dt5, &sz );
|
||||||
|
|
||||||
if (lb != -3 || ub != 132 || ex != 135) {
|
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);
|
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;
|
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 );
|
&upper );
|
||||||
free( disp );
|
free( disp );
|
||||||
free( blocklen );
|
free( blocklen );
|
||||||
@ -330,7 +330,7 @@ dt_desc_t* lower_matrix( unsigned int mat_size )
|
|||||||
blocklen[i] = i;
|
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 );
|
&upper );
|
||||||
free( disp );
|
free( disp );
|
||||||
free( blocklen );
|
free( blocklen );
|
||||||
@ -343,7 +343,7 @@ int test_upper( unsigned int length )
|
|||||||
{
|
{
|
||||||
double *mat1, *mat2, *inbuf;
|
double *mat1, *mat2, *inbuf;
|
||||||
dt_desc_t *pdt, *pdt1;
|
dt_desc_t *pdt, *pdt1;
|
||||||
lam_convertor_t * pConv;
|
ompi_convertor_t * pConv;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int i, j, split_chunk, total_length, rc;
|
int i, j, split_chunk, total_length, rc;
|
||||||
struct iovec a;
|
struct iovec a;
|
||||||
@ -369,12 +369,12 @@ int test_upper( unsigned int length )
|
|||||||
inbuf++;
|
inbuf++;
|
||||||
}
|
}
|
||||||
inbuf = (double*)ptr;
|
inbuf = (double*)ptr;
|
||||||
pConv = lam_convertor_create( 0, 0 );
|
pConv = ompi_convertor_create( 0, 0 );
|
||||||
lam_convertor_init_for_recv( pConv, 0, pdt, 1, mat2, 0 );
|
ompi_convertor_init_for_recv( pConv, 0, pdt, 1, mat2, 0 );
|
||||||
|
|
||||||
/* test the automatic destruction pf the data */
|
/* test the automatic destruction pf the data */
|
||||||
lam_ddt_destroy( &pdt ); assert( pdt == NULL );
|
ompi_ddt_destroy( &pdt ); assert( pdt == NULL );
|
||||||
lam_ddt_destroy( &pdt1 ); assert( pdt1 == NULL );
|
ompi_ddt_destroy( &pdt1 ); assert( pdt1 == NULL );
|
||||||
|
|
||||||
GET_TIME( start );
|
GET_TIME( start );
|
||||||
split_chunk = (length + 1) * sizeof(double);
|
split_chunk = (length + 1) * sizeof(double);
|
||||||
@ -383,7 +383,7 @@ int test_upper( unsigned int length )
|
|||||||
if( i < split_chunk ) split_chunk = i;
|
if( i < split_chunk ) split_chunk = i;
|
||||||
a.iov_base = ptr;
|
a.iov_base = ptr;
|
||||||
a.iov_len = split_chunk;
|
a.iov_len = split_chunk;
|
||||||
lam_convertor_unpack( pConv, &a, 1 );
|
ompi_convertor_unpack( pConv, &a, 1 );
|
||||||
ptr += split_chunk;
|
ptr += split_chunk;
|
||||||
i -= split_chunk;
|
i -= split_chunk;
|
||||||
if( mat2[0] != inbuf[0] ) assert(0);
|
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);
|
disp[1] = (size - width) * sizeof(double);
|
||||||
blocklen[1] = width;
|
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 );
|
&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 );
|
OBJ_RELEASE( pdt_line ); assert( pdt_line == NULL );
|
||||||
return pdt;
|
return pdt;
|
||||||
}
|
}
|
||||||
@ -424,18 +424,18 @@ dt_desc_t* test_contiguous( void )
|
|||||||
dt_desc_t *pdt, *pdt1, *pdt2;
|
dt_desc_t *pdt, *pdt1, *pdt2;
|
||||||
|
|
||||||
printf( "test contiguous (alignement)\n" );
|
printf( "test contiguous (alignement)\n" );
|
||||||
pdt1 = lam_ddt_create( -1 );
|
pdt1 = ompi_ddt_create( -1 );
|
||||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
ompi_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
||||||
lam_ddt_dump( pdt1 );
|
ompi_ddt_dump( pdt1 );
|
||||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
ompi_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
||||||
lam_ddt_dump( pdt1 );
|
ompi_ddt_dump( pdt1 );
|
||||||
lam_ddt_create_contiguous( 4, pdt1, &pdt2 );
|
ompi_ddt_create_contiguous( 4, pdt1, &pdt2 );
|
||||||
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
||||||
lam_ddt_dump( pdt2 );
|
ompi_ddt_dump( pdt2 );
|
||||||
lam_ddt_create_contiguous( 2, pdt2, &pdt );
|
ompi_ddt_create_contiguous( 2, pdt2, &pdt );
|
||||||
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
||||||
lam_ddt_dump( pdt );
|
ompi_ddt_dump( pdt );
|
||||||
lam_ddt_dump_complete( pdt );
|
ompi_ddt_dump_complete( pdt );
|
||||||
return pdt;
|
return pdt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,16 +449,16 @@ dt_desc_t* test_struct( void )
|
|||||||
dt_desc_t* pdt, *pdt1;
|
dt_desc_t* pdt, *pdt1;
|
||||||
|
|
||||||
printf( "test struct\n" );
|
printf( "test struct\n" );
|
||||||
pdt1 = lam_ddt_create( -1 );
|
pdt1 = ompi_ddt_create( -1 );
|
||||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
ompi_ddt_add( pdt1, &(basicDatatypes[DT_DOUBLE]), 1, 0, -1 );
|
||||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
ompi_ddt_add( pdt1, &(basicDatatypes[DT_CHAR]), 1, 8, -1 );
|
||||||
lam_ddt_dump_complete( pdt1 );
|
ompi_ddt_dump_complete( pdt1 );
|
||||||
|
|
||||||
types[1] = 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 );
|
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
||||||
lam_ddt_dump_complete( pdt );
|
ompi_ddt_dump_complete( pdt );
|
||||||
return 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[0] = (int)((char*)&(v[0].i1) - (char*)&(v[0])); /* 0 */
|
||||||
dispi[1] = (int)(((char*)(&(v[0].i2)) - (char*)&(v[0])) / sizeof(int)); /* 2 */
|
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
|
#ifdef USE_RESIZED
|
||||||
/* optional */
|
/* optional */
|
||||||
displ[0] = 0;
|
displ[0] = 0;
|
||||||
displ[1] = (char*)&(v[1]) - (char*)&(v[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 );
|
OBJ_RELEASE( pdtTemp ); assert( pdtTemp == NULL );
|
||||||
#else
|
#else
|
||||||
pdt1 = pdtTemp;
|
pdt1 = pdtTemp;
|
||||||
@ -504,24 +504,24 @@ dt_desc_t* create_strange_dt( void )
|
|||||||
displ[0] = 0;
|
displ[0] = 0;
|
||||||
displ[1] = (long)((char*)&(t[0].v[0]) - (char*)&(t[0]));
|
displ[1] = (long)((char*)&(t[0].v[0]) - (char*)&(t[0]));
|
||||||
displ[2] = (long)((char*)&(t[0].last) - (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
|
#ifdef USE_RESIZED
|
||||||
/* optional */
|
/* optional */
|
||||||
displ[1] = (char*)&(t[1]) - (char*)&(t[0]);
|
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 );
|
OBJ_RELEASE( pdtTemp ); assert( pdtTemp == NULL );
|
||||||
#else
|
#else
|
||||||
pdt2 = pdtTemp;
|
pdt2 = pdtTemp;
|
||||||
#endif /* USE_RESIZED */
|
#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( pdt1 ); assert( pdt1 == NULL );
|
||||||
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
||||||
lam_ddt_dump( pdt );
|
ompi_ddt_dump( pdt );
|
||||||
{
|
{
|
||||||
dt_type_desc_t pElemDesc = { 0, 0, NULL };
|
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 );
|
if( pElemDesc.desc != NULL ) free( pElemDesc.desc );
|
||||||
}
|
}
|
||||||
return pdt;
|
return pdt;
|
||||||
@ -531,14 +531,14 @@ int local_copy_ddt_count( dt_desc_t* pdt, int count )
|
|||||||
{
|
{
|
||||||
long extent;
|
long extent;
|
||||||
void *pdst, *psrc;
|
void *pdst, *psrc;
|
||||||
lam_ddt_type_extent( pdt, &extent );
|
ompi_ddt_type_extent( pdt, &extent );
|
||||||
|
|
||||||
pdst = malloc( extent * count );
|
pdst = malloc( extent * count );
|
||||||
psrc = malloc( extent * count );
|
psrc = malloc( extent * count );
|
||||||
|
|
||||||
pdt = create_strange_dt();
|
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( pdst );
|
||||||
free( psrc );
|
free( psrc );
|
||||||
@ -551,7 +551,7 @@ int main( int argc, char* argv[] )
|
|||||||
dt_desc_t *pdt, *pdt1, *pdt2, *pdt3;
|
dt_desc_t *pdt, *pdt1, *pdt2, *pdt3;
|
||||||
int rc, length = 500;
|
int rc, length = 500;
|
||||||
|
|
||||||
lam_ddt_init();
|
ompi_ddt_init();
|
||||||
|
|
||||||
pdt = create_strange_dt();
|
pdt = create_strange_dt();
|
||||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||||
@ -571,7 +571,7 @@ int main( int argc, char* argv[] )
|
|||||||
printf( "decode [NOT PASSED]\n" );
|
printf( "decode [NOT PASSED]\n" );
|
||||||
|
|
||||||
pdt = test_matrix_borders( length, 100 );
|
pdt = test_matrix_borders( length, 100 );
|
||||||
lam_ddt_dump( pdt );
|
ompi_ddt_dump( pdt );
|
||||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||||
|
|
||||||
printf( ">>--------------------------------------------<<\n" );
|
printf( ">>--------------------------------------------<<\n" );
|
||||||
@ -582,31 +582,31 @@ int main( int argc, char* argv[] )
|
|||||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||||
printf( ">>--------------------------------------------<<\n" );
|
printf( ">>--------------------------------------------<<\n" );
|
||||||
|
|
||||||
pdt1 = lam_ddt_create( -1 );
|
pdt1 = ompi_ddt_create( -1 );
|
||||||
pdt2 = lam_ddt_create( -1 );
|
pdt2 = ompi_ddt_create( -1 );
|
||||||
pdt3 = lam_ddt_create( -1 );
|
pdt3 = ompi_ddt_create( -1 );
|
||||||
lam_ddt_add( pdt3, &(basicDatatypes[DT_INT]), 10, 0, -1 );
|
ompi_ddt_add( pdt3, &(basicDatatypes[DT_INT]), 10, 0, -1 );
|
||||||
lam_ddt_add( pdt3, &(basicDatatypes[DT_FLOAT]), 5, 10 * sizeof(int), -1 );
|
ompi_ddt_add( pdt3, &(basicDatatypes[DT_FLOAT]), 5, 10 * sizeof(int), -1 );
|
||||||
|
|
||||||
lam_ddt_add( pdt2, &(basicDatatypes[DT_INT]), 1, 0, -1 );
|
ompi_ddt_add( pdt2, &(basicDatatypes[DT_INT]), 1, 0, -1 );
|
||||||
lam_ddt_add( pdt2, pdt3, 3, sizeof(int) * 1, -1 );
|
ompi_ddt_add( pdt2, pdt3, 3, sizeof(int) * 1, -1 );
|
||||||
|
|
||||||
lam_ddt_add( pdt1, &(basicDatatypes[DT_LONG_LONG]), 5, 0, -1 );
|
ompi_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_DOUBLE]), 2, sizeof(long long) * 5, -1 );
|
||||||
|
|
||||||
printf( ">>--------------------------------------------<<\n" );
|
printf( ">>--------------------------------------------<<\n" );
|
||||||
lam_ddt_dump( pdt1 );
|
ompi_ddt_dump( pdt1 );
|
||||||
printf( ">>--------------------------------------------<<\n" );
|
printf( ">>--------------------------------------------<<\n" );
|
||||||
lam_ddt_dump( pdt2 );
|
ompi_ddt_dump( pdt2 );
|
||||||
printf( ">>--------------------------------------------<<\n" );
|
printf( ">>--------------------------------------------<<\n" );
|
||||||
lam_ddt_dump( pdt3 );
|
ompi_ddt_dump( pdt3 );
|
||||||
|
|
||||||
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL );
|
||||||
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL );
|
||||||
OBJ_RELEASE( pdt3 ); assert( pdt3 == NULL );
|
OBJ_RELEASE( pdt3 ); assert( pdt3 == NULL );
|
||||||
|
|
||||||
/* clean-ups all data allocations */
|
/* clean-ups all data allocations */
|
||||||
lam_ddt_finalize();
|
ompi_ddt_finalize();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* the second is the internal representation using extents
|
* the second is the internal representation using extents
|
||||||
* the last is the representation used for send operations
|
* 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;
|
int newLength, place_needed = 0, i;
|
||||||
short localFlags;
|
short localFlags;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <lam_config.h>
|
#include <ompi_config.h>
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
#include <datatype.h>
|
#include <datatype.h>
|
||||||
#include <datatype_internal.h>
|
#include <datatype_internal.h>
|
||||||
@ -11,17 +11,17 @@ typedef struct __dt_args {
|
|||||||
int* i;
|
int* i;
|
||||||
MPI_Aint* a;
|
MPI_Aint* a;
|
||||||
MPI_Datatype* d;
|
MPI_Datatype* d;
|
||||||
} lam_ddt_args_t;
|
} ompi_ddt_args_t;
|
||||||
|
|
||||||
#define ALLOC_ARGS(PDATA, IC, AC, DC) \
|
#define ALLOC_ARGS(PDATA, IC, AC, DC) \
|
||||||
do { \
|
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 ); \
|
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->ci = (IC); \
|
||||||
pArgs->ca = (AC); \
|
pArgs->ca = (AC); \
|
||||||
pArgs->cd = (DC); \
|
pArgs->cd = (DC); \
|
||||||
buf += sizeof(lam_ddt_args_t); \
|
buf += sizeof(ompi_ddt_args_t); \
|
||||||
if( pArgs->ci == 0 ) pArgs->i = NULL; \
|
if( pArgs->ci == 0 ) pArgs->i = NULL; \
|
||||||
else { \
|
else { \
|
||||||
pArgs->i = (int*)buf; \
|
pArgs->i = (int*)buf; \
|
||||||
@ -40,18 +40,18 @@ do { \
|
|||||||
#define FREE_ARGS(PDATA) \
|
#define FREE_ARGS(PDATA) \
|
||||||
if( (PDATA)->args != NULL ) free( (PDATA)->args );
|
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 ci, int ** i,
|
||||||
int ca, MPI_Aint* a,
|
int ca, MPI_Aint* a,
|
||||||
int cd, MPI_Datatype* d,int type)
|
int cd, MPI_Datatype* d,int type)
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
lam_ddt_args_t* pArgs;
|
ompi_ddt_args_t* pArgs;
|
||||||
|
|
||||||
FREE_ARGS( pData );
|
FREE_ARGS( pData );
|
||||||
ALLOC_ARGS( pData, ci, ca, cd );
|
ALLOC_ARGS( pData, ci, ca, cd );
|
||||||
|
|
||||||
pArgs = (lam_ddt_args_t*)pData->args;
|
pArgs = (ompi_ddt_args_t*)pData->args;
|
||||||
pArgs->create_type = type;
|
pArgs->create_type = type;
|
||||||
|
|
||||||
switch(type){
|
switch(type){
|
||||||
@ -157,12 +157,12 @@ int lam_ddt_set_args( lam_datatype_t* pData,
|
|||||||
return MPI_SUCCESS;
|
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 * ci, int * i,
|
||||||
int * ca, MPI_Aint * a,
|
int * ca, MPI_Aint * a,
|
||||||
int * cd, MPI_Datatype * d, int * type)
|
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 ) {
|
if( (pData->flags & DT_FLAG_BASIC) == DT_FLAG_BASIC ) {
|
||||||
switch(which){
|
switch(which){
|
||||||
|
@ -42,11 +42,11 @@ static void __destroy_ddt_struct( dt_desc_t* pData )
|
|||||||
pData->args = NULL;
|
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;
|
if( expectedSize == -1 ) expectedSize = DT_INCREASE_STACK;
|
||||||
pdt->desc.length = expectedSize + 1; /* one for the fake elem at the end */
|
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;
|
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)->lb = lb;
|
||||||
(*newType)->ub = lb + extent;
|
(*newType)->ub = lb + extent;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
#include "datatype.h"
|
#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 )
|
int order, dt_desc_t* oldType, dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
return -1;
|
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,
|
int* pDArgs, int* pPSizes, int order, dt_desc_t* oldType,
|
||||||
dt_desc_t** newType )
|
dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "datatype.h"
|
#include "datatype.h"
|
||||||
#include "datatype_internal.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;
|
dt_desc_t* pdt;
|
||||||
void* temp;
|
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++;
|
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 */
|
temp = pdt->desc.desc; /* temporary copy of the desc pointer */
|
||||||
memcpy( pdt, oldType, sizeof(dt_desc_t) );
|
memcpy( pdt, oldType, sizeof(dt_desc_t) );
|
||||||
pdt->desc.desc = temp;
|
pdt->desc.desc = temp;
|
||||||
@ -23,10 +23,10 @@ int lam_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType )
|
|||||||
return 0;
|
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 );
|
dt_desc_t* pdt = ompi_ddt_create( oldType->desc.used + 2 );
|
||||||
lam_ddt_add( pdt, oldType, count, 0, (oldType->ub - oldType->lb) );
|
ompi_ddt_add( pdt, oldType, count, 0, (oldType->ub - oldType->lb) );
|
||||||
*newType = pdt;
|
*newType = pdt;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
#include "datatype.h"
|
#include "datatype.h"
|
||||||
|
|
||||||
/* We try to merge together data that are contiguous */
|
/* 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* oldType, dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
dt_desc_t* pdt;
|
dt_desc_t* pdt;
|
||||||
int i, dLength, endat, disp;
|
int i, dLength, endat, disp;
|
||||||
long extent = oldType->ub - oldType->lb;
|
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];
|
disp = pDisp[0];
|
||||||
dLength = pBlockLength[0];
|
dLength = pBlockLength[0];
|
||||||
endat = disp + dLength;
|
endat = disp + dLength;
|
||||||
@ -20,19 +20,19 @@ int lam_ddt_create_indexed( int count, int* pBlockLength, int* pDisp,
|
|||||||
dLength += pBlockLength[i];
|
dLength += pBlockLength[i];
|
||||||
endat += pBlockLength[i];
|
endat += pBlockLength[i];
|
||||||
} else {
|
} else {
|
||||||
lam_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
ompi_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||||
disp = pDisp[i];
|
disp = pDisp[i];
|
||||||
dLength = pBlockLength[i];
|
dLength = pBlockLength[i];
|
||||||
endat = disp + 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;
|
*newType = pdt;
|
||||||
return 0;
|
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* oldType, dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
dt_desc_t* pdt;
|
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 extent = oldType->ub - oldType->lb;
|
||||||
long disp, endat;
|
long disp, endat;
|
||||||
|
|
||||||
pdt = lam_ddt_create( count * (2 + oldType->desc.used) );
|
pdt = ompi_ddt_create( count * (2 + oldType->desc.used) );
|
||||||
disp = pDisp[0];
|
disp = pDisp[0];
|
||||||
dLength = pBlockLength[0];
|
dLength = pBlockLength[0];
|
||||||
endat = disp + dLength * extent;
|
endat = disp + dLength * extent;
|
||||||
@ -50,26 +50,26 @@ int lam_ddt_create_hindexed( int count, int* pBlockLength, long* pDisp,
|
|||||||
dLength += pBlockLength[i];
|
dLength += pBlockLength[i];
|
||||||
endat += pBlockLength[i] * extent;
|
endat += pBlockLength[i] * extent;
|
||||||
} else {
|
} else {
|
||||||
lam_ddt_add( pdt, oldType, dLength, disp, extent );
|
ompi_ddt_add( pdt, oldType, dLength, disp, extent );
|
||||||
disp = pDisp[i];
|
disp = pDisp[i];
|
||||||
dLength = pBlockLength[i];
|
dLength = pBlockLength[i];
|
||||||
endat = disp + pBlockLength[i] * extent;
|
endat = disp + pBlockLength[i] * extent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lam_ddt_add( pdt, oldType, dLength, disp, extent );
|
ompi_ddt_add( pdt, oldType, dLength, disp, extent );
|
||||||
|
|
||||||
*newType = pdt;
|
*newType = pdt;
|
||||||
return 0;
|
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* oldType, dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
dt_desc_t* pdt;
|
dt_desc_t* pdt;
|
||||||
int i, dLength, endat, disp;
|
int i, dLength, endat, disp;
|
||||||
long extent = oldType->ub - oldType->lb;
|
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];
|
disp = pDisp[0];
|
||||||
dLength = bLength;
|
dLength = bLength;
|
||||||
endat = disp + dLength;
|
endat = disp + dLength;
|
||||||
@ -79,13 +79,13 @@ int lam_ddt_create_indexed_block( int count, int bLength, int* pDisp,
|
|||||||
dLength += bLength;
|
dLength += bLength;
|
||||||
endat += bLength;
|
endat += bLength;
|
||||||
} else {
|
} else {
|
||||||
lam_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
ompi_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||||
disp = pDisp[i];
|
disp = pDisp[i];
|
||||||
dLength = bLength;
|
dLength = bLength;
|
||||||
endat = disp + bLength;
|
endat = disp + bLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lam_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
ompi_ddt_add( pdt, oldType, dLength, disp * extent, extent );
|
||||||
|
|
||||||
*newType = pdt;
|
*newType = pdt;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "datatype.h"
|
#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 )
|
dt_desc_t** pTypes, dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -42,7 +42,7 @@ int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
|||||||
lastDisp = pDisp[0];
|
lastDisp = pDisp[0];
|
||||||
endto = pDisp[0] + lastExtent * lastBlock;
|
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 */
|
/* Do again the same loop but now add the elements */
|
||||||
for( i = 1; i < count; i++ ) {
|
for( i = 1; i < count; i++ ) {
|
||||||
@ -50,7 +50,7 @@ int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
|||||||
lastBlock += pBlockLength[i];
|
lastBlock += pBlockLength[i];
|
||||||
endto = lastDisp + lastBlock * lastExtent;
|
endto = lastDisp + lastBlock * lastExtent;
|
||||||
} else {
|
} else {
|
||||||
lam_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
ompi_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
||||||
lastType = pTypes[i];
|
lastType = pTypes[i];
|
||||||
lastExtent = lastType->ub - lastType->lb;
|
lastExtent = lastType->ub - lastType->lb;
|
||||||
lastBlock = pBlockLength[i];
|
lastBlock = pBlockLength[i];
|
||||||
@ -58,7 +58,7 @@ int lam_ddt_create_struct( int count, int* pBlockLength, long* pDisp,
|
|||||||
endto = lastDisp + lastExtent * lastBlock;
|
endto = lastDisp + lastExtent * lastBlock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lam_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
ompi_ddt_add( pdt, lastType, lastBlock, lastDisp, lastExtent );
|
||||||
|
|
||||||
*newType = pdt;
|
*newType = pdt;
|
||||||
return 0;
|
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 )
|
dt_desc_t* oldType, dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
long extent = oldType->ub - oldType->lb;
|
long extent = oldType->ub - oldType->lb;
|
||||||
@ -16,30 +16,30 @@ int lam_ddt_create_vector( int count, int bLength, long stride,
|
|||||||
|
|
||||||
if( bLength == stride ) {
|
if( bLength == stride ) {
|
||||||
/* the elements are contiguous */
|
/* the elements are contiguous */
|
||||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||||
lam_ddt_add( pData, oldType, count * bLength, 0, extent );
|
ompi_ddt_add( pData, oldType, count * bLength, 0, extent );
|
||||||
} else {
|
} else {
|
||||||
if( count > 1 ) {
|
if( count > 1 ) {
|
||||||
if( bLength == 1 ) {
|
if( bLength == 1 ) {
|
||||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||||
lam_ddt_add( pData, oldType, count - 1, 0, stride * extent );
|
ompi_ddt_add( pData, oldType, count - 1, 0, stride * extent );
|
||||||
} else {
|
} else {
|
||||||
pTempData = lam_ddt_create( oldType->desc.used + 2 );
|
pTempData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||||
pData = lam_ddt_create( oldType->desc.used + 2 + 2 );
|
pData = ompi_ddt_create( oldType->desc.used + 2 + 2 );
|
||||||
lam_ddt_add( pTempData, oldType, bLength, 0, extent );
|
ompi_ddt_add( pTempData, oldType, bLength, 0, extent );
|
||||||
lam_ddt_add( pData, pTempData, count - 1, 0, stride * extent );
|
ompi_ddt_add( pData, pTempData, count - 1, 0, stride * extent );
|
||||||
OBJ_RELEASE( pTempData );
|
OBJ_RELEASE( pTempData );
|
||||||
}
|
}
|
||||||
} else {
|
} 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;
|
*newType = pData;
|
||||||
return 0;
|
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 )
|
dt_desc_t* oldType, dt_desc_t** newType )
|
||||||
{
|
{
|
||||||
long extent = oldType->ub - oldType->lb;
|
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 ) {
|
if( (extent * bLength) == stride ) {
|
||||||
/* contiguous */
|
/* contiguous */
|
||||||
pData = lam_ddt_create( oldType->desc.used + 2 );
|
pData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||||
lam_ddt_add( pData, oldType, count * bLength, 0, extent );
|
ompi_ddt_add( pData, oldType, count * bLength, 0, extent );
|
||||||
} else {
|
} else {
|
||||||
if( count > 1 ) {
|
if( count > 1 ) {
|
||||||
pTempData = lam_ddt_create( oldType->desc.used + 2 );
|
pTempData = ompi_ddt_create( oldType->desc.used + 2 );
|
||||||
pData = lam_ddt_create( oldType->desc.used + 2 + 2 );
|
pData = ompi_ddt_create( oldType->desc.used + 2 + 2 );
|
||||||
lam_ddt_add( pTempData, oldType, bLength, 0, extent );
|
ompi_ddt_add( pTempData, oldType, bLength, 0, extent );
|
||||||
lam_ddt_add( pData, pTempData, count - 1, 0, stride );
|
ompi_ddt_add( pData, pTempData, count - 1, 0, stride );
|
||||||
OBJ_RELEASE( pTempData );
|
OBJ_RELEASE( pTempData );
|
||||||
} else {
|
} 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;
|
*newType = pData;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
#include "datatype.h"
|
#include "datatype.h"
|
||||||
#include "datatype_internal.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;
|
dt_desc_t* pData = *dt;
|
||||||
|
|
||||||
if( pData->flags & DT_FLAG_FOREVER )
|
if( pData->flags & DT_FLAG_FOREVER )
|
||||||
return LAM_ERROR;
|
return OMPI_ERROR;
|
||||||
|
|
||||||
OBJ_RELEASE( pData );
|
OBJ_RELEASE( pData );
|
||||||
*dt = NULL;
|
*dt = NULL;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
/* other fields starting after bdt_used (index of DT_LOOP should be ONE) */
|
/* 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 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 ) \
|
#define INIT_BASIC_DATA( TYPE, ALIGN, NAME ) \
|
||||||
{ BASEOBJ_DATA, sizeof(TYPE), 0, sizeof(TYPE), ALIGN, \
|
{ BASEOBJ_DATA, sizeof(TYPE), 0, sizeof(TYPE), ALIGN, \
|
||||||
0, sizeof(TYPE), DT_FLAG_BASIC | DT_FLAG_DATA, DT_##NAME, 1, \
|
0, sizeof(TYPE), DT_FLAG_BASIC | DT_FLAG_DATA, DT_##NAME, 1, \
|
||||||
@ -15,42 +15,42 @@
|
|||||||
0, 0, DT_FLAG_BASIC, DT_##NAME, 1, \
|
0, 0, DT_FLAG_BASIC, DT_##NAME, 1, \
|
||||||
(((long long)1)<<(DT_##NAME)), EMPTY_DATA(NAME) }
|
(((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_LOOP, LOOP ),
|
||||||
INIT_BASIC_TYPE( DT_END_LOOP, END_LOOP ),
|
INIT_BASIC_TYPE( DT_END_LOOP, END_LOOP ),
|
||||||
INIT_BASIC_TYPE( DT_LB, LB ),
|
INIT_BASIC_TYPE( DT_LB, LB ),
|
||||||
INIT_BASIC_TYPE( DT_UB, UB ),
|
INIT_BASIC_TYPE( DT_UB, UB ),
|
||||||
INIT_BASIC_DATA( char, LAM_ALIGNMENT_CHAR, CHAR ),
|
INIT_BASIC_DATA( char, OMPI_ALIGNMENT_CHAR, CHAR ),
|
||||||
INIT_BASIC_DATA( char, LAM_ALIGNMENT_CHAR, CHARACTER ),
|
INIT_BASIC_DATA( char, OMPI_ALIGNMENT_CHAR, CHARACTER ),
|
||||||
INIT_BASIC_DATA( unsigned char, LAM_ALIGNMENT_CHAR, UNSIGNED_CHAR ),
|
INIT_BASIC_DATA( unsigned char, OMPI_ALIGNMENT_CHAR, UNSIGNED_CHAR ),
|
||||||
INIT_BASIC_DATA( unsigned char, LAM_ALIGNMENT_CHAR, BYTE ),
|
INIT_BASIC_DATA( unsigned char, OMPI_ALIGNMENT_CHAR, BYTE ),
|
||||||
INIT_BASIC_DATA( short, LAM_ALIGNMENT_SHORT, SHORT ),
|
INIT_BASIC_DATA( short, OMPI_ALIGNMENT_SHORT, SHORT ),
|
||||||
INIT_BASIC_DATA( unsigned short, LAM_ALIGNMENT_SHORT, UNSIGNED_SHORT ),
|
INIT_BASIC_DATA( unsigned short, OMPI_ALIGNMENT_SHORT, UNSIGNED_SHORT ),
|
||||||
INIT_BASIC_DATA( int, LAM_ALIGNMENT_INT, INT ),
|
INIT_BASIC_DATA( int, OMPI_ALIGNMENT_INT, INT ),
|
||||||
INIT_BASIC_DATA( unsigned int, LAM_ALIGNMENT_INT, UNSIGNED_INT ),
|
INIT_BASIC_DATA( unsigned int, OMPI_ALIGNMENT_INT, UNSIGNED_INT ),
|
||||||
INIT_BASIC_DATA( long, LAM_ALIGNMENT_LONG, LONG ),
|
INIT_BASIC_DATA( long, OMPI_ALIGNMENT_LONG, LONG ),
|
||||||
INIT_BASIC_DATA( unsigned long, LAM_ALIGNMENT_LONG, UNSIGNED_LONG ),
|
INIT_BASIC_DATA( unsigned long, OMPI_ALIGNMENT_LONG, UNSIGNED_LONG ),
|
||||||
#if HAVE_LONG_LONG
|
#if HAVE_LONG_LONG
|
||||||
INIT_BASIC_DATA( long long, LAM_ALIGNMENT_LONG_LONG, LONG_LONG ),
|
INIT_BASIC_DATA( long long, OMPI_ALIGNMENT_LONG_LONG, LONG_LONG ),
|
||||||
INIT_BASIC_DATA( long long, LAM_ALIGNMENT_LONG_LONG, LONG_LONG_INT ),
|
INIT_BASIC_DATA( long long, OMPI_ALIGNMENT_LONG_LONG, LONG_LONG_INT ),
|
||||||
INIT_BASIC_DATA( unsigned long long, LAM_ALIGNMENT_LONG_LONG, UNSIGNED_LONG_LONG ),
|
INIT_BASIC_DATA( unsigned long long, OMPI_ALIGNMENT_LONG_LONG, UNSIGNED_LONG_LONG ),
|
||||||
#else
|
#else
|
||||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||||
#endif /* HAVE_LONG_LONG */
|
#endif /* HAVE_LONG_LONG */
|
||||||
INIT_BASIC_DATA( float, LAM_ALIGNMENT_FLOAT, FLOAT ),
|
INIT_BASIC_DATA( float, OMPI_ALIGNMENT_FLOAT, FLOAT ),
|
||||||
INIT_BASIC_DATA( double, LAM_ALIGNMENT_DOUBLE, DOUBLE ),
|
INIT_BASIC_DATA( double, OMPI_ALIGNMENT_DOUBLE, DOUBLE ),
|
||||||
INIT_BASIC_DATA( long double, LAM_ALIGNMENT_LONG_DOUBLE, LONG_DOUBLE ),
|
INIT_BASIC_DATA( long double, OMPI_ALIGNMENT_LONG_DOUBLE, LONG_DOUBLE ),
|
||||||
INIT_BASIC_DATA( lam_complex_float_t, LAM_ALIGNMENT_FLOAT, COMPLEX_FLOAT ),
|
INIT_BASIC_DATA( ompi_complex_float_t, OMPI_ALIGNMENT_FLOAT, COMPLEX_FLOAT ),
|
||||||
INIT_BASIC_DATA( lam_complex_double_t, LAM_ALIGNMENT_DOUBLE, COMPLEX_DOUBLE ),
|
INIT_BASIC_DATA( ompi_complex_double_t, OMPI_ALIGNMENT_DOUBLE, COMPLEX_DOUBLE ),
|
||||||
#if HAVE_LONG_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
|
#else
|
||||||
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
INIT_BASIC_DATA( void*, 0, UNAVAILABLE ),
|
||||||
#endif /* HAVE_LONG_DOUBLE */
|
#endif /* HAVE_LONG_DOUBLE */
|
||||||
INIT_BASIC_DATA( char, LAM_ALIGNMENT_CHAR, PACKED ),
|
INIT_BASIC_DATA( char, OMPI_ALIGNMENT_CHAR, PACKED ),
|
||||||
INIT_BASIC_DATA( int, LAM_ALIGNMENT_INT, LOGIC ),
|
INIT_BASIC_DATA( int, OMPI_ALIGNMENT_INT, LOGIC ),
|
||||||
INIT_BASIC_TYPE( DT_FLOAT_INT, FLOAT_INT ),
|
INIT_BASIC_TYPE( DT_FLOAT_INT, FLOAT_INT ),
|
||||||
INIT_BASIC_TYPE( DT_DOUBLE_INT, DOUBLE_INT ),
|
INIT_BASIC_TYPE( DT_DOUBLE_INT, DOUBLE_INT ),
|
||||||
#if HAVE_LONG_DOUBLE
|
#if HAVE_LONG_DOUBLE
|
||||||
@ -78,54 +78,54 @@ lam_datatype_t basicDatatypes[DT_MAX_PREDEFINED] = {
|
|||||||
INIT_BASIC_TYPE( DT_UNAVAILABLE, UNAVAILABLE )
|
INIT_BASIC_TYPE( DT_UNAVAILABLE, UNAVAILABLE )
|
||||||
};
|
};
|
||||||
|
|
||||||
lam_datatype_t* lam_mpi_char = basicDatatypes + DT_CHAR;
|
ompi_datatype_t* ompi_mpi_char = basicDatatypes + DT_CHAR;
|
||||||
lam_datatype_t* lam_mpi_byte = basicDatatypes + DT_BYTE;
|
ompi_datatype_t* ompi_mpi_byte = basicDatatypes + DT_BYTE;
|
||||||
lam_datatype_t* lam_mpi_int = basicDatatypes + DT_INT;
|
ompi_datatype_t* ompi_mpi_int = basicDatatypes + DT_INT;
|
||||||
lam_datatype_t* lam_mpi_logic = basicDatatypes + DT_LOGIC;
|
ompi_datatype_t* ompi_mpi_logic = basicDatatypes + DT_LOGIC;
|
||||||
lam_datatype_t* lam_mpi_short = basicDatatypes + DT_SHORT;
|
ompi_datatype_t* ompi_mpi_short = basicDatatypes + DT_SHORT;
|
||||||
lam_datatype_t* lam_mpi_long = basicDatatypes + DT_LONG;
|
ompi_datatype_t* ompi_mpi_long = basicDatatypes + DT_LONG;
|
||||||
lam_datatype_t* lam_mpi_float = basicDatatypes + DT_FLOAT;
|
ompi_datatype_t* ompi_mpi_float = basicDatatypes + DT_FLOAT;
|
||||||
lam_datatype_t* lam_mpi_double = basicDatatypes + DT_DOUBLE;
|
ompi_datatype_t* ompi_mpi_double = basicDatatypes + DT_DOUBLE;
|
||||||
lam_datatype_t* lam_mpi_long_double = basicDatatypes + DT_LONG_DOUBLE;
|
ompi_datatype_t* ompi_mpi_long_double = basicDatatypes + DT_LONG_DOUBLE;
|
||||||
lam_datatype_t* lam_mpi_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
ompi_datatype_t* ompi_mpi_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||||
lam_datatype_t* lam_mpi_packed = basicDatatypes + DT_PACKED;
|
ompi_datatype_t* ompi_mpi_packed = basicDatatypes + DT_PACKED;
|
||||||
lam_datatype_t* lam_mpi_unsigned_char = basicDatatypes + DT_UNSIGNED_CHAR;
|
ompi_datatype_t* ompi_mpi_unsigned_char = basicDatatypes + DT_UNSIGNED_CHAR;
|
||||||
lam_datatype_t* lam_mpi_unsigned_short = basicDatatypes + DT_UNSIGNED_SHORT;
|
ompi_datatype_t* ompi_mpi_unsigned_short = basicDatatypes + DT_UNSIGNED_SHORT;
|
||||||
lam_datatype_t* lam_mpi_unsigned = basicDatatypes + DT_UNSIGNED_INT;
|
ompi_datatype_t* ompi_mpi_unsigned = basicDatatypes + DT_UNSIGNED_INT;
|
||||||
lam_datatype_t* lam_mpi_unsigned_long = basicDatatypes + DT_UNSIGNED_LONG;
|
ompi_datatype_t* ompi_mpi_unsigned_long = basicDatatypes + DT_UNSIGNED_LONG;
|
||||||
lam_datatype_t* lam_mpi_ub = basicDatatypes + DT_UB;
|
ompi_datatype_t* ompi_mpi_ub = basicDatatypes + DT_UB;
|
||||||
lam_datatype_t* lam_mpi_lb = basicDatatypes + DT_LB;
|
ompi_datatype_t* ompi_mpi_lb = basicDatatypes + DT_LB;
|
||||||
lam_datatype_t* lam_mpi_float_int = basicDatatypes + DT_FLOAT_INT;
|
ompi_datatype_t* ompi_mpi_float_int = basicDatatypes + DT_FLOAT_INT;
|
||||||
lam_datatype_t* lam_mpi_double_int = basicDatatypes + DT_DOUBLE_INT;
|
ompi_datatype_t* ompi_mpi_double_int = basicDatatypes + DT_DOUBLE_INT;
|
||||||
lam_datatype_t* lam_mpi_long_int = basicDatatypes + DT_LONG_INT;
|
ompi_datatype_t* ompi_mpi_long_int = basicDatatypes + DT_LONG_INT;
|
||||||
lam_datatype_t* lam_mpi_2int = basicDatatypes + DT_2INT;
|
ompi_datatype_t* ompi_mpi_2int = basicDatatypes + DT_2INT;
|
||||||
lam_datatype_t* lam_mpi_short_int = basicDatatypes + DT_SHORT_INT;
|
ompi_datatype_t* ompi_mpi_short_int = basicDatatypes + DT_SHORT_INT;
|
||||||
lam_datatype_t* lam_mpi_dblcplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
ompi_datatype_t* ompi_mpi_dblcplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||||
lam_datatype_t* lam_mpi_integer = basicDatatypes + DT_INTEGER;
|
ompi_datatype_t* ompi_mpi_integer = basicDatatypes + DT_INTEGER;
|
||||||
lam_datatype_t* lam_mpi_real = basicDatatypes + DT_REAL;
|
ompi_datatype_t* ompi_mpi_real = basicDatatypes + DT_REAL;
|
||||||
lam_datatype_t* lam_mpi_dblprec = basicDatatypes + DT_DBLPREC;
|
ompi_datatype_t* ompi_mpi_dblprec = basicDatatypes + DT_DBLPREC;
|
||||||
lam_datatype_t* lam_mpi_character = basicDatatypes + DT_CHARACTER;
|
ompi_datatype_t* ompi_mpi_character = basicDatatypes + DT_CHARACTER;
|
||||||
lam_datatype_t* lam_mpi_2real = basicDatatypes + DT_2REAL;
|
ompi_datatype_t* ompi_mpi_2real = basicDatatypes + DT_2REAL;
|
||||||
lam_datatype_t* lam_mpi_2dblprec = basicDatatypes + DT_2DBLPREC;
|
ompi_datatype_t* ompi_mpi_2dblprec = basicDatatypes + DT_2DBLPREC;
|
||||||
lam_datatype_t* lam_mpi_2integer = basicDatatypes + DT_2INTEGER;
|
ompi_datatype_t* ompi_mpi_2integer = basicDatatypes + DT_2INTEGER;
|
||||||
lam_datatype_t* lam_mpi_longdbl_int = basicDatatypes + DT_LONGDBL_INT;
|
ompi_datatype_t* ompi_mpi_longdbl_int = basicDatatypes + DT_LONGDBL_INT;
|
||||||
lam_datatype_t* lam_mpi_wchar = basicDatatypes + DT_WCHAR;
|
ompi_datatype_t* ompi_mpi_wchar = basicDatatypes + DT_WCHAR;
|
||||||
lam_datatype_t* lam_mpi_long_long_int = basicDatatypes + DT_LONG_LONG_INT;
|
ompi_datatype_t* ompi_mpi_long_long_int = basicDatatypes + DT_LONG_LONG_INT;
|
||||||
lam_datatype_t* lam_mpi_long_long = basicDatatypes + DT_LONG_LONG;
|
ompi_datatype_t* ompi_mpi_long_long = basicDatatypes + DT_LONG_LONG;
|
||||||
lam_datatype_t* lam_mpi_unsigned_long_long = basicDatatypes + DT_UNSIGNED_LONG_LONG;
|
ompi_datatype_t* ompi_mpi_unsigned_long_long = basicDatatypes + DT_UNSIGNED_LONG_LONG;
|
||||||
lam_datatype_t* lam_mpi_cxx_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
ompi_datatype_t* ompi_mpi_cxx_cplex = basicDatatypes + DT_COMPLEX_FLOAT;
|
||||||
lam_datatype_t* lam_mpi_cxx_dblcplex = basicDatatypes + DT_COMPLEX_DOUBLE;
|
ompi_datatype_t* ompi_mpi_cxx_dblcplex = basicDatatypes + DT_COMPLEX_DOUBLE;
|
||||||
lam_datatype_t* lam_mpi_cxx_ldblcplex = basicDatatypes + DT_COMPLEX_LONG_DOUBLE;
|
ompi_datatype_t* ompi_mpi_cxx_ldblcplex = basicDatatypes + DT_COMPLEX_LONG_DOUBLE;
|
||||||
lam_datatype_t* lam_mpi_cxx_bool;
|
ompi_datatype_t* ompi_mpi_cxx_bool;
|
||||||
lam_datatype_t* lam_mpi_2cplex = basicDatatypes + DT_2COMPLEX;
|
ompi_datatype_t* ompi_mpi_2cplex = basicDatatypes + DT_2COMPLEX;
|
||||||
lam_datatype_t* lam_mpi_2dblcplex = basicDatatypes + DT_2DOUBLE_COMPLEX;
|
ompi_datatype_t* ompi_mpi_2dblcplex = basicDatatypes + DT_2DOUBLE_COMPLEX;
|
||||||
|
|
||||||
int local_sizes[DT_MAX_PREDEFINED];
|
int local_sizes[DT_MAX_PREDEFINED];
|
||||||
|
|
||||||
/* VPS: fake convertor for time being / to provide pack/unpack functions */
|
/* 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 ) \
|
#define COPY_DATA_DESC( PDST, PSRC ) \
|
||||||
do { \
|
do { \
|
||||||
@ -152,7 +152,7 @@ static lam_convertor_t* pDumpConv = NULL;
|
|||||||
#define DECLARE_MPI2_COMPOSED_STRUCT_DDT( PDATA, MPIDDT, MPIDDTNAME, type1, type2, MPIType1, MPIType2 ) \
|
#define DECLARE_MPI2_COMPOSED_STRUCT_DDT( PDATA, MPIDDT, MPIDDTNAME, type1, type2, MPIType1, MPIType2 ) \
|
||||||
do { \
|
do { \
|
||||||
struct { type1 v1; type2 v2; } s[2]; \
|
struct { type1 v1; type2 v2; } s[2]; \
|
||||||
lam_datatype_t *types[2], *ptype; \
|
ompi_datatype_t *types[2], *ptype; \
|
||||||
int bLength[2] = {1, 1}; \
|
int bLength[2] = {1, 1}; \
|
||||||
long base, displ[2]; \
|
long base, displ[2]; \
|
||||||
\
|
\
|
||||||
@ -164,14 +164,14 @@ static lam_convertor_t* pDumpConv = NULL;
|
|||||||
displ[1] = (long)(&(s[0].v2)); \
|
displ[1] = (long)(&(s[0].v2)); \
|
||||||
displ[1] -= base; \
|
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] = (long)(&(s[1])); \
|
||||||
displ[0] -= base; \
|
displ[0] -= base; \
|
||||||
if( displ[0] != sizeof(s[0]) ) \
|
if( displ[0] != sizeof(s[0]) ) \
|
||||||
ptype->ub = displ[0]; /* force a new extent for the datatype */ \
|
ptype->ub = displ[0]; /* force a new extent for the datatype */ \
|
||||||
ptype->flags |= DT_FLAG_FOREVER; \
|
ptype->flags |= DT_FLAG_FOREVER; \
|
||||||
ptype->id = MPIDDT; \
|
ptype->id = MPIDDT; \
|
||||||
lam_ddt_commit( &ptype ); \
|
ompi_ddt_commit( &ptype ); \
|
||||||
COPY_DATA_DESC( PDATA, ptype ); \
|
COPY_DATA_DESC( PDATA, ptype ); \
|
||||||
ptype->desc.desc = NULL; \
|
ptype->desc.desc = NULL; \
|
||||||
ptype->opt_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 ) \
|
#define DECLARE_MPI2_COMPOSED_BLOCK_DDT( PDATA, MPIDDT, MPIDDTNAME, MPIType ) \
|
||||||
do { \
|
do { \
|
||||||
lam_datatype_t *ptype; \
|
ompi_datatype_t *ptype; \
|
||||||
lam_ddt_create_contiguous( 2, &(basicDatatypes[MPIType]), &ptype ); \
|
ompi_ddt_create_contiguous( 2, &(basicDatatypes[MPIType]), &ptype ); \
|
||||||
ptype->flags |= DT_FLAG_FOREVER; \
|
ptype->flags |= DT_FLAG_FOREVER; \
|
||||||
ptype->id = MPIDDT; \
|
ptype->id = MPIDDT; \
|
||||||
lam_ddt_commit( &ptype ); \
|
ompi_ddt_commit( &ptype ); \
|
||||||
COPY_DATA_DESC( PDATA, ptype ); \
|
COPY_DATA_DESC( PDATA, ptype ); \
|
||||||
ptype->desc.desc = NULL; \
|
ptype->desc.desc = NULL; \
|
||||||
ptype->opt_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 ); \
|
strncpy( PDATA->name, MPIDDTNAME, MPI_MAX_OBJECT_NAME ); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
int lam_ddt_init( void )
|
int ompi_ddt_init( void )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -210,37 +210,37 @@ int lam_ddt_init( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* the 2 complex datatypes (float and double) */
|
/* 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( ompi_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_dblcplex, DT_COMPLEX_DOUBLE, "MPI_DOUBLE_COMPLEX", double, double, DT_DOUBLE, DT_DOUBLE );
|
||||||
/* C++ complex types */
|
/* 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( ompi_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( ompi_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_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!) */
|
/* 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( ompi_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( ompi_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( ompi_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( ompi_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_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( ompi_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( ompi_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( ompi_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( ompi_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( ompi_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_2dblcplex, DT_2DOUBLE_COMPLEX, "MPI_2DOUBLE_COMPLEX", DT_COMPLEX_DOUBLE );
|
||||||
|
|
||||||
for( i = 0; i < DT_MAX_PREDEFINED; i++ )
|
for( i = 0; i < DT_MAX_PREDEFINED; i++ )
|
||||||
local_sizes[i] = basicDatatypes[i].size;
|
local_sizes[i] = basicDatatypes[i].size;
|
||||||
|
|
||||||
/* VPS: Create a fake convertor. No error checking here now, since
|
/* VPS: Create a fake convertor. No error checking here now, since
|
||||||
this will be removed sometime */
|
this will be removed sometime */
|
||||||
lam_convertor = lam_convertor_create(0,0);
|
ompi_convertor = ompi_convertor_create(0,0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lam_ddt_finalize( void )
|
int ompi_ddt_finalize( void )
|
||||||
{
|
{
|
||||||
int i;
|
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;
|
dt_desc_t* pData = (dt_desc_t*)data;
|
||||||
|
|
||||||
@ -371,8 +371,8 @@ DUMP_TYPE( long, long )
|
|||||||
DUMP_TYPE( double, double )
|
DUMP_TYPE( double, double )
|
||||||
DUMP_TYPE( long_long, long long )
|
DUMP_TYPE( long_long, long long )
|
||||||
DUMP_TYPE( long_double, long double )
|
DUMP_TYPE( long_double, long double )
|
||||||
DUMP_TYPE( complex_float, lam_complex_float_t )
|
DUMP_TYPE( complex_float, ompi_complex_float_t )
|
||||||
DUMP_TYPE( complex_double, lam_complex_double_t )
|
DUMP_TYPE( complex_double, ompi_complex_double_t )
|
||||||
|
|
||||||
static conversion_fct_t dump_functions[DT_MAX_PREDEFINED] = {
|
static conversion_fct_t dump_functions[DT_MAX_PREDEFINED] = {
|
||||||
(conversion_fct_t)NULL, /* DT_LOOP */
|
(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 */
|
(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;
|
dt_desc_t* pData = (dt_desc_t*)data;
|
||||||
struct iovec fake = { (void*)0, 0 };
|
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 contain " ); __dt_contain_basic_datatypes( pData );
|
||||||
printf( "\n{\n" );
|
printf( "\n{\n" );
|
||||||
if( pDumpConv == NULL ) {
|
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;
|
pDumpConv->pFunctions = dump_functions;
|
||||||
|
|
||||||
fake.iov_len = pData->size;
|
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
|
/* 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.
|
* application, we should release the ddt pointer and free the stack.
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include "datatype.h"
|
#include "datatype.h"
|
||||||
#include "datatype_internal.h"
|
#include "datatype_internal.h"
|
||||||
@ -40,7 +40,7 @@ static inline long GET_LOOP_DISP( dt_elem_desc_t* _pElem )
|
|||||||
return _pElem->disp;
|
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;
|
dt_elem_desc_t* pElemDesc;
|
||||||
long lastDisp = 0;
|
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); \
|
__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 */
|
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||||
int pos_desc; /* actual position in the description of the derived datatype */
|
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;
|
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_desc_t* pData = (dt_desc_t*)*data;
|
||||||
dt_elem_desc_t* pLast = &(pData->desc.desc[pData->desc.used]);
|
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 the data is contiguous is useless to generate an optimized version. */
|
||||||
if( pData->size != (pData->true_ub - pData->true_lb) ) {
|
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
|
/* let's add a fake element at the end just to avoid useless comparaisons
|
||||||
* in pack/unpack functions.
|
* in pack/unpack functions.
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include "datatype.h"
|
#include "datatype.h"
|
||||||
#include "datatype_internal.h"
|
#include "datatype_internal.h"
|
||||||
@ -10,7 +10,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#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 )
|
struct iovec* out, unsigned int outCount )
|
||||||
{
|
{
|
||||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
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
|
/* 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 )
|
struct iovec* iov, unsigned int out_size )
|
||||||
{
|
{
|
||||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
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;
|
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 )
|
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;
|
char* pSrc = pConv->pBaseBuf + pData->true_lb + pConv->bConverted;
|
||||||
size_t length = pData->size * pConv->count;
|
size_t length = pData->size * pConv->count;
|
||||||
long extent;
|
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 if everything went fine and the data was completly converted
|
||||||
* -1 something wrong occurs.
|
* -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;
|
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;
|
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];
|
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,
|
dt_desc_t* dt, int count,
|
||||||
void* pUserBuf, int local_starting_point )
|
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;
|
pConv->bConverted = 0;
|
||||||
if( dt->flags & DT_FLAG_CONTIGUOUS ) {
|
if( dt->flags & DT_FLAG_CONTIGUOUS ) {
|
||||||
pConv->flags |= DT_FLAG_CONTIGUOUS;
|
pConv->flags |= DT_FLAG_CONTIGUOUS;
|
||||||
pConv->fAdvance = lam_convertor_pack_homogeneous_contig;
|
pConv->fAdvance = ompi_convertor_pack_homogeneous_contig;
|
||||||
} else {
|
} else {
|
||||||
/* TODO handle the sender convert case */
|
/* TODO handle the sender convert case */
|
||||||
pConv->fAdvance = lam_convertor_pack_general;
|
pConv->fAdvance = ompi_convertor_pack_general;
|
||||||
pConv->fAdvance = lam_convertor_pack_homogeneous;
|
pConv->fAdvance = ompi_convertor_pack_homogeneous;
|
||||||
}
|
}
|
||||||
if( pConv->freebuf != NULL ) {
|
if( pConv->freebuf != NULL ) {
|
||||||
free( pConv->freebuf );
|
free( pConv->freebuf );
|
||||||
pConv->freebuf = NULL;
|
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;
|
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->pDesc = NULL;
|
||||||
pConv->pStack = NULL;
|
pConv->pStack = NULL;
|
||||||
@ -378,7 +378,7 @@ lam_convertor_t* lam_convertor_create( int remote_arch, int mode )
|
|||||||
return pConv;
|
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 == NULL ) return 0;
|
||||||
if( pConv->pStack != NULL ) free( pConv->pStack );
|
if( pConv->pStack != NULL ) free( pConv->pStack );
|
||||||
@ -387,11 +387,11 @@ static int lam_convertor_destroy( lam_convertor_t* pConv )
|
|||||||
return 0;
|
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->pStack = NULL;
|
||||||
pDestConv->pDesc = NULL;
|
pDestConv->pDesc = NULL;
|
||||||
pDestConv->count = 0;
|
pDestConv->count = 0;
|
||||||
@ -399,27 +399,27 @@ inline int lam_convertor_copy( lam_convertor_t* pSrcConv, lam_convertor_t* pDest
|
|||||||
pDestConv->bConverted = 0;
|
pDestConv->bConverted = 0;
|
||||||
pDestConv->fAdvance = NULL;
|
pDestConv->fAdvance = NULL;
|
||||||
pDestConv->freebuf = 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);
|
ompi_convertor_t* pDestConv = OBJ_NEW(ompi_convertor_t);
|
||||||
(void)lam_convertor_copy( pConvertor, pDestConv );
|
(void)ompi_convertor_copy( pConvertor, pDestConv );
|
||||||
return pDestConv;
|
return pDestConv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Actually we suppose that we can only do receiver side conversion */
|
/* 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;
|
return -1;
|
||||||
/* actually *pSize contain the size of one instance of the data */
|
/* actually *pSize contain the size of one instance of the data */
|
||||||
*pSize = (*pSize) * pConv->count;
|
*pSize = (*pSize) * pConv->count;
|
||||||
return 0;
|
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;
|
int i;
|
||||||
dt_desc_t* pData = pConv->pDesc;
|
dt_desc_t* pData = pConv->pDesc;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "datatype/datatype.h"
|
#include "datatype/datatype.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* lam_dtsndrcv
|
* ompi_dtsndrcv
|
||||||
*
|
*
|
||||||
* Function: - copy MPI message from buffer into another
|
* Function: - copy MPI message from buffer into another
|
||||||
* - send/recv done if cannot optimize
|
* - send/recv done if cannot optimize
|
||||||
@ -24,7 +24,7 @@
|
|||||||
* Returns: - MPI_SUCCESS or error code
|
* Returns: - MPI_SUCCESS or error code
|
||||||
*/
|
*/
|
||||||
int
|
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 rcount, MPI_Datatype rdtype, int tag, MPI_Comm comm)
|
||||||
{
|
{
|
||||||
int err; /* error code */
|
int err; /* error code */
|
||||||
@ -38,7 +38,7 @@ lam_ddt_sndrcv(void *sbuf, int scount, MPI_Datatype sdtype, void *rbuf,
|
|||||||
*/
|
*/
|
||||||
if (sdtype == rdtype) {
|
if (sdtype == rdtype) {
|
||||||
if (scount <= rcount) {
|
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);
|
(char *) sbuf);
|
||||||
err = MPI_SUCCESS;
|
err = MPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
#include "datatype.h"
|
#include "datatype.h"
|
||||||
#include "datatype_internal.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 if everything went fine and the data was completly converted
|
||||||
* -1 something wrong occurs.
|
* -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 )
|
struct iovec* pInputv, unsigned int inputCount )
|
||||||
{
|
{
|
||||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
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;
|
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 )
|
struct iovec* iov, unsigned int out_size )
|
||||||
{
|
{
|
||||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
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;
|
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 )
|
struct iovec* iov, unsigned int out_size )
|
||||||
{
|
{
|
||||||
dt_desc_t *pData = pConv->pDesc;
|
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));
|
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,
|
struct iovec* pInputv,
|
||||||
unsigned int inputCount )
|
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))) ) {
|
if( (pInput >= pOutput) && (pInput < (pOutput + pConvertor->count * (pData->ub - pData->lb))) ) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return lam_convertor_progress( pConvertor, pInputv, inputCount );
|
return ompi_convertor_progress( pConvertor, pInputv, inputCount );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return value:
|
/* Return value:
|
||||||
@ -385,8 +385,8 @@ COPY_TYPE( long, long )
|
|||||||
/*COPY_TYPE( double, double );*/
|
/*COPY_TYPE( double, double );*/
|
||||||
COPY_TYPE( long_long, long long )
|
COPY_TYPE( long_long, long long )
|
||||||
COPY_TYPE( long_double, long double )
|
COPY_TYPE( long_double, long double )
|
||||||
COPY_TYPE( complex_float, lam_complex_float_t )
|
COPY_TYPE( complex_float, ompi_complex_float_t )
|
||||||
COPY_TYPE( complex_double, lam_complex_double_t )
|
COPY_TYPE( complex_double, ompi_complex_double_t )
|
||||||
|
|
||||||
static int copy_double( unsigned int count,
|
static int copy_double( unsigned int count,
|
||||||
char* from, unsigned int from_len, long from_extent,
|
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
|
/* Should we supply buffers to the convertor or can we use directly
|
||||||
* the user buffer ?
|
* 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;
|
if( pConvertor->flags & DT_FLAG_CONTIGUOUS ) return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int local_sizes[DT_MAX_PREDEFINED];
|
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,
|
dt_desc_t* pData, int count,
|
||||||
void* pUserBuf, int starting_point )
|
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 */
|
/* TODO: work only on homogeneous architectures */
|
||||||
if( pData->flags & DT_FLAG_CONTIGUOUS ) {
|
if( pData->flags & DT_FLAG_CONTIGUOUS ) {
|
||||||
pConv->flags |= DT_FLAG_CONTIGUOUS;
|
pConv->flags |= DT_FLAG_CONTIGUOUS;
|
||||||
pConv->fAdvance = lam_convertor_unpack_homogeneous_contig;
|
pConv->fAdvance = ompi_convertor_unpack_homogeneous_contig;
|
||||||
} else {
|
} 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;
|
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
|
* positive = number of basic elements inside
|
||||||
* negative = some error occurs
|
* 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 */
|
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||||
int pos_desc; /* actual position in the description of the derived datatype */
|
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;
|
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 )
|
char* pDestBuf, char* pSrcBuf )
|
||||||
{
|
{
|
||||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include "datatype.h"
|
#include "datatype.h"
|
||||||
#include "datatype_internal.h"
|
#include "datatype_internal.h"
|
||||||
@ -16,19 +16,19 @@ static inline long GET_LOOP_DISP( dt_elem_desc_t* _pElem )
|
|||||||
return _pElem->disp;
|
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 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 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 starting_point, int* sizes )
|
||||||
{
|
{
|
||||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||||
int pos_desc; /* actual position in the description of the derived datatype */
|
int pos_desc; /* actual position in the description of the derived datatype */
|
||||||
int type, lastLength = 0;
|
int type, lastLength = 0;
|
||||||
long totalDisp;
|
long totalDisp;
|
||||||
lam_datatype_t* pData = pConvertor->pDesc;
|
ompi_datatype_t* pData = pConvertor->pDesc;
|
||||||
int* remoteLength;
|
int* remoteLength;
|
||||||
int loop_length;
|
int loop_length;
|
||||||
int resting_place = starting_point;
|
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
|
* because we can split a basic data in the middle if we
|
||||||
* have a optimized representation.
|
* 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 )
|
int starting_point, int* sizes )
|
||||||
{
|
{
|
||||||
dt_stack_t* pStack; /* pointer to the position on the stack */
|
dt_stack_t* pStack; /* pointer to the position on the stack */
|
||||||
int pos_desc; /* actual position in the description of the derived datatype */
|
int pos_desc; /* actual position in the description of the derived datatype */
|
||||||
int type, lastLength = 0;
|
int type, lastLength = 0;
|
||||||
long totalDisp;
|
long totalDisp;
|
||||||
lam_datatype_t* pData = pConvertor->pDesc;
|
ompi_datatype_t* pData = pConvertor->pDesc;
|
||||||
int* remoteLength;
|
int* remoteLength;
|
||||||
int loop_length;
|
int loop_length;
|
||||||
int resting_place = starting_point;
|
int resting_place = starting_point;
|
||||||
|
@ -22,8 +22,8 @@ liberrhandler_la_SOURCES = \
|
|||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
|
||||||
if WANT_INSTALL_HEADERS
|
if WANT_INSTALL_HEADERS
|
||||||
lamdir = $(includedir)/lam/errhandler
|
ompidir = $(includedir)/ompi/errhandler
|
||||||
lam_HEADERS = $(headers)
|
ompi_HEADERS = $(headers)
|
||||||
else
|
else
|
||||||
lamdir = $(includedir)
|
ompidir = $(includedir)
|
||||||
endif
|
endif
|
||||||
|
@ -2,46 +2,46 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include "communicator/communicator.h"
|
#include "communicator/communicator.h"
|
||||||
#include "win/win.h"
|
#include "win/win.h"
|
||||||
#include "file/file.h"
|
#include "file/file.h"
|
||||||
#include "errhandler/errhandler.h"
|
#include "errhandler/errhandler.h"
|
||||||
#include "errhandler/errhandler_predefined.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
|
* 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
|
* Class information
|
||||||
*/
|
*/
|
||||||
static void lam_errhandler_construct(lam_errhandler_t *eh);
|
static void ompi_errhandler_construct(ompi_errhandler_t *eh);
|
||||||
static void lam_errhandler_destruct(lam_errhandler_t *eh);
|
static void ompi_errhandler_destruct(ompi_errhandler_t *eh);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class instance
|
* Class instance
|
||||||
*/
|
*/
|
||||||
OBJ_CLASS_INSTANCE(lam_errhandler_t, lam_object_t, lam_errhandler_construct,
|
OBJ_CLASS_INSTANCE(ompi_errhandler_t, ompi_object_t, ompi_errhandler_construct,
|
||||||
lam_errhandler_destruct);
|
ompi_errhandler_destruct);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MPI_ERRHANDLER_NULL
|
* MPI_ERRHANDLER_NULL
|
||||||
*/
|
*/
|
||||||
lam_errhandler_t lam_mpi_errhandler_null = {
|
ompi_errhandler_t ompi_mpi_errhandler_null = {
|
||||||
{ NULL, 0 },
|
{ NULL, 0 },
|
||||||
|
|
||||||
"MPI_ERRHANDLER_NULL",
|
"MPI_ERRHANDLER_NULL",
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
LAM_ERRHANDLER_TYPE_COMM,
|
OMPI_ERRHANDLER_TYPE_COMM,
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -49,14 +49,14 @@ lam_errhandler_t lam_mpi_errhandler_null = {
|
|||||||
/*
|
/*
|
||||||
* MPI_ERRORS_ARE_FATAL
|
* MPI_ERRORS_ARE_FATAL
|
||||||
*/
|
*/
|
||||||
lam_errhandler_t lam_mpi_errors_are_fatal = {
|
ompi_errhandler_t ompi_mpi_errors_are_fatal = {
|
||||||
{ NULL, 0 },
|
{ NULL, 0 },
|
||||||
|
|
||||||
"MPI_ERRORS_ARE_FATAL",
|
"MPI_ERRORS_ARE_FATAL",
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
LAM_ERRHANDLER_TYPE_COMM,
|
OMPI_ERRHANDLER_TYPE_COMM,
|
||||||
{ lam_mpi_errors_are_fatal_handler },
|
{ ompi_mpi_errors_are_fatal_handler },
|
||||||
-1
|
-1
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -64,76 +64,76 @@ lam_errhandler_t lam_mpi_errors_are_fatal = {
|
|||||||
/*
|
/*
|
||||||
* MPI_ERRORS_RETURN
|
* MPI_ERRORS_RETURN
|
||||||
*/
|
*/
|
||||||
lam_errhandler_t lam_mpi_errors_return = {
|
ompi_errhandler_t ompi_mpi_errors_return = {
|
||||||
{ NULL, 0 },
|
{ NULL, 0 },
|
||||||
|
|
||||||
"MPI_ERRORS_ARE_RETURN",
|
"MPI_ERRORS_ARE_RETURN",
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
LAM_ERRHANDLER_TYPE_COMM,
|
OMPI_ERRHANDLER_TYPE_COMM,
|
||||||
{ lam_mpi_errors_return_handler },
|
{ ompi_mpi_errors_return_handler },
|
||||||
-1
|
-1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize LAM errhandler infrastructure
|
* Initialize OMPI errhandler infrastructure
|
||||||
*/
|
*/
|
||||||
int lam_errhandler_init(void)
|
int ompi_errhandler_init(void)
|
||||||
{
|
{
|
||||||
int ret_val;
|
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);
|
ompi_errhandler_f_to_c_table = OBJ_NEW(ompi_pointer_array_t);
|
||||||
if (NULL == lam_errhandler_f_to_c_table){
|
if (NULL == ompi_errhandler_f_to_c_table){
|
||||||
return LAM_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the predefined error handlers */
|
/* Initialize the predefined error handlers */
|
||||||
OBJ_CONSTRUCT( &lam_mpi_errhandler_null, lam_errhandler_t );
|
OBJ_CONSTRUCT( &ompi_mpi_errhandler_null, ompi_errhandler_t );
|
||||||
if( lam_mpi_errhandler_null.eh_f_to_c_index != LAM_ERRHANDLER_NULL_FORTRAN )
|
if( ompi_mpi_errhandler_null.eh_f_to_c_index != OMPI_ERRHANDLER_NULL_FORTRAN )
|
||||||
return LAM_ERROR;
|
return OMPI_ERROR;
|
||||||
|
|
||||||
OBJ_CONSTRUCT( &lam_mpi_errors_are_fatal, lam_errhandler_t );
|
OBJ_CONSTRUCT( &ompi_mpi_errors_are_fatal, ompi_errhandler_t );
|
||||||
if( lam_mpi_errors_are_fatal.eh_f_to_c_index != LAM_ERRORS_ARE_FATAL_FORTRAN )
|
if( ompi_mpi_errors_are_fatal.eh_f_to_c_index != OMPI_ERRORS_ARE_FATAL_FORTRAN )
|
||||||
return LAM_ERROR;
|
return OMPI_ERROR;
|
||||||
|
|
||||||
OBJ_CONSTRUCT( &lam_mpi_errors_return, lam_errhandler_t );
|
OBJ_CONSTRUCT( &ompi_mpi_errors_return, ompi_errhandler_t );
|
||||||
if( lam_mpi_errors_return.eh_f_to_c_index != LAM_ERRORS_RETURN_FORTRAN )
|
if( ompi_mpi_errors_return.eh_f_to_c_index != OMPI_ERRORS_RETURN_FORTRAN )
|
||||||
return LAM_ERROR;
|
return OMPI_ERROR;
|
||||||
|
|
||||||
/* All done */
|
/* All done */
|
||||||
|
|
||||||
return LAM_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clean up the errorhandler resources
|
* Clean up the errorhandler resources
|
||||||
*/
|
*/
|
||||||
int lam_errhandler_finalize(void)
|
int ompi_errhandler_finalize(void)
|
||||||
{
|
{
|
||||||
/* Remove errhandler F2C table */
|
/* Remove errhandler F2C table */
|
||||||
|
|
||||||
OBJ_RELEASE(lam_errhandler_f_to_c_table);
|
OBJ_RELEASE(ompi_errhandler_f_to_c_table);
|
||||||
|
|
||||||
/* All done */
|
/* All done */
|
||||||
|
|
||||||
return LAM_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lam_errhandler_t *lam_errhandler_create(lam_errhandler_type_t object_type,
|
ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type,
|
||||||
lam_errhandler_fortran_handler_fn_t *func)
|
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 */
|
/* 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 (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);
|
OBJ_RELEASE(new_errhandler);
|
||||||
new_errhandler = NULL;
|
new_errhandler = NULL;
|
||||||
} else {
|
} else {
|
||||||
@ -155,7 +155,7 @@ lam_errhandler_t *lam_errhandler_create(lam_errhandler_type_t object_type,
|
|||||||
|
|
||||||
|
|
||||||
/* All done */
|
/* 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
|
* 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;
|
int ret_val;
|
||||||
|
|
||||||
/* assign entry in fortran <-> c translation array */
|
/* 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);
|
||||||
new_errhandler->eh_f_to_c_index = ret_val;
|
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
|
* 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 */
|
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)) {
|
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);
|
errhandler->eh_f_to_c_index, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,51 +3,51 @@
|
|||||||
*/
|
*/
|
||||||
/** @file **/
|
/** @file **/
|
||||||
|
|
||||||
#ifndef LAM_ERRHANDLER_H
|
#ifndef OMPI_ERRHANDLER_H
|
||||||
#define LAM_ERRHANDLER_H
|
#define OMPI_ERRHANDLER_H
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "lfc/lam_pointer_array.h"
|
#include "class/ompi_pointer_array.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These must correspond to the fortran handle indices
|
* These must correspond to the fortran handle indices
|
||||||
*/
|
*/
|
||||||
#define LAM_ERRHANDLER_NULL_FORTRAN 0
|
#define OMPI_ERRHANDLER_NULL_FORTRAN 0
|
||||||
#define LAM_ERRORS_ARE_FATAL_FORTRAN 1
|
#define OMPI_ERRORS_ARE_FATAL_FORTRAN 1
|
||||||
#define LAM_ERRORS_RETURN_FORTRAN 2
|
#define OMPI_ERRORS_RETURN_FORTRAN 2
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Typedef for all fortran errhandler functions
|
* 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 used to describe what kind MPI object an error handler is used for
|
||||||
*/
|
*/
|
||||||
enum lam_errhandler_type_t {
|
enum ompi_errhandler_type_t {
|
||||||
LAM_ERRHANDLER_TYPE_COMM,
|
OMPI_ERRHANDLER_TYPE_COMM,
|
||||||
LAM_ERRHANDLER_TYPE_WIN,
|
OMPI_ERRHANDLER_TYPE_WIN,
|
||||||
LAM_ERRHANDLER_TYPE_FILE
|
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.
|
* Back-end type for MPI_Errorhandler.
|
||||||
*/
|
*/
|
||||||
struct lam_errhandler_t {
|
struct ompi_errhandler_t {
|
||||||
lam_object_t super;
|
ompi_object_t super;
|
||||||
|
|
||||||
char eh_name[MPI_MAX_OBJECT_NAME];
|
char eh_name[MPI_MAX_OBJECT_NAME];
|
||||||
|
|
||||||
/* Type of MPI object that this handler is for */
|
/* 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 */
|
/* Flags about the error handler */
|
||||||
|
|
||||||
@ -61,35 +61,35 @@ struct lam_errhandler_t {
|
|||||||
MPI_File_errhandler_fn *c_file_fn;
|
MPI_File_errhandler_fn *c_file_fn;
|
||||||
MPI_Win_errhandler_fn *c_win_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;
|
} eh_func;
|
||||||
|
|
||||||
/* index in Fortran <-> C translation array */
|
/* index in Fortran <-> C translation array */
|
||||||
|
|
||||||
int eh_f_to_c_index;
|
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
|
* 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
|
* 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
|
* 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
|
* 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
|
* This macro is used when you want to directly invoke the error
|
||||||
* handler. It is exactly equivalent to calling
|
* handler. It is exactly equivalent to calling
|
||||||
* lam_errhandler_invoke() directly, but is provided to have a
|
* ompi_errhandler_invoke() directly, but is provided to have a
|
||||||
* parallel invocation to LAM_ERRHANDLER_CHECK() and LAM_ERRHANDLER_RETURN().
|
* parallel invocation to OMPI_ERRHANDLER_CHECK() and OMPI_ERRHANDLER_RETURN().
|
||||||
*/
|
*/
|
||||||
#define LAM_ERRHANDLER_INVOKE(mpi_object, err_code, message) \
|
#define OMPI_ERRHANDLER_INVOKE(mpi_object, err_code, message) \
|
||||||
lam_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
ompi_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||||
(err_code), (message));
|
(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.
|
* MPI function that is invoking the error.
|
||||||
*
|
*
|
||||||
* This macro will invoke the error handler if the return code is not
|
* 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) \
|
#define OMPI_ERRHANDLER_CHECK(rc, mpi_object, err_code, message) \
|
||||||
if (rc != LAM_SUCCESS) { \
|
if (rc != OMPI_SUCCESS) { \
|
||||||
lam_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
ompi_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||||
(err_code), (message)); \
|
(err_code), (message)); \
|
||||||
return (err_code); \
|
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.
|
* MPI function that is invoking the error.
|
||||||
*
|
*
|
||||||
* This macro will invoke the error handler if the return code is not
|
* 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.
|
* MPI_SUCCESS.
|
||||||
*/
|
*/
|
||||||
#define LAM_ERRHANDLER_RETURN(rc, mpi_object, err_code, message) \
|
#define OMPI_ERRHANDLER_RETURN(rc, mpi_object, err_code, message) \
|
||||||
if (rc != LAM_SUCCESS) { \
|
if (rc != OMPI_SUCCESS) { \
|
||||||
lam_errhandler_invoke((mpi_object != NULL) ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
ompi_errhandler_invoke((mpi_object != NULL) ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||||
(err_code), (message)); \
|
(err_code), (message)); \
|
||||||
return (err_code); \
|
return (err_code); \
|
||||||
} else { \
|
} else { \
|
||||||
@ -163,31 +163,31 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* Initialize the error handler interface.
|
* Initialize the error handler interface.
|
||||||
*
|
*
|
||||||
* @returns LAM_SUCCESS Upon success
|
* @returns OMPI_SUCCESS Upon success
|
||||||
* @returns LAM_ERROR Otherwise
|
* @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
|
* creates the predefined MPI errorhandlers, and creates the
|
||||||
* corresopnding F2C translation table.
|
* corresopnding F2C translation table.
|
||||||
*/
|
*/
|
||||||
int lam_errhandler_init(void);
|
int ompi_errhandler_init(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finalize the error handler interface.
|
* 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.
|
* interface, and destroys the F2C translation table.
|
||||||
*/
|
*/
|
||||||
int lam_errhandler_finalize(void);
|
int ompi_errhandler_finalize(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \internal
|
* \internal
|
||||||
*
|
*
|
||||||
* This function should not be invoked directly; it should only be
|
* This function should not be invoked directly; it should only be
|
||||||
* invoked by LAM_ERRHANDLER_INVOKE(), LAM_ERRHANDLER_CHECK(), or
|
* invoked by OMPI_ERRHANDLER_INVOKE(), OMPI_ERRHANDLER_CHECK(), or
|
||||||
* LAM_ERRHANDLER_RETURN().
|
* OMPI_ERRHANDLER_RETURN().
|
||||||
*
|
*
|
||||||
* @param errhandler The MPI_Errhandler to invoke
|
* @param errhandler The MPI_Errhandler to invoke
|
||||||
* @param mpi_object The MPI object to invoke the errhandler on (a
|
* @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
|
* If this function returns, it returns the err_code. Note that it
|
||||||
* may not return (e.g., for MPI_ERRORS_ARE_FATAL).
|
* 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);
|
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 object_type Enum of the type of MPI object
|
||||||
* @param func Function pointer of the error handler
|
* @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
|
* created and returned
|
||||||
*
|
*
|
||||||
* This function is called as the back-end of all the
|
* This function is called as the back-end of all the
|
||||||
* MPI_*_CREATE_ERRHANDLER functions. It creates a new
|
* 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.
|
* type, and sets the callback function on it.
|
||||||
*
|
*
|
||||||
* The type of the function pointer is (arbitrarily) the fortran
|
* 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
|
* wrappers for MPI_*_CREATE_ERRHANDLER are expected to reset this
|
||||||
* flag to true manually.
|
* flag to true manually.
|
||||||
*/
|
*/
|
||||||
lam_errhandler_t *lam_errhandler_create(lam_errhandler_type_t object_type,
|
ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type,
|
||||||
lam_errhandler_fortran_handler_fn_t *func);
|
ompi_errhandler_fortran_handler_fn_t *func);
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -255,9 +255,9 @@ extern "C" {
|
|||||||
* this function is provided to hide the internal structure field
|
* this function is provided to hide the internal structure field
|
||||||
* names.
|
* 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;
|
return errhandler->eh_is_intrinsic;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LAM_ERRHANDLER_H */
|
#endif /* OMPI_ERRHANDLER_H */
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include "communicator/communicator.h"
|
#include "communicator/communicator.h"
|
||||||
#include "win/win.h"
|
#include "win/win.h"
|
||||||
@ -10,20 +10,20 @@
|
|||||||
#include "errhandler/errhandler.h"
|
#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 err_code, char *message)
|
||||||
{
|
{
|
||||||
int fortran_handle;
|
int fortran_handle;
|
||||||
lam_communicator_t *comm;
|
ompi_communicator_t *comm;
|
||||||
lam_win_t *win;
|
ompi_win_t *win;
|
||||||
lam_file_t *file;
|
ompi_file_t *file;
|
||||||
|
|
||||||
/* Figure out what kind of errhandler it is, figure out if it's
|
/* Figure out what kind of errhandler it is, figure out if it's
|
||||||
fortran or C, and then invoke it */
|
fortran or C, and then invoke it */
|
||||||
|
|
||||||
switch (errhandler->eh_mpi_object_type) {
|
switch (errhandler->eh_mpi_object_type) {
|
||||||
case LAM_ERRHANDLER_TYPE_COMM:
|
case OMPI_ERRHANDLER_TYPE_COMM:
|
||||||
comm = (lam_communicator_t *) mpi_object;
|
comm = (ompi_communicator_t *) mpi_object;
|
||||||
if (errhandler->eh_fortran_function) {
|
if (errhandler->eh_fortran_function) {
|
||||||
fortran_handle = comm->c_f_to_c_index;
|
fortran_handle = comm->c_f_to_c_index;
|
||||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
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;
|
break;
|
||||||
|
|
||||||
case LAM_ERRHANDLER_TYPE_WIN:
|
case OMPI_ERRHANDLER_TYPE_WIN:
|
||||||
win = (lam_win_t *) mpi_object;
|
win = (ompi_win_t *) mpi_object;
|
||||||
if (errhandler->eh_fortran_function) {
|
if (errhandler->eh_fortran_function) {
|
||||||
fortran_handle = win->w_f_to_c_index;
|
fortran_handle = win->w_f_to_c_index;
|
||||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
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;
|
break;
|
||||||
|
|
||||||
case LAM_ERRHANDLER_TYPE_FILE:
|
case OMPI_ERRHANDLER_TYPE_FILE:
|
||||||
file = (lam_file_t *) mpi_object;
|
file = (ompi_file_t *) mpi_object;
|
||||||
if (errhandler->eh_fortran_function) {
|
if (errhandler->eh_fortran_function) {
|
||||||
fortran_handle = file->f_f_to_c_index;
|
fortran_handle = file->f_f_to_c_index;
|
||||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "errhandler/errhandler_predefined.h"
|
#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, ...)
|
int *error_code, ...)
|
||||||
{
|
{
|
||||||
va_list arglist;
|
va_list arglist;
|
||||||
@ -23,11 +23,11 @@ void lam_mpi_errors_are_fatal_handler(lam_communicator_t **comm,
|
|||||||
#else
|
#else
|
||||||
va_start(arglist);
|
va_start(arglist);
|
||||||
#endif
|
#endif
|
||||||
lam_output(0, "*** An error occurred in %s", va_arg(arglist, char *));
|
ompi_output(0, "*** An error occurred in %s", va_arg(arglist, char *));
|
||||||
lam_output(0, "*** on communicator %s", (*comm)->c_name);
|
ompi_output(0, "*** on communicator %s", (*comm)->c_name);
|
||||||
lam_output(0, "*** error code: %d\n", *error_code);
|
ompi_output(0, "*** error code: %d\n", *error_code);
|
||||||
/* JMS: Should print the error string as well */
|
/* 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);
|
va_end(arglist);
|
||||||
|
|
||||||
/* Should we do something more intelligent here? */
|
/* 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, ...)
|
int *error_code, ...)
|
||||||
{
|
{
|
||||||
/* Don't need anything more -- just need this function to exist */
|
/* Don't need anything more -- just need this function to exist */
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LAM_ERRHANDLER_PREDEFINED_H
|
#ifndef OMPI_ERRHANDLER_PREDEFINED_H
|
||||||
#define LAM_ERRHANDLER_PREDEFINED_H
|
#define OMPI_ERRHANDLER_PREDEFINED_H
|
||||||
|
|
||||||
#include "errhandler/errhandler.h"
|
#include "errhandler/errhandler.h"
|
||||||
#include "communicator/communicator.h"
|
#include "communicator/communicator.h"
|
||||||
@ -12,15 +12,15 @@
|
|||||||
/**
|
/**
|
||||||
* Handler function for MPI_ERRORS_ARE_FATAL
|
* 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, ...);
|
int *error_code, ...);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler function for MPI_ERRORS_RETURN
|
* 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, ...);
|
int *error_code, ...);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* LAM_ERRHANDLER_PREDEFINED_H */
|
#endif /* OMPI_ERRHANDLER_PREDEFINED_H */
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
include $(top_srcdir)/config/Makefile.options
|
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
|
# 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 = \
|
AM_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/src/event/compat \
|
-I$(top_srcdir)/src/event/compat \
|
||||||
@ -10,14 +10,14 @@ AM_CPPFLAGS = \
|
|||||||
-I$(top_builddir)/../include \
|
-I$(top_builddir)/../include \
|
||||||
-I$(top_builddir)/..
|
-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 = . sample test
|
||||||
SUBDIRS = compat
|
SUBDIRS = compat
|
||||||
|
|
||||||
EXTRA_DIST = err.c event.h evsignal.h event.3 kqueue.c \
|
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
|
epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c
|
||||||
|
|
||||||
# LAM: This causes problems
|
# OMPI: This causes problems
|
||||||
junk = \
|
junk = \
|
||||||
sample/Makefile.am sample/Makefile.in sample/event-test.c \
|
sample/Makefile.am sample/Makefile.in sample/event-test.c \
|
||||||
sample/signal-test.c sample/time-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/signal_test/signal_test.dsp WIN32-Prj/time_test \
|
||||||
WIN32-Prj/time_test/time_test.dsp
|
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
|
noinst_LTLIBRARIES = libevent.la
|
||||||
|
|
||||||
# LAM: Automake sillyness so that we can have variable sources
|
# OMPI: Automake sillyness so that we can have variable sources
|
||||||
objects = $(LAM_LIBEVENT_SOURCES:.c=.lo)
|
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_SOURCES = event.c event.h
|
||||||
libevent_la_LIBADD = $(objects)
|
libevent_la_LIBADD = $(objects)
|
||||||
libevent_la_DEPENDENCIES = $(objects)
|
libevent_la_DEPENDENCIES = $(objects)
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -55,16 +55,16 @@
|
|||||||
#include "evsignal.h"
|
#include "evsignal.h"
|
||||||
#include "threads/mutex.h"
|
#include "threads/mutex.h"
|
||||||
|
|
||||||
extern struct lam_event_list lam_eventqueue;
|
extern struct ompi_event_list ompi_eventqueue;
|
||||||
extern volatile sig_atomic_t lam_evsignal_caught;
|
extern volatile sig_atomic_t ompi_evsignal_caught;
|
||||||
extern lam_mutex_t lam_event_lock;
|
extern ompi_mutex_t ompi_event_lock;
|
||||||
|
|
||||||
/* due to limitations in the epoll interface, we need to keep track of
|
/* due to limitations in the epoll interface, we need to keep track of
|
||||||
* all file descriptors outself.
|
* all file descriptors outself.
|
||||||
*/
|
*/
|
||||||
struct evepoll {
|
struct evepoll {
|
||||||
struct lam_event *evread;
|
struct ompi_event *evread;
|
||||||
struct lam_event *evwrite;
|
struct ompi_event *evwrite;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct epollop {
|
struct epollop {
|
||||||
@ -77,12 +77,12 @@ struct epollop {
|
|||||||
} epollop;
|
} epollop;
|
||||||
|
|
||||||
static void *epoll_init (void);
|
static void *epoll_init (void);
|
||||||
static int epoll_add (void *, struct lam_event *);
|
static int epoll_add (void *, struct ompi_event *);
|
||||||
static int epoll_del (void *, struct lam_event *);
|
static int epoll_del (void *, struct ompi_event *);
|
||||||
static int epoll_recalc (void *, int);
|
static int epoll_recalc (void *, int);
|
||||||
static int epoll_dispatch (void *, struct timeval *);
|
static int epoll_dispatch (void *, struct timeval *);
|
||||||
|
|
||||||
struct lam_eventop lam_epollops = {
|
struct ompi_eventop ompi_epollops = {
|
||||||
"epoll",
|
"epoll",
|
||||||
epoll_init,
|
epoll_init,
|
||||||
epoll_add,
|
epoll_add,
|
||||||
@ -131,7 +131,7 @@ epoll_init(void)
|
|||||||
}
|
}
|
||||||
epollop.nfds = nfiles;
|
epollop.nfds = nfiles;
|
||||||
|
|
||||||
lam_evsignal_init(&epollop.evsigmask);
|
ompi_evsignal_init(&epollop.evsigmask);
|
||||||
|
|
||||||
return (&epollop);
|
return (&epollop);
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ epoll_recalc(void *arg, int max)
|
|||||||
epollop->nfds = nfds;
|
epollop->nfds = nfds;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (lam_evsignal_recalc(&epollop->evsigmask));
|
return (ompi_evsignal_recalc(&epollop->evsigmask));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -170,19 +170,19 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
|||||||
struct evepoll *evep;
|
struct evepoll *evep;
|
||||||
int i, res, timeout;
|
int i, res, timeout;
|
||||||
|
|
||||||
if (lam_evsignal_deliver(&epollop->evsigmask) == -1)
|
if (ompi_evsignal_deliver(&epollop->evsigmask) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
timeout = tv->tv_sec * 1000 + tv->tv_usec / 1000;
|
timeout = tv->tv_sec * 1000 + tv->tv_usec / 1000;
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
|
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
|
||||||
lam_mutex_lock(&lam_event_lock);
|
ompi_mutex_lock(&ompi_event_lock);
|
||||||
} else {
|
} else {
|
||||||
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
|
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);
|
return (-1);
|
||||||
|
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
@ -191,17 +191,17 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
lam_evsignal_process();
|
ompi_evsignal_process();
|
||||||
return (0);
|
return (0);
|
||||||
} else if (lam_evsignal_caught)
|
} else if (ompi_evsignal_caught)
|
||||||
lam_evsignal_process();
|
ompi_evsignal_process();
|
||||||
|
|
||||||
LOG_DBG((LOG_MISC, 80, "%s: epoll_wait reports %d", __func__, res));
|
LOG_DBG((LOG_MISC, 80, "%s: epoll_wait reports %d", __func__, res));
|
||||||
|
|
||||||
for (i = 0; i < res; i++) {
|
for (i = 0; i < res; i++) {
|
||||||
int which = 0;
|
int which = 0;
|
||||||
int what = events[i].events;
|
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;
|
evep = (struct evepoll *)events[i].data.ptr;
|
||||||
|
|
||||||
@ -212,27 +212,27 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
|||||||
|
|
||||||
if (what & EPOLLIN) {
|
if (what & EPOLLIN) {
|
||||||
evread = evep->evread;
|
evread = evep->evread;
|
||||||
which |= LAM_EV_READ;
|
which |= OMPI_EV_READ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (what & EPOLLOUT) {
|
if (what & EPOLLOUT) {
|
||||||
evwrite = evep->evwrite;
|
evwrite = evep->evwrite;
|
||||||
which |= LAM_EV_WRITE;
|
which |= OMPI_EV_WRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!which)
|
if (!which)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (evread != NULL && !(evread->ev_events & LAM_EV_PERSIST))
|
if (evread != NULL && !(evread->ev_events & OMPI_EV_PERSIST))
|
||||||
lam_event_del_i(evread);
|
ompi_event_del_i(evread);
|
||||||
if (evwrite != NULL && evwrite != evread &&
|
if (evwrite != NULL && evwrite != evread &&
|
||||||
!(evwrite->ev_events & LAM_EV_PERSIST))
|
!(evwrite->ev_events & OMPI_EV_PERSIST))
|
||||||
lam_event_del_i(evwrite);
|
ompi_event_del_i(evwrite);
|
||||||
|
|
||||||
if (evread != NULL)
|
if (evread != NULL)
|
||||||
lam_event_active_i(evread, LAM_EV_READ, 1);
|
ompi_event_active_i(evread, OMPI_EV_READ, 1);
|
||||||
if (evwrite != NULL)
|
if (evwrite != NULL)
|
||||||
lam_event_active_i(evwrite, LAM_EV_WRITE, 1);
|
ompi_event_active_i(evwrite, OMPI_EV_WRITE, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -240,15 +240,15 @@ epoll_dispatch(void *arg, struct timeval *tv)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
epoll_add(void *arg, struct lam_event *ev)
|
epoll_add(void *arg, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
struct epollop *epollop = arg;
|
struct epollop *epollop = arg;
|
||||||
struct epoll_event epev;
|
struct epoll_event epev;
|
||||||
struct evepoll *evep;
|
struct evepoll *evep;
|
||||||
int fd, op, events;
|
int fd, op, events;
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||||
return (lam_evsignal_add(&epollop->evsigmask, ev));
|
return (ompi_evsignal_add(&epollop->evsigmask, ev));
|
||||||
|
|
||||||
fd = ev->ev_fd;
|
fd = ev->ev_fd;
|
||||||
if (fd >= epollop->nfds) {
|
if (fd >= epollop->nfds) {
|
||||||
@ -268,9 +268,9 @@ epoll_add(void *arg, struct lam_event *ev)
|
|||||||
op = EPOLL_CTL_MOD;
|
op = EPOLL_CTL_MOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_READ)
|
if (ev->ev_events & OMPI_EV_READ)
|
||||||
events |= EPOLLIN;
|
events |= EPOLLIN;
|
||||||
if (ev->ev_events & LAM_EV_WRITE)
|
if (ev->ev_events & OMPI_EV_WRITE)
|
||||||
events |= EPOLLOUT;
|
events |= EPOLLOUT;
|
||||||
|
|
||||||
epev.data.ptr = evep;
|
epev.data.ptr = evep;
|
||||||
@ -279,16 +279,16 @@ epoll_add(void *arg, struct lam_event *ev)
|
|||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
/* Update events responsible */
|
/* Update events responsible */
|
||||||
if (ev->ev_events & LAM_EV_READ)
|
if (ev->ev_events & OMPI_EV_READ)
|
||||||
evep->evread = ev;
|
evep->evread = ev;
|
||||||
if (ev->ev_events & LAM_EV_WRITE)
|
if (ev->ev_events & OMPI_EV_WRITE)
|
||||||
evep->evwrite = ev;
|
evep->evwrite = ev;
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
epoll_del(void *arg, struct lam_event *ev)
|
epoll_del(void *arg, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
struct epollop *epollop = arg;
|
struct epollop *epollop = arg;
|
||||||
struct epoll_event epev;
|
struct epoll_event epev;
|
||||||
@ -296,8 +296,8 @@ epoll_del(void *arg, struct lam_event *ev)
|
|||||||
int fd, events, op;
|
int fd, events, op;
|
||||||
int needwritedelete = 1, needreaddelete = 1;
|
int needwritedelete = 1, needreaddelete = 1;
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||||
return (lam_evsignal_del(&epollop->evsigmask, ev));
|
return (ompi_evsignal_del(&epollop->evsigmask, ev));
|
||||||
|
|
||||||
fd = ev->ev_fd;
|
fd = ev->ev_fd;
|
||||||
if (fd >= epollop->nfds)
|
if (fd >= epollop->nfds)
|
||||||
@ -307,9 +307,9 @@ epoll_del(void *arg, struct lam_event *ev)
|
|||||||
op = EPOLL_CTL_DEL;
|
op = EPOLL_CTL_DEL;
|
||||||
events = 0;
|
events = 0;
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_READ)
|
if (ev->ev_events & OMPI_EV_READ)
|
||||||
events |= EPOLLIN;
|
events |= EPOLLIN;
|
||||||
if (ev->ev_events & LAM_EV_WRITE)
|
if (ev->ev_events & OMPI_EV_WRITE)
|
||||||
events |= EPOLLOUT;
|
events |= EPOLLOUT;
|
||||||
|
|
||||||
if ((events & (EPOLLIN|EPOLLOUT)) != (EPOLLIN|EPOLLOUT)) {
|
if ((events & (EPOLLIN|EPOLLOUT)) != (EPOLLIN|EPOLLOUT)) {
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
@ -62,84 +62,84 @@
|
|||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "include/types.h"
|
#include "include/types.h"
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "lfc/lam_object.h"
|
#include "class/ompi_object.h"
|
||||||
#include "threads/mutex.h"
|
#include "threads/mutex.h"
|
||||||
#include "threads/thread.h"
|
#include "threads/thread.h"
|
||||||
#include "util/output.h"
|
#include "util/output.h"
|
||||||
|
|
||||||
#if HAVE_SELECT
|
#if HAVE_SELECT
|
||||||
extern const struct lam_eventop lam_selectops;
|
extern const struct ompi_eventop ompi_selectops;
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_POLL
|
#if HAVE_POLL
|
||||||
extern const struct lam_eventop lam_pollops;
|
extern const struct ompi_eventop ompi_pollops;
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_RTSIG
|
#if HAVE_RTSIG
|
||||||
extern const struct lam_eventop lam_rtsigops;
|
extern const struct ompi_eventop ompi_rtsigops;
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_EPOLL
|
#if HAVE_EPOLL
|
||||||
extern const struct lam_eventop lam_epollops;
|
extern const struct ompi_eventop ompi_epollops;
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_WORKING_KQUEUE
|
#if HAVE_WORKING_KQUEUE
|
||||||
extern const struct lam_eventop lam_kqops;
|
extern const struct ompi_eventop ompi_kqops;
|
||||||
#endif
|
#endif
|
||||||
#if WIN32
|
#if WIN32
|
||||||
extern const struct lam_eventop lam_win32ops;
|
extern const struct ompi_eventop ompi_win32ops;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* In order of preference */
|
/* In order of preference */
|
||||||
static const struct lam_eventop *lam_eventops[] = {
|
static const struct ompi_eventop *ompi_eventops[] = {
|
||||||
#if HAVE_WORKING_KQUEUE
|
#if HAVE_WORKING_KQUEUE
|
||||||
&lam_kqops,
|
&ompi_kqops,
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_EPOLL
|
#if HAVE_EPOLL
|
||||||
&lam_epollops,
|
&ompi_epollops,
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_RTSIG
|
#if HAVE_RTSIG
|
||||||
&lam_rtsigops,
|
&ompi_rtsigops,
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_POLL
|
#if HAVE_POLL
|
||||||
&lam_pollops,
|
&ompi_pollops,
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_SELECT
|
#if HAVE_SELECT
|
||||||
&lam_selectops,
|
&ompi_selectops,
|
||||||
#endif
|
#endif
|
||||||
#if WIN32
|
#if WIN32
|
||||||
&lam_win32ops,
|
&ompi_win32ops,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct lam_eventop *lam_evsel;
|
const struct ompi_eventop *ompi_evsel;
|
||||||
void *lam_evbase;
|
void *ompi_evbase;
|
||||||
|
|
||||||
/* Handle signals */
|
/* Handle signals */
|
||||||
int (*lam_event_sigcb)(void); /* Signal callback when gotsig is set */
|
int (*ompi_event_sigcb)(void); /* Signal callback when gotsig is set */
|
||||||
int lam_event_gotsig; /* Set in signal handler */
|
int ompi_event_gotsig; /* Set in signal handler */
|
||||||
|
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
static void lam_event_process_active(void);
|
static void ompi_event_process_active(void);
|
||||||
static void lam_timeout_correct(struct timeval *off);
|
static void ompi_timeout_correct(struct timeval *off);
|
||||||
static void lam_timeout_insert(struct lam_event *);
|
static void ompi_timeout_insert(struct ompi_event *);
|
||||||
static void lam_event_queue_insert(struct lam_event *, int);
|
static void ompi_event_queue_insert(struct ompi_event *, int);
|
||||||
static void lam_event_queue_remove(struct lam_event *, int);
|
static void ompi_event_queue_remove(struct ompi_event *, int);
|
||||||
static void lam_timeout_process(void);
|
static void ompi_timeout_process(void);
|
||||||
int lam_event_haveevents(void);
|
int ompi_event_haveevents(void);
|
||||||
|
|
||||||
static RB_HEAD(lam_event_tree, lam_event) lam_timetree;
|
static RB_HEAD(ompi_event_tree, ompi_event) ompi_timetree;
|
||||||
static struct lam_event_list lam_activequeue;
|
static struct ompi_event_list ompi_activequeue;
|
||||||
struct lam_event_list lam_signalqueue;
|
struct ompi_event_list ompi_signalqueue;
|
||||||
struct lam_event_list lam_eventqueue;
|
struct ompi_event_list ompi_eventqueue;
|
||||||
static struct timeval lam_event_tv;
|
static struct timeval ompi_event_tv;
|
||||||
lam_mutex_t lam_event_lock;
|
ompi_mutex_t ompi_event_lock;
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
lam_thread_t lam_event_thread;
|
ompi_thread_t ompi_event_thread;
|
||||||
lam_event_t lam_event_pipe_event;
|
ompi_event_t ompi_event_pipe_event;
|
||||||
int lam_event_pipe[2];
|
int ompi_event_pipe[2];
|
||||||
int lam_event_pipe_signalled;
|
int ompi_event_pipe_signalled;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
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, <))
|
if (timercmp(&a->ev_timeout, &b->ev_timeout, <))
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -148,17 +148,17 @@ compare(struct lam_event *a, struct lam_event *b)
|
|||||||
return (0);
|
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 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;
|
*tv = dflt;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@ -176,76 +176,76 @@ static int lam_timeout_next(struct timeval *tv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* run loop for dispatch thread */
|
/* 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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
static void lam_event_pipe_handler(int sd, short flags, void* user)
|
static void ompi_event_pipe_handler(int sd, short flags, void* user)
|
||||||
{
|
{
|
||||||
unsigned char byte;
|
unsigned char byte;
|
||||||
if(read(sd, &byte, 1) != 1) {
|
if(read(sd, &byte, 1) != 1) {
|
||||||
lam_output(0, "lam_event_pipe: read failed with: errno=%d\n", errno);
|
ompi_output(0, "ompi_event_pipe: read failed with: errno=%d\n", errno);
|
||||||
lam_event_del(&lam_event_pipe_event);
|
ompi_event_del(&ompi_event_pipe_event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_event_init(void)
|
ompi_event_init(void)
|
||||||
{
|
{
|
||||||
static int inited = false;
|
static int inited = false;
|
||||||
int i;
|
int i;
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
int rc;
|
int rc;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(inited)
|
if(inited)
|
||||||
return LAM_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
|
|
||||||
lam_event_sigcb = NULL;
|
ompi_event_sigcb = NULL;
|
||||||
lam_event_gotsig = 0;
|
ompi_event_gotsig = 0;
|
||||||
gettimeofday(&lam_event_tv, NULL);
|
gettimeofday(&ompi_event_tv, NULL);
|
||||||
|
|
||||||
OBJ_CONSTRUCT(&lam_event_lock, lam_mutex_t);
|
OBJ_CONSTRUCT(&ompi_event_lock, ompi_mutex_t);
|
||||||
RB_INIT(&lam_timetree);
|
RB_INIT(&ompi_timetree);
|
||||||
TAILQ_INIT(&lam_eventqueue);
|
TAILQ_INIT(&ompi_eventqueue);
|
||||||
TAILQ_INIT(&lam_activequeue);
|
TAILQ_INIT(&ompi_activequeue);
|
||||||
TAILQ_INIT(&lam_signalqueue);
|
TAILQ_INIT(&ompi_signalqueue);
|
||||||
|
|
||||||
lam_evbase = NULL;
|
ompi_evbase = NULL;
|
||||||
for (i = 0; lam_eventops[i] && !lam_evbase; i++) {
|
for (i = 0; ompi_eventops[i] && !ompi_evbase; i++) {
|
||||||
lam_evsel = lam_eventops[i];
|
ompi_evsel = ompi_eventops[i];
|
||||||
lam_evbase = lam_evsel->init();
|
ompi_evbase = ompi_evsel->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lam_evbase == NULL)
|
if (ompi_evbase == NULL)
|
||||||
errx(1, "%s: no event mechanism available", __func__);
|
errx(1, "%s: no event mechanism available", __func__);
|
||||||
|
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
if(pipe(lam_event_pipe) != 0) {
|
if(pipe(ompi_event_pipe) != 0) {
|
||||||
lam_output(0, "lam_event_init: pipe() failed with errno=%d\n", errno);
|
ompi_output(0, "ompi_event_init: pipe() failed with errno=%d\n", errno);
|
||||||
return LAM_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
lam_event_pipe_signalled = 1;
|
ompi_event_pipe_signalled = 1;
|
||||||
lam_event_set(
|
ompi_event_set(
|
||||||
&lam_event_pipe_event,
|
&ompi_event_pipe_event,
|
||||||
lam_event_pipe[0],
|
ompi_event_pipe[0],
|
||||||
LAM_EV_READ|LAM_EV_PERSIST,
|
OMPI_EV_READ|OMPI_EV_PERSIST,
|
||||||
lam_event_pipe_handler,
|
ompi_event_pipe_handler,
|
||||||
0);
|
0);
|
||||||
lam_event_add_i(&lam_event_pipe_event, 0);
|
ompi_event_add_i(&ompi_event_pipe_event, 0);
|
||||||
lam_event_pipe_signalled = 0;
|
ompi_event_pipe_signalled = 0;
|
||||||
|
|
||||||
/* spin up a thread to dispatch events */
|
/* spin up a thread to dispatch events */
|
||||||
OBJ_CONSTRUCT(&lam_event_thread, lam_thread_t);
|
OBJ_CONSTRUCT(&ompi_event_thread, ompi_thread_t);
|
||||||
lam_event_thread.t_run = lam_event_run;
|
ompi_event_thread.t_run = ompi_event_run;
|
||||||
if((rc = lam_thread_start(&lam_event_thread)) != LAM_SUCCESS)
|
if((rc = ompi_thread_start(&ompi_event_thread)) != OMPI_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -254,25 +254,25 @@ lam_event_init(void)
|
|||||||
log_debug_cmd(LOG_MISC, 80);
|
log_debug_cmd(LOG_MISC, 80);
|
||||||
#endif
|
#endif
|
||||||
inited = true;
|
inited = true;
|
||||||
return LAM_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_event_haveevents(void)
|
ompi_event_haveevents(void)
|
||||||
{
|
{
|
||||||
return (RB_ROOT(&lam_timetree) || TAILQ_FIRST(&lam_eventqueue) ||
|
return (RB_ROOT(&ompi_timetree) || TAILQ_FIRST(&ompi_eventqueue) ||
|
||||||
TAILQ_FIRST(&lam_signalqueue) || TAILQ_FIRST(&lam_activequeue));
|
TAILQ_FIRST(&ompi_signalqueue) || TAILQ_FIRST(&ompi_activequeue));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lam_event_process_active(void)
|
ompi_event_process_active(void)
|
||||||
{
|
{
|
||||||
struct lam_event *ev;
|
struct ompi_event *ev;
|
||||||
short ncalls;
|
short ncalls;
|
||||||
|
|
||||||
for (ev = TAILQ_FIRST(&lam_activequeue); ev;
|
for (ev = TAILQ_FIRST(&ompi_activequeue); ev;
|
||||||
ev = TAILQ_FIRST(&lam_activequeue)) {
|
ev = TAILQ_FIRST(&ompi_activequeue)) {
|
||||||
lam_event_queue_remove(ev, LAM_EVLIST_ACTIVE);
|
ompi_event_queue_remove(ev, OMPI_EVLIST_ACTIVE);
|
||||||
|
|
||||||
/* Allows deletes to work */
|
/* Allows deletes to work */
|
||||||
ncalls = ev->ev_ncalls;
|
ncalls = ev->ev_ncalls;
|
||||||
@ -280,10 +280,10 @@ lam_event_process_active(void)
|
|||||||
while (ncalls) {
|
while (ncalls) {
|
||||||
ncalls--;
|
ncalls--;
|
||||||
ev->ev_ncalls = ncalls;
|
ev->ev_ncalls = ncalls;
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
(*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg);
|
(*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 {
|
} else {
|
||||||
(*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg);
|
(*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg);
|
||||||
}
|
}
|
||||||
@ -292,121 +292,121 @@ lam_event_process_active(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_event_dispatch(void)
|
ompi_event_dispatch(void)
|
||||||
{
|
{
|
||||||
return (lam_event_loop(0));
|
return (ompi_event_loop(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_event_loop(int flags)
|
ompi_event_loop(int flags)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int res, done;
|
int res, done;
|
||||||
|
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
THREAD_LOCK(&lam_event_lock);
|
THREAD_LOCK(&ompi_event_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate the initial events that we are waiting for */
|
/* Calculate the initial events that we are waiting for */
|
||||||
if (lam_evsel->recalc && lam_evsel->recalc(lam_evbase, 0) == -1) {
|
if (ompi_evsel->recalc && ompi_evsel->recalc(ompi_evbase, 0) == -1) {
|
||||||
lam_output(0, "lam_event_loop: lam_evsel->recalc() failed.");
|
ompi_output(0, "ompi_event_loop: ompi_evsel->recalc() failed.");
|
||||||
THREAD_UNLOCK(&lam_event_lock);
|
THREAD_UNLOCK(&ompi_event_lock);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
done = 0;
|
done = 0;
|
||||||
while (!done) {
|
while (!done) {
|
||||||
while (lam_event_gotsig) {
|
while (ompi_event_gotsig) {
|
||||||
lam_event_gotsig = 0;
|
ompi_event_gotsig = 0;
|
||||||
if (lam_event_sigcb) {
|
if (ompi_event_sigcb) {
|
||||||
res = (*lam_event_sigcb)();
|
res = (*ompi_event_sigcb)();
|
||||||
if (res == -1) {
|
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;
|
errno = EINTR;
|
||||||
THREAD_UNLOCK(&lam_event_lock);
|
THREAD_UNLOCK(&ompi_event_lock);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & LAM_EVLOOP_NONBLOCK)) {
|
if (!(flags & OMPI_EVLOOP_NONBLOCK)) {
|
||||||
static struct timeval dflt = LAM_TIMEOUT_DEFAULT;
|
static struct timeval dflt = OMPI_TIMEOUT_DEFAULT;
|
||||||
tv = dflt;
|
tv = dflt;
|
||||||
} else
|
} else
|
||||||
timerclear(&tv);
|
timerclear(&tv);
|
||||||
|
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
lam_event_pipe_signalled = 0;
|
ompi_event_pipe_signalled = 0;
|
||||||
#endif
|
#endif
|
||||||
res = lam_evsel->dispatch(lam_evbase, &tv);
|
res = ompi_evsel->dispatch(ompi_evbase, &tv);
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
lam_event_pipe_signalled = 1;
|
ompi_event_pipe_signalled = 1;
|
||||||
#endif
|
#endif
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
lam_output(0, "lam_event_loop: lam_evesel->dispatch() failed.");
|
ompi_output(0, "ompi_event_loop: ompi_evesel->dispatch() failed.");
|
||||||
THREAD_UNLOCK(&lam_event_lock);
|
THREAD_UNLOCK(&ompi_event_lock);
|
||||||
return (-1);
|
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 */
|
/* Check if time is running backwards */
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
if (timercmp(&tv, &lam_event_tv, <)) {
|
if (timercmp(&tv, &ompi_event_tv, <)) {
|
||||||
struct timeval off;
|
struct timeval off;
|
||||||
LOG_DBG((LOG_MISC, 10,
|
LOG_DBG((LOG_MISC, 10,
|
||||||
"%s: time is running backwards, corrected",
|
"%s: time is running backwards, corrected",
|
||||||
__func__));
|
__func__));
|
||||||
|
|
||||||
timersub(&lam_event_tv, &tv, &off);
|
timersub(&ompi_event_tv, &tv, &off);
|
||||||
lam_timeout_correct(&off);
|
ompi_timeout_correct(&off);
|
||||||
}
|
}
|
||||||
lam_event_tv = tv;
|
ompi_event_tv = tv;
|
||||||
lam_timeout_process();
|
ompi_timeout_process();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TAILQ_FIRST(&lam_activequeue)) {
|
if (TAILQ_FIRST(&ompi_activequeue)) {
|
||||||
lam_event_process_active();
|
ompi_event_process_active();
|
||||||
if (flags & LAM_EVLOOP_ONCE)
|
if (flags & OMPI_EVLOOP_ONCE)
|
||||||
done = 1;
|
done = 1;
|
||||||
} else if (flags & (LAM_EVLOOP_NONBLOCK|LAM_EVLOOP_ONCE))
|
} else if (flags & (OMPI_EVLOOP_NONBLOCK|OMPI_EVLOOP_ONCE))
|
||||||
done = 1;
|
done = 1;
|
||||||
|
|
||||||
if (lam_evsel->recalc && lam_evsel->recalc(lam_evbase, 0) == -1) {
|
if (ompi_evsel->recalc && ompi_evsel->recalc(ompi_evbase, 0) == -1) {
|
||||||
lam_output(0, "lam_event_loop: lam_evesel->recalc() failed.");
|
ompi_output(0, "ompi_event_loop: ompi_evesel->recalc() failed.");
|
||||||
THREAD_UNLOCK(&lam_event_lock);
|
THREAD_UNLOCK(&ompi_event_lock);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
THREAD_UNLOCK(&lam_event_lock);
|
THREAD_UNLOCK(&ompi_event_lock);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
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;
|
int rc = 0;
|
||||||
LOG_DBG((LOG_MISC, 55,
|
LOG_DBG((LOG_MISC, 55,
|
||||||
"event_add: event: %p, %s%s%scall %p",
|
"event_add: event: %p, %s%s%scall %p",
|
||||||
ev,
|
ev,
|
||||||
ev->ev_events & LAM_EV_READ ? "LAM_EV_READ " : " ",
|
ev->ev_events & OMPI_EV_READ ? "OMPI_EV_READ " : " ",
|
||||||
ev->ev_events & LAM_EV_WRITE ? "LAM_EV_WRITE " : " ",
|
ev->ev_events & OMPI_EV_WRITE ? "OMPI_EV_WRITE " : " ",
|
||||||
tv ? "LAM_EV_TIMEOUT " : " ",
|
tv ? "OMPI_EV_TIMEOUT " : " ",
|
||||||
ev->ev_callback));
|
ev->ev_callback));
|
||||||
|
|
||||||
assert(!(ev->ev_flags & ~LAM_EVLIST_ALL));
|
assert(!(ev->ev_flags & ~OMPI_EVLIST_ALL));
|
||||||
|
|
||||||
if (tv != NULL) {
|
if (tv != NULL) {
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
|
|
||||||
if (ev->ev_flags & LAM_EVLIST_TIMEOUT)
|
if (ev->ev_flags & OMPI_EVLIST_TIMEOUT)
|
||||||
lam_event_queue_remove(ev, LAM_EVLIST_TIMEOUT);
|
ompi_event_queue_remove(ev, OMPI_EVLIST_TIMEOUT);
|
||||||
|
|
||||||
/* Check if it is active due to a timeout. Rescheduling
|
/* Check if it is active due to a timeout. Rescheduling
|
||||||
* this timeout before the callback can be executed
|
* this timeout before the callback can be executed
|
||||||
* removes it from the active list. */
|
* removes it from the active list. */
|
||||||
if ((ev->ev_flags & LAM_EVLIST_ACTIVE) &&
|
if ((ev->ev_flags & OMPI_EVLIST_ACTIVE) &&
|
||||||
(ev->ev_res & LAM_EV_TIMEOUT)) {
|
(ev->ev_res & OMPI_EV_TIMEOUT)) {
|
||||||
/* See if we are just active executing this
|
/* See if we are just active executing this
|
||||||
* event in a loop
|
* event in a loop
|
||||||
*/
|
*/
|
||||||
@ -415,7 +415,7 @@ lam_event_add_i(struct lam_event *ev, struct timeval *tv)
|
|||||||
*ev->ev_pncalls = 0;
|
*ev->ev_pncalls = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lam_event_queue_remove(ev, LAM_EVLIST_ACTIVE);
|
ompi_event_queue_remove(ev, OMPI_EVLIST_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gettimeofday(&now, NULL);
|
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",
|
"event_add: timeout in %d seconds, call %p",
|
||||||
tv->tv_sec, ev->ev_callback));
|
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)) &&
|
if ((ev->ev_events & (OMPI_EV_READ|OMPI_EV_WRITE)) &&
|
||||||
!(ev->ev_flags & (LAM_EVLIST_INSERTED|LAM_EVLIST_ACTIVE))) {
|
!(ev->ev_flags & (OMPI_EVLIST_INSERTED|OMPI_EVLIST_ACTIVE))) {
|
||||||
lam_event_queue_insert(ev, LAM_EVLIST_INSERTED);
|
ompi_event_queue_insert(ev, OMPI_EVLIST_INSERTED);
|
||||||
rc = (lam_evsel->add(lam_evbase, ev));
|
rc = (ompi_evsel->add(ompi_evbase, ev));
|
||||||
} else if ((ev->ev_events & LAM_EV_SIGNAL) &&
|
} else if ((ev->ev_events & OMPI_EV_SIGNAL) &&
|
||||||
!(ev->ev_flags & LAM_EVLIST_SIGNAL)) {
|
!(ev->ev_flags & OMPI_EVLIST_SIGNAL)) {
|
||||||
lam_event_queue_insert(ev, LAM_EVLIST_SIGNAL);
|
ompi_event_queue_insert(ev, OMPI_EVLIST_SIGNAL);
|
||||||
rc = (lam_evsel->add(lam_evbase, ev));
|
rc = (ompi_evsel->add(ompi_evbase, ev));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
if(lam_event_pipe_signalled == 0) {
|
if(ompi_event_pipe_signalled == 0) {
|
||||||
unsigned char byte = 0;
|
unsigned char byte = 0;
|
||||||
if(write(lam_event_pipe[1], &byte, 1) != 1)
|
if(write(ompi_event_pipe[1], &byte, 1) != 1)
|
||||||
lam_output(0, "lam_event_add: write() to lam_event_pipe[1] failed with errno=%d\n", errno);
|
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);
|
||||||
lam_event_pipe_signalled++;
|
ompi_event_pipe_signalled++;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return rc;
|
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",
|
LOG_DBG((LOG_MISC, 80, "event_del: %p, callback %p",
|
||||||
ev, ev->ev_callback));
|
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 */
|
/* See if we are just active executing this event in a loop */
|
||||||
if (ev->ev_ncalls && ev->ev_pncalls) {
|
if (ev->ev_ncalls && ev->ev_pncalls) {
|
||||||
@ -463,26 +463,26 @@ int lam_event_del_i(struct lam_event *ev)
|
|||||||
*ev->ev_pncalls = 0;
|
*ev->ev_pncalls = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->ev_flags & LAM_EVLIST_TIMEOUT)
|
if (ev->ev_flags & OMPI_EVLIST_TIMEOUT)
|
||||||
lam_event_queue_remove(ev, LAM_EVLIST_TIMEOUT);
|
ompi_event_queue_remove(ev, OMPI_EVLIST_TIMEOUT);
|
||||||
|
|
||||||
if (ev->ev_flags & LAM_EVLIST_ACTIVE)
|
if (ev->ev_flags & OMPI_EVLIST_ACTIVE)
|
||||||
lam_event_queue_remove(ev, LAM_EVLIST_ACTIVE);
|
ompi_event_queue_remove(ev, OMPI_EVLIST_ACTIVE);
|
||||||
|
|
||||||
if (ev->ev_flags & LAM_EVLIST_INSERTED) {
|
if (ev->ev_flags & OMPI_EVLIST_INSERTED) {
|
||||||
lam_event_queue_remove(ev, LAM_EVLIST_INSERTED);
|
ompi_event_queue_remove(ev, OMPI_EVLIST_INSERTED);
|
||||||
return (lam_evsel->del(lam_evbase, ev));
|
return (ompi_evsel->del(ompi_evbase, ev));
|
||||||
} else if (ev->ev_flags & LAM_EVLIST_SIGNAL) {
|
} else if (ev->ev_flags & OMPI_EVLIST_SIGNAL) {
|
||||||
lam_event_queue_remove(ev, LAM_EVLIST_SIGNAL);
|
ompi_event_queue_remove(ev, OMPI_EVLIST_SIGNAL);
|
||||||
return (lam_evsel->del(lam_evbase, ev));
|
return (ompi_evsel->del(ompi_evbase, ev));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_HAVE_THREADS
|
#if OMPI_HAVE_THREADS
|
||||||
if(lam_event_pipe_signalled == 0) {
|
if(ompi_event_pipe_signalled == 0) {
|
||||||
unsigned char byte = 0;
|
unsigned char byte = 0;
|
||||||
if(write(lam_event_pipe[1], &byte, 1) != 1)
|
if(write(ompi_event_pipe[1], &byte, 1) != 1)
|
||||||
lam_output(0, "lam_event_add: write() to lam_event_pipe[1] failed with errno=%d\n", errno);
|
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);
|
||||||
lam_event_pipe_signalled++;
|
ompi_event_pipe_signalled++;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return (0);
|
return (0);
|
||||||
@ -490,48 +490,48 @@ int lam_event_del_i(struct lam_event *ev)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
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
|
/* We can modify the key element of the node without destroying
|
||||||
* the key, beause we apply it to all in the right order.
|
* 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);
|
timersub(&ev->ev_timeout, off, &ev->ev_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lam_timeout_process(void)
|
ompi_timeout_process(void)
|
||||||
{
|
{
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
struct lam_event *ev, *next;
|
struct ompi_event *ev, *next;
|
||||||
|
|
||||||
gettimeofday(&now, NULL);
|
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, >))
|
if (timercmp(&ev->ev_timeout, &now, >))
|
||||||
break;
|
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 */
|
/* 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",
|
LOG_DBG((LOG_MISC, 60, "timeout_process: call %p",
|
||||||
ev->ev_callback));
|
ev->ev_callback));
|
||||||
lam_event_active_i(ev, LAM_EV_TIMEOUT, 1);
|
ompi_event_active_i(ev, OMPI_EV_TIMEOUT, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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) {
|
if (tmp != NULL) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@ -541,18 +541,18 @@ lam_timeout_insert(struct lam_event *ev)
|
|||||||
tv = ev->ev_timeout;
|
tv = ev->ev_timeout;
|
||||||
do {
|
do {
|
||||||
timeradd(&tv, &add, &tv);
|
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, ==));
|
} while (tmp != NULL && timercmp(&tmp->ev_timeout, &tv, ==));
|
||||||
|
|
||||||
ev->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);
|
assert(tmp == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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))
|
if (!(ev->ev_flags & queue))
|
||||||
errx(1, "%s: %p(fd %d) not on queue %x", __func__,
|
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;
|
ev->ev_flags &= ~queue;
|
||||||
switch (queue) {
|
switch (queue) {
|
||||||
case LAM_EVLIST_ACTIVE:
|
case OMPI_EVLIST_ACTIVE:
|
||||||
TAILQ_REMOVE(&lam_activequeue, ev, ev_active_next);
|
TAILQ_REMOVE(&ompi_activequeue, ev, ev_active_next);
|
||||||
break;
|
break;
|
||||||
case LAM_EVLIST_SIGNAL:
|
case OMPI_EVLIST_SIGNAL:
|
||||||
TAILQ_REMOVE(&lam_signalqueue, ev, ev_signal_next);
|
TAILQ_REMOVE(&ompi_signalqueue, ev, ev_signal_next);
|
||||||
break;
|
break;
|
||||||
case LAM_EVLIST_TIMEOUT:
|
case OMPI_EVLIST_TIMEOUT:
|
||||||
RB_REMOVE(lam_event_tree, &lam_timetree, ev);
|
RB_REMOVE(ompi_event_tree, &ompi_timetree, ev);
|
||||||
break;
|
break;
|
||||||
case LAM_EVLIST_INSERTED:
|
case OMPI_EVLIST_INSERTED:
|
||||||
TAILQ_REMOVE(&lam_eventqueue, ev, ev_next);
|
TAILQ_REMOVE(&ompi_eventqueue, ev, ev_next);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errx(1, "%s: unknown queue %x", __func__, queue);
|
errx(1, "%s: unknown queue %x", __func__, queue);
|
||||||
@ -578,7 +578,7 @@ lam_event_queue_remove(struct lam_event *ev, int queue)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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)
|
if (ev->ev_flags & queue)
|
||||||
errx(1, "%s: %p(fd %d) already on queue %x", __func__,
|
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;
|
ev->ev_flags |= queue;
|
||||||
switch (queue) {
|
switch (queue) {
|
||||||
case LAM_EVLIST_ACTIVE:
|
case OMPI_EVLIST_ACTIVE:
|
||||||
TAILQ_INSERT_TAIL(&lam_activequeue, ev, ev_active_next);
|
TAILQ_INSERT_TAIL(&ompi_activequeue, ev, ev_active_next);
|
||||||
break;
|
break;
|
||||||
case LAM_EVLIST_SIGNAL:
|
case OMPI_EVLIST_SIGNAL:
|
||||||
TAILQ_INSERT_TAIL(&lam_signalqueue, ev, ev_signal_next);
|
TAILQ_INSERT_TAIL(&ompi_signalqueue, ev, ev_signal_next);
|
||||||
break;
|
break;
|
||||||
case LAM_EVLIST_TIMEOUT:
|
case OMPI_EVLIST_TIMEOUT:
|
||||||
lam_timeout_insert(ev);
|
ompi_timeout_insert(ev);
|
||||||
break;
|
break;
|
||||||
case LAM_EVLIST_INSERTED:
|
case OMPI_EVLIST_INSERTED:
|
||||||
TAILQ_INSERT_TAIL(&lam_eventqueue, ev, ev_next);
|
TAILQ_INSERT_TAIL(&ompi_eventqueue, ev, ev_next);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errx(1, "%s: unknown queue %x", __func__, queue);
|
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 */
|
/* 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;
|
ev->ev_res |= res;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -614,7 +614,7 @@ void lam_event_active_i(struct lam_event * ev, int res, short ncalls)
|
|||||||
ev->ev_res = res;
|
ev->ev_res = res;
|
||||||
ev->ev_ncalls = ncalls;
|
ev->ev_ncalls = ncalls;
|
||||||
ev->ev_pncalls = NULL;
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#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
|
include path from "src/". Also, config.h is a terrible
|
||||||
unqualified name for a header file. :-) */
|
unqualified name for a header file. :-) */
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
#endif
|
#endif
|
||||||
#include "threads/mutex.h"
|
#include "threads/mutex.h"
|
||||||
|
|
||||||
@ -49,23 +49,23 @@ extern "C" {
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LAM_EVLIST_TIMEOUT 0x01
|
#define OMPI_EVLIST_TIMEOUT 0x01
|
||||||
#define LAM_EVLIST_INSERTED 0x02
|
#define OMPI_EVLIST_INSERTED 0x02
|
||||||
#define LAM_EVLIST_SIGNAL 0x04
|
#define OMPI_EVLIST_SIGNAL 0x04
|
||||||
#define LAM_EVLIST_ACTIVE 0x08
|
#define OMPI_EVLIST_ACTIVE 0x08
|
||||||
#define LAM_EVLIST_INIT 0x80
|
#define OMPI_EVLIST_INIT 0x80
|
||||||
|
|
||||||
/* EVLIST_X_ Private space: 0x1000-0xf000 */
|
/* EVLIST_X_ Private space: 0x1000-0xf000 */
|
||||||
#define LAM_EVLIST_ALL (0xf000 | 0x8f)
|
#define OMPI_EVLIST_ALL (0xf000 | 0x8f)
|
||||||
|
|
||||||
#define LAM_EV_TIMEOUT 0x01
|
#define OMPI_EV_TIMEOUT 0x01
|
||||||
#define LAM_EV_READ 0x02
|
#define OMPI_EV_READ 0x02
|
||||||
#define LAM_EV_WRITE 0x04
|
#define OMPI_EV_WRITE 0x04
|
||||||
#define LAM_EV_SIGNAL 0x08
|
#define OMPI_EV_SIGNAL 0x08
|
||||||
#define LAM_EV_PERSIST 0x10 /* Persistant event */
|
#define OMPI_EV_PERSIST 0x10 /* Persistant event */
|
||||||
|
|
||||||
#ifndef LAM_EVENT_USE_SIGNALS
|
#ifndef OMPI_EVENT_USE_SIGNALS
|
||||||
#define LAM_EVENT_USE_SIGNALS 0
|
#define OMPI_EVENT_USE_SIGNALS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Fix so that ppl dont have to run with <sys/queue.h> */
|
/* Fix so that ppl dont have to run with <sys/queue.h> */
|
||||||
@ -88,11 +88,11 @@ struct { \
|
|||||||
}
|
}
|
||||||
#endif /* !RB_ENTRY */
|
#endif /* !RB_ENTRY */
|
||||||
|
|
||||||
struct lam_event {
|
struct ompi_event {
|
||||||
TAILQ_ENTRY (lam_event) ev_next;
|
TAILQ_ENTRY (ompi_event) ev_next;
|
||||||
TAILQ_ENTRY (lam_event) ev_active_next;
|
TAILQ_ENTRY (ompi_event) ev_active_next;
|
||||||
TAILQ_ENTRY (lam_event) ev_signal_next;
|
TAILQ_ENTRY (ompi_event) ev_signal_next;
|
||||||
RB_ENTRY (lam_event) ev_timeout_node;
|
RB_ENTRY (ompi_event) ev_timeout_node;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
HANDLE ev_fd;
|
HANDLE ev_fd;
|
||||||
@ -112,67 +112,67 @@ struct lam_event {
|
|||||||
int ev_res; /* result passed to event callback */
|
int ev_res; /* result passed to event callback */
|
||||||
int ev_flags;
|
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 OMPI_EVENT_SIGNAL(ev) (int)ev->ev_fd
|
||||||
#define LAM_EVENT_FD(ev) (int)ev->ev_fd
|
#define OMPI_EVENT_FD(ev) (int)ev->ev_fd
|
||||||
|
|
||||||
#ifdef _EVENT_DEFINED_TQENTRY
|
#ifdef _EVENT_DEFINED_TQENTRY
|
||||||
#undef TAILQ_ENTRY
|
#undef TAILQ_ENTRY
|
||||||
#undef _EVENT_DEFINED_TQENTRY
|
#undef _EVENT_DEFINED_TQENTRY
|
||||||
#else
|
#else
|
||||||
TAILQ_HEAD (lam_event_list, lam_event);
|
TAILQ_HEAD (ompi_event_list, ompi_event);
|
||||||
#endif /* _EVENT_DEFINED_TQENTRY */
|
#endif /* _EVENT_DEFINED_TQENTRY */
|
||||||
#ifdef _EVENT_DEFINED_RBENTRY
|
#ifdef _EVENT_DEFINED_RBENTRY
|
||||||
#undef RB_ENTRY
|
#undef RB_ENTRY
|
||||||
#undef _EVENT_DEFINED_RBENTRY
|
#undef _EVENT_DEFINED_RBENTRY
|
||||||
#endif /* _EVENT_DEFINED_RBENTRY */
|
#endif /* _EVENT_DEFINED_RBENTRY */
|
||||||
|
|
||||||
struct lam_eventop {
|
struct ompi_eventop {
|
||||||
char *name;
|
char *name;
|
||||||
void *(*init)(void);
|
void *(*init)(void);
|
||||||
int (*add)(void *, struct lam_event *);
|
int (*add)(void *, struct ompi_event *);
|
||||||
int (*del)(void *, struct lam_event *);
|
int (*del)(void *, struct ompi_event *);
|
||||||
int (*recalc)(void *, int);
|
int (*recalc)(void *, int);
|
||||||
int (*dispatch)(void *, struct timeval *);
|
int (*dispatch)(void *, struct timeval *);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LAM_TIMEOUT_DEFAULT {10, 0}
|
#define OMPI_TIMEOUT_DEFAULT {10, 0}
|
||||||
#define LAM_EVLOOP_ONCE 0x01
|
#define OMPI_EVLOOP_ONCE 0x01
|
||||||
#define LAM_EVLOOP_NONBLOCK 0x02
|
#define OMPI_EVLOOP_NONBLOCK 0x02
|
||||||
|
|
||||||
|
|
||||||
int lam_event_init(void);
|
int ompi_event_init(void);
|
||||||
int lam_event_dispatch(void);
|
int ompi_event_dispatch(void);
|
||||||
int lam_event_loop(int);
|
int ompi_event_loop(int);
|
||||||
|
|
||||||
#define lam_evtimer_add(ev, tv) lam_event_add(ev, tv)
|
#define ompi_evtimer_add(ev, tv) ompi_event_add(ev, tv)
|
||||||
#define lam_evtimer_set(ev, cb, arg) lam_event_set(ev, -1, 0, cb, arg)
|
#define ompi_evtimer_set(ev, cb, arg) ompi_event_set(ev, -1, 0, cb, arg)
|
||||||
#define lam_evtimer_del(ev) lam_event_del(ev)
|
#define ompi_evtimer_del(ev) ompi_event_del(ev)
|
||||||
#define lam_evtimer_pending(ev, tv) lam_event_pending(ev, LAM_EV_TIMEOUT, tv)
|
#define ompi_evtimer_pending(ev, tv) ompi_event_pending(ev, OMPI_EV_TIMEOUT, tv)
|
||||||
#define lam_evtimer_initialized(ev) (ev)->ev_flags & LAM_EVLIST_INIT)
|
#define ompi_evtimer_initialized(ev) (ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||||
|
|
||||||
#define lam_timeout_add(ev, tv) lam_event_add(ev, tv)
|
#define ompi_timeout_add(ev, tv) ompi_event_add(ev, tv)
|
||||||
#define lam_timeout_set(ev, cb, arg) lam_event_set(ev, -1, 0, cb, arg)
|
#define ompi_timeout_set(ev, cb, arg) ompi_event_set(ev, -1, 0, cb, arg)
|
||||||
#define lam_timeout_del(ev) lam_event_del(ev)
|
#define ompi_timeout_del(ev) ompi_event_del(ev)
|
||||||
#define lam_timeout_pending(ev, tv) lam_event_pending(ev, LAM_EV_TIMEOUT, tv)
|
#define ompi_timeout_pending(ev, tv) ompi_event_pending(ev, OMPI_EV_TIMEOUT, tv)
|
||||||
#define lam_timeout_initialized(ev) ((ev)->ev_flags & LAM_EVLIST_INIT)
|
#define ompi_timeout_initialized(ev) ((ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||||
|
|
||||||
#define lam_signal_add(ev, tv) lam_event_add(ev, tv)
|
#define ompi_signal_add(ev, tv) ompi_event_add(ev, tv)
|
||||||
#define lam_signal_set(ev, x, cb, arg) \
|
#define ompi_signal_set(ev, x, cb, arg) \
|
||||||
lam_event_set(ev, x, LAM_EV_SIGNAL|LAM_EV_PERSIST, cb, arg)
|
ompi_event_set(ev, x, OMPI_EV_SIGNAL|OMPI_EV_PERSIST, cb, arg)
|
||||||
#define lam_signal_del(ev) lam_event_del(ev)
|
#define ompi_signal_del(ev) ompi_event_del(ev)
|
||||||
#define lam_signal_pending(ev, tv) lam_event_pending(ev, LAM_EV_SIGNAL, tv)
|
#define ompi_signal_pending(ev, tv) ompi_event_pending(ev, OMPI_EV_SIGNAL, tv)
|
||||||
#define lam_signal_initialized(ev) ((ev)->ev_flags & LAM_EVLIST_INIT)
|
#define ompi_signal_initialized(ev) ((ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||||
|
|
||||||
/* for internal use only */
|
/* for internal use only */
|
||||||
int lam_event_add_i(struct lam_event *, struct timeval *);
|
int ompi_event_add_i(struct ompi_event *, struct timeval *);
|
||||||
int lam_event_del_i(struct lam_event *);
|
int ompi_event_del_i(struct ompi_event *);
|
||||||
void lam_event_active_i(struct lam_event*, int, short);
|
void ompi_event_active_i(struct ompi_event*, int, short);
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
static inline void
|
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)
|
void (*callback)(int, short, void *), void *arg)
|
||||||
{
|
{
|
||||||
ev->ev_callback = callback;
|
ev->ev_callback = callback;
|
||||||
@ -184,70 +184,70 @@ lam_event_set(struct lam_event *ev, int fd, short events,
|
|||||||
ev->ev_fd = fd;
|
ev->ev_fd = fd;
|
||||||
#endif
|
#endif
|
||||||
ev->ev_events = events;
|
ev->ev_events = events;
|
||||||
ev->ev_flags = LAM_EVLIST_INIT;
|
ev->ev_flags = OMPI_EVLIST_INIT;
|
||||||
ev->ev_ncalls = 0;
|
ev->ev_ncalls = 0;
|
||||||
ev->ev_pncalls = NULL;
|
ev->ev_pncalls = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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;
|
int rc;
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_lock(&lam_event_lock);
|
ompi_mutex_lock(&ompi_event_lock);
|
||||||
rc = lam_event_add_i(ev, tv);
|
rc = ompi_event_add_i(ev, tv);
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
} else {
|
} else {
|
||||||
rc = lam_event_add_i(ev, tv);
|
rc = ompi_event_add_i(ev, tv);
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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;
|
int rc;
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_lock(&lam_event_lock);
|
ompi_mutex_lock(&ompi_event_lock);
|
||||||
rc = lam_event_del_i(ev);
|
rc = ompi_event_del_i(ev);
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
} else {
|
} else {
|
||||||
rc = lam_event_del_i(ev);
|
rc = ompi_event_del_i(ev);
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
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;
|
extern ompi_mutex_t ompi_event_lock;
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_lock(&lam_event_lock);
|
ompi_mutex_lock(&ompi_event_lock);
|
||||||
lam_event_active_i(ev, res, ncalls);
|
ompi_event_active_i(ev, res, ncalls);
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
} else {
|
} else {
|
||||||
lam_event_active_i(ev, res, ncalls);
|
ompi_event_active_i(ev, res, ncalls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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;
|
int flags = 0;
|
||||||
|
|
||||||
if (ev->ev_flags & LAM_EVLIST_INSERTED)
|
if (ev->ev_flags & OMPI_EVLIST_INSERTED)
|
||||||
flags |= (ev->ev_events & (LAM_EV_READ|LAM_EV_WRITE));
|
flags |= (ev->ev_events & (OMPI_EV_READ|OMPI_EV_WRITE));
|
||||||
if (ev->ev_flags & LAM_EVLIST_ACTIVE)
|
if (ev->ev_flags & OMPI_EVLIST_ACTIVE)
|
||||||
flags |= ev->ev_res;
|
flags |= ev->ev_res;
|
||||||
if (ev->ev_flags & LAM_EVLIST_TIMEOUT)
|
if (ev->ev_flags & OMPI_EVLIST_TIMEOUT)
|
||||||
flags |= LAM_EV_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 */
|
/* 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;
|
*tv = ev->ev_timeout;
|
||||||
|
|
||||||
return (flags & event);
|
return (flags & event);
|
||||||
@ -255,9 +255,9 @@ lam_event_pending(struct lam_event *ev, short event, struct timeval *tv)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#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
|
#else
|
||||||
#define lam_event_initialized(ev) ((ev)->ev_flags & LAM_EVLIST_INIT)
|
#define ompi_event_initialized(ev) ((ev)->ev_flags & OMPI_EVLIST_INIT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -27,11 +27,11 @@
|
|||||||
#ifndef _EVSIGNAL_H_
|
#ifndef _EVSIGNAL_H_
|
||||||
#define _EVSIGNAL_H_
|
#define _EVSIGNAL_H_
|
||||||
|
|
||||||
void lam_evsignal_init(sigset_t *);
|
void ompi_evsignal_init(sigset_t *);
|
||||||
void lam_evsignal_process(void);
|
void ompi_evsignal_process(void);
|
||||||
int lam_evsignal_recalc(sigset_t *);
|
int ompi_evsignal_recalc(sigset_t *);
|
||||||
int lam_evsignal_deliver(sigset_t *);
|
int ompi_evsignal_deliver(sigset_t *);
|
||||||
int lam_evsignal_add(sigset_t *, struct lam_event *);
|
int ompi_evsignal_add(sigset_t *, struct ompi_event *);
|
||||||
int lam_evsignal_del(sigset_t *, struct lam_event *);
|
int ompi_evsignal_del(sigset_t *, struct ompi_event *);
|
||||||
|
|
||||||
#endif /* _EVSIGNAL_H_ */
|
#endif /* _EVSIGNAL_H_ */
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
@ -66,7 +66,7 @@
|
|||||||
extern struct event_list timequeue;
|
extern struct event_list timequeue;
|
||||||
extern struct event_list eventqueue;
|
extern struct event_list eventqueue;
|
||||||
extern struct event_list addqueue;
|
extern struct event_list addqueue;
|
||||||
extern lam_mutex_t lam_event_lock;
|
extern ompi_mutex_t ompi_event_lock;
|
||||||
|
|
||||||
#define EVLIST_X_KQINKERNEL 0x1000
|
#define EVLIST_X_KQINKERNEL 0x1000
|
||||||
|
|
||||||
@ -81,13 +81,13 @@ struct kqop {
|
|||||||
} kqueueop;
|
} kqueueop;
|
||||||
|
|
||||||
static void *kq_init (void);
|
static void *kq_init (void);
|
||||||
static int kq_add (void *, struct lam_event *);
|
static int kq_add (void *, struct ompi_event *);
|
||||||
static int kq_del (void *, struct lam_event *);
|
static int kq_del (void *, struct ompi_event *);
|
||||||
static int kq_recalc (void *, int);
|
static int kq_recalc (void *, int);
|
||||||
static int kq_dispatch (void *, struct timeval *);
|
static int kq_dispatch (void *, struct timeval *);
|
||||||
static int kq_insert (struct kqop *, struct kevent *);
|
static int kq_insert (struct kqop *, struct kevent *);
|
||||||
|
|
||||||
const struct lam_eventop lam_kqops = {
|
const struct ompi_eventop ompi_kqops = {
|
||||||
"kqueue",
|
"kqueue",
|
||||||
kq_init,
|
kq_init,
|
||||||
kq_add,
|
kq_add,
|
||||||
@ -193,18 +193,18 @@ kq_dispatch(void *arg, struct timeval *tv)
|
|||||||
struct kqop *kqop = arg;
|
struct kqop *kqop = arg;
|
||||||
struct kevent *changes = kqop->changes;
|
struct kevent *changes = kqop->changes;
|
||||||
struct kevent *events = kqop->events;
|
struct kevent *events = kqop->events;
|
||||||
struct lam_event *ev;
|
struct ompi_event *ev;
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
int i, res;
|
int i, res;
|
||||||
|
|
||||||
TIMEVAL_TO_TIMESPEC(tv, &ts);
|
TIMEVAL_TO_TIMESPEC(tv, &ts);
|
||||||
|
|
||||||
/* release lock while waiting in kernel */
|
/* release lock while waiting in kernel */
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
res = kevent(kqop->kq, changes, kqop->nchanges,
|
res = kevent(kqop->kq, changes, kqop->nchanges,
|
||||||
events, kqop->nevents, &ts);
|
events, kqop->nevents, &ts);
|
||||||
lam_mutex_lock(&lam_event_lock);
|
ompi_mutex_lock(&ompi_event_lock);
|
||||||
} else {
|
} else {
|
||||||
res = kevent(kqop->kq, changes, kqop->nchanges,
|
res = kevent(kqop->kq, changes, kqop->nchanges,
|
||||||
events, kqop->nevents, &ts);
|
events, kqop->nevents, &ts);
|
||||||
@ -242,26 +242,26 @@ kq_dispatch(void *arg, struct timeval *tv)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = (struct lam_event *)events[i].udata;
|
ev = (struct ompi_event *)events[i].udata;
|
||||||
|
|
||||||
if (events[i].filter == EVFILT_READ) {
|
if (events[i].filter == EVFILT_READ) {
|
||||||
which |= LAM_EV_READ;
|
which |= OMPI_EV_READ;
|
||||||
} else if (events[i].filter == EVFILT_WRITE) {
|
} else if (events[i].filter == EVFILT_WRITE) {
|
||||||
which |= LAM_EV_WRITE;
|
which |= OMPI_EV_WRITE;
|
||||||
} else if (events[i].filter == EVFILT_SIGNAL) {
|
} else if (events[i].filter == EVFILT_SIGNAL) {
|
||||||
which |= LAM_EV_SIGNAL;
|
which |= OMPI_EV_SIGNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!which)
|
if (!which)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(ev->ev_events & LAM_EV_PERSIST)) {
|
if (!(ev->ev_events & OMPI_EV_PERSIST)) {
|
||||||
ev->ev_flags &= ~EVLIST_X_KQINKERNEL;
|
ev->ev_flags &= ~EVLIST_X_KQINKERNEL;
|
||||||
lam_event_del_i(ev);
|
ompi_event_del_i(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
lam_event_active_i(ev, which,
|
ompi_event_active_i(ev, which,
|
||||||
ev->ev_events & LAM_EV_SIGNAL ? events[i].data : 1);
|
ev->ev_events & OMPI_EV_SIGNAL ? events[i].data : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -269,19 +269,19 @@ kq_dispatch(void *arg, struct timeval *tv)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
kq_add(void *arg, struct lam_event *ev)
|
kq_add(void *arg, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
struct kqop *kqop = arg;
|
struct kqop *kqop = arg;
|
||||||
struct kevent kev;
|
struct kevent kev;
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_SIGNAL) {
|
if (ev->ev_events & OMPI_EV_SIGNAL) {
|
||||||
int nsignal = LAM_EVENT_SIGNAL(ev);
|
int nsignal = OMPI_EVENT_SIGNAL(ev);
|
||||||
|
|
||||||
memset(&kev, 0, sizeof(kev));
|
memset(&kev, 0, sizeof(kev));
|
||||||
kev.ident = nsignal;
|
kev.ident = nsignal;
|
||||||
kev.filter = EVFILT_SIGNAL;
|
kev.filter = EVFILT_SIGNAL;
|
||||||
kev.flags = EV_ADD;
|
kev.flags = EV_ADD;
|
||||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||||
kev.flags |= EV_ONESHOT;
|
kev.flags |= EV_ONESHOT;
|
||||||
kev.udata = (void *) INTPTR(ev);
|
kev.udata = (void *) INTPTR(ev);
|
||||||
|
|
||||||
@ -295,12 +295,12 @@ kq_add(void *arg, struct lam_event *ev)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_READ) {
|
if (ev->ev_events & OMPI_EV_READ) {
|
||||||
memset(&kev, 0, sizeof(kev));
|
memset(&kev, 0, sizeof(kev));
|
||||||
kev.ident = ev->ev_fd;
|
kev.ident = ev->ev_fd;
|
||||||
kev.filter = EVFILT_READ;
|
kev.filter = EVFILT_READ;
|
||||||
kev.flags = EV_ADD;
|
kev.flags = EV_ADD;
|
||||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||||
kev.flags |= EV_ONESHOT;
|
kev.flags |= EV_ONESHOT;
|
||||||
kev.udata = (void *) INTPTR(ev);
|
kev.udata = (void *) INTPTR(ev);
|
||||||
|
|
||||||
@ -310,12 +310,12 @@ kq_add(void *arg, struct lam_event *ev)
|
|||||||
ev->ev_flags |= EVLIST_X_KQINKERNEL;
|
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));
|
memset(&kev, 0, sizeof(kev));
|
||||||
kev.ident = ev->ev_fd;
|
kev.ident = ev->ev_fd;
|
||||||
kev.filter = EVFILT_WRITE;
|
kev.filter = EVFILT_WRITE;
|
||||||
kev.flags = EV_ADD;
|
kev.flags = EV_ADD;
|
||||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||||
kev.flags |= EV_ONESHOT;
|
kev.flags |= EV_ONESHOT;
|
||||||
kev.udata = (void *) INTPTR(ev);
|
kev.udata = (void *) INTPTR(ev);
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ kq_add(void *arg, struct lam_event *ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
kq_del(void *arg, struct lam_event *ev)
|
kq_del(void *arg, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
struct kqop *kqop = arg;
|
struct kqop *kqop = arg;
|
||||||
struct kevent kev;
|
struct kevent kev;
|
||||||
@ -337,8 +337,8 @@ kq_del(void *arg, struct lam_event *ev)
|
|||||||
if (!(ev->ev_flags & EVLIST_X_KQINKERNEL))
|
if (!(ev->ev_flags & EVLIST_X_KQINKERNEL))
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_SIGNAL) {
|
if (ev->ev_events & OMPI_EV_SIGNAL) {
|
||||||
int nsignal = LAM_EVENT_SIGNAL(ev);
|
int nsignal = OMPI_EVENT_SIGNAL(ev);
|
||||||
|
|
||||||
memset(&kev, 0, sizeof(kev));
|
memset(&kev, 0, sizeof(kev));
|
||||||
kev.ident = (int)signal;
|
kev.ident = (int)signal;
|
||||||
@ -355,7 +355,7 @@ kq_del(void *arg, struct lam_event *ev)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->ev_events & LAM_EV_READ) {
|
if (ev->ev_events & OMPI_EV_READ) {
|
||||||
memset(&kev, 0, sizeof(kev));
|
memset(&kev, 0, sizeof(kev));
|
||||||
kev.ident = ev->ev_fd;
|
kev.ident = ev->ev_fd;
|
||||||
kev.filter = EVFILT_READ;
|
kev.filter = EVFILT_READ;
|
||||||
@ -367,7 +367,7 @@ kq_del(void *arg, struct lam_event *ev)
|
|||||||
ev->ev_flags &= ~EVLIST_X_KQINKERNEL;
|
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));
|
memset(&kev, 0, sizeof(kev));
|
||||||
kev.ident = ev->ev_fd;
|
kev.ident = ev->ev_fd;
|
||||||
kev.filter = EVFILT_WRITE;
|
kev.filter = EVFILT_WRITE;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
@ -52,32 +52,32 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
#include "evsignal.h"
|
#include "evsignal.h"
|
||||||
#endif
|
#endif
|
||||||
#include "threads/mutex.h"
|
#include "threads/mutex.h"
|
||||||
|
|
||||||
|
|
||||||
extern struct lam_event_list lam_eventqueue;
|
extern struct ompi_event_list ompi_eventqueue;
|
||||||
extern volatile sig_atomic_t lam_evsignal_caught;
|
extern volatile sig_atomic_t ompi_evsignal_caught;
|
||||||
extern lam_mutex_t lam_event_lock;
|
extern ompi_mutex_t ompi_event_lock;
|
||||||
|
|
||||||
struct pollop {
|
struct pollop {
|
||||||
int event_count; /* Highest number alloc */
|
int event_count; /* Highest number alloc */
|
||||||
struct pollfd *event_set;
|
struct pollfd *event_set;
|
||||||
struct lam_event **event_back;
|
struct ompi_event **event_back;
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
sigset_t evsigmask;
|
sigset_t evsigmask;
|
||||||
#endif
|
#endif
|
||||||
} pollop;
|
} pollop;
|
||||||
|
|
||||||
static void *poll_init (void);
|
static void *poll_init (void);
|
||||||
static int poll_add (void *, struct lam_event *);
|
static int poll_add (void *, struct ompi_event *);
|
||||||
static int poll_del (void *, struct lam_event *);
|
static int poll_del (void *, struct ompi_event *);
|
||||||
static int poll_recalc (void *, int);
|
static int poll_recalc (void *, int);
|
||||||
static int poll_dispatch (void *, struct timeval *);
|
static int poll_dispatch (void *, struct timeval *);
|
||||||
|
|
||||||
const struct lam_eventop lam_pollops = {
|
const struct ompi_eventop ompi_pollops = {
|
||||||
"poll",
|
"poll",
|
||||||
poll_init,
|
poll_init,
|
||||||
poll_add,
|
poll_add,
|
||||||
@ -94,8 +94,8 @@ poll_init(void)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
memset(&pollop, 0, sizeof(pollop));
|
memset(&pollop, 0, sizeof(pollop));
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
lam_evsignal_init(&pollop.evsigmask);
|
ompi_evsignal_init(&pollop.evsigmask);
|
||||||
#endif
|
#endif
|
||||||
return (&pollop);
|
return (&pollop);
|
||||||
}
|
}
|
||||||
@ -108,9 +108,9 @@ poll_init(void)
|
|||||||
static int
|
static int
|
||||||
poll_recalc(void *arg, int max)
|
poll_recalc(void *arg, int max)
|
||||||
{
|
{
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
struct pollop *pop = arg;
|
struct pollop *pop = arg;
|
||||||
return (lam_evsignal_recalc(&pop->evsigmask));
|
return (ompi_evsignal_recalc(&pop->evsigmask));
|
||||||
#else
|
#else
|
||||||
return (0);
|
return (0);
|
||||||
#endif
|
#endif
|
||||||
@ -120,12 +120,12 @@ static int
|
|||||||
poll_dispatch(void *arg, struct timeval *tv)
|
poll_dispatch(void *arg, struct timeval *tv)
|
||||||
{
|
{
|
||||||
int res, i, count, sec, nfds;
|
int res, i, count, sec, nfds;
|
||||||
struct lam_event *ev;
|
struct ompi_event *ev;
|
||||||
struct pollop *pop = arg;
|
struct pollop *pop = arg;
|
||||||
|
|
||||||
count = pop->event_count;
|
count = pop->event_count;
|
||||||
nfds = 0;
|
nfds = 0;
|
||||||
TAILQ_FOREACH(ev, &lam_eventqueue, ev_next) {
|
TAILQ_FOREACH(ev, &ompi_eventqueue, ev_next) {
|
||||||
if (nfds + 1 >= count) {
|
if (nfds + 1 >= count) {
|
||||||
if (count < 256)
|
if (count < 256)
|
||||||
count = 256;
|
count = 256;
|
||||||
@ -140,14 +140,14 @@ poll_dispatch(void *arg, struct timeval *tv)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
pop->event_back = realloc(pop->event_back,
|
pop->event_back = realloc(pop->event_back,
|
||||||
count * sizeof(struct lam_event *));
|
count * sizeof(struct ompi_event *));
|
||||||
if (pop->event_back == NULL) {
|
if (pop->event_back == NULL) {
|
||||||
log_error("realloc");
|
log_error("realloc");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
pop->event_count = count;
|
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];
|
struct pollfd *pfd = &pop->event_set[nfds];
|
||||||
pfd->fd = ev->ev_fd;
|
pfd->fd = ev->ev_fd;
|
||||||
pfd->events = POLLOUT;
|
pfd->events = POLLOUT;
|
||||||
@ -157,7 +157,7 @@ poll_dispatch(void *arg, struct timeval *tv)
|
|||||||
|
|
||||||
nfds++;
|
nfds++;
|
||||||
}
|
}
|
||||||
if (ev->ev_events & LAM_EV_READ) {
|
if (ev->ev_events & OMPI_EV_READ) {
|
||||||
struct pollfd *pfd = &pop->event_set[nfds];
|
struct pollfd *pfd = &pop->event_set[nfds];
|
||||||
|
|
||||||
pfd->fd = ev->ev_fd;
|
pfd->fd = ev->ev_fd;
|
||||||
@ -170,22 +170,22 @@ poll_dispatch(void *arg, struct timeval *tv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
if (lam_evsignal_deliver(&pop->evsigmask) == -1)
|
if (ompi_evsignal_deliver(&pop->evsigmask) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
|
sec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
res = poll(pop->event_set, nfds, sec);
|
res = poll(pop->event_set, nfds, sec);
|
||||||
lam_mutex_lock(&lam_event_lock);
|
ompi_mutex_lock(&ompi_event_lock);
|
||||||
} else {
|
} else {
|
||||||
res = poll(pop->event_set, nfds, sec);
|
res = poll(pop->event_set, nfds, sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
if (lam_evsignal_recalc(&pop->evsigmask) == -1)
|
if (ompi_evsignal_recalc(&pop->evsigmask) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -195,15 +195,15 @@ poll_dispatch(void *arg, struct timeval *tv)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
lam_evsignal_process();
|
ompi_evsignal_process();
|
||||||
#endif
|
#endif
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
else if (lam_evsignal_caught)
|
else if (ompi_evsignal_caught)
|
||||||
lam_evsignal_process();
|
ompi_evsignal_process();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOG_DBG((LOG_MISC, 80, "%s: poll reports %d", __func__, res));
|
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)
|
if (what & POLLERR)
|
||||||
what |= POLLIN|POLLOUT;
|
what |= POLLIN|POLLOUT;
|
||||||
if (what & POLLIN)
|
if (what & POLLIN)
|
||||||
res |= LAM_EV_READ;
|
res |= OMPI_EV_READ;
|
||||||
if (what & POLLOUT)
|
if (what & POLLOUT)
|
||||||
res |= LAM_EV_WRITE;
|
res |= OMPI_EV_WRITE;
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -232,9 +232,9 @@ poll_dispatch(void *arg, struct timeval *tv)
|
|||||||
res &= ev->ev_events;
|
res &= ev->ev_events;
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||||
lam_event_del_i(ev);
|
ompi_event_del_i(ev);
|
||||||
lam_event_active_i(ev, res, 1);
|
ompi_event_active_i(ev, res, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,12 +242,12 @@ poll_dispatch(void *arg, struct timeval *tv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
struct pollop *pop = arg;
|
||||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||||
return (lam_evsignal_add(&pop->evsigmask, ev));
|
return (ompi_evsignal_add(&pop->evsigmask, ev));
|
||||||
#endif
|
#endif
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -257,15 +257,15 @@ poll_add(void *arg, struct lam_event *ev)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
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;
|
struct pollop *pop = arg;
|
||||||
#endif
|
#endif
|
||||||
if (!(ev->ev_events & LAM_EV_SIGNAL))
|
if (!(ev->ev_events & OMPI_EV_SIGNAL))
|
||||||
return (0);
|
return (0);
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
return (lam_evsignal_del(&pop->evsigmask, ev));
|
return (ompi_evsignal_del(&pop->evsigmask, ev));
|
||||||
#else
|
#else
|
||||||
return (0);
|
return (0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
/* Enable F_SETSIG and F_SETOWN */
|
/* Enable F_SETSIG and F_SETOWN */
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
@ -123,7 +123,7 @@ static int rtsig_del(void *, struct event *);
|
|||||||
static int rtsig_recalc(void *, int);
|
static int rtsig_recalc(void *, int);
|
||||||
static int rtsig_dispatch(void *, struct timeval *);
|
static int rtsig_dispatch(void *, struct timeval *);
|
||||||
|
|
||||||
struct lam_eventop rtsigops = {
|
struct ompi_eventop rtsigops = {
|
||||||
"rtsig",
|
"rtsig",
|
||||||
rtsig_init,
|
rtsig_init,
|
||||||
rtsig_add,
|
rtsig_add,
|
||||||
|
@ -25,13 +25,13 @@ fifo_read(int fd, short event, void *arg)
|
|||||||
{
|
{
|
||||||
char buf[255];
|
char buf[255];
|
||||||
int len;
|
int len;
|
||||||
struct lam_event *ev = arg;
|
struct ompi_event *ev = arg;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
DWORD dwBytesRead;
|
DWORD dwBytesRead;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reschedule this event */
|
/* 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",
|
fprintf(stderr, "fifo_read called with fd: %d, event: %d, arg: %p\n",
|
||||||
fd, event, arg);
|
fd, event, arg);
|
||||||
@ -41,7 +41,7 @@ fifo_read(int fd, short event, void *arg)
|
|||||||
// Check for end of file.
|
// Check for end of file.
|
||||||
if(len && dwBytesRead == 0) {
|
if(len && dwBytesRead == 0) {
|
||||||
fprintf(stderr, "End Of File");
|
fprintf(stderr, "End Of File");
|
||||||
lam_event_del(ev);
|
ompi_event_del(ev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ fifo_read(int fd, short event, void *arg)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct lam_event evfifo;
|
struct ompi_event evfifo;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
HANDLE socket;
|
HANDLE socket;
|
||||||
// Open a file.
|
// Open a file.
|
||||||
@ -114,19 +114,19 @@ main (int argc, char **argv)
|
|||||||
fprintf(stderr, "Write data to %s\n", fifo);
|
fprintf(stderr, "Write data to %s\n", fifo);
|
||||||
#endif
|
#endif
|
||||||
/* Initalize the event library */
|
/* Initalize the event library */
|
||||||
lam_event_init();
|
ompi_event_init();
|
||||||
|
|
||||||
/* Initalize one event */
|
/* Initalize one event */
|
||||||
#ifdef WIN32
|
#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
|
#else
|
||||||
lam_event_set(&evfifo, socket, LAM_EV_READ, fifo_read, &evfifo);
|
ompi_event_set(&evfifo, socket, OMPI_EV_READ, fifo_read, &evfifo);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add it to the active events, without a timeout */
|
/* 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
|
#ifdef WIN32
|
||||||
CloseHandle(socket);
|
CloseHandle(socket);
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,12 +26,12 @@ int called = 0;
|
|||||||
void
|
void
|
||||||
signal_cb(int fd, short event, void *arg)
|
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)
|
if (called >= 2)
|
||||||
lam_event_del(signal);
|
ompi_event_del(signal);
|
||||||
|
|
||||||
called++;
|
called++;
|
||||||
}
|
}
|
||||||
@ -39,18 +39,18 @@ signal_cb(int fd, short event, void *arg)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct lam_event signal_int;
|
struct ompi_event signal_int;
|
||||||
|
|
||||||
/* Initalize the event library */
|
/* Initalize the event library */
|
||||||
lam_event_init();
|
ompi_event_init();
|
||||||
|
|
||||||
/* Initalize one event */
|
/* 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);
|
&signal_int);
|
||||||
|
|
||||||
lam_event_add(&signal_int, NULL);
|
ompi_event_add(&signal_int, NULL);
|
||||||
|
|
||||||
lam_event_dispatch();
|
ompi_event_dispatch();
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ void
|
|||||||
timeout_cb(int fd, short event, void *arg)
|
timeout_cb(int fd, short event, void *arg)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct lam_event *timeout = arg;
|
struct ompi_event *timeout = arg;
|
||||||
int newtime = time(NULL);
|
int newtime = time(NULL);
|
||||||
|
|
||||||
printf("%s: called at %d: %d\n", __func__, newtime,
|
printf("%s: called at %d: %d\n", __func__, newtime,
|
||||||
@ -35,28 +35,28 @@ timeout_cb(int fd, short event, void *arg)
|
|||||||
|
|
||||||
timerclear(&tv);
|
timerclear(&tv);
|
||||||
tv.tv_sec = 2;
|
tv.tv_sec = 2;
|
||||||
lam_event_add(timeout, &tv);
|
ompi_event_add(timeout, &tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct lam_event timeout;
|
struct ompi_event timeout;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
/* Initalize the event library */
|
/* Initalize the event library */
|
||||||
lam_event_init();
|
ompi_event_init();
|
||||||
|
|
||||||
/* Initalize one event */
|
/* Initalize one event */
|
||||||
lam_evtimer_set(&timeout, timeout_cb, &timeout);
|
ompi_evtimer_set(&timeout, timeout_cb, &timeout);
|
||||||
|
|
||||||
timerclear(&tv);
|
timerclear(&tv);
|
||||||
tv.tv_sec = 2;
|
tv.tv_sec = 2;
|
||||||
lam_event_add(&timeout, &tv);
|
ompi_event_add(&timeout, &tv);
|
||||||
|
|
||||||
lasttime = time(NULL);
|
lasttime = time(NULL);
|
||||||
|
|
||||||
lam_event_dispatch();
|
ompi_event_dispatch();
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
#include "util/output.h"
|
#include "util/output.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -55,14 +55,14 @@
|
|||||||
#include "evsignal.h"
|
#include "evsignal.h"
|
||||||
#include "threads/mutex.h"
|
#include "threads/mutex.h"
|
||||||
|
|
||||||
extern struct lam_event_list lam_eventqueue;
|
extern struct ompi_event_list ompi_eventqueue;
|
||||||
extern lam_mutex_t lam_event_lock;
|
extern ompi_mutex_t ompi_event_lock;
|
||||||
|
|
||||||
#ifndef howmany
|
#ifndef howmany
|
||||||
#define howmany(x, y) (((x)+((y)-1))/(y))
|
#define howmany(x, y) (((x)+((y)-1))/(y))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern volatile sig_atomic_t lam_evsignal_caught;
|
extern volatile sig_atomic_t ompi_evsignal_caught;
|
||||||
|
|
||||||
struct selectop {
|
struct selectop {
|
||||||
int event_fds; /* Highest fd in fd set */
|
int event_fds; /* Highest fd in fd set */
|
||||||
@ -73,12 +73,12 @@ struct selectop {
|
|||||||
} sop;
|
} sop;
|
||||||
|
|
||||||
static void *select_init (void);
|
static void *select_init (void);
|
||||||
static int select_add (void *, struct lam_event *);
|
static int select_add (void *, struct ompi_event *);
|
||||||
static int select_del (void *, struct lam_event *);
|
static int select_del (void *, struct ompi_event *);
|
||||||
static int select_recalc (void *, int);
|
static int select_recalc (void *, int);
|
||||||
static int select_dispatch (void *, struct timeval *);
|
static int select_dispatch (void *, struct timeval *);
|
||||||
|
|
||||||
const struct lam_eventop lam_selectops = {
|
const struct ompi_eventop ompi_selectops = {
|
||||||
"select",
|
"select",
|
||||||
select_init,
|
select_init,
|
||||||
select_add,
|
select_add,
|
||||||
@ -94,7 +94,7 @@ select_init(void)
|
|||||||
if (getenv("EVENT_NOSELECT"))
|
if (getenv("EVENT_NOSELECT"))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
memset(&sop, 0, sizeof(sop));
|
memset(&sop, 0, sizeof(sop));
|
||||||
lam_evsignal_init(&sop.evsigmask);
|
ompi_evsignal_init(&sop.evsigmask);
|
||||||
return (&sop);
|
return (&sop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,14 +108,14 @@ select_recalc(void *arg, int max)
|
|||||||
{
|
{
|
||||||
struct selectop *sop = arg;
|
struct selectop *sop = arg;
|
||||||
fd_set *readset, *writeset;
|
fd_set *readset, *writeset;
|
||||||
struct lam_event *ev;
|
struct ompi_event *ev;
|
||||||
int fdsz;
|
int fdsz;
|
||||||
|
|
||||||
if (sop->event_fds < max)
|
if (sop->event_fds < max)
|
||||||
sop->event_fds = max;
|
sop->event_fds = max;
|
||||||
|
|
||||||
if (!sop->event_fds) {
|
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)
|
if (ev->ev_fd > sop->event_fds)
|
||||||
sop->event_fds = ev->ev_fd;
|
sop->event_fds = ev->ev_fd;
|
||||||
}
|
}
|
||||||
@ -142,8 +142,8 @@ select_recalc(void *arg, int max)
|
|||||||
sop->event_writeset = writeset;
|
sop->event_writeset = writeset;
|
||||||
sop->event_fdsz = fdsz;
|
sop->event_fdsz = fdsz;
|
||||||
}
|
}
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
return (lam_evsignal_recalc(&sop->evsigmask));
|
return (ompi_evsignal_recalc(&sop->evsigmask));
|
||||||
#else
|
#else
|
||||||
return (0);
|
return (0);
|
||||||
#endif
|
#endif
|
||||||
@ -153,37 +153,37 @@ static int
|
|||||||
select_dispatch(void *arg, struct timeval *tv)
|
select_dispatch(void *arg, struct timeval *tv)
|
||||||
{
|
{
|
||||||
int maxfd, res;
|
int maxfd, res;
|
||||||
struct lam_event *ev, *next;
|
struct ompi_event *ev, *next;
|
||||||
struct selectop *sop = arg;
|
struct selectop *sop = arg;
|
||||||
|
|
||||||
memset(sop->event_readset, 0, sop->event_fdsz);
|
memset(sop->event_readset, 0, sop->event_fdsz);
|
||||||
memset(sop->event_writeset, 0, sop->event_fdsz);
|
memset(sop->event_writeset, 0, sop->event_fdsz);
|
||||||
|
|
||||||
TAILQ_FOREACH(ev, &lam_eventqueue, ev_next) {
|
TAILQ_FOREACH(ev, &ompi_eventqueue, ev_next) {
|
||||||
if (ev->ev_events & LAM_EV_WRITE)
|
if (ev->ev_events & OMPI_EV_WRITE)
|
||||||
FD_SET(ev->ev_fd, sop->event_writeset);
|
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);
|
FD_SET(ev->ev_fd, sop->event_readset);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
if (lam_evsignal_deliver(&sop->evsigmask) == -1)
|
if (ompi_evsignal_deliver(&sop->evsigmask) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* release lock while waiting in kernel */
|
/* release lock while waiting in kernel */
|
||||||
if(lam_using_threads()) {
|
if(ompi_using_threads()) {
|
||||||
lam_mutex_unlock(&lam_event_lock);
|
ompi_mutex_unlock(&ompi_event_lock);
|
||||||
res = select(sop->event_fds + 1, sop->event_readset,
|
res = select(sop->event_fds + 1, sop->event_readset,
|
||||||
sop->event_writeset, NULL, tv);
|
sop->event_writeset, NULL, tv);
|
||||||
lam_mutex_lock(&lam_event_lock);
|
ompi_mutex_lock(&ompi_event_lock);
|
||||||
} else {
|
} else {
|
||||||
res = select(sop->event_fds + 1, sop->event_readset,
|
res = select(sop->event_fds + 1, sop->event_readset,
|
||||||
sop->event_writeset, NULL, tv);
|
sop->event_writeset, NULL, tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
if (lam_evsignal_recalc(&sop->evsigmask) == -1)
|
if (ompi_evsignal_recalc(&sop->evsigmask) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -193,30 +193,30 @@ select_dispatch(void *arg, struct timeval *tv)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
lam_evsignal_process();
|
ompi_evsignal_process();
|
||||||
#endif
|
#endif
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
else if (lam_evsignal_caught)
|
else if (ompi_evsignal_caught)
|
||||||
lam_evsignal_process();
|
ompi_evsignal_process();
|
||||||
#endif
|
#endif
|
||||||
maxfd = 0;
|
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);
|
next = TAILQ_NEXT(ev, ev_next);
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
if (FD_ISSET(ev->ev_fd, sop->event_readset))
|
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))
|
if (FD_ISSET(ev->ev_fd, sop->event_writeset))
|
||||||
res |= LAM_EV_WRITE;
|
res |= OMPI_EV_WRITE;
|
||||||
res &= ev->ev_events;
|
res &= ev->ev_events;
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||||
lam_event_del_i(ev);
|
ompi_event_del_i(ev);
|
||||||
lam_event_active_i(ev, res, 1);
|
ompi_event_active_i(ev, res, 1);
|
||||||
}
|
}
|
||||||
if (ev->ev_fd > maxfd)
|
if (ev->ev_fd > maxfd)
|
||||||
maxfd = ev->ev_fd;
|
maxfd = ev->ev_fd;
|
||||||
@ -228,13 +228,13 @@ select_dispatch(void *arg, struct timeval *tv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
select_add(void *arg, struct lam_event *ev)
|
select_add(void *arg, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
struct selectop *sop = arg;
|
struct selectop *sop = arg;
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
if (ev->ev_events & LAM_EV_SIGNAL)
|
if (ev->ev_events & OMPI_EV_SIGNAL)
|
||||||
return (lam_evsignal_add(&sop->evsigmask, ev));
|
return (ompi_evsignal_add(&sop->evsigmask, ev));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -252,15 +252,15 @@ select_add(void *arg, struct lam_event *ev)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
select_del(void *arg, struct lam_event *ev)
|
select_del(void *arg, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
struct selectop *sop = arg;
|
struct selectop *sop = arg;
|
||||||
|
|
||||||
if (!(ev->ev_events & LAM_EV_SIGNAL))
|
if (!(ev->ev_events & OMPI_EV_SIGNAL))
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
#if LAM_EVENT_USE_SIGNALS
|
#if OMPI_EVENT_USE_SIGNALS
|
||||||
return (lam_evsignal_del(&sop->evsigmask, ev));
|
return (ompi_evsignal_del(&sop->evsigmask, ev));
|
||||||
#else
|
#else
|
||||||
return (0);
|
return (0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "lam_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
@ -53,28 +53,28 @@
|
|||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "evsignal.h"
|
#include "evsignal.h"
|
||||||
|
|
||||||
extern struct lam_event_list lam_signalqueue;
|
extern struct ompi_event_list ompi_signalqueue;
|
||||||
|
|
||||||
static short lam_evsigcaught[NSIG];
|
static short ompi_evsigcaught[NSIG];
|
||||||
static int lam_needrecalc;
|
static int ompi_needrecalc;
|
||||||
volatile sig_atomic_t lam_evsignal_caught = 0;
|
volatile sig_atomic_t ompi_evsignal_caught = 0;
|
||||||
|
|
||||||
void lam_evsignal_handler(int sig);
|
void ompi_evsignal_handler(int sig);
|
||||||
|
|
||||||
void
|
void
|
||||||
lam_evsignal_init(sigset_t *evsigmask)
|
ompi_evsignal_init(sigset_t *evsigmask)
|
||||||
{
|
{
|
||||||
sigemptyset(evsigmask);
|
sigemptyset(evsigmask);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_evsignal_add(sigset_t *evsigmask, struct lam_event *ev)
|
ompi_evsignal_add(sigset_t *evsigmask, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
int evsignal;
|
int evsignal;
|
||||||
|
|
||||||
if (ev->ev_events & (LAM_EV_READ|LAM_EV_WRITE))
|
if (ev->ev_events & (OMPI_EV_READ|OMPI_EV_WRITE))
|
||||||
errx(1, "%s: LAM_EV_SIGNAL incompatible use", __func__);
|
errx(1, "%s: OMPI_EV_SIGNAL incompatible use", __func__);
|
||||||
evsignal = LAM_EVENT_SIGNAL(ev);
|
evsignal = OMPI_EVENT_SIGNAL(ev);
|
||||||
sigaddset(evsigmask, evsignal);
|
sigaddset(evsigmask, evsignal);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -85,54 +85,54 @@ lam_evsignal_add(sigset_t *evsigmask, struct lam_event *ev)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_evsignal_del(sigset_t *evsigmask, struct lam_event *ev)
|
ompi_evsignal_del(sigset_t *evsigmask, struct ompi_event *ev)
|
||||||
{
|
{
|
||||||
int evsignal;
|
int evsignal;
|
||||||
|
|
||||||
evsignal = LAM_EVENT_SIGNAL(ev);
|
evsignal = OMPI_EVENT_SIGNAL(ev);
|
||||||
sigdelset(evsigmask, evsignal);
|
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
|
void
|
||||||
lam_evsignal_handler(int sig)
|
ompi_evsignal_handler(int sig)
|
||||||
{
|
{
|
||||||
lam_evsigcaught[sig]++;
|
ompi_evsigcaught[sig]++;
|
||||||
lam_evsignal_caught = 1;
|
ompi_evsignal_caught = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
lam_evsignal_recalc(sigset_t *evsigmask)
|
ompi_evsignal_recalc(sigset_t *evsigmask)
|
||||||
{
|
{
|
||||||
struct sigaction sa;
|
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);
|
return (0);
|
||||||
lam_needrecalc = 0;
|
ompi_needrecalc = 0;
|
||||||
|
|
||||||
if (sigprocmask(SIG_BLOCK, evsigmask, NULL) == -1)
|
if (sigprocmask(SIG_BLOCK, evsigmask, NULL) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
/* Reinstall our signal handler. */
|
/* Reinstall our signal handler. */
|
||||||
memset(&sa, 0, sizeof(sa));
|
memset(&sa, 0, sizeof(sa));
|
||||||
sa.sa_handler = lam_evsignal_handler;
|
sa.sa_handler = ompi_evsignal_handler;
|
||||||
sa.sa_mask = *evsigmask;
|
sa.sa_mask = *evsigmask;
|
||||||
sa.sa_flags |= SA_RESTART;
|
sa.sa_flags |= SA_RESTART;
|
||||||
|
|
||||||
TAILQ_FOREACH(ev, &lam_signalqueue, ev_signal_next) {
|
TAILQ_FOREACH(ev, &ompi_signalqueue, ev_signal_next) {
|
||||||
if (sigaction(LAM_EVENT_SIGNAL(ev), &sa, NULL) == -1)
|
if (sigaction(OMPI_EVENT_SIGNAL(ev), &sa, NULL) == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
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 (0);
|
||||||
|
|
||||||
return (sigprocmask(SIG_UNBLOCK, evsigmask, NULL));
|
return (sigprocmask(SIG_UNBLOCK, evsigmask, NULL));
|
||||||
@ -140,21 +140,21 @@ lam_evsignal_deliver(sigset_t *evsigmask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lam_evsignal_process(void)
|
ompi_evsignal_process(void)
|
||||||
{
|
{
|
||||||
struct lam_event *ev;
|
struct ompi_event *ev;
|
||||||
short ncalls;
|
short ncalls;
|
||||||
|
|
||||||
TAILQ_FOREACH(ev, &lam_signalqueue, ev_signal_next) {
|
TAILQ_FOREACH(ev, &ompi_signalqueue, ev_signal_next) {
|
||||||
ncalls = lam_evsigcaught[LAM_EVENT_SIGNAL(ev)];
|
ncalls = ompi_evsigcaught[OMPI_EVENT_SIGNAL(ev)];
|
||||||
if (ncalls) {
|
if (ncalls) {
|
||||||
if (!(ev->ev_events & LAM_EV_PERSIST))
|
if (!(ev->ev_events & OMPI_EV_PERSIST))
|
||||||
lam_event_del_i(ev);
|
ompi_event_del_i(ev);
|
||||||
lam_event_active_i(ev, LAM_EV_SIGNAL, ncalls);
|
ompi_event_active_i(ev, OMPI_EV_SIGNAL, ncalls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(lam_evsigcaught, 0, sizeof(lam_evsigcaught));
|
memset(ompi_evsigcaught, 0, sizeof(ompi_evsigcaught));
|
||||||
lam_evsignal_caught = 0;
|
ompi_evsignal_caught = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче
Block a user