5.4.7 : Un script pour lancer tous nos jobs
Écrivons le script start_all_job.sh :
1 |
#!/bin/bash
|
On définit la configuration de base que l'on veut utiliser :
1 |
BASE_JOB_CONFIG="submit.condor"
|
Puis la liste des GPU à ciblé (il n'y a pas de K80 car elles ne sont pas gérées par nvc++)
1 |
LIST_GPU="a100 3g.20gb p6000 t4 v100"
|
Un petit dossier temporaire pour sauver nos scripts spécialisés par GPU :
1 |
mkdir -p tmp_job_config
|
Enfin, on boucle sur les GPU et on remplace leur noms aux bons endroits :
1 2 3 4 5 6 7 |
for GPU in ${LIST_GPU[@]} do echo "Submit job for gpu ${GPU}" OUTPUT_JOB_CONFIG="tmp_job_config/submit_${GPU}.condor" cat ${BASE_JOB_CONFIG} | sed -e s/GPUNAME/${GPU}/g > ${OUTPUT_JOB_CONFIG} condor_submit -batch-name MultFileHadamardProduct ${OUTPUT_JOB_CONFIG} done |
Le fichier start_all_job.sh complet :
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/bin/bash BASE_JOB_CONFIG="submit.condor" LIST_GPU="a100 3g.20gb p6000 t4 v100" mkdir -p tmp_job_config for GPU in ${LIST_GPU[@]} do echo "Submit job for gpu ${GPU}" OUTPUT_JOB_CONFIG="tmp_job_config/submit_${GPU}.condor" cat ${BASE_JOB_CONFIG} | sed -e s/GPUNAME/${GPU}/g > ${OUTPUT_JOB_CONFIG} condor_submit -batch-name MultFileHadamardProduct ${OUTPUT_JOB_CONFIG} done |
Le fichier start_all_job.sh est disponible ici.