Exemplo n.º 1
0
def report_job_problem(idconn,ID,job_reported,STATE):
    # Obtain WN where the Wait Job was assigned
    worknodes = stat_job.statjob(ID,job_reported)
    main_information = ["Job_Name", #0
                        "Job_Owner", #1
                        "job_state", #2
                        "queue", #3
                        "ctime", #4
                        "Error_Path", #5
                        "mtime", #6
                        "Output_Path", #7
                        "Priority", #8
                        "qtime", #9
                        "session_id", #10
                        "stagein", #11
                        "stageout", #12
                        "etime", #13
                        "start_time"] #14
    
    dict_resource = stat_job.get_attribs(ID,job_reported)
    
    if dict_resource['job_state'] == STATE:
        index = dict_resource['lenght_resources']
        for i in main_information:
            sys.stdout.write("\x1b[01;34m" + i + "\x1b[00m" + " - " + dict_resource[i])
            sys.stdout.write("\n")
Exemplo n.º 2
0
def report_job_problem(idconn,ID,job_reported,STATE):
    # Obtain WN where the Wait Job was assigned
    worknodes = stat_job.statjob(ID,job_reported)
    attribs = stat_job.define_attribs(ID,job_reported)
    attribs_resources = []    
    attribs_values = []    
    
    index = len(attribs)    
        
    for attr in attribs:
        id_resource = stat_job.getResourceID(attribs,attr)
        attribs_resources.append(stat_job.resource_name_forjob(ID,job_reported,id_resource))
        attribs_values.append(stat_job.resource_forjob(ID,job_reported,id_resource))
    
    # Controlla se il job e' ancora wait prima di inserire le informazioni
    if (stat_job.getResourceValue(ID,job_reported,"job_state") == STATE):
        store_report(idconn,job_reported,attribs,attribs_values)        
Exemplo n.º 3
0
def node_list_by_job(ID,status,id_job):
    machines = []

    
    attribs = pbs.new_attropl(1)
    
    if id_job == "":
	attribs[0].name = pbs.ATTR_state
	attribs[0].value = status
	attribs[0].op =  pbs.EQ
    else:	
	attribs[0].name = pbs.ATTR_N
	attribs[0].value = job_id
	attribs[0].op =  pbs.EQ
        
    jobs = pbs.pbs_selectjob(ID, attribs, 'NULL')
    
    if status == "W":
	print "Numero Jobs Bloccati:",len(jobs), "\n"

    if status == "R":
	print "Numero Jobs Attivi sul sistema:",len(jobs), "\n"

    if status == "Q":
	print "Numero Jobs in coda:",len(jobs), "\n"

    
    print "Attendere prego ..."
    log = open("logs/result.txt","w")
    for i in jobs:
	py_mach = stat_job.statjob(ID,i)
	py_tot = i, "->" ,py_mach
	py_tot2 = i, "->" ,py_mach,"\r\n"	
	log.write(str(py_tot2))
	machines.append(py_tot)

    log.close()	
    return machines