Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 278935 Details for
Bug 373923
sys-cluster/openmpi-1.5.3-r1: mpirun hangs or fails with Segmentation faults
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
ex1a.c
ex1a.c (text/plain), 1.79 KB, created by
Juergen Rose
on 2011-07-03 15:49:05 UTC
(
hide
)
Description:
ex1a.c
Filename:
MIME Type:
Creator:
Juergen Rose
Created:
2011-07-03 15:49:05 UTC
Size:
1.79 KB
patch
obsolete
>/* test of MPI */ > >#include "mpi.h" >#include <stdio.h> >#include <string.h> >#include <unistd.h> > >int main(int argc, char **argv) { > char idstr[2232]; char buff[22128]; > char processor_name[MPI_MAX_PROCESSOR_NAME]; > int numtask,rank; int i,j; int namelen; > MPI_Status stat; > > printf("argc=%2d argv=%p\n",argc,argv); > for (i=0;i<argc;i++) { > printf(" i=%2d[%2d] argv[i]=|%s|\n",i,argc,argv[i]); > } > printf("before 'MPI_Init(&argc,&argv)'\n"); > int rc=MPI_Init(&argc,&argv); > printf("rc=%d MPI_SUCCESS=%d\n",rc,MPI_SUCCESS); > if (rc != MPI_SUCCESS) { > printf("Error starting MPI programm. Terminating.\n"); > MPI_Abort(MPI_COMM_WORLD, rc); > } > MPI_Comm_size(MPI_COMM_WORLD,&numtask); > MPI_Comm_rank(MPI_COMM_WORLD,&rank); > MPI_Get_processor_name(processor_name, &namelen); > > printf("Hello, world. I am %d of %d on %s\n", rank,numtask,processor_name); > fflush(stdout); > > if(rank == 0) { > printf("WE have %d processes\n", numtask); > for(i=1;i<numtask;i++) { > sprintf(buff, "Hello %d", i); > MPI_Send(buff, 128, MPI_CHAR, i, 0, MPI_COMM_WORLD); > sleep(1); > } > for(j=1;j<numtask;j++) { > MPI_Recv(buff, 128, MPI_CHAR, j, 0, MPI_COMM_WORLD, &stat); > printf("%s\n", buff); > sleep(1); > } > } else { > MPI_Recv(buff, 128, MPI_CHAR, 0, 0, MPI_COMM_WORLD, &stat); > sprintf(idstr, " Processor %d at node %s ", rank, processor_name); > strcat(buff, idstr); > strcat(buff, "reporting for duty\n"); > MPI_Send(buff, 128, MPI_CHAR, 0, 0, MPI_COMM_WORLD); > sleep(1); > } > > printf("rank=%2d numtask=%2d processor_name=%s, before 'sleep(%d)'\n", > rank,numtask,processor_name,5*numtask); > sleep(5*numtask); > printf("rank=%2d numtask=%2d processor_name=%s, after 'sleep(%d)'\n", > rank,numtask,processor_name,5*numtask); > sleep(10); > printf("rank=%2d, before 'MPI_Finalize'\n",rank); > > MPI_Finalize(); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 373923
: 278935 |
278937