-
Notifications
You must be signed in to change notification settings - Fork 15
envmgmt: error class/code/string test #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
naughtont3
wants to merge
3
commits into
open-mpi:master
Choose a base branch
from
naughtont3:envmgmt-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved | ||
# Copyright (c) 2025 UT-Battelle, LLC. All rights reserved | ||
# | ||
# $COPYRIGHT$ | ||
# | ||
|
||
SUBDIRS = src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Environ Management Tests | ||
------------------------ | ||
|
||
Tests for items in the "MPI Environmental Management" chapter. | ||
|
||
These are begin created in the ompi-tests-public repository | ||
to ensure they are easy to access. | ||
|
||
Using autotools to detect if we have the MPI-4.1 remove error code | ||
functionality, otherwise skips. | ||
|
||
Usage | ||
----- | ||
- Ensure MPI `mpicc` in `PATH` | ||
- Run autogen/configure/make to build test | ||
|
||
``` | ||
cd environ-mgmt/ | ||
./autogen.sh && ./configure && make | ||
``` | ||
|
||
- Run test(s) | ||
|
||
``` | ||
mpirun -np 1 ./src/test_add_del_err_codes | ||
``` | ||
|
||
Example Output | ||
-------------- | ||
|
||
- On MPI 3.x | ||
``` | ||
laptop:$ mpirun -np 1 ./src/test_add_del_err_codes | ||
TEST: Success creating error class/code/string (last=92, newlast=94) | ||
==== Adds done ==== | ||
==== Remove estring ==== | ||
Warning: MPI_Remove_error_xxx code/class/string NOT available! | ||
==== Remove ecode ==== | ||
Warning: MPI_Remove_error_xxx code/class/string NOT available! | ||
==== Remove eclass ==== | ||
Warning: MPI_Remove_error_xxx code/class/string NOT available! | ||
DONE: Success | ||
laptop$ echo $? | ||
0 | ||
laptop$ | ||
``` | ||
|
||
- On MPI 4.1 or later | ||
``` | ||
laptop:$ mpirun -np 1 ./src/test_add_del_err_codes | ||
TEST: Success creating error class/code/string (last=92, newlast=94) | ||
==== Adds done ==== | ||
==== Remove estring ==== | ||
==== Remove ecode ==== | ||
TEST: Success reomved error code (oldlast=94, newlast=93) | ||
==== Remove eclass ==== | ||
TEST: Success reomved error class (oldlast=93, newlast=92) | ||
DONE: Success | ||
laptop$ echo $? | ||
0 | ||
laptop$ | ||
``` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/sh | ||
# | ||
# Note: Use './autogen.sh clean' to delete autotool droppings, | ||
# otherwise just runs 'autoreconf' by default. | ||
# | ||
|
||
if [ "$1" = "clean" ] ; then | ||
|
||
# | ||
# Run 'make clean' (if possible) | ||
# | ||
if [ -f "Makefile" ] ; then | ||
make clean | ||
fi | ||
|
||
# | ||
# Delete files | ||
# | ||
delete_files=`find . -name Makefile \ | ||
naughtont3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-o -name Makefile.in \ | ||
-o -name configure \ | ||
-o -name depcomp \ | ||
-o -name install-sh \ | ||
-o -name compile \ | ||
-o -name missing \ | ||
-o -name aclocal.m4 \ | ||
-o -name missing \ | ||
-o -name stamp-h1 \ | ||
-o -name "config.*"` | ||
|
||
for file in ${delete_files} ; do | ||
echo "Remove: $file" | ||
rm -f $file | ||
done | ||
|
||
# | ||
# Delete directories | ||
# | ||
delete_dirs=`find . -name .deps` | ||
delete_dirs="${delete_dirs} autom4te.cache" | ||
|
||
for dir in ${delete_dirs} ; do | ||
echo "Remove: $dir" | ||
rm -rf $dir | ||
done | ||
|
||
else | ||
# | ||
# Run configure setup utilities... | ||
# | ||
autoreconf --install | ||
fi | ||
|
||
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
# -*- shell-script -*- | ||
# | ||
# Copyright (c) 2012-2020 Cisco Systems, Inc. All rights reserved. | ||
# Copyright (c) 2025 UT-Battelle, LLC. All rights reserved. | ||
# | ||
# $COPYRIGHT$ | ||
# | ||
|
||
dnl | ||
dnl Init autoconf | ||
dnl | ||
|
||
AC_PREREQ([2.67]) | ||
AC_INIT([mpi-environmgmt-test], [1.0], [http://www.open-mpi.org]) | ||
AC_CONFIG_AUX_DIR([config]) | ||
AC_CONFIG_MACRO_DIR([config]) | ||
AC_CONFIG_SRCDIR([.]) | ||
|
||
echo "Configuring Environmental Management test" | ||
|
||
AM_INIT_AUTOMAKE([1.11 foreign -Wall -Werror]) | ||
|
||
# If Automake supports silent rules, enable them. | ||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | ||
|
||
AH_TOP([/* -*- c -*- | ||
* | ||
* Environmental Management test suite configuation header file. | ||
* See the top-level LICENSE file for license and copyright | ||
* information. | ||
*/ | ||
|
||
#ifndef MPI_ENVIRONMGMT_TEST_CONFIG_H | ||
#define MPI_ENVIRONMGMT_TEST_CONFIG_H | ||
]) | ||
AH_BOTTOM([#endif /* MPI_ENVIRONMGMT_TEST_CONFIG_H */]) | ||
|
||
dnl | ||
dnl Make automake clean emacs ~ files for "make clean" | ||
dnl | ||
|
||
CLEANFILES="*~" | ||
AC_SUBST(CLEANFILES) | ||
|
||
dnl | ||
dnl Get various programs | ||
dnl Bias towards mpicc/mpic++/mpif77 | ||
dnl C compiler | ||
dnl | ||
|
||
if test "$CC" != ""; then | ||
BASE="`basename $CC`" | ||
else | ||
BASE= | ||
fi | ||
if test "$BASE" = "" -o "$BASE" = "." -o "$BASE" = "cc" -o \ | ||
"$BASE" = "gcc" -o "$BASE" = "xlc" -o "$BASE" = "pgcc" -o \ | ||
"$BASE" = "icc"; then | ||
AC_CHECK_PROG(HAVE_MPICC, mpicc, yes, no) | ||
if test "$HAVE_MPICC" = "yes"; then | ||
CC=mpicc | ||
export CC | ||
fi | ||
fi | ||
|
||
CFLAGS_save=$CFLAGS | ||
AC_PROG_CC | ||
CFLAGS=$CFLAGS_save | ||
|
||
dnl | ||
dnl Because these are meant to be used for debugging, after all | ||
dnl | ||
|
||
if test -z "$CFLAGS"; then | ||
CFLAGS="-g" | ||
fi | ||
|
||
dnl | ||
dnl Ensure that we can compile and link a C MPI program | ||
dnl | ||
|
||
AC_LANG_PUSH([C]) | ||
AC_CHECK_HEADERS(mpi.h) | ||
|
||
AC_MSG_CHECKING([if linking MPI program works]) | ||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h> | ||
]], | ||
[[MPI_Comm a = MPI_COMM_WORLD]])], | ||
[AC_MSG_RESULT([yes])], | ||
[AC_MSG_RESULT([no]) | ||
AC_MSG_WARN([Simple MPI program fails to link]) | ||
AC_MSG_ERROR([Cannot continue]) | ||
]) | ||
|
||
AC_CHECK_LIB([mpi], [MPI_Add_error_code], | ||
[AC_DEFINE([HAVE_MPI_ADD_ERROR_CODE], [1], [Define if have MPI_Add_error_code])], | ||
[AC_MSG_WARN([MPI_Add_error_code not found; disable related features])]) | ||
|
||
|
||
AC_CHECK_LIB([mpi], [MPI_Remove_error_code], | ||
[AC_DEFINE([HAVE_MPI_REMOVE_ERROR_CODE], [1], [Define if have MPI_Remove_error_code])], | ||
[AC_MSG_WARN([MPI_Remove_error_code not found; disable related features])]) | ||
|
||
AC_CHECK_LIB([mpi], [MPI_Remove_error_class], | ||
[AC_DEFINE([HAVE_MPI_REMOVE_ERROR_CLASS], [1], [Define if have MPI_Remove_error_class])], | ||
[AC_MSG_WARN([MPI_Remove_error_class not found; disable related features])]) | ||
|
||
AC_CHECK_LIB([mpi], [MPI_Remove_error_string], | ||
[AC_DEFINE([HAVE_MPI_REMOVE_ERROR_STRING], [1], [Define if have MPI_Remove_error_string])], | ||
[AC_MSG_WARN([MPI_Remove_error_string not found; disable related features])]) | ||
|
||
AC_SUBST([MPI_LIBS]) | ||
|
||
AC_LANG_POP([C]) | ||
|
||
dnl | ||
dnl Party on | ||
dnl | ||
|
||
AC_CONFIG_FILES([ | ||
Makefile | ||
src/Makefile | ||
]) | ||
AC_OUTPUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved | ||
# Copyright (c) 2025 UT-Battelle, LLC. All rights reserved | ||
# | ||
# | ||
# $COPYRIGHT$ | ||
# | ||
|
||
noinst_PROGRAMS = test_add_del_err_codes | ||
|
||
test_add_del_err_codes_SOURCES = \ | ||
test_add_del_err_codes.c |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.