I tried to start the singularity container with pbs script. Here is my .def file and pbs script
#!/bin/bash
# ph.sh
export MPI_DIR=/opt/mpich
module load singularity/3.7.5
mpirun -n $num_cores -hostfile ./hostlist singularity exec --bind "MPI_DIR" ./bind.sif /usr/local/bin/PHengLEIv3d0-5720-tianhe > cfd.log
Bootstrap: docker
From: centos:7
%files
/usr/local/bin/PHengLEIv3d0-5720-tianhe /usr/local/bin/PHengLEIv3d0-5720-tianhe
%environment
export PATH="$MPI_DIR/bin:$PATH"
export LD_LIBRARY_PATH="$MPI_DIR/lib:$LD_LIBRARY_PATH"
%post
export DEBIAN_FRONTEND=noninteractive
yum update -y && yum install -y gcc-c++ && yum install -y gcc-gfortran
The error is:
[proxy:0:0@phdev1] HYDU_create_process (utils/launch/launch.c:74): execvp error on file singularity (No such file or directory)
use this shell script will be ok
export MPI_DIR="/opt/mpich"
mpirun -n 1 singularity exec --bind "$MPI_DIR" bind.sif /usr/local/bin/PHengLEIv3d0-5720-tianhe
but when I use pbs command is failed
qsub -N Pro325_Job281 -W sandbox=PRIVATE -q workq -l nodes=1:ppn=1 ph_ys144.sh
In my opinion, it's because pbs didn't find the singularity file. So I tried using relative and absolute paths, but it's failed. I looked up the information, there is very little information about how to start singularity with pbs, almost all of them are slurm. I don't know if this has anything to do with my use of bind mode, I want to create a lightweight mirror