#! /usr/bin/python ####################################################### # #for i in range(6): # print i # #import os # #os.system("ls; sleep 3") # ####################################################### ################################################### ## Computes all Basic forms in a given range/set ## ################################################### import os, sys ## Get the range from the command line args = sys.argv[1:] assert (len(args) == 2) start = int(args[0]) end = int(args[1]) assert (1 <= start) and (start <= end) print " Looking from " + str(start) + " to " + str(end) Basic_Form_Range = range(start, end + 1) ####################################################### ## Basic Settings Basic_Dir = "/tmp/Basic_Logs" magma_tempfile = "tempfile.magma" magma_codefile = "jon_cusp12-2.m" #print Basic_Form_Range, Basic_Dir ####################################################### ## Create the appropriate temporary directory (if it's missing) if not os.path.isdir(Basic_Dir): os.mkdir(Basic_Dir) ## Compute all Auxiliary constants for i in Basic_Form_Range: ## Write a MAGMA file which computes one local constant tempfile = open(magma_tempfile, "w") tempfile.write('load "' + magma_codefile + '";') tempfile.write("time make_cusp_bounds_for_basic_forms([" + str(i) + "]);") tempfile.write("quit;") tempfile.close() ## Run that file print " Starting to compute Basic form #" + str(i) os.system("magma " + magma_tempfile) print " Finished computing Basic form #" + str(i) ## Delete the Magma file, and start over os.system("rm " + magma_tempfile) ## Copy the datafile to a safe place...