「cluster_info.json」
{
"name" : "pbscluster",
"worker_bin_path" : "/home/illya/csparc_worker/bin/cryosparcw",
"cache_path" : "/tmp/cs-scr",
"send_cmd_tpl" : "{{ command } }",
"qsub_cmd_tpl" : "qsub {{ script_path_abs } }",
"qstat_cmd_tpl" : "qstat -as {{ cluster_job_id } }",
"qdel_cmd_tpl" : "qdel {{ cluster_job_id } }",
"qinfo_cmd_tpl" : "qstat -q"
}
「cluster_script.sh」
#!/usr/bin/env bash
#PBS -N cryosparc_{{ project_uid } }_{{ job_uid } }
#PBS -l select=1:ncpus={{ num_cpu } }:ngpus={{ num_gpu } }:mem={{ (ram_gb*1000)|int } }mb
#PBS -o {{ job_log_path_abs } }
#PBS -e {{ job_log_path_abs } }
available_devs=""
for devidx in $(seq 0 16);
do
if [[ -z $(nvidia-smi -i $devidx --query-compute-apps=pid --format=csv,noheader) ]] ; then
if [[ -z "$available_devs" ]] ; then
available_devs=$devidx
else
available_devs=$available_devs,$devidx
fi
fi
done
export CUDA_VISIBLE_DEVICES=$available_devs
# scratchが動的に変更するなら 「ln -s /scratch/$JOB_ID /tmp/cs-scr : {{run_cmd} } ; rm -f /tmp/cs-scr 」 とします
{{ run_cmd } }