Slaton Lipscomb

Slaton's Tips:
How To Create & Run IMAGIC Batch Jobs with MODE-ACCUMULATE

Last updated February 21, 2006
Comments/corrections welcome.

Parts of the following are adapted from the IMAGIC manual, which is copyright by Image Science Software GmbH.

Imagine that you have a huge dataset of images and you want to calculate the Fourier transform for each of them, or run a computationally-intensive operation such as MULTI-REF-ALIGN or MSA-RUN. This corresponds to a lot of work for your computer and will cost a lot of CPU (and your) time. While calculating all of this stuff your shell/desktop remains in use.

Another scenario is that you want to start a sequence of commands and you do not want to wait until the end of each program to start the next IMAGIC command.

To deal with such problems IMAGIC can "accumulate" commands and can create command or job files. While not as powerful (or arcane) as SPIDER's batch command language, IMAGIC's "accumulation mode" is very useful for running computationally-intensive or tedious jobs.

First call IMAGIC and give the command:

IMAGIC-COMMAND : MODE-ACCU

IMAGIC answers with:

IMAGIC-COMMAND (ACC.) :

Now you can give any IMAGIC command you want. As usual give the corresponding answers to all IMAGIC questions and use ? to get help. You can also give more than one command here. If you want to stop after all the commands are given, then type the IMAGIC command MODE-STOP.

IMAGIC-COMMAND (ACC.) : MODE-STOP

IMAGIC will now create a batch / command file that contains all the commands you have typed in one after the other. IMAGIC prompts you for a name to be given to this command file.

IMAGIC-COMMAND (ACC.) : MODE-STOP

Give file name for command file (bigjob) :

You can give any name you want. Example:

IMAGIC-COMMAND (ACC.) : MODE-STOP

Give file name for command file (bigjob) : myjob

IMAGIC will create a command / batch file using the specified name with the extension .b, in this case myjob.b (UNIX). IMAGIC will also give you some help on how to start the command / batch file.

To run your job on the monitor please use
the UNIX command:  ./myjob.b

To run it as a hidden job please use the UNIX
command: ./myjob.b > myjob.log &

Before starting the job you can, of course, edit the corresponding command / batch file.

In IMAGIC-COMMAND (ACC.): you can also use ? or HELP as an answer to every question and * to leave a given command without aborting the MODE-ACCUMULATE status. Or, if you want to interrupt the whole process because some of the input is wrong, you can type instead:

IMAGIC-COMMAND (ACC.) : MODE-ABORT

IMAGIC then ignores all commands and returns to the normal mode with:

IMAGIC-COMMAND :

See also the commands MODE-SEND-TO-BATCH and MODE-RUN, which can be used instead of MODE-STOP or MODE-ABORT.

Once the batch file has been created, it can be run in the background, with a log kept:

$ ./myjob.b > myjob.log &

To monitor the job's progress, use the following command:

$ tail -f myjob.log

At this point, the job can only be killed with the kill (or killall) command.