cluster.py 965 B

123456789101112131415161718192021222324252627282930
  1. import sys
  2. import os
  3. if __name__=="__main__":
  4. if len(sys.argv)!=2:
  5. print("Usage : python3 "+sys.argv[0]+" genus")
  6. exit(-1)
  7. g=int(sys.argv[1])
  8. mmax=int((3*(g+2))/5)
  9. n=0
  10. file=open("output/param_"+repr(g),'w')
  11. for m in range(2,mmax+1):
  12. for k in range(1,m):
  13. file.write(repr(m)+' '+repr(k)+"\n")
  14. n+=1
  15. file.close()
  16. print("Split in ",n," subtasks")
  17. os.system("make clean;make MAX_GENUS="+repr(g))
  18. file=open("oar_wilf.sh",'w')
  19. file.write("#!/bin/sh\n")
  20. file.write("#OAR -l core=1,walltime=02:00:00\n")
  21. file.write("#OAR -t idempotent\n")
  22. file.write("#OAR -q besteffort\n")
  23. file.write("#OAR -t besteffort\n")
  24. #OAR -p cputype="skylake"
  25. file.write("#OAR --array-param-file output/param_"+repr(g)+"\n")
  26. file.write("#OAR -O output/job.%jobid%.output\n")
  27. file.write("#OAR -E output/job.%jobid%.error\n")
  28. file.write("wilf_alone $*\n")
  29. file.close()