Submitting from a Rappture tool¶
How a Rappture wrapper script calls submit to run its simulation on a
cluster instead of in the tool session. The page is kept for hubs that
still run Rappture tools.
Warning
Rappture is deprecated. rappture.org now redirects to a
nanoHUB page that is not readable without an account, and no new tool
should be built on it. If you are writing a tool today, drive submit
from a notebook instead: see
Submitting from a Jupyter notebook.
Note
Rappture and submit both belong to the tool execution
platform, which is separate software and is not in this repository,
so none of this could be checked against the code here. The examples are
the ones that shipped with the original documentation, with import damage
repaired: escape sequences that had been doubled are back to single
backslashes, and the errors noted in each section below are corrected.
They are Python 2 era code and are illustrations, not a tested library.
The pattern is the same in every language. Build a small shell script that
runs submit in the background, run that script through the Rappture
helper that forwards signals, and gather the job's output files afterwards.
Handling the signal matters: without it, pressing Abort in the tool
leaves the remote job running and consuming the hub's resource allocation.
TCL wrapper script¶
Catch the Abort interrupt first. Setting execctl to 1 terminates the
process and its children.
Then build a script to run with Rappture::exec. The trap statement
catches the interrupt raised when the wrapper is aborted. Putting submit
in the background allows several submit commands in one script, and
wait holds the script open until they have all finished.
Run it the usual way. The output of every submit command in the script is
streamed to the display and kept in out.
Each submit command writes the command's standard output and error to
JOBID.stdout and JOBID.stderr, where JOBID is the run identifier
submit assigned. Gather them like this.
Remove the script, then present the gathered text as the job's output log. Everything after that is ordinary result processing.
Python wrapper script¶
Import the helper that runs a command and traps the signals the Abort
button raises. submit must finish before RapptureExec returns.
Build the command as a list and run it. Its output is streamed to the
display and kept in stdOutput.
Gather the job's own output files afterwards, then hand the text to the output log.
Note
The published version of this example called os.getpwd(),
which is not a Python function, missed the re import, and appended the
letter n where a newline was meant. All three are corrected above.
Perl wrapper¶
Catch the Abort interrupt.
Build the shell script. trap catches the interrupt raised on abort, and
wait holds the script open until submit finishes.
Run it with the usual fork and exec. This route cannot stream the command's output.
The JOBID.stdout and JOBID.stderr files are gathered with ordinary Perl
file matching and reading, and result processing proceeds as normal.
Octave and MATLAB scripts¶
rpExec runs a command and terminates it on an interrupt, hangup or
terminate signal, so the process stops when Abort is pressed.
COMMAND is the set of strings making up the command to run. When
STREAMOUTPUT is 1, the command's standard output and error are piped
back to the current process as it runs. EXITSTATUS is 0 when no error
occurred; STDOUTPUT and STDERROR, if asked for, hold copies of the two
streams.
Note
The published version of this example wrote -wallTime, which
submit reads as -w allTime. The long form takes two hyphens; the
short form is -w. The tool name is an example — run
submit --help tools for the ones your hub has.
Reviewed against 2.4-main @ e097e0236d on 2026-09-10.