Skip to content
Justin Bassett edited this page Apr 4, 2020 · 12 revisions

Welcome to the OptSched wiki!

This is a place for helpful tips and tricks for working with OptSched as a project developer.


Running a long-running command over SSH

Building the benchmark suites take a long time. There are also several long-running tasks which we may need to do. For this, the screen command can be useful.

In it's simplest form, run: screen -q the command to run (e.g. screen -q ninja), or screen -q bash -c '...' for more complex scripts which need redirection or pipes. Ctrl+AD puts the screen into the background, and you can then log out of your ssh session. screen -r resumes.

Building a task queue with screen

More generally, you can have screen work as a task queue and queue up several commands to run after each other. See this SuperUser answer:

startqueue: starts the queuing system.

#!/usr/bin/env bash
screen -d m -S queue

queue: enqueue a command

#!/usr/bin/env bash
screen -S queue -X stuff "$@^M"

Where the ^M is a single special character. In vim in insert mode, produce it by typing Ctrl+V M. You may want to :set list to show the special character.

viewqueue: Look at the screen.

#!/usr/bin/env bash
screen -S queue -r
Clone this wiki locally