ends_all_server.py 391 B

1234567891011121314151617
  1. import os
  2. table = os.popen('squeue').read()
  3. for line in str(table).split('\n'):
  4. # print(line)
  5. if 'server.b' in line or 'batch.sh' in line:
  6. id = line.split('vip_gpu')[0] #change to your slurm partition name
  7. os.system(f'scancel {id}')
  8. # print(table)
  9. try:
  10. os.remove('./server.csv')
  11. except:
  12. pass
  13. try:
  14. os.system('rm *.out')
  15. except:
  16. pass
  17. os.system('squeue')