Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
2b5f4eea
Commit
2b5f4eea
authored
12 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Add run-time test of MPI launcher.
parent
1b761d0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure
+63
-1
63 additions, 1 deletion
configure
configure.ac
+43
-2
43 additions, 2 deletions
configure.ac
with
106 additions
and
3 deletions
configure
+
63
−
1
View file @
2b5f4eea
...
...
@@ -26632,10 +26632,72 @@ fi
test -n "$MPI_LAUNCH" && break
done
test -n "$MPI_LAUNCH" || MPI_LAUNCH="true"
if test x"$cross_compiling" = xno; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MPI_LAUNCH works" >&5
$as_echo_n "checking if $MPI_LAUNCH works... " >&6; }
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
CFLAGS="$CFLAGS $MPI_C_INCLUDE"
LIBS="$LIBS $MPI_C_LIB"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
if test x$MPI_LAUNCH = x; then :
#define xmpi(ret) \\
do { \\
if (ret != MPI_SUCCESS) \\
exit(EXIT_FAILURE); \\
} while (0)
int
main(int argc, char **argv)
{
xmpi(MPI_Init(&argc, &argv));
char *numarg = argv[1];
int cmdnum = atoi(numarg);
int procnum = 1;
xmpi(MPI_Allreduce(MPI_IN_PLACE, &procnum, 1, MPI_INT, MPI_SUM,
MPI_COMM_WORLD));
xmpi(MPI_Finalize());
return (procnum == cmdnum)?EXIT_SUCCESS:EXIT_FAILURE;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
if $MPI_LAUNCH -n 4 ./conftest$EXEEXT 4; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "mpirun doesn't work
See \`config.log' for more details" "$LINENO" 5; }
fi
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot compile simple MPI program
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
fi
if test "x$MPI_LAUNCH" = xtrue; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MPI launch command unavailable" >&5
$as_echo "$as_me: WARNING: MPI launch command unavailable" >&2;}
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAXT" >&5
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
43
−
2
View file @
2b5f4eea
...
...
@@ -94,8 +94,49 @@ AS_IF([test x"${enable_mpi}" = x"yes"],
HAVE_PARALLEL_NC4=0
AS_IF([test x"$USE_MPI" = xyes],
[AC_DEFINE([USE_MPI],[1],[parallel I/O requested and available])
AC_PATH_PROGS([MPI_LAUNCH],[mpirun mpiexec],[])
AS_IF([test x$MPI_LAUNCH = x],[])
AC_PATH_PROGS([MPI_LAUNCH],[mpirun mpiexec],[true])
AS_IF([test x"$cross_compiling" = xno],
[AC_MSG_CHECKING([if $MPI_LAUNCH works])
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
CFLAGS="$CFLAGS $MPI_C_INCLUDE"
LIBS="$LIBS $MPI_C_LIB"
AC_LINK_IFELSE([AC_LANG_SOURCE([
@%:@include <stdio.h>
@%:@include <stdlib.h>
@%:@include <mpi.h>
@%:@define xmpi(ret) \\
do { \\
if (ret != MPI_SUCCESS) \\
exit(EXIT_FAILURE); \\
} while (0)
int
main(int argc, char **argv)
{
xmpi(MPI_Init(&argc, &argv));
char *numarg = argv@<:@1@:>@;
int cmdnum = atoi(numarg);
int procnum = 1;
xmpi(MPI_Allreduce(MPI_IN_PLACE, &procnum, 1, MPI_INT, MPI_SUM,
MPI_COMM_WORLD));
xmpi(MPI_Finalize());
return (procnum == cmdnum)?EXIT_SUCCESS:EXIT_FAILURE;
}
])],
[AS_IF([$MPI_LAUNCH -n 4 ./conftest$EXEEXT 4],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([mpirun doesn't work])])],
[AC_MSG_FAILURE([Cannot compile simple MPI program])])
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
])
AS_IF([test "x$MPI_LAUNCH" = xtrue],
[AC_MSG_WARN([MPI launch command unavailable])])
PKG_CHECK_MODULES([YAXT],[yaxt],
[AC_DEFINE([HAVE_YAXT],,[yaxt library is available])],
[AC_MSG_FAILURE([Required yaxt library unavailable.])])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment