=== How to install DMI ===

You can install DMI as follows:

    $ ./configure --prefix=/home/foo/bar
    $ make
    $ make install

=== How to compile DMI programs ===

There are sample source codes of DMI in sample/ directory. 
You can compile a DMI program using 'dmicc' command as follows:

    $ cd sample/
    $ dmicc matmat_dmi.c

Since 'dmicc' calls 'gcc' command internally, 
you can also specify all 'gcc' options:

    $ dmicc -O3 matmat_dmi.c -o matmat_dmi

=== How to run DMI programs ===

(1) How to run in an SPMD way

You can run your DMI program in a SPMD way using 'dmimw' command 
(dmi'mw' means 'master-worker'), if the DMI program is written 
so that it supports an SPMD execution. 
For example, sample/matmat_dmi.c supports the SPMD execution. 

First, prepare a node file that describes the possible nodes 
on which DMI processes are spawned. 
The format of this node file is as follows:

    node000.foo.bar.jp
    node001.foo.bar.jp
    node002.foo.bar.jp
    node003.foo.bar.jp

You can describe one node in each line.
You can also specify some options after each node name. 
These options are used when a DMI process is spawned on the node. 
See 'dmirun -h' for more details of these options. 

Then, run your DMI program using dmimw command: 

    $ dmimw -f nodefile.txt -n 16 ./matmat_dmi 16 8 1024

You can specify the nodefile by -f option 
and the number of nodes you want to use by -n option. 
DMI processes are spawned on the nodes specified in the i-th line (0 <= i < n). 
If you omit -n option, DMI processes are spawned on all the nodes in the node file.
The m-th node becomes a master node and the rest become worker nodes,
where m is specified by -m option. 
If you omit -m option, the first node in the node file becomes a master node. 

(2) How to put in or put out nodes dynamically

You can use 'dmirun' command in order to put in or put out 
nodes one by one interactively, if your DMI program is 
described so that nodes can join and leave dynamically. 
For example, sample/ep_dmi.c supports dynamic joining 
and leaving of nodes. 

First, compile ep_dmi.c:

    $ dmicc ep_dmi.c -o ep_dmi

Second, run ep_dmi using 'dmirun' command with no option 
on node000.foo.bar.jp: 

    $ dmirun ./ep_dmi 1024
    === initialized ===
    === joined ===
    press any key to continue ...

When you press any key, the program starts. 
(If you want to start the execution after putting in some nodes, 
press any key after putting in those nodes.)

Third, go to another node, for example node001.foo.bar.jp, 
and then run 'dmirun' command with -i option. 

    $ dmirun -i node000.foo.bar.jp ./ep_dmi

Then this node can join the execution. 
This -i option specifies the node that is connected firstly 
by this 'dmirun'. You can specify any nodes that are 
already joining the execution. 
Similarly, you can join any number of nodes. 

Forth, if you want to put out node001.foo.bar.jp from the execution, 
go to node001.foo.bar.jp and press Ctrl+C. 
Then node001.foo.bar.jp leaves the execution. 
Note that the node from which the execution starts 
must be put out at the end. 

See DMI documents in http://haraken.info/dmi/ for more details. 

=== How to describe DMI programs ===

See DMI documents in http://haraken.info/dmi/

=== Author ===

Kentaro Hara, The University of Tokyo

=== License ===

This software is licensed under the GPL license.
See also DMI documents in http://haraken.info/dmi/

=== Version ===
1.5.0.0
