multi-run

multi-run is an emacs package that manages multiple terminals and runs commands in them.

Sagar Jha      View on GitHub Download v1 .zip Download v1 .tar.gz
Menu Introduction Features   1. Creating Terminals   2. Running Commands   3. Active Terminals   4. Aborting Commands   5. Commands with delay   6. Loops Installation Customization tips Advanced examples   1. gdb   2. Performance tests   3. Miscellaneous New Features   1. Opening Remote Files Conclusion

Miscellaneous   1. sl: Term vs Eshell   2. delay + music   3. stampede 64 nodes   4. Synchronous Escape


View on GitHub

Miscellaneous Examples

Difference between using term and eshell

All eshell terminals are run by Emacs (single-process). Each terminal emulator, however, runs bash as a different process. This can matter, for example, when running the command sl (steam locomotive) using multi-run:

multi-run-loop

Different delay commands

The following video shows the difference between the two delay commands by playing some music using the play command. If you pause the video at 1 second, you can see the select-notes function that is run with multi-run. Expect some abrupt sound changes.

multi-run-loop

Running on Stampede Supercomputing cluster

I was running some experiments on the Stampede supercomputing cluster on up to 128 nodes. Because of the limited resources, my script wasn’t able to run successfully. It was hard to debug because the script would run in their batch scheduling environment. In the interest of time, I decided to manually run them in the terminal. The following video shows one run of the program on 64 terminals:

multi-run-loop

Game Idea: Synchronous Escape

I like the idea of using games to illustrate a concept. The best I can think of is a maze problem where you have multiple mazes and the goal is to exit all the mazes simultaneously by using the same set of movement commands (L, R, U, D). When a movement command cannot be executed in a maze, the player remains in the same position in that maze, but its position in the other mazes can still change. This game can be played (conceptually, not implemented yet) using multi-run with a terminal for each maze and the movement commands communicated by running them through multi-run. I call this game synchronous escape . Even though this is decidable, it is inspired by the undecidable Post correspondence problem.

The following is an illustration of the gameplay, walking through solving one instance of the game:

The starting position

All the four players need to simultaneously reach the goal. We first take one step to the right (multi-run “R”).

one step to the right

After that, they all take one step down.

one step down

Notice that the action has no effect on players 2 and 4 because they can’t move down.

Similarly, the sequence of steps “RDDLLU” from here will ensure that all players reach the goal simultaneously.

solved

back