#! /usr/bin/python ####################################################### # #for i in range(6): # print i # #import os # #os.system("ls; sleep 3") # ####################################################### ####################################################### ## Computes all Auxiliary 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) Aux_Form_Range = range(start, end + 1) ####################################################### ## Basic Settings Aux_Dir = "/tmp/Auxiliary_Logs" magma_tempfile = "tempfile.magma" magma_codefile = "jon_cusp12-2.m" #print Aux_Form_Range, Aux_Dir ####################################################### ## Create the appropriate temporary directory (if it's missing) if not os.path.isdir(Aux_Dir): os.mkdir(Aux_Dir) ## Compute all Auxiliary constants for i in Aux_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_auxiliary_forms([" + str(i) + "]);") tempfile.write("quit;") tempfile.close() ## Run that file print " Starting to compute Auxiliary form #" + str(i) os.system("magma " + magma_tempfile) print " Finished computing Auxiliary form #" + str(i) ## Delete the Magma file, and start over os.system("rm " + magma_tempfile) ## Copy the datafile to a safe place...