Parallel GAP/MPI (ParGAP/MPI), a share package for GAP

This package works only under UNIX. (Cygwin is an option on Windows, but you will have to port it, then.) The most recent version of this package can always be found in the ParGAP ftp directory. You can also find ParGAP/MPI at its web page for GAP share package, ParGAP. A good introduction to ParGAP is available as a preprint in either gzipped postscript format or in dvi format. There is also a ParGAP manual (.ps) or .pdf. It has been tested on Linux (ELF, Pentium), Solaris 2.6 (sparc) and OSF 1 (alpha), and IRIX 6.5 (SGI). To unpack:

# Replace gap4r3 by the directory where you store GAP.
cd .../gap4r3/pkg/
gunzip pargap.tar.gz
tar xvf pargap.tar

It can be installed as described for a generic GAP share package:

cd .../pkg/pargap
./configure ../..

Verify that .../pkg/pargap/bin/ and .../pkg/pargap/bin/procgroup have correct paths.

If you had trouble installing it, please see the next section of this file. Otherwise, try it out:

cd .../pkg/pargap/bin
[ALTERNATIVE: PATH/ -p4pg PATH/procgroup]

gap>  # This assumes your procgroup file includes two slave processes.
gap>  PingSlave(1);
gap>  SendMsg( "Print(3+4)" );
gap>  SendMsg( "Print(3+4,\"\\n\")" );
gap>  SendMsg( "3+4", 2);
gap>  RecvMsg( 2 );
gap>  FlushAllMsgs();
gap>  SendRecvMsg( "Exec(\"pwd\")" );
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();
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 );
gap>  SendMsg( "a", 1 );
gap>  RecvMsg( 1 );
gap>  myfnc := function() return 42; end;
gap>  BroadcastMsg( PrintToString( "myfnc := ", myfnc ) );
gap>  SendRecvMsg( "myfnc()", 1 );
gap>  FlushAllMsgs();
gap>  squares := ParList( [1..100], x->x^2 );
gap>  MSexample();
gap>  BroadcastMsg( PrintToString("MSList := ", MSList) );
gap>  ParTrace := false;
gap>  BroadcastMsg( PrintToString("MSList := ", MSList) );
gap>  ParEval( "MSList( [10..20], x->x^2 )" );
gap>  ParRead( "/home/gene/.gaprc" );

The ParGAP/MPI share package was designed and written by Gene Cooperman, College of Computer Science, Northeastern University, Boston, MA, U.S.A.

If you use ParGAP/MPI to solve a problem then please send a short email to `' about it, and reference the ParGAP/MPI package as follows:

      Cooperman, Gene,
      {\sl Parallel GAP/MPI (ParGAP/MPI)}, Version 1,
      College of Computer Science, Northeastern University, 1999,

Note that this package currently modifies the GAP src and bin files, and creates a new GAP kernel. This new GAP kernel can be shared by traditional users of the old, sequential GAP kernel, and by those doing parallel processing. (A future version of GAP should allow ParGAP/MPI to be loaded into GAP without modification to the kernel.)

The GAP kernel will have identical behavior to the old GAP kernel when invoked through the script or the bin/@GAParch@/gap binary. The new ParGAP variables will appear to the end user _ONLY_ if the GAP binary was invoked as pargapmpi: a symbolic link to the actual GAP binary. The script,, does this.

So, in a multi-user environment, traditional users can continue to use without noticing any difference. Only an invocation as will add the new features.

Comments and contributions to a ParGAP user library, or any other type of assistance, are gratefully accepted.

							Gene Cooperman

NOTE: This material is based upon work supported by the National Science Foundation under Grants No. CCR-9732330 and CCR-0204113. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.