Building & Running the MPI-CH "hello world" Program

Before running the benchmark programs listed below, you should try building a simple MPI "hello world" program to ensure your cluster is properly configured.

The file mpihello.f in this directory contains a simple MPI "hello world" program that can be used to test MPI-CH. First bring up a shell window on your screen. We assume here that the PGI CDK compilers and tools are installed in the directory /export/0/pgi. First initialize your environment to make the PGI CDK compilers and tools accessible. Issue the following commands if you're using csh:


	% setenv PGI /export/0/pgi
	% set path=($path $PGI/linux86/bin /usr/local/pbs/bin)
	% setenv MANPATH "$MANPATH":$PGI/man:$PGI/cdk/man:/usr/local/pbs/man
	% setenv LM_LICENSE_FILE "$LM_LICENSE_FILE":$PGI/license.dat

or the following if you're using sh, ksh, or bash:

	% PGI=/export/0/pgi 
	% export PGI
        % PATH=$PATH:$PGI/linux86/bin:/usr/local/pbs/bin 
	% export PATH
        % MANPATH=$MANPATH:$PGI/man:$PGI/cdk/man:/usr/local/pbs/man 
	% export MANPATH
        % LM_LICENSE_FILE=$LM_LICENSE_FILE:$PGI/license.dat
	% export LM_LICENSE_FILE

Then make a copy of mpihello.f in your current working directory, and compile and execute it using the following commands:

	% pgf77 -o mpihello mpihello.f -lfmpich -lmpich
	% mpirun -np 4 mpihello
	Hello world!  I'm node 0
	Hello world!  I'm node 2
	Hello world!  I'm node 1
	Hello world!  I'm node 3

You can submit the job to PBS by copying mpihello.pbs to your current working directory, changing the "setenv PGI" command on the fourth-to-last line to point to your PGI CDK installation directory, changing the "cd" command on the second-to-last line to point to your current working directory, and then issuing the commands:

	% qsub mpihello.pbs
	% qstat

You'll need to type qstat quickly in order to see the "mpihello" job in the queue. Be sure to look at the "mpihello.log" file to see that the job has executed correctly. You should see output something like the following:

  % cat mpihello.log
  Hello world!  I'm node 0
  Hello world!  I'm node 2
  Hello world!  I'm node 1
  Hello world!  I'm node 3
  %

If these simple tests don't work, refer to the IMPORTANT PBS NOTEs in the PGI CDK Installation and Release Notes, section 2.1. Usually it's a problem with one of: If these simple tests do work, you're ready to execute some of the more extensive tests listed above.


© 1998-2000 The Portland Group, Inc (PGI). All rights reserved. This software and documentation are supplied under the terms of a license agreement with The Portland Group and may not be copied or disclosed except in accordance with the terms of that agreement.


© Copyright 1998-2000 The Portland Group, Inc (PGI). All rights reserved. This software and documentation are supplied under the terms of a license agreement with The Portland Group and may not be copied or disclosed except in accordance with the terms of that agreement.