Skip to content
Snippets Groups Projects
Commit fa264dcf authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

Task #4575: Use mpirun.sh instead of mpirun. For this to work, the bin...

Task #4575: Use mpirun.sh instead of mpirun. For this to work, the bin directory of the build tree needed to be added to PATH in runctest.sh
parent b8825c55
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,9 @@
# runtest.sh uses this variable to find test input files and the like.
srcdir="@srcdir@"; export srcdir
# Add the bin directory in the build tree to PATH
PATH="@CMAKE_BINARY_DIR@/bin:$PATH"; export PATH
# Add the Python build directory to PYTHONPATH.
PYTHONPATH="@PYTHON_BUILD_DIR@"; export PYTHONPATH
......
......@@ -8,7 +8,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/runrtcp.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/runrtcp.sh" # internal, no need to install
"${CMAKE_CURRENT_BINARY_DIR}/runrtcp.sh"
@ONLY # internal, no need to install
)
......
#!/bin/bash -x
#!/bin/bash
if [ "$#" == "0" ]
then
echo Usage: '[NRPROCS=x]' $0 '[params]'
exit
exit 1
fi
EXECUTABLE="@CMAKE_CURRENT_BINARY_DIR@/../src/rtcp"
HAVE_MPI="@HAVE_MPI@"
echo "EXECUTABLE: $EXECUTABLE"
echo EXECUTABLE: $EXECUTABLE
echo HAVE_MPI: $HAVE_MPI
# A sane default for 1-3 stations
NRPROCS=${NPROCS:=4}
if [ "$HAVE_MPI" == "TRUE" ] # TODO: what to match here? I've seen TRUE and OFF
then
# OpenMPI
if [ "$NRPROCS" == "" ]
then
# A sane default for 1-3 stations
NRPROCS=4
fi
mpirun -H localhost -np $NRPROCS "$EXECUTABLE" "$@"
else
# No MPI
"$EXECUTABLE" "$@"
fi
mpirun.sh -H localhost -np $NRPROCS "$EXECUTABLE" "$@"
#!/bin/sh
mpirun -H localhost,localhost t_cpu_utils
mpirun.sh -H localhost,localhost t_cpu_utils
......@@ -5,10 +5,6 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/include/${PACKAGE_NAME})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/mpirun.sh.in
${CMAKE_BINARY_DIR}/bin/mpirun.sh @ONLY)
set(_inputproc_sources
Package__Version.cc
RSPBoards.cc
......@@ -39,3 +35,11 @@ lofar_add_bin_program(filterRSP Station/filterRSP.cc)
lofar_add_bin_program(printRSP Station/printRSP.cc)
lofar_add_bin_program(generate Station/generate.cc)
lofar_add_bin_program(capture Station/capture.cc)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/mpirun.sh.in
${CMAKE_BINARY_DIR}/bin/mpirun.sh @ONLY)
install(PROGRAMS
${CMAKE_BINARY_DIR}/bin/mpirun.sh
DESTINATION bin)
#!/bin/sh
mpirun -host localhost -np 1 tMPI
mpirun.sh -host localhost -np 1 tMPI
#!/bin/sh
mpirun -host localhost -np 2 tMPISendReceiveStation
mpirun.sh -host localhost -np 2 tMPISendReceiveStation
#!/bin/sh
mpirun -host localhost -np 4 tMPITransfer
mpirun.sh -host localhost -np 4 tMPITransfer
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment