I created a thread in slave function with detached attribute(which initiates a new processin it),When MASTER(rank-0) sends a message after this thread creation in SLAVE,The SLAVE doesnot recieve the last message.Error message is shown with signal 11.I have checked mail archieve but it was not very helpful as the most posts were old.Plz answer me earlier as i have comitted to this job before monday.and i am in this problem from one day.
* I am using a single INTEL mechine running RedHat 9
* What is signal 11 and signal 15
* How can i get and use graphical debugger for the debugging of parallel programs
SLAVE FUNCTION IS GIVEN BELOW
/********************************************************************/
////////////////////// Error message ///////////////////////////////
-----------------------------------------------------------------------------
One of the processes started by mpirun has exited with a nonzero exit
code. This typically indicates that the process finished in error.
If your process did not finish in error, be sure to include a "return
0" or "exit(0)" in your C code before exiting the application.
PID 14751 failed on node n0 (127.0.0.1) due to signal 11.
------------------------------------------------------------------------------
////////////////////// Start of SLAVE ///////////////////////////////////
int
slave(void)
{
int rank, my_rank, ntasks, work, rt, counter=1, st;
MPI_Status status;
char buff_1[F_buff];
char buff_2[R_buff];
void *arg;
pthread_t b_thread;
pthread_attr_t thread_attr;
MPI_Comm_rank( MPI_COMM_WORLD,&my_rank); /* process rank */
for(rank=1; rank < ntasks; rank++){
// below message prints,but it doesnot cross MPI_PROB,when last msg sent by MASTER
printf("**-*-*-*-*-***-**-**-*-*- Before PROBE CALL [%d] -**--****-*-*-*-*-*\n",rank);
MPI_Probe(0,MPI_ANY_TAG,MPI_COMM_WORLD,&status);
st = status.MPI_TAG;
printf("RANK : %d, counter :%d, st : %d\n",rank,counter,st);
counter += 1;
if(status.MPI_TAG == F_DATA){
MPI_Recv(buff_1, count, MPI_CHAR,0,F_DATA,MPI_COMM_WORLD,&status);
...................
...............
..........
}
else if(status.MPI_TAG == R_DATA){
MPI_Recv(buff_2,R_buff,MPI_CHAR,0,R_DATA,MPI_COMM_WORLD,&status);
...................
...............
}
else if(status.MPI_TAG == WORKTAG){
MPI_Recv(&work, 1,MPI_INT, 0,WORKTAG, MPI_COMM_WORLD, &status);
//*******************************************************
//Thread creation for generating a new process
rt = pthread_attr_init(&thread_attr);
if(rt != 0){
perror("Attribute creation failed");
exit(EXIT_FAILURE);
}
rt = pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
if(rt != 0){
perror("Setting detached attribute failed");
exit(EXIT_FAILURE);
}
rt = pthread_create(&b_thread, &thread_attr, thread_work,(void *)arg);
if (rt != 0){
perror("Thread creation failed");
exit(EXIT_FAILURE);
}
(void)pthread_attr_destroy(&thread_attr);
//*******************************************************
}
else if(status.MPI_TAG == DIETAG){
MPI_Recv(&work, 1, MPI_INT, 0, DIETAG, MPI_COMM_WORLD,&status);
return;
}
}
return(0);
}
///////////////////// END OF SLAVE FUNCTION //////////////////////////
Ahmed irshad
---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
|