Synchronous and asynchronous execution

Synchronous mode

By default, clcservercommands are run synchronously. Synchronous mode can be useful when running short, individual jobs, for example when testing.

In synchronous mode:

Considerations when launching many jobs synchronously include memory use for the waiting command, and that the number of user processes allowed is sufficient (ulimit setting). Adding sleep 10 between the commands in a script may help keep the memory needed for the waiting command to a minimum. When launching multiple tasks and using scripts, asynchronous mode may be preferable.

Asynchronous mode

Adding the -Y flag to a clcserver command will run the task asynchronously. Asynchronous mode can be particularly useful when submitting many jobs, including using scripts, and when submitting jobs expected to run a long time.

In asynchronous mode:

clcserver options relevant for asynchronous mode are:

-Y
Run the task asynchronously. The process ID is returned. This can be used with the -I and -R options, described below.

Note: The -I and -R options, although generally intended for working with asynchronous jobs, apply to any process in the process list.

-I
Return status and progress information for all processes. A non-administrative user receives information for only their own processes. Administrative users receive information for all processes in the process list.
-I <process ID>
Return status and progress information for the specified process. To query the status and progress of multiple processes, include additional -I <processID> terms.
-R <process ID>
Return the list of results generated by the specified process. Include additional -R <processID> terms to return lists of results from multiple jobs.

Important: The specified process is removed from the process list after the list of results has been returned. Thus, this option can be used only once for any given process. Adding -O <filename.txt> to this command will save the list of results to a file for later reference. See Saving a list of results for further details.

-R <process ID> -R cancel
Cancel the specified process if it is still running. Canceled asynchronous processes remain in the process list. When queried using -I, the progress description message states the job was canceled. Canceled synchronous processes are cleared from the process list. A non-administrative user can only cancel their own processes. A separate command is needed for each process to be canceled.
-R cancel-all
Cancel all running processes. Canceled asynchronous processes remain in the process list until further action is taken to remove them (see below). When such processes are queried using -I, the progress description message states the job was canceled. By contrast, canceled synchronous processes are immediately cleared from the process list. A non-administrative user can only cancel their own processes. Warning: If an administrative user uses-R cancel-all, all users' processes will be canceled.

Clearing finished processes from the process list

A process for a job run in asynchronous mode is not cleared from the list automatically. The user who launched the job can clear finished processes from the process list by:

An CLC Server administrative user can clear any user's finished processes from the process list by:

Note: The process list for all users is cleared when the CLC Server is restarted.