Example #1
0
    while (cRID < NIDs):
        #print cRID
        
        # Define paths
        cRID_char = "R_" + str(Run_IDs[cRID])
        c_fileManager    = settings_dir + c_Site_ID + "/" + cRID_char + "/summa_fileManager_" + c_Site_ID + ".txt"
        c_output_dir     = output_dir + c_Site_ID + "/" + cRID_char
        run_output       = c_output_dir + "/Run_output.txt"
        print c_fileManager 
        # Check Run files exists
        if not os.path.exists(c_fileManager):
             sys.exit("Run ID %s for site %s doesn't exist" % (cRID_char,c_Site_ID))
       
        if jobrun == 1: # Submit to command line
            run_exe_input = run_exe + " " + exp_name + " " + c_fileManager + " > " + run_output + " &"
            os.system(run_exe_input)
        elif jobrun == 2: # Submit run to Queue

           # Edit pbs.cmd file
           Create_new.pbs(pbs_file,exp_name,c_fileManager,run_output,run_dir,cRID_char,your_email)
           run_exe_input = "qsub " + home_dir + "pbs.cmd "
           #print run_exe_input
           os.system(run_exe_input)

        # End of Run_ID loop
        cRID +=1
    # End of Site loop
    cSite += 1    

print "\nFinished submiting\n"
Example #2
0
#####################################################################################
# Loop through each Site (Index from zero)
#####################################################################################
cRID = 0  # Index of current Run_IDs
cSite = 0  # Index of current Site
while (cSite < NSites):

    # Define Site Info
    c_Site_ID = Site_ID_all[cSite]
    print c_Site_ID

    # If more than one NPruns, then get value to vary
    if NPruns > 1:
        # Get Vaules of param_2_vary from LocalParamInfo
        Pvals = Create_new.GetParamVals(param_2_vary, NPruns, settings_dir,
                                        c_Site_ID)
        print Pvals
        # Find Index specifed parameters (new_param_all)
        Iparam = new_param_all.index(param_2_vary)

    #####################################################################################
    # Loop through each Parameter set run (Index from zero)
    #####################################################################################
    cPR = 0
    while (cPR < NPruns):
        #print cPR
        # Define current Run ID
        cRID_char = "R_" + str(Run_IDs[cRID])
        print cRID_char

        # If more than one NPruns, Update
        # Define new run paths
	c_output_dir   = output_dir + c_Site_ID + "/" + cRID_char
        c_settings_dir = settings_dir + c_Site_ID + "/" + cRID_char
        run_output     = c_output_dir + "/Run_output.txt"
        
        # Make needed directories
        if not os.path.exists(c_output_dir):
            os.makedirs(c_output_dir)

	if not os.path.exists(c_settings_dir):
            os.makedirs(c_settings_dir)

        ## Now create 5 needed files for current Run ID

        # Create the file Manager
        Create_new.file_Manager(settings_dir,input_dir,output_dir,c_Site_ID,cRID_char)
        
	# Create the snow Desicians file
	Create_new.Desicions(Decisions_ALL,settings_dir,c_Site_ID,cRID_char,datestart,dateend)

        # Edit Parameter settings for current run
        Create_new.ParamTrial(new_param_all,new_param_val,param_2_vary,NPruns,settings_dir,c_Site_ID,cRID_char)

        # Create run output file (overwrites previous)
        if not os.path.exists(run_output):
            ftemp = open(run_output,'w')
            ftemp.close() # Simple way to make a file

	# See submit_FUSE_SNOW_Runs.py to submit Runs    
	    
        # End of current Paramter set Run