Files
rocm-systems/tests/featuretests/profiler/gtests/apps/mpi/mpi_run.sh
T
Ammar ELWazir 8032adb64f Adding rocprofilerv2
Change-Id: Ic0cc280ba207d2b8f6ccae1cd4ac3184152fc1ad
2023-03-09 13:20:33 +00:00

38 lines
1.5 KiB
Bash
Executable File

'
--------------------------------------------------------------------------
Running as root is *strongly* discouraged as any mistake (e.g., in
defining TMPDIR) or bug can result in catastrophic damage to the OS
file system, leaving your system in an unusable state.
We strongly suggest that you run mpirun as a non-root user.
You can override this protection by adding the --allow-run-as-root option
to the cmd line or by setting two environment variables in the following way:
the variable OMPI_ALLOW_RUN_AS_ROOT=1 to indicate the desire to override this
protection, and OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 to confirm the choice and
add one more layer of certainty that you want to do so.
We reiterate our advice against doing so - please proceed at your own risk.
--------------------------------------------------------------------------
'
MPIRUN=mpirun
if ! command -v $MPIRUN &> /dev/null
then
echo "$MPIRUN could not be found. checking libs"
if [ -f "/usr/lib64/openmpi/bin/mpirun" ]
then
MPIRUN=/usr/lib64/openmpi/bin/mpirun
else
if [ -f "/usr/lib64/mpi/gcc/openmpi2/bin/mpirun" ]
then
MPIRUN=/usr/lib64/mpi/gcc/openmpi2/bin/mpirun
else
echo "$MPIRUN could not be found. exiting"
exit
fi
fi
fi
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
$MPIRUN --allow-run-as-root -np 2 $SCRIPTPATH/mpi_vectoradd mdrun -pin on -nsteps 10 -resetstep 9 -ntomp 64 -noconfout -nb gpu -bonded gpu -pme gpu -v -gpu_id 0