Skip to content

Commit

Permalink
updated readme and man page
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed May 28, 2021
1 parent 83b972a commit e3f9289
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 23 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ Then one can add `-L$(CUDA_HOME)/lib64/stubs` to [this line](./Makefile#L29) in
```
Why would you want to do that anyway?

## Known issues

- This is not an issue, but when multiple consecutive GPU jobs are queued,
after the first job runs, there is a small delay for the next GPU job to run
in order to ensure that the same GPUs are not claimed by different jobs.
There was an issue causing this delay significantly longer as reported in [`#2`](https://github.com/justanhduc/task-spooler/issues/2)
but has been fixed in [176d0b76](https://github.com/justanhduc/task-spooler/commit/176d0b76).
To avoid the delay, you can use `-g` to indicate the exact GPU IDs for the job.


## Mailing list

I created a GoogleGroup for the program. You look for the archive and the join methods in the taskspooler google group page.
Expand All @@ -103,11 +113,7 @@ When the job finishes, the client notifies the server. At this time, the server

Moreover the client can take advantage of many information from the server: when a job finishes, where does the job output go to, etc.

## Download

Download the latest version (GPLv2+ licensed): ts-1.0.tar.gz - v1.0 (2016-10-19) - Changelog

Look at the version repository if you are interested in its development.
## History

Андрей Пантюхин (Andrew Pantyukhin) maintains the BSD port.

Expand All @@ -121,10 +127,11 @@ Gnomeye maintains the AUR package.

Eric Keller wrote a nodejs web server showing the status of the task spooler queue (github project).

Duc Nguyen took the project and develops a GPU-support version.

## Manual

**NOTE**: `man ts` is not updated (yet).
See below or `man ts` for more details.

```
usage: ts [action] [-ngfmdE] [-L <lab>] [-D <id>] [cmd...]
Expand Down Expand Up @@ -184,8 +191,8 @@ Options adding jobs:
## Thanks

**Author**
- Lluís Batlle i Rossell, <[email protected]>
- Duc Nguyen, <[email protected]>
- Duc Nguyen, <[email protected]>
- Lluís Batlle i Rossell, <[email protected]>

**Acknowledgement**
* To Raúl Salinas, for his inspiring ideas
Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int server_socket;
static char getopt_env[] = "POSIXLY_CORRECT=YES";
static char *old_getopt_env;

static char version[] = "Task Spooler v1.1 - a task queue system for the unix user.\n"
static char version[] = "Task Spooler v1.2 - a task queue system for the unix user.\n"
"Copyright (C) 2007-2020 Duc Nguyen - Lluis Batlle i Rossell";


Expand Down Expand Up @@ -446,10 +446,10 @@ static void print_help(const char *cmd) {
printf(" -T send SIGTERM to all running job groups.\n");
printf(" -u [id] put that job first. The last added, if not specified.\n");
printf(" -U <id-id> swap two jobs in the queue.\n");
printf(" -B in case of full queue on the server, quit (2) instead of waiting.\n");
printf(" -h show this help\n");
printf(" -V show the program version\n");
printf("Options adding jobs:\n");
printf(" -B in case of full clients on the server, quit instead of waiting.\n");
printf(" -n don't store the output of the command.\n");
printf(" -E Keep stderr apart, in a name like the output file, but adding '.e'.\n");
printf(" -z gzip the stored output (if not -n).\n");
Expand Down
67 changes: 54 additions & 13 deletions ts.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
.\" that should have been distributed together with this file.
.\"
.\" Note: I took the gnu 'ls' man page as an example.
.TH TS 1 2016-03 "Task Spooler 1.0"
.TH TS 1 2021-05 "Task Spooler 1.2"
.SH NAME
ts \- task spooler. A simple unix batch system
.SH SYNOPSIS
.BI "ts [" actions "] [" options "] [" command... ]
.sp
Actions:
.BI "[\-KClhV]
.BI "[\-KClhVTRq]
.BI "[\-t ["id ]]
.BI "[\-c ["id ]]
.BI "[\-p ["id ]]
Expand All @@ -25,11 +25,18 @@ Actions:
.BI "[\-i ["id ]]
.BI "[\-U <"id - id >]
.BI "[\-S ["num ]]
.BI "[\--get_gpu_wait]
.BI "[\--set_gpu_wait ["sec ]]
.BI "[\-a/--get_label ["id ]]
.BI "[\-F/--full_cmd ["id ]]

.sp
Options:
.BI "[\-nfgmd]"
.BI "[\-nEfzmd]"
.BI "[\-L <"label >]
.BI "[\-D <"id >]
.BI "[\-D <"id1,id2,... >]
.BI "[\-G/--gpus ["num ]]
.BI "[\--gpus_indices <"id1,id2,... >]

.SH DESCRIPTION
.B ts
Expand All @@ -42,16 +49,16 @@ Calling
with a command will add that command to the queue, and calling it without
commands or parameters will show the task list.
.SH COMMAND OPTIONS
When adding a job to ts, we can specify how it will be run and how will the
results be collected:
When adding a job to ts, we can specify how it will be run and how the
results will be collected:
.TP
.B "\-n"
Do not store the standard output/error in a file at
.B $TMPDIR
- let it use the
file descriptors decided by the calling process. If it is not used, the
.B jobid
for the new task will be outputed to stdout.
for the new task will be output to stdout.
.TP
.B "\-g"
Pass the output through gzip (only if
Expand Down Expand Up @@ -80,11 +87,14 @@ the queue. It makes more comfortable distinguishing similar commands with
different goals.
.TP
.B "\-d"
Run the command only if the command before finished well (errorlevel = 0). This new
task enqueued depends on the result of the previous command. If the task is not run,
it is considered as failed for further dependencies.
Run the command only after the last command finished.
It does not depend on how its dependency ends.
.TP
.B "\-D <id,...>"
Run the command only after the specified job IDs finished.
It does not depend on how its dependencies end.
.TP
.B "\-D <id>"
.B "\-W <id,...>"
Run the command only if the job of given id finished well (errorlevel = 0). This new
task enqueued depends on the result of the previous command. If the task is not run,
it is considered as failed for further dependencies.
Expand All @@ -108,6 +118,12 @@ Run the command only if there are \fbnum\fB slots free in the queue. Without it,
the job will run if there is one slot free. For example, if you use the
queue to feed cpu cores, and you know that a job will take two cores, with \fB\-N\fB
you can let ts know that.
.TP
.B "\-G/--gpus <num>"
Run the job with \fbnum\fB GPUs.
.TP
.B "\-g/--gpu_indices <id,...>"
Run the job with the specified GPU IDs. GPU IDs should be separated by commas.
.SH ACTIONS
Instead of giving a new command, we can use the parameters for other purposes:
.TP
Expand All @@ -124,6 +140,9 @@ It is not reliable to think that
.B ts -K
will finish when the server is really killed. By now it is a race condition.
.TP
.B "\-T"
Send SIGTERM to all running job groups.
.TP
.B "\-C"
Clear the results of finished jobs from the queue.
.TP
Expand All @@ -133,6 +152,28 @@ This is the default behaviour if
.B ts
is called without options.
.TP
.B "\-q/--last_queue_id"
Show the job ID of the last added.
.TP
.B "\-R/--count_running"
Return the number of running jobs
.TP
.B "\--get_gpu_wait"
Get the time to wait before running the next GPU job. This time delay is to ensure
two closely consecutive jobs do not share GPUs as GPUs' memory is not filled up
immediately after a job claims.
.TP
.B "\--set_gpu_wait <sec>"
Set time to wait before running the next GPU job (30 seconds by default).
This time delay is to ensure two closely consecutive jobs do not share GPUs
as GPUs' memory is not filled up immediately after a job claims.
.TP
.B "\-a/--get_label <id>"
Show the job label. Of the last added, if not specified.
.TP
.B "\-F/--full_cmd <id>"
Show the full command. Of the last added, if not specified.
.TP
.B "\-t [id]"
Show the last ten lines of the output file of the named job, or the last
running/run if not specified. If the job is still running, it will keep on
Expand Down Expand Up @@ -310,11 +351,11 @@ is created, which you can submit to the developer in order to fix the bug.
.SH SEE ALSO
.BR at (1)
.SH AUTHOR
Lluis Batlle i Rossell
Duc Nguyen and Lluis Batlle i Rossell
.SH NOTES
This page describes
.B ts
as in version 1.0. Other versions may differ. The file
as in version 1.2. Other versions may differ. The file
.B TRICKS
found in the distribution package can show some ideas on special uses of
.B ts.

0 comments on commit e3f9289

Please sign in to comment.