# HG changeset patch # User Me # Date 1289761672 28800 # Node ID 78d8bd6aadacdf61b80b4076799024d59e464900 # Parent 0a8667d136274335ef166c4940756501a83cac4e Updated singleton -- works, and added measurement of Request Handler time diff -r 0a8667d13627 -r 78d8bd6aadac .hgignore --- a/.hgignore Mon Nov 08 04:04:19 2010 -0800 +++ b/.hgignore Sun Nov 14 11:07:52 2010 -0800 @@ -7,3 +7,6 @@ src/.cproject src/.project .dep.inc +glob:.cproject +glob:.project +glob:Debug diff -r 0a8667d13627 -r 78d8bd6aadac src/Application/SSR_Matrix_Mult/Divide_Pr.c --- a/src/Application/SSR_Matrix_Mult/Divide_Pr.c Mon Nov 08 04:04:19 2010 -0800 +++ b/src/Application/SSR_Matrix_Mult/Divide_Pr.c Sun Nov 14 11:07:52 2010 -0800 @@ -469,7 +469,7 @@ newSubMatrix->origMatrix = origMatrix; newSubMatrix->origStartRow = startRow; newSubMatrix->origStartCol = startCol; - newSubMatrix->alreadyCopied = FALSE; + newSubMatrix->copySingleton = NULL; newSubMatrix->numUsesLeft = numUses; //can free after this many subMatrices[ rowOffset + colIdx ] = newSubMatrix; diff -r 0a8667d13627 -r 78d8bd6aadac src/Application/SSR_Matrix_Mult/SSR_Matrix_Mult.h --- a/src/Application/SSR_Matrix_Mult/SSR_Matrix_Mult.h Mon Nov 08 04:04:19 2010 -0800 +++ b/src/Application/SSR_Matrix_Mult/SSR_Matrix_Mult.h Sun Nov 14 11:07:52 2010 -0800 @@ -48,6 +48,8 @@ int32 origStartCol; int32 alreadyCopied; int32 numUsesLeft; //have update via message to avoid multiple writers + SSRSingleton *copySingleton; + SSRSingleton *copyTransSingleton; float32 *array; //2D, but dynamically sized, so use addr arith } SubMatrix; diff -r 0a8667d13627 -r 78d8bd6aadac src/Application/SSR_Matrix_Mult/subMatrix_Pr.c --- a/src/Application/SSR_Matrix_Mult/subMatrix_Pr.c Mon Nov 08 04:04:19 2010 -0800 +++ b/src/Application/SSR_Matrix_Mult/subMatrix_Pr.c Sun Nov 14 11:07:52 2010 -0800 @@ -52,10 +52,12 @@ SubMatrix *leftSubMatrix, *rightSubMatrix; DEBUG1(dbgAppFlow, "start sub-matrix mult: %d\n", animatingPr->procrID) + #ifdef TURN_ON_DEBUG_PROBES int32 subMatrixProbe = VMS__create_single_interval_probe( "subMtx", animatingPr); VMS__record_sched_choice_into_probe( subMatrixProbe, animatingPr ); VMS__record_interval_start_in_probe( subMatrixProbe ); + #endif params = (SMPairParams *)data; resultPr = params->resultPr; @@ -89,8 +91,10 @@ //send result to result processor params->partialResultArray = resArray; + #ifdef TURN_ON_DEBUG_PROBES VMS__record_interval_end_in_probe( subMatrixProbe ); - + #endif + SSR__send_of_type_to( animatingPr, params, RESULTS_MSG, resultPr ); SSR__dissipate_procr( animatingPr ); } @@ -225,8 +229,15 @@ Matrix *origMatrix; float32 *origArray, *subArray; - if( subMatrix->alreadyCopied ) return; - SSR__start_singleton( copyMatrixSingleton, &&EndOfTransSingleton, animPr); +// if( subMatrix->copyTransSingleton && \ +// subMatrix->copyTransSingleton->hasFinished ) \ +// return; + SSR__start_data_singleton( &(subMatrix->copyTransSingleton), animPr ); + + if( subMatrix->copyTransSingleton->hasFinished ) + { + printf("error!"); + } origMatrix = subMatrix->origMatrix; origArray = origMatrix->array; @@ -244,8 +255,8 @@ origStartRow, origStartCol, origStride, subArray, origArray ); - subMatrix->alreadyCopied = TRUE; //must be last thing before label - EndOfTransSingleton: + SSR__end_data_singleton( &(subMatrix->copyTransSingleton), animPr ); + return; } @@ -264,9 +275,18 @@ //Note, for non-GCC, can add a second SSR call at the end, and inside // that one, look at the stack at the return addr & save that in an // array indexed by singletonID - if( subMatrix->alreadyCopied ) return; - SSR__start_singleton( copyMatrixSingleton, &&EndOfCopySingleton, animPr ); +// if( subMatrix->copySingleton && subMatrix->copySingleton->hasFinished )\ + return; + SSR__start_data_singleton( &(subMatrix->copySingleton), animPr ); + if( subMatrix->copySingleton->endInstrAddr ) + { + printf("error!"); + } + if( subMatrix->copySingleton->hasFinished ) + { + printf("error!"); + } origMatrix = subMatrix->origMatrix; origArray = origMatrix->array; @@ -293,7 +313,7 @@ } } - subMatrix->alreadyCopied = TRUE; //must be last thing before label - EndOfCopySingleton: + SSR__end_data_singleton( &(subMatrix->copySingleton), animPr ); + return; } diff -r 0a8667d13627 -r 78d8bd6aadac src/Application/main.c --- a/src/Application/main.c Mon Nov 08 04:04:19 2010 -0800 +++ b/src/Application/main.c Sun Nov 14 11:07:52 2010 -0800 @@ -12,7 +12,6 @@ #include "SSR_Matrix_Mult/SSR_Matrix_Mult.h" /** - *Matrix multiply program written using VMS_HW piggy-back language * */ int main( int argc, char **argv ) @@ -29,8 +28,8 @@ printf("\nresult matrix: \n"); printMatrix( resultMatrix ); - // SSR__print_stats(); + fflush(stdin); exit(0); //cleans up }