Skip to content

test: refactor runtests - #5741

Merged
hzhou merged 15 commits into
pmodels:mainfrom
hzhou:2112_runtests
Jan 31, 2022
Merged

hzhou merged 15 commits into
pmodels:mainfrom
hzhou:2112_runtests

Conversation

@hzhou

@hzhou hzhou commented Dec 23, 2021 •

Copy link
Copy Markdown
Collaborator

Pull Request Description

Preparation for #5725.

Refactor runtests and prepare for modifications to add ability to run multiple tests inside a single MPI_Init/MPI_Finalize window.

[skip warnings]

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@hzhou

hzhou commented Dec 23, 2021 •

Copy link
Copy Markdown
Collaborator Author

test:mpich/ch3/tcp ✔️

@hzhou

hzhou commented Dec 27, 2021

Copy link
Copy Markdown
Collaborator Author

test:mpich/ch3/tcp

@raffenet raffenet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good. A couple of comments.

Comment thread test/mpi/runtests
@@ -66,7 +69,7 @@ our $g_total_seen = 0;
our $g_num_timeout;
our $g_num_timeout_thresh = 5;

$mpiexec = "@MPIEXEC@"; # Name of mpiexec program (including path, if necessary)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we've got some test scripts that rely on this old method. This is probably fixable, so just noting it here.

if test "$jenkins_configure" = "pmix" ; then
    MPIEXEC="$HOME/software/openmpi-3.0.0/bin/mpiexec -oversubscribe"
elif test "$MPIEXEC" = "" ; then
    MPIEXEC=$INSTALL_PREFIX/bin/mpiexec
fi
export MPIEXEC

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can easily add and let runtests to check MPIEXEC environment variable, which should work for the test scripts.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, configure will set the variable in Makefile so make testing will pass the correct mpiexec via runtests command line -mpiexec=. So the mechanism still works. The only difference is if the user want to directly invoke runtests and when mpiexec is not in the path, then user need to manually add -mpiexec= option. Let me add the ability to pickup MPIEXEC environment, so the user have one extra option to invoke runtests.

Comment thread test/mpi/runtests Outdated
Comment on lines 383 to 396
# Run the programs listed in the file given as the argument.
# This file describes the tests in the format
# programname number-of-processes [ key=value ... ]
# If the second value is not given, the default value is used.
#

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment needs an update with this change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raffenet Done. Added the last two commits to address your comment.

@hzhou

hzhou commented Jan 10, 2022

Copy link
Copy Markdown
Collaborator Author

test:mpich/ch3/tcp

@hzhou
hzhou requested a review from raffenet January 19, 2022 17:36
hzhou added 15 commits January 31, 2022 16:16
The mpix=true option is not used and functionally the same as
strict=false. Remove to simplify.
Use explicit options rather than autoconf substitutions. It is more
flexible and removes the script dependency on configure.
It is unnecessary to use reference.
Move the option to g_opt hash.

Remove the error check since mpiexec is always set and never will be
empty.

Avoid duplication of long cmd string.
Reduce code duplication.
Remember the working directory and top source directory.
Use strict to prevent many potential errors. Move the option variables
into %g_opt hash to signify options.
This cleans up the code. It also provides the flexibility to separating
the loading of tests from testlists from building or running the tests.
Consistently use prefix g_ to name global variables.

It is not necessary to use our since it is not a module.

Update g_err_count in RunTestFailed.
Only update global test counters in one of the three test reporting
routines to ensure consistency.
This provide an alternative of way of customize mpiexec path in addition
to using the command line option -mpiexec=path/to/mpiexec.
@hzhou
hzhou merged commit 91a2c54 into pmodels:main Jan 31, 2022
@hzhou
hzhou deleted the 2112_runtests branch January 31, 2022 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants