From: mquinson Date: Wed, 15 Jul 2009 16:38:09 +0000 (+0000) Subject: More debug X-Git-Tag: SVN~1140 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2db5341593ee6af66d5ae0163a079dda0fe5f615 More debug git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6508 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/smpi/smpi_receiver.c b/src/smpi/smpi_receiver.c index 90d6ea8632..d2b9fc5f4a 100644 --- a/src/smpi/smpi_receiver.c +++ b/src/smpi/smpi_receiver.c @@ -23,11 +23,13 @@ int smpi_receiver(int argc, char *argv[]) request_queue = mydata->pending_recv_request_queue; message_queue = mydata->received_message_queue; + DEBUG0("Up and running"); while (1) { // FIXME: better algorithm, maybe some kind of balanced tree? or a heap? + DEBUG0("Look for matching"); xbt_fifo_foreach(request_queue, request_item, request, smpi_mpi_request_t) { xbt_fifo_foreach(message_queue, message_item, message, smpi_received_message_t) { @@ -48,6 +50,8 @@ int smpi_receiver(int argc, char *argv[]) printf("[%s] found match: req_src=%d,msg_src=%d)x(req_tag=%d,msg_tag=%d)\n", __FILE__,request->src,message->src,request->tag, message->tag); #endif + DEBUG4("found match: (req_src=%d,msg_src=%d)x(req_tag=%d,msg_tag=%d)", + request->src,message->src,request->tag, message->tag); goto stopsearch; } } @@ -84,11 +88,14 @@ int smpi_receiver(int argc, char *argv[]) } else if (mydata->finalize > 0) { /* main wants me to die and nothing to do */ // FIXME: display the list of remaining requests and messages (user code synchronization faulty?) + DEBUG0("Main wants me to die and I'm done. Bye, guys."); mydata->finalize--; SIMIX_cond_signal(mydata->cond); return 0; } else { + DEBUG0("Nothing to do. Let's get a nap"); SIMIX_process_suspend(self); + DEBUG0("Uh? Someone called me?"); } } diff --git a/src/smpi/smpi_sender.c b/src/smpi/smpi_sender.c index 129caab533..9ec5273b07 100644 --- a/src/smpi/smpi_sender.c +++ b/src/smpi/smpi_sender.c @@ -30,6 +30,8 @@ int smpi_sender(int argc, char *argv[]) index = mydata->index; + DEBUG0("Up and running"); + request_queue = mydata->pending_send_request_queue; while (1) { @@ -53,6 +55,7 @@ int smpi_sender(int argc, char *argv[]) SIMIX_process_get_data(smpi_global->main_processes[dindex]); dhost = SIMIX_process_get_host(smpi_global->main_processes[dindex]); + DEBUG3("Handle send request %p to %s (tag:%d)",request,SIMIX_host_get_name(dhost),message->tag); message->forward = (request->forward - 1) / 2; request->forward = request->forward / 2; @@ -61,10 +64,7 @@ int smpi_sender(int argc, char *argv[]) (request->dst + message->forward + 1) % request->comm->size; xbt_fifo_push(request_queue, request); } else { -//#define DEBUG_MATCH -#ifdef DEBUG_MATCH - printf("**SENDER: request %p completed :=1\n",request); -#endif + DEBUG3("DONE Handling send request %p to %s (tag:%d)",request, SIMIX_host_get_name(dhost),message->tag); request->completed = 1; } @@ -94,11 +94,14 @@ int smpi_sender(int argc, char *argv[]) SIMIX_process_resume(remote_process->receiver); } else if (mydata->finalize > 0) { /* main wants me to die and nothing to do */ + DEBUG0("Main wants me to die and I'm done. Bye, guys."); mydata->finalize--; SIMIX_cond_signal(mydata->cond); return 0; } else { + DEBUG0("Nothing to do. Let's get a nap"); SIMIX_process_suspend(self); + DEBUG0("Uh? Someone called me?"); } } return 0;