cluster.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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. os.system("make clean;make MAX_GENUS="+repr(g))
  11. file=open("output/param_"+repr(g),'w')
  12. for m in range(2,mmax+1):
  13. for k in range(g-m+1):
  14. file.write(repr(m)+' '+repr(k)+"\n")
  15. n+=1
  16. file.close()
  17. print("Split in ",n," subtasks")
  18. file=open("oar_wilf.sh",'w')
  19. file.write("#!/bin/sh\n")
  20. file.write("#OAR -l core=1,walltime=100: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. file.write("#OAR --array-param-file output/param_"+repr(g)+"\n")
  25. file.write("#OAR -O oar/output/job_%jobid%\n")
  26. file.write("#OAR -E oar/error/job_%jobid%\n")
  27. file.write("cd /nfs/home/lmpa/jfromentin/wilf/single\n")
  28. file.write("./wilf $* output/$OAR_JOBID\n")
  29. file.write("mv output/$OAR_JOBID*wilf* output/done/\n")
  30. file.close()