Newer
Older
Master_thesis / run-linux2.job
@saslie saslie on 2 Apr 2019 1 KB ...
  1. #!/bin/bash
  2. #
  3. # example.slurm
  4. # Invoke with:
  5. # sbatch -p express example.slurm
  6.  
  7. # Uncomment the following to see the values of SLURM Environment variables
  8. # echo "slurm host is"
  9. # echo $SLURMD_NODENAME
  10. # echo "slurm queue is"
  11. # echo $SLURM_JOB_PARTITION
  12. # echo "slurm working directory absolute is"
  13. # echo $SLURM_SUBMIT_DIR
  14. # echo "slurm batch id"
  15. # echo $SLURM_JOB_ID
  16. # echo "slurm job name from me is"
  17. # echo $SLURM_JOB_NAME
  18.  
  19. source /app/cern/root_v6.08.06/bin/thisroot.sh
  20.  
  21. # Make sure we are in the right directory in case writing files
  22. mkdir -p /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID
  23. mkdir /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID/data
  24. mkdir /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID/plots
  25. mkdir /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID/plots/points
  26.  
  27. cp test2.py /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID
  28. cp raremodel.py /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID
  29. cp pdg_const.py /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID
  30. cp helperfunctions.py /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID
  31.  
  32. cd /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID
  33.  
  34. # Run actual commands here
  35. echo "Starting simulation"
  36. python test2.py
  37. echo "Simulation finished"
  38.  
  39. cp -a /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID/ /disk/data12/lhcb/saslie/jobs
  40. cp /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID/data/*.pkl /disk/data12/lhcb/saslie/data
  41. # Remove scratch directory at the end of your job
  42. # Do not forget to copy any output first to a safe place
  43. rm -rf /disk/data12/lhcb/saslie/scratch/$SLURM_JOB_ID
  44.  
  45. echo "Data moved to final folder