Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 91213ddcfbe7f54821d42c2d9e091326 > files > 2182

gap-system-packages-4.4.12-5mdv2010.0.i586.rpm

The only modification to the source of the GAP kernel is in src/gap.c.
These modifications have "#ifdef GAPMPI" conditionalizations around them,
and so are not seen unless the GAP/MPI package has been installed.
The gap binary also links in src/gapmpi.c.

src/gap.c:InitializeGap() calls src/gapmpi.c:InitGapmpi().
InitGapmpi() is called early in the GAP initialization.
If the gap binary was _NOT_ called by a path ending in /gapmpi (typically
  a symbolic link to the true gap binary), then we assme this is a traditional
  GAP user, and InitGapmpi() terminates _without_ installing the GAP/MPI
  package.
If this is a gapmpi binary, InitGapmpi() calls MPI_Init() to initialize the
  MPI package.  MPI_Init() also modifies the command line argument
  (argc and argv) to remove any command line flags meant only for
  GAP/MPI and not for GAP.  This is done before GAP inspects its
  command line.
  If this is a slave GAP/MPI process, InitGapmpi() also modifies BreakOnError,
  SyBanner and SyQuiet, since slave processes do not have a user at
  the console to handle break loops, invormational messages, etc.
  Finally, if this is a slave, then interrupts (^C) are ignored.
  This is necessary, since a slave uses rsh for standard input, and so
  it will see remote interrupts.
Next, src/gap.c:InitInfoFuncs() will install the built-in modules.
  The last installation to be called is a call to:
       src/gapmpi.c:InitInfoGapmpi(), which returns a gapmpi module struct.
  That struct includes functions, src/gapmpi.c:InitKernel(),
  and src/gapmpi.c:InitLibrary(), which are invoked by GAP's process
  for installing built-in modules.  The former installs the GAP tables and
  registers information about the gapmpi module without creating the
  objects.  This produces no outwardly visible change in GAP.
  The latter return immediatly if MPI_Initialized() returns false.
  Otherwise, the latter installs the functions and variables that were defined
  by C code in src/gapmpi.c, using the traditional GAP module mechanism.
At this point, the GAP kernel has installed its built-in modules, and
  the new built-in functions, MPI_XXX(), GAPMPI_XXX(), etc. now exist.
  Next, GAP loads certain of its libraries.  The earlier call to MPI_Init()
  has caused libmpi.a to look at the procgroup file (found either in the
  current directory or as a command line argument using -p4pg).  That
  procgroup file indicates what remote hosts (or possibly 'localhost')
  to use for slave processes, and where gapmpi.sh can be found on those
  remote processes.  libmpi.a then uses "rsh" to invoke a remote gapmpi
  in a manner similar to what was described above.
After the GAP kernel is functioning, gapmpi should be present in
  .../pkg/ALLPKG.  So .../pkg/gapmpi/init.g is read and the
  gapmpi package is declared.  Later, GAP reads .../pkg/gapmpi/read.g.
  That file invokes .../pkg/gapmpi/lib/slavelist.g.  The file
  slavelist.g has the master and slave exchange messages allowing the
  slave to set its current directory to the same as that of the master
  (or report that the slave was unable).  Some indication of this
  conversation is printed to the screen, including, e.g.:
    Receiving from slave 1
    Receiving from slave 2