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

RFE: Detect when OpenMPI is run as root in test suite and pass appropriate flags #520

Closed
ghost opened this issue Mar 21, 2018 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Mar 21, 2018

Avg response time
Issue Stats

EDITED/UPDATED by @zbeekman 2018-03-27

Request for Enhancement (RFE, AKA feature request)

Patch... to insert "--allow-run-as-root" [when running test suite with OpenMPI].

Old bug report text (now outdated/resolved):

Defect/Bug Report

  • OpenCoarrays Version:
# ./install.sh --version
OpenCoarrays 2.0.0
  • Fortran Compiler:
-- The Fortran compiler identification is GNU 7.3.0
-- Check for working Fortran compiler: /usr/local/bin/gfortran7
-- Check for working Fortran compiler: /usr/local/bin/gfortran7  -- works
  • C compiler used for building lib:
-- The C compiler identification is Clang 4.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works

  • Installation method: FreeBSD make under ports tree

  • Output of uname -a:

# uname -a
FreeBSD 11.1-RELEASE-p8 #0: Tue Mar 13 17:07:05 UTC 2018     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
# 
  • MPI library being used:
-- Found MPI_C: /usr/local/mpi/openmpi/lib/libmpi.so (found version "3.0")
-- Found MPI_Fortran: /usr/local/mpi/openmpi/lib/libmpi_usempi.so (found version "3.0")
-- Found MPI: TRUE (found version "3.0")
-- MPI runtime and compile time environments appear to be consistent
-- Performing Test MPI_C_COMPILES
-- Performing Test MPI_C_COMPILES - Success
-- Performing Test MPI_Fortran_MODULE_COMPILES
-- Performing Test MPI_Fortran_MODULE_COMPILES - Success
-- Performing Test MPI_Fortran_INCLUDE_COMPILES
-- Performing Test MPI_Fortran_INCLUDE_COMPILES - Success
-- OpenMPI detected
  • Machine architecture and number of physical cores:

amd64 (x86-64), tried on 2 or 4 core laptops.

  • Version of CMake:
# cmake --version
cmake version 3.10.1

Full build log:
https://seis.bristol.ac.uk/~mexas/oca-2.0.0-openmpi.log

make test errors:
https://seis.bristol.ac.uk/~mexas/make.test

@ghost
Copy link
Author

ghost commented Mar 22, 2018

Easy: OpenMPI does not like running tests as root:

Script started on Thu Mar 22 11:41:05 2018
Command: ctest -VV
UpdateCTestConfiguration  from :/usr/ports/lang/opencoarrays/work/.build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/usr/ports/lang/opencoarrays/work/.build/DartConfiguration.tcl
Test project /usr/ports/lang/opencoarrays/work/.build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
      Start  1: initialize_mpi

1: Test command: /usr/local/bin/bash "/usr/ports/lang/opencoarrays/work/.build/bin/cafrun" "-np" "2"
 "--hostfile" "/usr/ports/lang/opencoarrays/work/.build/hostfile" "/usr/ports/lang/opencoarrays/work
/.build/bin/OpenCoarrays-2.0.0-tests/initialize_mpi"
1: Test timeout computed to be: 9.99988e+06
1: --------------------------------------------------------------------------
1: mpiexec has detected an attempt to run as root.
1: Running at root is *strongly* discouraged as any mistake (e.g., in
1: defining TMPDIR) or bug can result in catastrophic damage to the OS
1: file system, leaving your system in an unusable state.
1:
1: You can override this protection by adding the --allow-run-as-root
1: option to your cmd line. However, we reiterate our strong advice
1: against doing so - please do so at your own risk.
1: --------------------------------------------------------------------------
1: Error: Command:
1:    `/usr/local/mpi/openmpi2/bin/mpiexec -n 2 --hostfile /usr/ports/lang/opencoarrays/work/.build/
hostfile /usr/ports/lang/opencoarrays/work/.build/bin/OpenCoarrays-2.0.0-tests/initialize_mpi`
1: failed to run.
 1/63 Test  #1: initialize_mpi .......................***Failed  Required regular expression not fou
nd.Regex=[Test passed.

Questions:

  1. How do you guys run tests with OpenMPI on linux?
    As an unprivileged user?

  2. Patching to insert "--allow-run-as-root" is a possibility, but,
    of course it would be better to somehow teach tell the FreeBSD
    ports builder to run the tests as an unprivileged user.

Anton

@zbeekman zbeekman changed the title 2.0.0 FreeBSD, OpenMPI - all tests fail, but caf/cafrun seems to work fine defect: 2.0.0 FreeBSD, OpenMPI - all tests fail, but caf/cafrun seems to work fine Mar 26, 2018
@zbeekman
Copy link
Collaborator

Hi Anton,

Am I understanding you correctly?

i.e., You have found the source of this issue (running as root)

Is OpenCoarrays 2.x otherwise functional on FreeBSD?

To answer your questions:

Questions:

How do you guys run tests with OpenMPI on linux?
As an unprivileged user?

yes, we typically run tests as an unprivileged user, and test mostly with MPICH, but also test a little with Clang & OpenMPI on macOS (administrator user, but not ROOT)

Patching to insert "--allow-run-as-root" is a possibility, but,
of course it would be better to somehow teach tell the FreeBSD
ports builder to run the tests as an unprivileged user.

Yes, that's a decent idea: have the cafrun script detect when being invoked as root with OpenMPI and pass the --allow-run-as-root flag. I'll try to patch this soon, with #467

Thanks,
Zaak

@ghost
Copy link
Author

ghost commented Mar 27, 2018 via email

@zbeekman zbeekman changed the title defect: 2.0.0 FreeBSD, OpenMPI - all tests fail, but caf/cafrun seems to work fine RFE: Detect when OpenMPI is run as root in test suite and pass appropriate flags Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant