commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r7590 - in gnuradio/branches/developers/eb/gcell/src:


From: eb
Subject: [Commit-gnuradio] r7590 - in gnuradio/branches/developers/eb/gcell/src: apps lib lib/spu
Date: Wed, 6 Feb 2008 11:55:22 -0700 (MST)

Author: eb
Date: 2008-02-06 11:55:17 -0700 (Wed, 06 Feb 2008)
New Revision: 7590

Modified:
   gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc
   gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
   gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c
Log:
working again, and faster ;)

Modified: gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc     
2008-02-06 18:09:42 UTC (rev 7589)
+++ gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc     
2008-02-06 18:55:17 UTC (rev 7590)
@@ -81,7 +81,7 @@
   while (ncompleted < njobs){
     njds[ci^1] = 0;
     int n = mgr->wait_jobs(njds[ci], jds[ci], done, GC_WAIT_ANY);
-    printf("%2d\n", n);
+    // printf("%2d\n", n);
     if (n < 0){
       fprintf(stderr, "mgr->wait_jobs failed\n");
       break;
@@ -92,7 +92,7 @@
       }
       else {
        ncompleted++;
-       printf("ncompleted = %7d\n", ncompleted);
+       // printf("ncompleted = %7d\n", ncompleted);
        if (nsubmitted < njobs){                    // submit another one
          if (mgr->submit_job(jds[ci][i])){
            jds[ci^1][njds[ci^1]++] = jds[ci][i];  // remember for next iter

Modified: gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc        
2008-02-06 18:09:42 UTC (rev 7589)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc        
2008-02-06 18:55:17 UTC (rev 7590)
@@ -659,7 +659,7 @@
 void
 gc_job_manager_impl::create_event_handler()
 {
-  // create the SPE event handler and register our interest in all events
+  // create the SPE event handler and register our interest in events
 
   d_spe_event_handler.ptr = spe_event_handler_create();
   if (d_spe_event_handler.ptr == 0){
@@ -749,10 +749,12 @@
 
   gc_comp_info_t *ci = &d_comp_info[2 * spe_num + (completion_info_idx & 0x1)];
 
-  if (1){
-    static int total_complete;
-    total_complete += ci->ncomplete;
-    printf("ppe: total_complete = %6d\n", total_complete);
+  if (0){
+    static int total_jobs;
+    static int total_msgs;
+    total_msgs++;
+    total_jobs += ci->ncomplete;
+    printf("ppe:     tj = %6d  tm = %6d\n", total_jobs, total_msgs);
   }
 
   // FIXME sort by client_id so we only have to lock & signal once / client

Modified: gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c        
2008-02-06 18:09:42 UTC (rev 7589)
+++ gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c        
2008-02-06 18:55:17 UTC (rev 7590)
@@ -71,18 +71,20 @@
   if (comp_info.ncomplete == 0)
     return;
   
-  if (1){
-    static int total_complete = 0;
-    total_complete += comp_info.ncomplete;
-    printf("spu[%d]: tc = %6d\n", spu_args.spu_idx, total_complete);
+  if (0){
+    static int total_jobs = 0;
+    static int total_msgs = 0;
+    total_msgs++;
+    total_jobs += comp_info.ncomplete;
+    printf("spe[%2d]: tj = %6d  tm = %6d\n", spu_args.spu_idx,
+          total_jobs, total_msgs);
   }
 
   // ensure that PPE is done with the buffer we're about to overwrite
   wait_for_ppe_to_be_done_with_comp_info(ci_idx);
 
+  // dma the comp_info out to PPE
   int tag = ci_tags + ci_idx;
-  
-  // dma the comp_info out to PPE
   mfc_putf(&comp_info, spu_args.comp_info[ci_idx], sizeof(gc_comp_info_t), 
tag, 0, 0);
   mfc_write_tag_mask(1 << tag);                // the tag we're interested in
   mfc_read_tag_status_all();           // wait for DMA to complete
@@ -90,7 +92,7 @@
   // send it a message
   spu_writech(SPU_WrOutIntrMbox, MK_MBOX_MSG(OP_JOBS_DONE, ci_idx));
 
-  // ci_idx ^= 0x1;    // switch buffers
+  ci_idx ^= 0x1;       // switch buffers
   comp_info.in_use = 1;
   comp_info.ncomplete = 0;
 }
@@ -148,6 +150,12 @@
 {
   // FIXME do something useful ;)
 
+  if (0){
+    static int total_jobs = 0;
+    total_jobs++;
+    printf("spe[%2d]: tij =%6d\n", spu_args.spu_idx, total_jobs);
+  }
+
   if (0)
     printf("spu[%d]: job_id = %3d  client_id = %3d\n",
           spu_args.spu_idx, jd->sys.job_id, jd->sys.client_id);
@@ -176,23 +184,14 @@
   
   // Tell PPE we're done with the job.
   //
-  // We accrue this info until the PPE is ready to accept it or we run
-  // out of room.  The PPE is ready to accept if we can write to the
-  // SPU_WrOutIntrMbox without blocking.
+  // We queue these up until we run out of room, or until we can send
+  // the info to the PPE w/o blocking.  The blocking check is in
+  // main_loop
 
   comp_info.job_id[comp_info.ncomplete++] = jd->sys.job_id;
 
-  if (0){
-    static int total_complete = 0;
-    total_complete++;
-    printf("spu[%d]: tc = %6d\n", spu_args.spu_idx, total_complete);
-  }
-
-  if (spu_readchcnt(SPU_WrOutIntrMbox) != 0
-      || comp_info.ncomplete == GC_CI_NJOBS){
-
+  if (comp_info.ncomplete == GC_CI_NJOBS)
     flush_completion_info();
-  }
 }
 
 void
@@ -221,6 +220,12 @@
     }
     else
       backoff_delay();
+
+    // If we've got job completion info for the PPE and we can send a
+    // message without blocking, do it.
+
+    if (comp_info.ncomplete != 0 && spu_readchcnt(SPU_WrOutIntrMbox) != 0)
+      flush_completion_info();
   }
 }
 
@@ -238,10 +243,6 @@
   mfc_write_tag_mask(1 << sys_tag);    // the tag we're interested in
   mfc_read_tag_status_all();           // wait for DMA to complete
 
-  // printf("&comp_info = %p\n", &comp_info);
-
-  // printf("spu[%d] queue = 0x%llx\n", spu_args.spu_idx, spu_args.queue);
-
   backoff_init();              // initialize backoff parameters
 
   main_loop();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]