PageRenderTime 55ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/GabeditSrc240/utils/Molpro/LoadLeveler/submitMolpro

#
Korn Shell | 116 lines | 89 code | 8 blank | 19 comment | 3 complexity | 07bff03034785a276e964298f24c4021 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 : Avril 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. if test ! -s "$filecom"
  36. then
  37. echo " "
  38. echo "============================================"
  39. echo "le fichier $filecom est introuvable(ou vide)"
  40. echo "============================================"
  41. echo " "
  42. exit 2
  43. fi
  44. molproScr=/tmpp/$NAME
  45. endof=EOF
  46. cat > $filename.cmd <<EOF
  47. #!/bin/ksh
  48. #--------------------------------------------------------------------
  49. # fichier script genere par submitMolpro
  50. #--------------------------------------------------------------------
  51. #
  52. # @ SET=$filename
  53. #
  54. # @ restart=no
  55. #
  56. # @ output=\$(SET).output
  57. # @ error=\$(SET).error
  58. #
  59. # @ initialdir = `pwd`
  60. # @ wall_clock_limit = $jobtime
  61. # @ environment = COPY_ALL; SET=\$(SET);
  62. # @ checkpoint = no
  63. # @ restart = no
  64. # @ queue
  65. PREFIX=molpro
  66. util=\`whoami\`
  67. #-------------------------------------------------------------
  68. # operations a realiser avant l'execution de Molpro
  69. #-------------------------------------------------------------
  70. if test ! -d $gscr
  71. then
  72. mkdir $gscr
  73. fi
  74. # creation du scratch dir s'il n'existe pas
  75. #-------------------------------------------------------------
  76. # demarrage de Molpro
  77. #-------------------------------------------------------------
  78. echo "demarrage de Molpro"
  79. molproBin=/home/NFS_1/sim2340/allouche/molpro/bin/molpro
  80. timex \$molproBin \$SET.com
  81. #
  82. #-------------------------------------------------------------
  83. # operations a realiser apres l'execution de Molpro
  84. #-------------------------------------------------------------
  85. # destruction du scratch dir s'il a ete cree durant le run
  86. EOF
  87. llsubmit $filename.cmd
  88. echo " "
  89. echo "==================================================================="
  90. echo " "
  91. echo "Un fichier $filename.cmd a ete cree pour lancer le calcul"
  92. echo "Ne pas effacer ce fichier avant la fin du calcul"
  93. echo " "
  94. echo "-------------------------------------------------------------------"
  95. echo " "
  96. echo "pour avoir des informations sur vos job taper : llq -u $NAME"
  97. echo " "
  98. echo "pour detruire un job taper : llcancel host.cluster.proc"
  99. echo " host.cluster.proc est fourni par llq"
  100. echo " "
  101. echo "pour avoir plus d'informations taper : llq -x -l -u $NAME"
  102. echo " "
  103. echo "==================================================================="
  104. echo " "