qstat and long job names

后端 未结 9 1522
[愿得一人]
[愿得一人] 2021-01-31 08:23

How can I get qstat to give me full job names?

I know qstat -r gives detailed information about the task, but it\'s too much and the resource r

9条回答
  •  孤街浪徒
    2021-01-31 08:41

    python code

    import xmltodict
    import subprocess as sp
    import pandas as pd
    
    qstat_xml = sp.check_output(['qstat','--xml'], stderr=sp.STDOUT)  # read xml
    stat_dict = xmltodict.parse(qstat_xml) # convert to dict
    job_list = stat_dict['Data']['Job'] # select job_list
    job_df = pd.DataFrame(job_list) # convert to dataframe
    print('columns', job_df.columns) # print available columns
    column_list = ['Job_Id', 'Job_Name']
    selection_df = job_df[column_list]  # select columns
    print(selection_df)
    

提交回复
热议问题