prolog-mpi: a distributed prolog environment
abstract
news goals status old news benchmarks plots algorithm generating analysis documentation manuals installation operation interface scheduling types architecture download |
Please note that a bug in the documentation is considered a bug in the system overall. Documentation bugs include missing or incomplete data; please contact Kristaps with any errata.
There are several utilities bundled with the prolog-mpi system. Each comes with a Unix manual distributed during installation. Be sure to read these manuals carefully before operating any component.
Most of the complexity of installing prolog-mpi is in the MPI installation itself. Beyond that, the system follows standard compilation and installation conventions. This document assumes that you have an MPI deployment installed and working, and that further, the file-system in which the pl-mpi(1) and pl-mpi-test(1) binaries reside is accessible to all participating nodes. Future versions of prolog-mpi will be considerably more friendly in this regard. Tested MPI implementations (please notify us of additions): Tested operating systems (please notify us of additions):
To compile the binary, you'll need make (BSD or GNU), an MPI C compiler (hcc or mpicc), and a working installation of Prolog (must be SWI Prolog) with a usable plld linker. Edit the Makefile in the top-level directory of the distribution with the locations and/or names of these files, if the defaults are not correct. Compile the system with make, and (optionally) install it with make install. At this point, you're ready to run the system. Note that the system should compile without warnings, although on i386 you may get the following warning (it doesn't cause execution problems): src/master.c: In function `pl_adist': src/master.c:487: warning: cast from pointer to integer of different size
The Makefile may be edited in several ways. You'll probably want to modify
the file to suit your MPI installation needs. If you wish to compile in Prolog scripts, edit the
A sample session may be the most instructive. Note that extraneous output has been snipped. $ cat test.pl testp(A, B) :- B is A + 2. $ $ mpirun -np 20 pl-mpi 1 ?- mpiload('test.pl'). 2 ?- mpidist(testp, [1, 2], RES, YESN, INDEX). RES = 3 YESN = 1 INDEX = 0 ; RES = 4 YESN = 1 INDEX = 1 ; No 3 ?- halt. $ The mpirun utility will execute pl-mpi on 20 nodes. Note that one must execute on at least three nodes: one control, one master, and one slave. Node location is not important; note also that the master the control take minimal processing power, and may safely piggy-back on physical slave nodes. For systems with a very high rate of communication (small, constant jobs), a dedicated I/O signal line may be appropriate (physical machine, or distinct interface) but I have no benchmarks on this. You'll probably want to read the manual page. If you ran make install, it should be installed under pl-mpi(1).
Caveats: signals. Do not use signals during operation. While sending an interrupt (control-C) to a Prolog system triggers a trace, it will usually kill the MPI group (this behaviour differs with MPI implementations). This has the added ill effect of polluting the MPI channels with crufty data.
The control node in a pl-mpi run-time maintains a scheduling queue for all pending jobs. As jobs are entered into the system via mpidist/5 or ampidist/3, they are enqueued according to a distribution scheduling algorithm. When a job is enqueued for distribution, it is interleaved with existing jobs in a round-robin fashion. In other words, the initial set of jobs is an empty set S = {0}. When a particular job X is added, its contents x0 - xn are added to S yielding {x0, x1, ..., xn}. If a concurrent job Y is added, its elements are fairly interleaved into S yielding {x0, y0, x1, y1, ..., xn, yn}. Thus if several jobs are added with ampidist/3, then a synchronous job with mpidist/5, the synchronous job will have to wait for competing asynchronous jobs to complete as well.
Data passed through prolog-mpi may have limited data types. Please note that there is a difference between Prolog's stated type system ("single data type is a term") and the internal representation. In short, data passed through to the prolog-mpi system must be assigned a type. At this time, atomic data types (float, integer, atom) are supported. Term types are not supported. Supported:
Not supported:
If these types are inputted to (or outputted from) prolog-mpi predicates, the system will abort and coredump immediately. Type detection occurs dynamically at the point of entry or when results are first received.
This section is being fully re-written.
|
$Id: docs.html,v 1.14 2007-01-24 12:16:08 kristaps Exp $