run.py 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import os
  2. import sys
  3. def make(gmax):
  4. os.chdir("src")
  5. os.system("make clean > /dev/null")
  6. os.system("make GMAX="+repr(gmax)+" > /dev/null")
  7. os.chdir("../")
  8. def init():
  9. os.system("./init_files > /dev/null")
  10. todo=os.listdir("todo")
  11. print("There is",len(todo),"files to treat");
  12. def filter():
  13. todo=os.listdir("todo")
  14. print("=> Filter <=")
  15. print("in :",len(todo))
  16. todo_flat=' '.join(todo)
  17. cmd="parallel ./run_walk ::: "+todo_flat+" ::: 1 > /dev/null"
  18. os.system(cmd)
  19. todo2=os.listdir("todo")
  20. rem=set(todo).intersection(todo2)
  21. print("rem :",len(rem))
  22. print("done :",len(todo)-len(rem))
  23. print("new :",len(todo2)-len(rem))
  24. def run():
  25. if __name__=="__main__":
  26. if(len(sys.argv)!=2):
  27. print("Argument error")
  28. exit(-1)
  29. gmax=int(sys.argv[1])
  30. print("gmax =",gmax)
  31. make(gmax)
  32. init()
  33. filter()
  34. #run(timeout)