Discussion:
strange problem
(too old to reply)
Irfan Khan
2007-11-17 01:52:55 UTC
Permalink
Hi
I am facing a strange problem with running my code on a 16 node Rocks
cluster.
1. I can do a passwordless login without any problem
2. I run a sample hello world program and a simple data send_recv code
without any problem.
3. Now I try to run my code on 2 nodes and I get the following error.

"Connection to compute-0-0 closed by remote host"

I have successfully run my code several times on other clusters without
any problem.

There is another interesting aspect to this problem. The code takes in
the name of the input file as an argument. But when I do provide it, I
get the following error message.
Please notice that process 2 is trying to open a file by name joshi_hpcc1.in
which is the hostname of the computer. The process should be trying to
open a file called a1.in. Can the argument "argc" and "argv" be used to
give arguments to the program?
I would appreciate any suggestions, comments, advice on this issue.

Thanks a lot in advance

[***@joshi_hpcc working_dir]$ mpirun -np 2 -machinefile machines ./lbm3dp a1
mpi version Parallel LBM, amended ONGOING
x and z divisions 2 1
xmin = -1, xmax = 100 lx = 102
ymin = 0, ymax = 199 lx = 200
zmin = 0, zmax = 199 lx = 200
mpi version Parallel LBM, amended ONGOING
Error opening file: joshi_hpcc1.in
p_lattbes=iteration1_3d
Navier-Stokes flow: p_feq_3d=feq_3d
Starting a new simulation
1, 0 warnings/errors


Irfan
Georg Bisseling
2007-11-17 20:04:09 UTC
Permalink
Post by Irfan Khan
There is another interesting aspect to this problem. The code takes in
the name of the input file as an argument. But when I do provide it, I
get the following error message.
Please notice that process 2 is trying to open a file by name
joshi_hpcc1.in
which is the hostname of the computer. The process should be trying to
open a file called a1.in. Can the argument "argc" and "argv" be used to
give arguments to the program?
I would appreciate any suggestions, comments, advice on this issue.
Do you call MPI_Init(&argc, &argv)?
This allows MPI_Init to strip off any command line arguments
that are used internally by the MPI library.

Regards
Georg
--
This signature was left intentionally almost blank.
http://www.this-page-intentionally-left-blank.org/
Irfan Khan
2007-11-19 03:23:21 UTC
Permalink
Thanks for your reply Georg. I did make the call to MPI_Init(&argc,&argv)
albiet I made the call after I assigned the value of the argument to the
variable, as shown below. Once I made the correction, I don't get the
error any more.


int main(int argc, char *argv[])
{
struct initial_condition init;
int ic;
char myRankInChar[3];

int count,counter;
float *array;
int tag=50;

//MISTAKE: NEED TO BE AFTER THE CALL TO MPI_Init
if (argc <=1) {
printf("Usage: beta_3d inputfile\n");
exit(0);
}
strcpy(simulationParameters.fname,argv[1]);

/* CALL TO INITIATE MPI */
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Comm_size(MPI_COMM_WORLD, &procs);


Irfan
Post by Georg Bisseling
Post by Irfan Khan
There is another interesting aspect to this problem. The code takes in
the name of the input file as an argument. But when I do provide it, I
get the following error message.
Please notice that process 2 is trying to open a file by name joshi_hpcc1.in
which is the hostname of the computer. The process should be trying to
open a file called a1.in. Can the argument "argc" and "argv" be used to
give arguments to the program?
I would appreciate any suggestions, comments, advice on this issue.
Do you call MPI_Init(&argc, &argv)?
This allows MPI_Init to strip off any command line arguments
that are used internally by the MPI library.
Regards
Georg
--
This signature was left intentionally almost blank.
http://www.this-page-intentionally-left-blank.org/
Loading...