PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/GabeditSrc240/utils/Molpro/PBS/submitMolpro

#
Korn Shell | 73 lines | 62 code | 2 blank | 9 comment | 2 complexity | 79e07daeefe65d3a832935a2f275de21 MD5 | raw file
  1. #!/bin/ksh
  2. ###################################################################
  3. # #
  4. # Script ksh pour lancer un calcul Molpro en batch #
  5. # Auteur: A-R Allouche allouche@lasim.univ-lyon1.fr #
  6. # LASIM, Villeurbanne #
  7. # Ecriture : September 2004 #
  8. # #
  9. ###################################################################
  10. jobtime=$1 ; [ 0 = $# ] || shift
  11. filename=$1 ; [ 0 = $# ] || shift
  12. if [ -z "$filename" ] || [ -z "$jobtime" ]
  13. then
  14. clear
  15. echo " "
  16. echo "==========================================="
  17. echo " submitMolpro "
  18. echo " Pour toutes questions contacter : "
  19. echo " A.R. Allouche allouche@lasim.univ-lyon1.fr"
  20. echo "==========================================="
  21. echo "vous devez fournir :"
  22. echo " - le temps de calcul( hh:mm:ss)"
  23. echo " - le nom du fichier(y compris l'extension .com)"
  24. echo "-------------------------------------------"
  25. echo "Exemple:"
  26. echo " submitMolpro 2:00:00 h2.com "
  27. echo " fichier de donnees : h2.com"
  28. echo " Temps de calcul(maximum) : 2 heurs"
  29. echo "==========================================="
  30. echo " "
  31. exit 1
  32. fi
  33. filecom=$filename
  34. filename=${filecom%.com}
  35. DEFAULTDIR=`pwd`
  36. if test ! -s "$filecom"
  37. then
  38. echo " "
  39. echo "============================================"
  40. echo "le fichier $filecom est introuvable(ou vide)"
  41. echo "============================================"
  42. echo " "
  43. exit 2
  44. fi
  45. endof=EOF
  46. cat > $filename.pbs <<EOF
  47. #!/bin/sh
  48. #PBS -j oe
  49. #PBS -N $filename
  50. #PBS -l walltime=$jobtime
  51. #PBS -o $filename.pbsout
  52. /data/logiciels/Molpro/bin/molpro "$DEFAULTDIR/$filecom"
  53. EOF
  54. qsub $filename.pbs
  55. echo " "
  56. echo "==================================================================="
  57. echo " "
  58. echo "Un fichier $filename.pbs a ete cree pour lancer le calcul"
  59. echo "Ne pas effacer ce fichier avant la fin du calcul"
  60. echo " "
  61. echo "-------------------------------------------------------------------"
  62. echo " "
  63. echo "pour avoir des informations sur vos job taper : qstat "
  64. echo " "
  65. echo "pour detruire un job taper : qdel num.master0.alin"
  66. echo " num.master0.alin est le Job Id fourni par qstat"
  67. echo " "
  68. echo "==================================================================="
  69. echo " "