Guest User

Untitled

a guest
Feb 18th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #!/bin/bash
  2. #SBATCH -n 1
  3. #SBATCH -c 36
  4. #SBATCH --gres=gpu:4
  5. #SBATCH --mem=120G
  6. #SBATCH --mail-type=END
  7.  
  8. ## The following sends a SIGHUP signal 900 seconds before the job
  9. ## gets sent a kill signal on TimeOut. We can thus premptively clean
  10. ## up and export any data saved automatically.
  11.  
  12. ## It is possible to use SIGUSR1, SIGUSR2 as well.
  13.  
  14. #SBATCH --signal=B:HUP@900
  15.  
  16.  
  17. function _export {
  18. ssh $USER@ada "mkdir -p $REMOTE_DIR/"
  19. rsync -rz $CHECKPOINTS/checkpoint_{best,last}.pt ada:$REMOTE_DIR/
  20. }
  21.  
  22. ## We trap the SIGHUP signal and register a handler, which saves computed checkpoint
  23. ## In my case.
  24.  
  25. trap "_export" SIGHUP
Add Comment
Please, Sign In to add comment