[GAP Forum] Run GAP command for x seconds
Frank Lübeck
frank.luebeck at math.rwth-aachen.de
Thu Jan 28 13:26:49 GMT 2021
On Thu, Jan 28, 2021 at 10:31:28AM +0000, Carl-Fredrik Nyberg Brodda (MTH - Postgraduate Researcher) wrote:
> Chris: I cannot seem to load the function IO_CallWithTimeout, or indeed
> IO_CallWithTimeoutList -- there seems to be no function with this name. I
> have IO 4.5.2 loaded.
Dear Carl-Frederik, dear Forum,
The functions IO_CallWithTimeout and IO_CallWithTimeoutList are pretty new
and mainly for convenience with respect to specifying the time, they just
call ParDoByFork.
> Frank: Your code runs fine, but when I run e.g the following code
> > ParTakeFirstResultByFork([function(x) local F; F := FreeGroup(x); return
> F; end], [[1]],rec(TimeOut :=rec(tv_sec :=2, tv_usec := 0 )));
>
> this makes my GAP go haywire and totally breaks it,
> [...]
There is a limitation in the kind of return values of the called functions.
GAP must be able to encode (serialize) any return value with IO_Pickle
and decode it with IO_Unpickle (this is how the forked child process
transfers its result to the parent process).
Unfortunately, a free group which is returned by your simple function
is not among the supported objects. See
?IO_Pickle
for more details.
Best regards again,
Frank
--
/// Dr. Frank Lübeck, Lehrstuhl für Algebra und Zahlentheorie,
\\\ Pontdriesch 14/16, 52062 Aachen, Germany
/// E-mail: Frank.Luebeck at Math.RWTH-Aachen.De
\\\ WWW: http://www.math.rwth-aachen.de/~Frank.Luebeck/
More information about the Forum
mailing list