|
D.15.16.1 parallelWaitN
Procedure from library parallel.lib (see parallel_lib).
- Usage:
- parallelWaitN(commands, args, N[, timeout, linktype, servers,
maxmemory]); commands list, args list, N int, timeout int,
linktype string, servers list, maxmemory intvec
- Return:
- a list, containing the results of commands[i] applied to arg[i],
i = 1, ..., size(commands).
The procedure waits for N jobs to finish.
OPTIONAL PARAMETERS:
An optional timeout in ms can be provided. Default is 0 which
disables the timeout.
Supported linktypes are up to now "ssi" and "mp", see
Ssi links and MP links.
Servers:
Each server is given by a list containing the address of the server,
the number of cores to use on this server and the command to start
Singular.
If the address is "localhost", the processes will be generated on
the same machine using forks. If the command to start Singular is
"" (the empty string), "Singular" will be used.
Default is list("localhost", system("cpu"), "") .
There are some obvious shortcuts for servers, e.g. "myserver" is
a shortcut for
list("myserver", [nb. of cores on myserver], "") , or 3
for list("localhost", 3, "") .
Memory limits:
If an intvec maxmemory of size size(commands) is given, the
i-th job will be killed if it uses more than maxmemory[i] MB of
memory. If maxmemory[i] is 0, there will be no restraint for the
i-th job. Default is 0:size(commands) .
- Note:
- The entries of the list commands must be strings.
The entries of the list args must be lists.
The returned list may contain more than N results if several jobs
finished "at the same time". It may contain less than N results in
the case of timeout or errors occurring.
MP links do not work with a 64 bit version of Singular. If you want
to use MP links, make sure that MP is available. This can be checked
by the Singular command system("with", "MP"); .
The check whether the jobs exceed the memory sizes given by
maxmemory is only done from time to time. This feature is
experimental and should be used with care.
Example:
See also:
MP links;
Ssi links;
waitall;
waitfirst.
|