用达蒙收集SGE的工作信息

sgejob的Python项目详细描述


sgejob

1简介

和达蒙一起收集SGE的工作信息。见https://github.com/linzhi2013/sgejob

2安装

确保您的pip来自python3

$ pip install sgejob

将在pip命令所在的同一目录下创建命令sgejob_daemon

如果您想进一步了解python3和pip,请参阅https://www.python.org/https://docs.python.org/3/tutorial/venv.html?highlight=pip

3用法

$ sgejob_daemon

    usage: sgejob_daemon.py [-h] [-qstat <str>] [-user <str>] [-PIDFILE <file>]
                            [-DAEMON_LOG <file>] [-sge_infor_file <file>]
                            [-sge_usage_file <file>] [-interval INTERVAL]
                            {start,stop} ...

    Start and stop a daemon to collect SGE job information. see https://github.com/linzhi2013/sgejob

    Copyright (c) 2018 Guanliang Meng (see https://github.com/linzhi2013).

    The function `daemonize()` part was copied from
    `https://python3-cookbook.readthedocs.io/zh_CN/latest/c12/p14_launching_daemon_process_on_unix.html`,
    which is licensed under the Apache License, Version 2.0.



    positional arguments:
      {start,stop}
        start               start the daemon
        stop                stop the daemon

    optional arguments:
      -h, --help            show this help message and exit
      -qstat <str>          the qstat command to be used [qstatt]
      -user <str>           whose SGE jobs to be collected? [mengguanliang]
      -PIDFILE <file>       set PIDFILE path [/home/mengguanliang/sge_daemon.pid]
      -DAEMON_LOG <file>    set DAEMON_LOG path
                            [/home/mengguanliang/sge_daemon.log]
      -sge_infor_file <file>
                            set sge infor_file path
                            [/home/mengguanliang/sge.infor_df.csv]
      -sge_usage_file <file>
                            set sge usage_file path
                            [/home/mengguanliang/sge.usage_df.csv]
      -interval INTERVAL    how often to check the SGE job status? [300]

用作模块

  In [5]: from sgejob import UserJobs, SgeJob, record_jobs

  In [6]: UserJobs?
  Init signature: UserJobs(user=None, qstat='qstat')
  Docstring:
  `UserJobs` object has one attribute `jobs`, which is a dictionary, whose keys are the sge job numbers.

  Then `UserJobs.jobs[job_number]` is also a dictionary, whic has following
  keys:

  ['JB_job_number', 'JAT_prio', 'JB_name', 'JB_owner', 'state',
   'JAT_start_time', 'queue_name', 'slots']
  File:           ~/soft/script/sgejob/source/v0.0.1/sgejob/sgejob.py
  Type:           type

  In [7]: SgeJob?
  Init signature: SgeJob(job_number=None, qstat='qstat')
  Docstring:
  `SgeJob` object has two attributes: `infor` and `usage`.

  `SgeJob.infor` is a dictionary, corresponding to the output content of
  `qstat -j job_number`, where the first column is the key, the second column
  is the value.

  `SgeJob.usage` is also a dictionary, whose content is from
  `SgeJob.infor['usage         1']`.


  `SgeJob.infor` has following keys:

  ['current_time', 'job_number', 'exec_file', 'submission_time', 'owner',
   'uid', 'group', 'gid', 'sge_o_home', 'sge_o_log_name', 'sge_o_path',
   'sge_o_shell', 'sge_o_workdir', 'sge_o_host', 'account', 'cwd',
   'hard resource_list', 'mail_list', 'notify', 'job_name', 'jobshare',
   'hard_queue_list', 'env_list', 'script_file', 'project', 'binding',
   'job_type', 'usage         1', 'binding       1', 'scheduling info']


  `SgeJob.usage` has following keys:

  ['current_time', 'job_number', 'cpu', 'mem', 'io', 'vmem', 'maxvmem']
  File:           ~/soft/script/sgejob/source/v0.0.1/sgejob/sgejob.py
  Type:           type

  In [8]: record_jobs?
  Signature: record_jobs(user=None, qstat='qstat', running_only=True, infor_df_csvfile=None, usage_df_csvfile=None)
  Docstring:
  Collect job information and append to infor_df_csvfile and
  usage_df_csvfile.

  user=None, collect current user's jobs.

  if running_only=True, it will only collect the running jobs.

  return: None.
  File:      ~/soft/script/sgejob/source/v0.0.1/sgejob/sgejob.py
  Type:      function

5条引文

目前,我没有计划发布sgejob

6作者

孟冠良。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java得到的分数是Android屏幕大小的25%   爪哇杰克逊。数据绑定。JsonNode()在null字段上返回true(不应该返回)   java使用改型2获取和获取未知数据集   java Play框架:使用WS将图像发布到imageshack   高效eclipse的java最佳设置   swing KeyListener Java   无法解析java链表   java ListView内存问题   java在创建重载构造函数、实例化对象时遇到问题   如何在java中沿树进行预排序遍历,并打印0和1以对应每个节点上的特定字符?   swing在Java中使用矩阵和JButton设计扑克UI   SpringREST异常无法读取JSON:无法反序列化java实例。lang.从START_对象中取出的字符串   java如何消除JPanel的透明度   为什么“i”和“i”在Java for循环中有相同的行为?   java静态工厂方法   java在不使用Stringbuilder的情况下将SQLite数据设置为JsonObject类   java能否为标题“DispositionNotificationTo”分配2个或更多地址?   java无法打开openclinica