f19_sub.csh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/csh
  2. ########################################
  3. ## ##
  4. ## csh script to generate scripts ##
  5. ## for converting f19 to root files ##
  6. ## ##
  7. ########################################
  8. # initial variables
  9. set Oscar2RootDir = "/home/mrworm/my_star/source/Oscar97Tree"
  10. set RunDir = "$PWD"
  11. set ListFormat = "list_*"
  12. #
  13. # main code
  14. echo "Running in directory $RunDir..."
  15. set counter = 0
  16. foreach iFile (`ls $ListFormat`)
  17. cat > f19_launch_$counter.sh << EOF
  18. #!/bin/bash
  19. cd $RunDir
  20. ln -s $Oscar2RootDir/Oscar97Tree.C
  21. ln -s $Oscar2RootDir/Oscar97Track_cxx.so
  22. ln -s $Oscar2RootDir/Oscar97Track_cxx.d
  23. ln -s $Oscar2RootDir/Oscar97Event_cxx.so
  24. ln -s $Oscar2RootDir/Oscar97Event_cxx.d
  25. ln -s $Oscar2RootDir/Oscar97Tree_cxx.so
  26. ln -s $Oscar2RootDir/Oscar97Tree_cxx.d
  27. root.exe Oscar97Tree.C\(\"$iFile\",\"out_$counter.root\"\)
  28. EOF
  29. RETRY_QSUB:
  30. qsub f19_launch_$counter.sh
  31. if ($? != "0") then
  32. echo "Failed to submit job $counter, retrying..."
  33. goto RETRY_QSUB
  34. endif
  35. qsub f19_launch_$counter.sh
  36. @ counter++
  37. end