changeset 6:78d8bd6aadac

Updated singleton -- works, and added measurement of Request Handler time
author Me
date Sun, 14 Nov 2010 11:07:52 -0800
parents 0a8667d13627
children c5d77078740c
files .hgignore src/Application/SSR_Matrix_Mult/Divide_Pr.c src/Application/SSR_Matrix_Mult/SSR_Matrix_Mult.h src/Application/SSR_Matrix_Mult/subMatrix_Pr.c src/Application/main.c
diffstat 5 files changed, 36 insertions(+), 12 deletions(-) [+]
line diff
     1.1 --- a/.hgignore	Mon Nov 08 04:04:19 2010 -0800
     1.2 +++ b/.hgignore	Sun Nov 14 11:07:52 2010 -0800
     1.3 @@ -7,3 +7,6 @@
     1.4  src/.cproject
     1.5  src/.project
     1.6  .dep.inc
     1.7 +glob:.cproject
     1.8 +glob:.project
     1.9 +glob:Debug
     2.1 --- a/src/Application/SSR_Matrix_Mult/Divide_Pr.c	Mon Nov 08 04:04:19 2010 -0800
     2.2 +++ b/src/Application/SSR_Matrix_Mult/Divide_Pr.c	Sun Nov 14 11:07:52 2010 -0800
     2.3 @@ -469,7 +469,7 @@
     2.4           newSubMatrix->origMatrix    = origMatrix;
     2.5           newSubMatrix->origStartRow  = startRow;
     2.6           newSubMatrix->origStartCol  = startCol;
     2.7 -         newSubMatrix->alreadyCopied = FALSE;
     2.8 +         newSubMatrix->copySingleton = NULL;
     2.9           newSubMatrix->numUsesLeft   = numUses; //can free after this many
    2.10  
    2.11           subMatrices[ rowOffset + colIdx ] = newSubMatrix;
     3.1 --- a/src/Application/SSR_Matrix_Mult/SSR_Matrix_Mult.h	Mon Nov 08 04:04:19 2010 -0800
     3.2 +++ b/src/Application/SSR_Matrix_Mult/SSR_Matrix_Mult.h	Sun Nov 14 11:07:52 2010 -0800
     3.3 @@ -48,6 +48,8 @@
     3.4     int32    origStartCol;
     3.5     int32    alreadyCopied;
     3.6     int32    numUsesLeft; //have update via message to avoid multiple writers
     3.7 +   SSRSingleton *copySingleton;
     3.8 +   SSRSingleton *copyTransSingleton;
     3.9     float32 *array;  //2D, but dynamically sized, so use addr arith
    3.10   }
    3.11  SubMatrix;
     4.1 --- a/src/Application/SSR_Matrix_Mult/subMatrix_Pr.c	Mon Nov 08 04:04:19 2010 -0800
     4.2 +++ b/src/Application/SSR_Matrix_Mult/subMatrix_Pr.c	Sun Nov 14 11:07:52 2010 -0800
     4.3 @@ -52,10 +52,12 @@
     4.4     SubMatrix      *leftSubMatrix, *rightSubMatrix;
     4.5  
     4.6           DEBUG1(dbgAppFlow, "start sub-matrix mult: %d\n", animatingPr->procrID)
     4.7 +         #ifdef TURN_ON_DEBUG_PROBES
     4.8           int32 subMatrixProbe = VMS__create_single_interval_probe( "subMtx",
     4.9                                                                  animatingPr);
    4.10           VMS__record_sched_choice_into_probe( subMatrixProbe, animatingPr );
    4.11           VMS__record_interval_start_in_probe( subMatrixProbe );
    4.12 +         #endif
    4.13  
    4.14     params         = (SMPairParams *)data;
    4.15     resultPr       = params->resultPr;
    4.16 @@ -89,8 +91,10 @@
    4.17     //send result to result processor
    4.18     params->partialResultArray = resArray;
    4.19  
    4.20 +         #ifdef TURN_ON_DEBUG_PROBES
    4.21           VMS__record_interval_end_in_probe( subMatrixProbe );
    4.22 -
    4.23 +         #endif
    4.24 +         
    4.25     SSR__send_of_type_to( animatingPr, params, RESULTS_MSG, resultPr );
    4.26     SSR__dissipate_procr( animatingPr );
    4.27   }
    4.28 @@ -225,8 +229,15 @@
    4.29     Matrix *origMatrix;
    4.30     float32 *origArray, *subArray;
    4.31  
    4.32 -   if( subMatrix->alreadyCopied ) return;
    4.33 -   SSR__start_singleton( copyMatrixSingleton, &&EndOfTransSingleton, animPr);
    4.34 +//   if( subMatrix->copyTransSingleton && \
    4.35 +//       subMatrix->copyTransSingleton->hasFinished ) \
    4.36 +//      return;
    4.37 +   SSR__start_data_singleton( &(subMatrix->copyTransSingleton), animPr );
    4.38 +
    4.39 +   if( subMatrix->copyTransSingleton->hasFinished )
    4.40 +    {
    4.41 +      printf("error!");
    4.42 +    }
    4.43  
    4.44     origMatrix   = subMatrix->origMatrix;
    4.45     origArray    = origMatrix->array;
    4.46 @@ -244,8 +255,8 @@
    4.47                    origStartRow, origStartCol, origStride,
    4.48                    subArray, origArray );
    4.49  
    4.50 -   subMatrix->alreadyCopied = TRUE; //must be last thing before label
    4.51 -   EndOfTransSingleton:
    4.52 +   SSR__end_data_singleton( &(subMatrix->copyTransSingleton), animPr );
    4.53 +   
    4.54     return;
    4.55   }
    4.56  
    4.57 @@ -264,9 +275,18 @@
    4.58        //Note, for non-GCC, can add a second SSR call at the end, and inside
    4.59        // that one, look at the stack at the return addr & save that in an
    4.60        // array indexed by singletonID
    4.61 -   if( subMatrix->alreadyCopied ) return;
    4.62 -   SSR__start_singleton( copyMatrixSingleton, &&EndOfCopySingleton, animPr );
    4.63 +//   if( subMatrix->copySingleton && subMatrix->copySingleton->hasFinished )\
    4.64 +      return;
    4.65 +   SSR__start_data_singleton( &(subMatrix->copySingleton), animPr );
    4.66 +   if( subMatrix->copySingleton->endInstrAddr )
    4.67 +    {
    4.68 +      printf("error!");
    4.69 +    }
    4.70  
    4.71 +   if( subMatrix->copySingleton->hasFinished )
    4.72 +    {
    4.73 +      printf("error!");
    4.74 +    }
    4.75  
    4.76     origMatrix    = subMatrix->origMatrix;
    4.77     origArray     = origMatrix->array;
    4.78 @@ -293,7 +313,7 @@
    4.79         }
    4.80      }
    4.81  
    4.82 -   subMatrix->alreadyCopied = TRUE; //must be last thing before label
    4.83 -   EndOfCopySingleton:
    4.84 +   SSR__end_data_singleton( &(subMatrix->copySingleton), animPr );
    4.85 +
    4.86     return;
    4.87   }
     5.1 --- a/src/Application/main.c	Mon Nov 08 04:04:19 2010 -0800
     5.2 +++ b/src/Application/main.c	Sun Nov 14 11:07:52 2010 -0800
     5.3 @@ -12,7 +12,6 @@
     5.4  #include "SSR_Matrix_Mult/SSR_Matrix_Mult.h"
     5.5  
     5.6  /**
     5.7 - *Matrix multiply program written using VMS_HW piggy-back language
     5.8   * 
     5.9   */
    5.10  int main( int argc, char **argv )
    5.11 @@ -29,8 +28,8 @@
    5.12  
    5.13     printf("\nresult matrix: \n");
    5.14     printMatrix( resultMatrix );
    5.15 -   
    5.16  //   SSR__print_stats();
    5.17 +   fflush(stdin);
    5.18     
    5.19     exit(0); //cleans up
    5.20   }