ompi-ps talks to mpirun to get the info, and then pretty-prints it to stderr. Best guess is that it is having problems contacting mpirun. Are you running it on the same node as mpirun (a requirement, unless you pass it the full contact info)?
Jeff and Ralph,
Thank you for your reply.
1) I'm not running on machines with OpenFabrics.
2) In my example, ompi-ps prints a maximum 82 bytes per line. Even so, I augment to 300 bytes per line to be sure that it is not the problem.
char mystring [300];
...
fgets (mystring , 300 , pFile);
2) When I run ps, it shows just two process: ps and bash.
PID TTY TIME CMD
1961 pts/5 00:00:00 bash
2154 pts/5 00:00:00 ps
But when I run ps -a -l, it appears my program(test.run) and other processes. I put below just the information related to my program.
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 S 1000 1841 1840 0 80 0 - 18054 pipe_w pts/0 00:00:00 test.run
0 S 1000 1842 1840 0 80 0 - 18053 poll_s pts/0 00:00:00 test.run
0 S 1000 1843 1840 0 80 0 - 18053 poll_s pts/0 00:00:00 test.run
0 S 1000 1844 1840 0 80 0 - 18053 poll_s pts/0 00:00:00 test.run
pipe_s = wait state on read/write against a pipe.
So, with that command I concluded that one mpi process is waiting for the read of a pipe.
The problem still persists.
Thanks,
Matheus.-----------------------------------------------------------------
On Wed, Sep 22, 2010 at 11:24 AM, Ralph Castain <rhc@open-mpi.org> wrote:Printouts of less than 100 bytes would be unusual...but possibleOn Wed, Sep 22, 2010 at 8:15 AM, Jeff Squyres <jsquyres@cisco.com> wrote:
Are you running on machines with OpenFabrics devices (that Open MPI is using)?
Is ompi-ps printing 100 bytes or more?
What does ps show when your program is hung?
On Sep 17, 2010, at 3:13 PM, Matheus Bersot Siqueira Barros wrote:
> Open MPI Version = 1.4.2
> OS = Ubuntu 10.04 LTS and CentOS 5.3
>
> When I run the mpi program below in the terminal, the function fgets hangs.
> How do I know it? I do a printf before and later the call of fgets and only the message "before fgets()" is showed.
>
> However, when I run the same program at Eclipse 3.6 with CDT 7.0.0.201006141710 or using gdb it runs normally.
> If you change the command in the function popen to another one(for instance: "ls -l"), it will run correctly.
>
> I use the following commands to compile and run the program:
>
> compile : mpicc teste.c -o teste.run
>
> run : mpirun -np 4 ./teste.run
>
>
> Does anyone know why the program behaves like that?
>
> Thanks in advance,
>
> Matheus Bersot.
>
> MPI_PROGRAM:
>
> #include <stdio.h>
> #include "mpi.h"
>
> int main(int argc, char *argv[])
> {
> int rank, nprocs;
> FILE * pFile = NULL;
> char mystring [100];
>
> MPI_Init(&argc,&argv);
> MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
> MPI_Comm_rank(MPI_COMM_WORLD,&rank);
>
> if(rank == 0)
> {
> pFile = popen ("ompi-ps" , "r");
> if (pFile == NULL) perror ("Error opening file");
> else {
> while(!feof(pFile))
> {
> printf("before fgets()\n");
> fgets (mystring , 100 , pFile);
> printf("after fgets()\n");
> puts (mystring);
> }
> pclose (pFile);
> }
> }
>
> MPI_Finalize();
> return 0;
> }
> _______________________________________________
> users mailing list
> users@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users
--
Jeff Squyres
jsquyres@cisco.com
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/
_______________________________________________
users mailing list
users@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users
_______________________________________________
users mailing list
users@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users
--
"In moments of crisis, only the inspiration is more important than knowledge."
(Albert Einstein)
_______________________________________________
users mailing list
users@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users