Skip to content
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

make it possible to launch binary using --launch-agent #21

Merged
merged 1 commit into from Sep 25, 2018
Merged

Conversation

bast
Copy link
Owner

@bast bast commented Sep 24, 2018

@stigrj can you please test this?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 74.233% when pulling f5d2824 on launch-agent into 8a8c056 on master.

@bast
Copy link
Owner Author

bast commented Sep 24, 2018

Also if you have a better name than --launch-agent that would be very welcome. My problem is that I already use "launcher" in there for the "regular" launcher/script.

@stigrj
Copy link

stigrj commented Sep 24, 2018

It seems to work as expected if I run the test manually

./test --binary-dir=/home/stig/src/mrchem/build-mpi/bin --launch-agent='mpirun -np 5'

But I'm having trouble running it through ctest. The following works

 add_test(h2o "/usr/bin/python"
              "/home/stig/src/mrchem/tests/h2o/test"
              "--launch-agent='mpirun'"
              "--binary=/home/stig/src/mrchem/build-mpi/bin"
              "--work-dir=/home/stig/src/mrchem/build-mpi/tests/h2o"
              "--verbose")

which will use the default number of procs, but not if I add additional options to mpirun

 add_test(h2o "/usr/bin/python"
              "/home/stig/src/mrchem/tests/h2o/test"
              "--launch-agent='mpirun -np 5'"
              "--binary=/home/stig/src/mrchem/build-mpi/bin"
              "--work-dir=/home/stig/src/mrchem/build-mpi/tests/h2o"
              "--verbose")

Then I get the following error from ctest --output-on-failure --verbose

Traceback (most recent call last):
  File "/home/stig/src/mrchem/tests/h2o/test", line 33, in <module>
    options, configure, input_files=['mrchem.inp'], filters={'stdout': f})
  File "/home/stig/src/mrchem/tests/h2o/../runtest/run.py", line 49, in run
    universal_newlines=True)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Not sure what to make of this, but I get exactly the same error message if I use e.g. valgrind --leak-check=full, e.i. with extra arguments.

@bast
Copy link
Owner Author

bast commented Sep 25, 2018

Thanks for testing! I will look at the ctest side of it which I did not test yesterday.

@bast
Copy link
Owner Author

bast commented Sep 25, 2018

I tried this (in GIMIC) and it behaved normally:

    add_test(
        NAME ${_name}
        COMMAND ./test
                --binary-dir=${PROJECT_BINARY_DIR}/bin
                --work-dir=${PROJECT_BINARY_DIR}/test/${_name}
                --launch-agent "valgrind --leak-check=yes"
                --verbose
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test/${_name}
        )

Can you test this form on your side?

@stigrj
Copy link

stigrj commented Sep 25, 2018

Yes, this works!

@bast
Copy link
Owner Author

bast commented Sep 25, 2018

Brilliant! I am merging now but will hopefully very soon put a new version out on PyPI.

@bast bast merged commit 72262f9 into master Sep 25, 2018
@bast bast deleted the launch-agent branch September 25, 2018 10:13
@bast
Copy link
Owner Author

bast commented Sep 25, 2018

Latest version is now on PyPI: https://pypi.org/project/runtest/

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.

None yet

3 participants