tq—简单的命令行作业管理器
英文描述:
TQ(任务队列)是一个简单的命令行作业管理器。原则上TQ是
一个非常灵活和智能的ATD(8),它可以安排一系列的工作
有效的方法。
(1)默认情况下,TQ将按FIFO顺序逐个运行作业。
(2)优先级高的作业将提前处理。
(3)给定估计的占用系数,可以在
尽量平行。
作业队列的管理基于sqlite3数据库,其中
存储有关每个作业的信息,包括开始和结束时间。
中材(中文说明):
一、检测方法。
自动驾驶仪,自动驾驶仪
全面质量管理
预测
英国内政部
英国
功能tq将您的命令保存在队列中,并逐个执行它们。
支持优先级属性。调度程序将首先执行高优先级命令行。
支持资源占用系数。调度程序将尽可能长时间并行执行命令行。
程序输出将重定向到添加任务的目录下的tq.out和tq.err。
队列保存在sqlite3中。即使发生断电也不会丢失任何数据。
无依赖性,重量轻。这个工具只依赖于python3本身。(支持sqlite3)
安装
pypi上提供了这些工具。只需发出以下命令:pip3 install tq1
注意,python3 >= 3.6是必需的,因为使用了新的语言功能
在密码里。没有计划支持较低版本的python。
真实生活示例
TQ可用于以异步方式处理某些命令。例如$ tq -- git push # Doesn't block. Have it done in async.
$ vim mycode.py
TQ可用于管理一系列计算实验,例如
深度学习实验,例如$ tq r5 -- caffe train -solver net1forfun.prototxt
$ tq r5 -- caffe train -solver net2forfun.prototxt
$ tq 1 5 -- python3 train.py --lr 1e-2
$ tq 1 5 -- python3 train.py --lr 1e-3
$ tq 1 5 -- python3 train.py --lr 1e-4
$ tq 1 5 -- python3 train.py --lr 1e-5
$ tq p10 -- python3 important_train.py
一个人只要把许多计算任务放在队列中,TQ就会很聪明
根据给定的优先级和资源安排这些实验
占用参数。
用法Usage: tq ACTION [COMMAND_ARGS]
tq [P R] -- TASK
Available Actions:
start start TQ's daemon
stop stop TQ's daemon
log dump log to screen
ls fancy print of task queue
db print database content to screen
rm remove task with specified id, see ID with tq ls
clean remove finished tasks from queue
purge remove log file and sqlite3 db file
Apending Task:
-- TASK append TASK to the queue
p
-- TASK append TASK with priority P to the queue
r -- TASK append TASK with resource occupancy R to the queue
P R -- TASK append TASK with priority P and estimated occupancy R
int P default 0 range [INT_MIN, INT_MAX], large=important
int R detault 10 range [1, 10], large=consuming
用法示例0. Daemon: to start or stop the daemon
tq start
tq stop
1. Serial: the two given tasks should be executed one by one
tq -- sleep 100
tq -- sleep 100
2. Parallel: each task occupies 40% of resource.
In this example two tasks will be active at the same time.
tq r4 -- sleep 100
tq r4 -- sleep 100
tq r4 -- sleep 100
3. Priority: break the FIFO order of tasks. 1 > default Priority.
tq p1 -- sleep 100
4. Special Case: run the given task right away ignoring Pri and Rsc
tq 1 0 -- sleep 100
另请参见
ATD(8),高温秃鹰,扭矩,泥浆,PBS。
许可证
麻省理工学院执照。
欢迎加入QQ群-->: 979659372
推荐PyPI第三方库