Newsgroups: comp.parallel.mpi
From: ma_adlum@uxmail.ust.hk (Lum Wing Fung Adrian)
Subject: What's wrong?
Organization: Hong Kong University of Science and Technology
Date: Fri, 30 Jun 1995 06:32:51 GMT
Message-ID: <1995Jun30.063251.20465@uxmail.ust.hk>

Dear all,
	First of all, say hello to all users of MPI first.  I am a beginner
of MPI.  Nice to meet you.

	I have encountered the following problems.

	I modified the original cpi.c in the 1.0.9 version package to the
following :

/* Begin */
#include "mpi.h"
#include <stdio.h>

int main(argc,argv)
int argc;
char *argv[];
{
    int myid, numprocs;
    char temp[3];
    char filename[20];
    FILE *fptr;

    MPI_Init(&argc,&argv);
    MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
    MPI_Comm_rank(MPI_COMM_WORLD,&myid);

    sprintf (temp, "%d", myid);
    strcpy (filename, "dump");
    strcat (filename, temp);
    fptr = fopen (filename, "w+");
    fprintf (fptr, "Hello World from processor %d\n", myid);
    fprintf (fptr, "I am %s\n", getenv ("HOST"));
    fclose (fptr);
    MPI_Finalize();
}
/* End */

	and the compiled executable file is called "cpi".

	When I run the program by "mpirun -np 4 cpi", no problem.
	When I use 5 processors or more, all files will still be produced.  
However, the command line will be hanged.  I need to use "ctrl-C" to break 
the program.  So, can anyone tell me how to deal with it? 

	Thanks.

--
 ___       _ _             _      _     _           
/ __| __ _(_) |___ _ _    /_\  __| |_ _(_)__ _ _ _  
\__ \/ _` | | / _ \ '_|  / _ \/ _` | '_| / _` | ' \ 
|___/\__,_|_|_\___/_|   /_/ \_\__,_|_| |_\__,_|_||_| ճߦۤ
o Sailor Venus ...

