info logo

Documentation

Frequently Asked Questions

General

  1. What are the advantages of p2p-mpi over popular implementations of mpi (mpich, lam/mpi, ...) ?
  2. Is it Free Software ? What is the License ?

Technical

  1. Immediately after running runRDV or mpiboot i get something like:
    C:\Documents and Settings\cjj>Exception in thread "main" java.lang.UnsupportedClassVersionError: p2pmpi/rdv/RDV (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) ....
  2. I have several network cards and P2P-MPI does not use the one i wish.
  3. My program starts on my local host, the other peers have accepted their job but it seems they cannot run it.
  4. After running mpiboot my Linux box always seems to bind to the address 127.0.0.1. Is there a way to force mpiboot to use a particular IP address ?
  5. My computer has a private IP (and i have a router doing NAT). Can i participate in a P2P-MPI group with computers having normal IPs ?
  6. Can i limit the number of jobs that my computer can run simultaneously ?
  7. Can i deny access to my machine to some visitors ?
  8. Can I tell P2P-MPI to use a specific configuration file (other than $P2PMPI_HOME/P2P-MPI.conf) ?

Programming

  1. In my application all ranks do a System.out.println("..."), but where does this output go? Because it doesn't appear in any terminal except for output of rank 0.
  2. How to send 2D matrix with MPI.Send ?
  3. I cannot access my command line arguments as usually because 'p2pmpirun' and its arguments precedes those of my own program. For instance args[0] is 'p2pmpirun' and not my program name.





Frequently Asked Questions: Answers

General

  1. Is it Free Software ? What is the License ?
    Yes, it is free software. P2P-MPI is licensed under the GNU/GPL license. Terms and conditions of the license are available here, or in the LICENSE file in the distribution.
  2. What are the advantages of p2p-mpi over popular implementations of mpi (mpich, lam/mpi, ...) ?
    • There is no machinefile file to maintain: P2P-MPI will find hosts for you.
    • The program to be executed is automatically transfered to selected hosts.
    • Application runs are more "robust" against hosts failures because you can ask the system to run taks redundantly.

Technical

  1. Immediately after running runRDV or mpiboot i get something like:


    Version 49 means that P2P-MPI is compiled with a 1.5 JDK while The JVM you are using is unable to interpret this code. We recommend that you upgrade to a JDK 1.5 (also called JDK 5.0). Note that it is possible to generate code compatible with older JVM by using the -target option in java (see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html). However, we use the JDK 1.5 format for sake of performances.

  2. I have several network cards and P2P-MPI does not use the one i wish.

    P2P-MPI lists the available network interfaces on your computers that have a suitable IP and select arbitrarily one of them. You can set IFACE= in the configuration file to say which one you prefer. You will typically use IFACE=eth0 or IFACE=eth1 (linux), IFACE=en0 or IFACE=en1 (MacOSX), but on Windows, you will need the whole interface description as returned by the command ipconfig, e.g IFACE=Broadcom Ethernet Card.

  3. My program starts on my local host, the other peers have accepted their job but it seems they cannot run it.
    This situation may currently happen because P2P-MPI does not check the "java" settings of peers. So when a peer accepts a job, it may have a , e.g., java 1.5 installed while the class files you send are produced by a JDK 1.6 (version 50 class files), and the remote peer might be unable to run it. Remember that a remote peer just issue "java classname" upon receipt of transfered files. Actually, mismatch between 1.5 and 1.6 is currently the only potential problematic case, since a JDK >= 1.5 is required to run P2P-MPI. We plan in a near future, to advertize the java settings of peers to avoid such mismatches.

  4. After running mpiboot my Linux box always seems to bind to the address 127.0.0.1. Is there a way to force mpiboot to use a particular IP address ?
    This happens with some Linux distributions that set the /etc/hosts file so that you can read something like:

    127.0.0.1 localhost mymachinename
    In that case, the getLocalHost() will return 127.0.0.1.
    To avoid this, you should set your /etc/hosts file so that it reads the sole loopback address:
    127.0.0.1 localhost
    which is perfectly correct. The computer name should be retrieved either from a DNS or from another line in the /etc/hosts file.

  5. My computer has a private IP (and i have a router doing NAT). Can i participate in a P2P-MPI group with computers having normal IPs ?
    Yes. You have to set EXTERNAL_IP in P2P-MPI.conf to the public IP of your router doing NAT and take care to configure your router to do appropriate port forwarding (i.e. when packets are sent to your router on ports used by P2P-MPI, it should redirect it to the private IP).

  6. Can i limit the number of jobs that my computer can run simultaneously ?
    Yes, from version 0.17.0, you can specify in your configuration file NUMTASK_SIMULTANEOUS=x, where x is the maximum number of jobs run simultaneously on your computer (if x > 0). x=0 means you do not limit the number of jobs, and is the default.

  7. Can i deny access to my machine to some visitors ?
    Yes, from version 0.17.0, you can specify in your configuration file HOST_DENY=x1,x2,...   where x1, x2 are network IP or first digits of IPs of hosts you want to deny access. Valid examples are

    HOST_DENY=192.56.34.1 HOST_DENY=192.56. HOST_DENY=192.56.34.1,192.56.34.2,192.57.34

  8. Can I tell P2P-MPI to use a specific configuration file (other than $P2PMPI_HOME/P2P-MPI.conf) ?
    Yes, from version 0.27.0, you can set the environment variable P2PMPI_CONF_FILE. By setting this variable to a filename (absolute pathname) you override the default $P2PMPI_HOME/P2P-MPI.conf.
    This can be handy if you share your p2pmpi installation over NFS, and you want specific settings for the various hosts. You can setup for example two different configuration files cluster-node-type1.conf and cluster-node-type2.conf and assign P2PMPI_CONF_FILE (e.g. in .bashrc) with the correct config name based on the cluster name (e.g. hostname).

Programming

  1. In my application all ranks do a System.out.println("..."), but where does this output go? Because it doesn't appear in any terminal except for output of rank 0.

    In fact, MPDs catch I/O from System.out.println() and redirect these to rank 0 (the submitter host, where you run p2pmpirun). However, i/o are buffered, waiting on a newline char to transmit. The solution is therefore to make a System.out.println() somewhere in your program to flush the buffer.

  2. How to send a 2D matrix with MPI.Send ?
    Because java treats 2-Dimension matrix as an object, you have to use the MPI primitive MPI.OBJECT.

    The following code shows an example of how to use MPI.OBJECT :
    import p2pmpi.mpi.*;
    public class SendMatrix2D
    {
    	public static void main(String[] args)
    	{
    		int x[][] = new int[10][10];
    		int y[][] = new int[10][10];
    
    		MPI.Init(args);
    		int rank = MPI.COMM_WORLD.Rank();
    		int size = MPI.COMM_WORLD.Size();
    		if(size != 2) {
    			System.out.println("Please run test with -n 2 option");
    			MPI.Finalize();
    		}
    		//Generate value for matrix X
    		for(int i = 0; i < 10; i++) {
    			for(int j = 0; j < 10; j++) {
    				x[i][j] = i;
    				y[i][j] = 0;
    			}
    		}
    		//Rank 0 sends matrix X, and Rank 1 store it in Y
    		//Test to send 2 lines each time
    		for(int i = 0; i < 10; i+=2) {
    			if(rank == 0) {
    				MPI.COMM_WORLD.Send(x, i, 2, MPI.OBJECT, 1, 10);
    			} else {
    				MPI.COMM_WORLD.Recv(y, i, 2, MPI.OBJECT, 0, 10);
    			}
    		}
    		//Display value of matrix Y on Rank 1
    		if(rank != 0) {
    			for(int i = 0; i < 10; i++) {
    				System.out.println("y["+i+"][5] = " + y[i][5]);
    			}
    		}
    		MPI.Finalize();
    	}
    }
    
  3. I cannot access my command line arguments as usually because 'p2pmpirun' and its arguments precedes those of my own program. For instance args[0] is 'p2pmpirun' and not my program name.
    MPI.Init() returns your normal program arguments, i.e without the extra command arguments required to launch the paralell program. Below is an illustration showing how to get 'myArgs' which are the real program arguments.

    public static void main(String[] args) { String[] myArgs = MPI.Init(args); /* ... now parse myArgs .... */
About P2P-MPI · Download · Documentation (Middleware) · Documentation (Programming) · Mailing list · Links · Contact · FAQ