1 | Most of the sample programs here implement a simple master/slave |
---|
2 | paradigm in which the master cooperates with a single slave. Each |
---|
3 | "master" program takes a commandline argument specifying the transport |
---|
4 | device to use: -MPtransp PVM. This argument is passed to the "slave" |
---|
5 | in the spawn command. Some programs take additional arguments, as |
---|
6 | specified below. The order of the arguments on the commandline does |
---|
7 | not matter. |
---|
8 | |
---|
9 | The PVM convention is to place the Makefile and the source files in |
---|
10 | $HOME/pvm3/bin/src and the executables in $HOME/pvm3/bin/$$PVM_ARCH, |
---|
11 | where $PVM_ARCH specifies the machine architecture (e.g., SUN4). PVM |
---|
12 | expects the environment variables PVM_ROOT and PVM_ARCH to be set. |
---|
13 | PVM_ROOT specifies the directory where pvm is installed (for example, |
---|
14 | /usr/local/pvm3). See the PVM3 documentation for details. |
---|
15 | |
---|
16 | The Makefile assumes that MP has been installed in the user's home |
---|
17 | directory. Modify the Makefile accordingly if this is not the |
---|
18 | case. The Makefile makes the examples in the current directory and |
---|
19 | moves the binaries to $HOME/pvm3/bin/$PVM_ARCH. Once the programs are |
---|
20 | compiled, they can be run in the usual PVM manner. |
---|
21 | |
---|
22 | |
---|
23 | master/slave |
---|
24 | ------------ |
---|
25 | The master program will prompt for the name of the input file, which |
---|
26 | it sends to the slave. The input file contains some syntactically |
---|
27 | correct MP trees in ASCII format. Three example files are given in |
---|
28 | this directory (test.ex1, test.ex2, test.ex3, test.ex4). The slave |
---|
29 | reads the MP trees from the file (which it expects to find in the root |
---|
30 | of your home directory), converts them to the MP format and returns |
---|
31 | them to the master, which outputs them in ASCII format and prints them |
---|
32 | to the file /tmp/test.out. The master takes an optional argument |
---|
33 | -remhost giving the name of the remote host on which to run the slave. |
---|
34 | If -remhost is missing, pvm chooses the remote host. To run this |
---|
35 | example, type: master -MPtransp PVM [-remhost <remote hostname>] |
---|
36 | |
---|
37 | |
---|
38 | put-tree/get-tree |
---|
39 | ----------------- |
---|
40 | Similar to the master/slave programs, except that the put-tree program |
---|
41 | takes a command line argument -infile specifying the name of the input |
---|
42 | file containing ASCII version of the MP tree, which it reads in, |
---|
43 | converts to the MP format, and puts to the get-tree process, which |
---|
44 | converts the trees back to ASCII and writes them to /tmp/get-tree.out. |
---|
45 | put-tree also takes the optional -remhost argument as described for |
---|
46 | the master/slave example. To run this example, type: |
---|
47 | put-tree -MPtransp PVM -infile <testfilename> [-remhost <rem host>] |
---|
48 | |
---|
49 | |
---|
50 | put-vec/get-vec |
---|
51 | --------------- |
---|
52 | Programs for timings for transmitting vectors of integers. The |
---|
53 | put-vec program sends a vector of integers to the get-vec program |
---|
54 | using the usual pvm integer pack routine as well as the MP put vector |
---|
55 | routine. The put-vec routine takes two commandline arguments in |
---|
56 | addition to the -MPtransp PVM argument: |
---|
57 | |
---|
58 | -pts ==> an integer specifying the number of integers to send; |
---|
59 | -iters ==> an integer specifying the number of times to send the |
---|
60 | vector of integers. |
---|
61 | |
---|
62 | put-vec also takes the optional argument -remhost, described under the |
---|
63 | master/slave example. |
---|
64 | |
---|
65 | To run this program example type: |
---|
66 | |
---|
67 | put-vec -pts <#pts> -iters <#iters> [-remhost <rem host>] -MPtransp PVM |
---|
68 | |
---|
69 | The output is stored in a file mp-pvm.dat in the current directory. |
---|
70 | |
---|
71 | mcast-put-tree/mcast-get-tree |
---|
72 | ----------------------------- |
---|
73 | Similar to the put/get-tree programs, except there are multiple "slaves" |
---|
74 | who receive the same tree from the "master". |
---|
75 | |
---|
76 | |
---|
77 | |
---|