Dear GAP Forum,
I am delighted to announce the acceptance of the Share Package
ParGAP/MPI for GAP 4. ParGAP/MPI will work with the current release of
GAP4, version 4 beta 5, or the imminent GAP 4.1.
The package provides a simple, yet powerful programmer's model of
parallelism, enabling large computations to be distributed between
multiple GAP sessions running on one or more computers.
The package can be found at
or from the general GAP4 Share packages Web page:
and in the GAP 4 share packages ftp directory:
It also includes a 45 page manual, with extensive tutorial material
which can be obtained separately from
The tutorials should allow one to quickly "get up to speed" in parallel
programming. Questions should be addressed to the author:
Gene Cooperman (email@example.com)
By design, ParGAP/MPI runs well on a cheap network of UNIX or Linux
workstations. Parallelizing an interpreted language such as GAP has
some unique issues for any production-quality implementation. In order
to make ParGAP/MPI robust, the following issues have been addressed:
keyboard-generated interrupts, handling of external signals, exceptions
and ``break'' loops on a slave process, escaping from infinite loops in
a slave process, flushing pending messages, and resetting to a known
state after an error.
In addition to supporting a simple master-slave communication scheme,
there is support for the TOP-C (Task-Oriented Parallel C) model, which
allows one to _easily_ write more complex parallel applications with
many cooperating processors. Some of the features of the model are
latency tolerance, natural load balancing, robustness in the presence of
processors crashing, and support for checkpointing.
The brief example below allows you to get the flavor of the package. The
manual describes these simple commands, and also use of the TOP-C model.
The GAP Council
23 July 1999
gap> # This assumes your procgroup file includes two slave processes. gap> PingSlave(1); gap> SendMsg( "Print(3+4)" ); # Default slave is slave 1 gap> SendMsg( "Print(3+4,\"\\n\")" ); gap> SendMsg( "3+4", 2); gap> RecvMsg( 2 ); gap> FlushAllMsgs(); gap> SendRecvMsg( "Exec(\"pwd\")" ); # Start an ininite loop on a slave. gap> SendMsg("for i in [1..1000000] do for j in [1..1000000] do od; od"); gap> SendMsg("Print(\"WAKE UP\\n\")"); gap> ProbeMsgNonBlocking(); gap> ParReset(); # Send a global interrupt to all slaves gap> FlushAllMsgs(); gap> SendRecvMsg( "a:=45; 3+4", 1 ); gap> SendMsg( "a", 2 ); # Note "a" defined only on slave 1, not slave 2 gap> RecvMsg( 2 ); # Receive error reply from slave 2 gap> SendMsg( "a", 1 ); gap> RecvMsg( 1 ); gap> myfnc := function() return 42; end; # Sending more complex GAP data types, such as functions, is supported gap> BroadcastMsg( PrintToString( "myfnc := ", myfnc ) ); gap> SendRecvMsg( "myfnc()", 1 ); gap> FlushAllMsgs(); gap> squares := ParList( [1..100], x->x^2 ); # compute using all slaves gap> ParRead( "/home/gene/.gaprc" ); # read on master and slaves