jobber examples: basic usage
This example shows a typical use of jobber on a personnel computer:
- A
task_list
must be prepared. - Processing of the list in a jobber queue must be
init
-ialized. all
tasks in the list are executed by running tasks in parallel on all cores available:--parallel=4
executes 4 tasks simultaneously, assuming a quad core processor. Timestamps show the parallel execution of 4 tasks each.
shell$# create/generate task.list
shell$cat task.list
sleep 1; echo '--task-1--' sleep 1; echo '--task-2--' sleep 1; echo '--task-3--' sleep 1; echo '--task-4--' sleep 1; echo '--task-5--' sleep 1; echo '--task-6--' sleep 1; echo '--task-7--' sleep 1; echo '--task-8--' sleep 1; echo '--task-9--' sleep 1; echo '--task-10--' shell$jobber task.list init
[2022-04-06T12:34:12] appended 10 tasks shell$jobber --parallel=4 task.list all
[2022-04-06T12:34:12] 1.1 task.worker: sleep 1; echo '--task-1--' [2022-04-06T12:34:12] 2.2 task.worker: sleep 1; echo '--task-2--' [2022-04-06T12:34:12] 3.3 task.worker: sleep 1; echo '--task-3--' [2022-04-06T12:34:12] 4.4 task.worker: sleep 1; echo '--task-4--' [2022-04-06T12:34:13] 1.1 exit status: 0 --task-1-- [2022-04-06T12:34:13] 5.5 task.worker: sleep 1; echo '--task-5--' [2022-04-06T12:34:13] 2.2 exit status: 0 [2022-04-06T12:34:13] 3.3 exit status: 0 [2022-04-06T12:34:13] 4.4 exit status: 0 --task-2-- --task-3-- --task-4-- [2022-04-06T12:34:13] 6.6 task.worker: sleep 1; echo '--task-6--' [2022-04-06T12:34:13] 7.7 task.worker: sleep 1; echo '--task-7--' [2022-04-06T12:34:13] 8.8 task.worker: sleep 1; echo '--task-8--' [2022-04-06T12:34:14] 5.5 exit status: 0 --task-5-- [2022-04-06T12:34:14] 9.9 task.worker: sleep 1; echo '--task-9--' [2022-04-06T12:34:14] 6.6 exit status: 0 --task-6-- [2022-04-06T12:34:14] 10.10 task.worker: sleep 1; echo '--task-10--' [2022-04-06T12:34:14] 7.7 exit status: 0 [2022-04-06T12:34:14] 8.8 exit status: 0 --task-7-- --task-8-- [2022-04-06T12:34:15] 9.9 exit status: 0 --task-9-- [2022-04-06T12:34:15] 10.10 exit status: 0 --task-10-- shell$