# HG changeset patch # User Sean Halle # Date 1391392721 28800 # Node ID c4b1849c05eff0da1bb1ae7febd8311afafea6f7 init add diff -r 000000000000 -r c4b1849c05ef Matrix_Mult.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Matrix_Mult.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,165 @@ +/* + * Copyright 2009 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + * Created on November 15, 2009, 2:35 AM + */ + +#include +#include + +#include "Matrix_Mult.h" +#include "ParamHelper/Param.h" + +void +initialize_Input_Matrices_Via( Matrix **leftMatrix, Matrix **rightMatrix, + ParamBag *paramBag ) + { char *leftMatrixFileName, *rightMatrixFileName; + int leftMatrixRows, leftMatrixCols, rightMatrixRows, rightMatrixCols; + + ParamStruc *param; + param = getParamFromBag( "leftMatrixRows", paramBag ); + leftMatrixRows = param->intValue; + param = getParamFromBag( "leftMatrixCols", paramBag ); + leftMatrixCols = param->intValue; + *leftMatrix = makeMatrix_WithResMat( leftMatrixRows, leftMatrixCols ); + + param = getParamFromBag( "leftMatrixFileName", paramBag ); + leftMatrixFileName = param->strValue; //no need to copy + read_Matrix_From_File( *leftMatrix, leftMatrixFileName ); + + param = getParamFromBag( "rightMatrixRows", paramBag ); + rightMatrixRows = param->intValue; + param = getParamFromBag( "rightMatrixCols", paramBag ); + rightMatrixCols = param->intValue; + *rightMatrix = makeMatrix_WithResMat( rightMatrixRows, rightMatrixCols ); + + param = getParamFromBag( "rightMatrixFileName", paramBag ); + rightMatrixFileName = param->strValue; + read_Matrix_From_File( *rightMatrix, rightMatrixFileName ); + } + + +void parseLineIntoRow( char *line, float32* row ); + + + void +read_Matrix_From_File( Matrix *matrixStruc, char *matrixFileName ) + { int row, maxRead, numRows, numCols; + float32 *matrixStart; + size_t lineSz = 0; + FILE *file; + char *line = NULL; + + lineSz = 50000; //max length of line in a matrix data file + line = (char *) malloc( lineSz ); + if( line == NULL ) printf( "no mem for matrix line" ); + + numRows = matrixStruc->numRows; + numCols = matrixStruc->numCols; + matrixStart = matrixStruc->array; + + file = fopen( matrixFileName, "r" ); + if( file == NULL ) { printf( "\nCouldn't open file!!\n"); exit(1);} + fseek( file, 0, SEEK_SET ); + for( row = 0; row < numRows; row++ ) + { + if( feof( file ) ) printf( "file ran out too soon" ); + maxRead = getline( &line, &lineSz, file ); + if( maxRead == -1 ) printf( "prob reading mat line"); + + if( *line == '\n') continue; //blank line + if( *line == '/' ) continue; //comment line + + parseLineIntoRow( line, matrixStart + row * numCols ); + } + free( line ); + } + +/*This function relies on each line having the proper number of cols. It + * doesn't check, nor enforce, so if the file is improperly formatted it + * can write over unrelated memory + */ + void +parseLineIntoRow( char *line, float32* row ) + { + char *valueStr, *searchPos; + + //read the float values + searchPos = valueStr = line; //start + + for( ; *searchPos != 0; searchPos++) //bit dangerous, should use buff len + { + if( *searchPos == '\n' ) //last col.. relying on well-formatted file + { *searchPos = 0; + *row = atof( valueStr ); + break; //end FOR loop + } + if( *searchPos == ',' ) + { *searchPos = 0; //mark end of string + *row = (float32) atof( valueStr ); + row += 1; //address arith + //skip any spaces before digits.. use searchPos + 1 to skip the 0 + for( ; *(searchPos + 1)== ' ' && *(searchPos + 1) !=0; searchPos++); + valueStr = searchPos + 1; + } + } + } + + //========================================================================== + +/*In the "_Flat" version of constructor, do only malloc of the top data struc + * and set values in that top-level. Don't malloc any sub-structures. + */ + Matrix * +makeMatrix_Flat( int32 numRows, int32 numCols ) + { Matrix * retMatrix; + retMatrix = malloc( sizeof( Matrix ) ); + retMatrix->numRows = numRows; + retMatrix->numCols = numCols; + + return retMatrix; + } + + Matrix * +makeMatrix_WithResMat( int32 numRows, int32 numCols ) + { Matrix * retMatrix; + retMatrix = malloc( sizeof( Matrix ) ); + retMatrix->numRows = numRows; + retMatrix->numCols = numCols; + retMatrix->array = malloc( numRows * numCols * sizeof(float32) ); + + return retMatrix; + } + + void +freeMatrix_Flat( Matrix * matrix ) + { //( matrix ); + } + void +freeMatrix( Matrix * matrix ) + { free( matrix->array ); + free( matrix ); + } + +void +printMatrix( Matrix *matrix ) + { int r, c, numRows, numCols, rowsToPrint, colsToPrint, rowIncr, colIncr; + float32 *matrixArray; + + numRows = rowsToPrint = matrix->numRows; + numCols = colsToPrint = matrix->numCols; + matrixArray = matrix->array; + + rowIncr = numRows/20; if(rowIncr == 0) rowIncr = 1;//20 to 39 rows printed + colIncr = numCols/20; if(colIncr == 0) colIncr = 1;//20 to 39 cols printed + for( r = 0; r < numRows; r += rowIncr ) + { for( c = 0; c < numCols; c += colIncr ) + { printf( "%3.1f | ", matrixArray[ r * numCols + c ] ); + } + printf("\n"); + } + } + diff -r 000000000000 -r c4b1849c05ef Matrix_Mult.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Matrix_Mult.h Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,76 @@ +/* + * Copyright Oct 24, 2009 OpenSourceCodeStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + */ + +#ifndef MATRIX_MULT_H_ +#define MATRIX_MULT_H_ + +#include +#include +#include + +#include "ParamHelper/Param.h" + +//============================== Structures ============================== + +typedef +struct + { int32 numRows; + int32 numCols; + float32 *array; //2D, but dynamically sized, so use addr arith + } +Matrix; + +/* This is the "appSpecificPiece" that is carried inside a DKUPiece. + * In the DKUPiece data struc it is declared to be of type "void *". This + * allows the application to define any data structure it wants and put it + * into a DKUPiece. + * When the app specific info is used, it is in app code, so it is cast to + * the correct type to tell the compiler how to access fields. + * This keeps all app-specific things out of the DKU directory, as per the + * DKU standard. */ +typedef +struct + { + // pointers to shared data.. the result matrix must be created when the + // left and right matrices are put into the root ancestor DKUPiece. + Matrix * leftMatrix; + Matrix * rightMatrix; + Matrix * resultMatrix; + + // define the starting and ending boundaries for this piece of the + // result matrix. These are derivable from the left and right + // matrices, but included them for readability of code. + int prodStartRow, prodEndRow; + int prodStartCol, prodEndCol; + // Start and end of the portion of the left matrix that contributes to + // this piece of the product + int leftStartRow, leftEndRow; + int leftStartCol, leftEndCol; + // Start and end of the portion of the right matrix that contributes to + // this piece of the product + int rightStartRow, rightEndRow; + int rightStartCol, rightEndCol; + } +MatrixProdPiece; + +//============================== Functions ================================ +void readFile(); + +Matrix *makeMatrix( int32 numRows, int32 numCols ); +Matrix *makeMatrix_Flat( int32 numRows, int32 numCols ); +Matrix *makeMatrix_WithResMat( int32 numRows, int32 numCols ); +void freeMatrix_Flat( Matrix * matrix ); +void freeMatrix( Matrix * matrix ); +void printMatrix( Matrix *matrix ); + +void read_Matrix_From_File( Matrix *matrixStruc, char *matrixFileName ); + +void +initialize_Input_Matrices_Via( Matrix **leftMatrix, Matrix **rightMatrix, + ParamBag *paramBag ); + +//=========================================================================== + +#endif /*MATRIX_MULT_H_*/ diff -r 000000000000 -r c4b1849c05ef ParamHelper/Param.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ParamHelper/Param.h Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,56 @@ +/* + * + * Author: SeanHalle@yahoo.com + * + * Created on November 19, 2009, 6:30 PM + */ + +#ifndef _PARAM_H +#define _PARAM_H + +typedef +struct + { int type; + int intValue; + char * strValue; + float floatValue; + } +ParamStruc; + +#define INT_PARAM_TYPE 0 +#define STRING_PARAM_TYPE 1 +#define FLOAT_PARAM_TYPE 2 + +#define PARAM_BAG_HASHSIZE 1024 + +typedef struct _ParamBagHashEntry ParamBagHashEntry; + +struct _ParamBagHashEntry + { + char *key; + ParamStruc *param; + struct _ParamBagHashEntry *next; + } +/*ParamBagHashEntry*/; + + +typedef +struct + { int bagSz; + ParamBagHashEntry* *entries; + } +ParamBag; + + +ParamBag *makeParamBag(); +void readParamFileIntoBag( char *paramFileName, ParamBag * bag ); +ParamStruc *getParamFromBag( char *key, ParamBag * bag ); +int addParamToBag( char* key, ParamStruc *param, ParamBag *bag ); +void freeParamBag( ParamBag *bag ); +//char *paramBagToString( ParamBag * bag ); +ParamStruc *makeParamStruc(); +ParamStruc *makeParamFromStrs( char * type, char *value ); +ssize_t getline( char **lineptr, size_t *n, FILE *stream ); + +#endif /* _PARAM_H */ + diff -r 000000000000 -r c4b1849c05ef ParamHelper/ParamBag.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ParamHelper/ParamBag.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,203 @@ +/* + * Copyright 2009 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Based on code posted to a discussion group on the web. (Forgot to mark + * down where got it from) + * + * Author: seanhalle@yahoo.com + * + * Created on November 14, 2009, 9:00 PM + */ +#include +#include +#include + +#include "Param.h" + +void freeParamStruc( ParamStruc * param ); +void freeParamBagHashEntry( ParamBagHashEntry *entry ); +ParamBagHashEntry * lookupKeyInHash( char *key, ParamBag * bag ); +unsigned int hashThisKey( char *s, int hashSz ); +void nullOutParamBagHashEntries( ParamBag *bag ); + + ParamBag * +makeParamBag() + { ParamBag * retBag; + retBag = malloc( sizeof( ParamBag ) ); + retBag->entries = malloc( PARAM_BAG_HASHSIZE * sizeof( ParamBagHashEntry *) ); + retBag->bagSz = PARAM_BAG_HASHSIZE; + nullOutParamBagHashEntries( retBag ); + + return retBag; + } + + void +nullOutParamBagHashEntries( ParamBag *bag ) + { int i, bagSz; + bagSz = bag->bagSz; + ParamBagHashEntry ** entries = bag->entries; + for( i = 0; i < bagSz; i++ ) + entries[ i ] = NULL; + } + + unsigned int +hashKey( char *s, int hashSz ) + { unsigned int h = 0; + + for( ; *s != 0; s++ ) + h = *s + h*31; + return h % hashSz; + } + +/*Need this to be separated out, for use in both getParam and putParam + */ + ParamBagHashEntry * +lookupKeyInHash( char *key, ParamBag * bag ) + { unsigned int + hashIndex = hashKey( key, bag->bagSz ); + ParamBagHashEntry* + hashEntry = bag->entries[ hashIndex ]; + for( ; hashEntry != NULL; hashEntry = hashEntry->next ) + { if( strcmp( hashEntry->key, key ) == 0 ) return hashEntry; + } + return NULL; + } + + ParamStruc * +getParamFromBag( char *key, ParamBag * bag ) + { ParamBagHashEntry *entry; + entry = lookupKeyInHash( key, bag ); + if( entry == NULL ) return NULL; + + return entry->param; + } + + int +addParamToBag( char* key, ParamStruc *param, ParamBag *bag ) + { unsigned int hashIdx; + ParamBagHashEntry* hashEntry; + hashEntry = lookupKeyInHash( key, bag ); + if( hashEntry == NULL ) + { hashIdx = hashKey( key, bag->bagSz ); + hashEntry = (ParamBagHashEntry*) malloc( sizeof( ParamBagHashEntry ) ); + if( hashEntry == NULL ) return 0; + hashEntry->key = strdup( key ); + if( hashEntry->key == NULL ) return 0; + hashEntry->next = (bag->entries)[hashIdx]; + (bag->entries)[hashIdx] = hashEntry; + } + else + { freeParamStruc( hashEntry->param ); + } + hashEntry->param = param; + return 1; + } + + + void +freeParamBag( ParamBag *bag ) + { int i; + ParamBagHashEntry *hashEntry, *temp, **entries; + + entries = bag->entries; + for( i=0; i < bag->bagSz; i++ ) + { if( entries[i] != NULL ) + { hashEntry = entries[i]; + while( hashEntry != NULL ) + { + temp = hashEntry->next; + freeParamBagHashEntry( hashEntry ); + hashEntry = temp; + } + } + } + } + + void +freeParamBagHashEntry( ParamBagHashEntry *entry ) + { + freeParamStruc( entry->param ); + free( entry->key ); //was malloc'd above, so free it + free( entry ); + } + + void +freeParamStruc( ParamStruc * param ) + { if( param->type == STRING_PARAM_TYPE ) free( param->strValue ); + free( param ); + } + + ParamStruc * +makeParamStruc() + { ParamStruc *retStruc; + retStruc = malloc( sizeof( ParamStruc ) ); + retStruc->floatValue = 0.0; + retStruc->intValue = 0; + retStruc->strValue = NULL; + + return retStruc; + } + +void +removeEndWhtSpaceFromStr( char *str ) + { int n; + + n = strlen ( str ); + while( --n >= 0 ) + { + if(str[n] != ' ' && str[n] != '\t' && str[n] != '\n' && str[n] != '\r') + break; + } + str[n + 1] = '\0'; + } + + +ParamStruc * +makeParamFromStrs( char * type, char *value ) + { ParamStruc *retParam; + retParam = makeParamStruc(); + switch(*type) + { case 'i': + { retParam->type = INT_PARAM_TYPE; + retParam->intValue = atoi( value ); + } break; + case 's': + { retParam->type = STRING_PARAM_TYPE; + retParam->strValue = malloc( strlen(value) + 1); + strcpy( retParam->strValue, value ); + removeEndWhtSpaceFromStr( retParam->strValue ); + } break; + case 'f': + { retParam->type = FLOAT_PARAM_TYPE; + retParam->floatValue = atof( value ); + } break; + } + return retParam; + } + + +/* A pretty useless but good debugging function, + which simply displays the hashtable in (key.value) pairs +*/ +/*void paramBagToString( ParamBag * bag ) + { int i; + ParamBagHashEntry *t; + for( i = 0; i < bag->bagSz; i++ ) + { t = entries[i]; + if( t == NULL ) + strcat_m( retStr, &"()" ); + else + { strcat_m( retStr, &"(" ); + for( ; t != NULL; t = t->next ) + { strcat_m( retStr, &" " ); + strcat_m( retStr, t->key ); + strcat_m( retStr, &"." ); + strcat_m( retStr, paramToString( t->param ) ); + strcat_m( retStr, &" " ); + } + strcat_m( retStr, &")" ); + } + } + } +*/ diff -r 000000000000 -r c4b1849c05ef ParamHelper/ReadParamsFromFile.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ParamHelper/ReadParamsFromFile.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,110 @@ +/* + * Author: SeanHalle@yahoo.com + * + * Created on June 15, 2009, 10:12 AM + */ + +#include +#include +#include + +#include "../Matrix_Mult.h" + +ParamStruc * makeParamFromStrs( char * type, char *value ); + +#define _GNU_SOURCE + +/*Copied from gnu's win32 lib + */ + ssize_t +getline( char **lineptr, size_t *n, FILE *stream ) + { + if ( lineptr == NULL || n == NULL) return -1; + if (*lineptr == NULL || *n == 0) + { *n = 500; //max length of line in a config file + *lineptr = (char *) malloc( *n ); + if (*lineptr == NULL) return -1; + } + if( fgets( *lineptr, *n, stream ) ) + return *n; + else + return -1; + } + + void +readParamFileIntoBag( char *paramFileName, ParamBag * bag ) + { + size_t lineSz = 0; + FILE* paramFile; + char* line = NULL; + + char* paramType;// = malloc( 12 ); //"double" is the longest type + char* paramName;// = malloc( 500 ); //max of 500 chars in name + char* paramValue;// = malloc( 500 ); //max of 500 chars in value + + lineSz = 500; //max length of line in a config file + line = (char *) malloc( lineSz ); + if( line == NULL ) + { printf( "\nIn readParamFileIntoBag: no mem for line\n" ); + return; + } + + + paramFile = fopen( paramFileName, "r" ); + if( paramFile == NULL ) {printf("\ncouldn't open file\n"); exit(0);} + fseek( paramFile, 0, SEEK_SET ); + while( !feof( paramFile ) ) + { while( getline( &line, &lineSz, paramFile ) != -1 ) + { + char *lineEnd = line + strlen(line) +1; + char *searchPos = line; + + if( *line == '\n') continue; //blank line + if( *line == '/' ) continue; //comment line + + //read the param type + paramType = line; //start of string + int foundIt = 0; + for( ; searchPos < lineEnd && !foundIt; searchPos++) + { if( *searchPos == ',' ) + { foundIt = 1; + *searchPos = 0; //mark end of string + } + } + //get rid of leading spaces + for( ; searchPos < lineEnd; searchPos++) + { if( *searchPos != ' ' ) break; + } + //read the param name + paramName = searchPos; + foundIt = 0; + for( ; searchPos < lineEnd && !foundIt; searchPos++) + { if( *searchPos == ',' ) + { foundIt = 1; + *searchPos = 0; //mark end + } + } + //get rid of leading spaces + for( ; searchPos < lineEnd; searchPos++) + { if( *searchPos != ' ' ) break; + } + //read the param value + paramValue = searchPos; + foundIt = 0; + for( ; searchPos < lineEnd && !foundIt; searchPos++) + { if( *searchPos == '\n' ) + { foundIt = 1; + *searchPos = 0; //mark end + } + } + if( foundIt ) + { printf("Found: %s, %s, %s\n", paramType, paramName, paramValue ); + ParamStruc * + paramStruc = makeParamFromStrs( paramType, paramValue ); + addParamToBag( paramName, paramStruc, bag ); + } + } + } + free( line ); + } + diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/Circuit.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/Circuit.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,938 @@ +#include +#include +#include "VReo__Test_App.h" +#include "Circuit.h" + +VReoCircuit *create_circuit(SlaveVP *animVP) { + + /* Declare variables. */ + VReoCircuit *circuit; + VReoBridge *bridge, *bridges, **boundaryBridges; + VReoIsland *islands, *island; + VReoO1island *o1islands, *o1island; + VReoCheckerFn *bridgeReaderCheckerFns, *bridgeWriterCheckerFns; + VReoDoerFn *bridgeReaderDoerFns, *bridgeWriterDoerFns; + PrivQueueStruc *offerQ0, *offerQ1; + VReoPartnerQStruct *partnerQStruct0, *partnerQStruct1; + + /* Allocate memory for bridges, islands, and the circuit. */ + bridges = PR_WL__malloc(NUM_BRIDGES * sizeof(VReoBridge)); + islands = PR_WL__malloc((NUM_ISLANDS == 0 ? 1 : NUM_ISLANDS) * sizeof(VReoIsland)); + o1islands = PR_WL__malloc((NUM_O1ISLANDS == 0 ? 1 : NUM_O1ISLANDS) * sizeof(VReoO1island)); + circuit = (VReoCircuit *) PR_WL__malloc(sizeof(VReoCircuit)); + + // + // INITIALIZE BRIDGES + // + + /* Initialize bridge Broad_0. */ + bridge = &(bridges[CKT_BRIDGE_Broad_0]); + bridge->buffer = NULL; + bridge->bridgeIsFull = FALSE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge In_0. */ + bridge = &(bridges[CKT_BRIDGE_In_0]); + bridge->buffer = NULL; + bridge->bridgeIsFull = FALSE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge In_1. */ + bridge = &(bridges[CKT_BRIDGE_In_1]); + bridge->buffer = NULL; + bridge->bridgeIsFull = FALSE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge Out_0. */ + bridge = &(bridges[CKT_BRIDGE_Out_0]); + bridge->buffer = NULL; + bridge->bridgeIsFull = FALSE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge Out_1. */ + bridge = &(bridges[CKT_BRIDGE_Out_1]); + bridge->buffer = NULL; + bridge->bridgeIsFull = FALSE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge FIFO0. */ + bridge = &(bridges[CKT_BRIDGE_FIFO0]); + bridge->buffer = NULL; + bridge->bridgeIsFull = FALSE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge FIFO1. */ + bridge = &(bridges[CKT_BRIDGE_FIFO1]); + bridge->buffer = malloc(1); + bridge->bridgeIsFull = TRUE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge FIFO2. */ + bridge = &(bridges[CKT_BRIDGE_FIFO2]); + bridge->buffer = NULL; + bridge->bridgeIsFull = FALSE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize bridge FIFO3. */ + bridge = &(bridges[CKT_BRIDGE_FIFO3]); + bridge->buffer = malloc(1); + bridge->bridgeIsFull = TRUE; + bridge->waitingReaderVP = NULL; + bridge->waitingWriterVP = NULL; + bridge->readerPartnerQStruct = NULL; + bridge->writerPartnerQStruct = NULL; + + /* Initialize boundary bridges. */ + boundaryBridges = PR_WL__malloc(NUM_BOUNDARY_BRIDGES * sizeof(VReoBridge*)); + boundaryBridges[0] = &(bridges[CKT_BRIDGE_Broad_0]); + boundaryBridges[1] = &(bridges[CKT_BRIDGE_In_0]); + boundaryBridges[2] = &(bridges[CKT_BRIDGE_In_1]); + boundaryBridges[3] = &(bridges[CKT_BRIDGE_Out_0]); + boundaryBridges[4] = &(bridges[CKT_BRIDGE_Out_1]); + + // + // INITIALIZE ISLANDS + // + + /* Initialize Island 0. */ + island = &(islands[CKT_I0]); + + island->numCheckerFns = 1; + island->numBridges = 4; + + island->checkerFns = PR_WL__malloc(island->numCheckerFns * sizeof(VReoCheckerFn)); + island->checkerFns[0] = &Checker_0__I0; + + island->doerFns = PR_WL__malloc(island->numCheckerFns * sizeof(VReoDoerFn)); + island->doerFns[0] = &Doer_0__I0; + + island->bridges = PR_WL__malloc(island->numBridges * sizeof(VReoBridge *)); + island->bridges[I0_BRIDGE_Broad_0] = &(bridges[CKT_BRIDGE_Broad_0]); + island->bridges[I0_BRIDGE_Broad_0Output1] = &(bridges[CKT_BRIDGE_Broad_0Output1]); + island->bridges[I0_BRIDGE_Broad_0Output2] = &(bridges[CKT_BRIDGE_Broad_0Output2]); + island->bridges[I0_BRIDGE_Out_1] = &(bridges[CKT_BRIDGE_Out_1]); + + /* + * Initialize Island 0: register Island 0 as a reader on + * bridge Broad_0. + */ + bridgeReaderCheckerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0 * sizeof(VReoCheckerFn *) ); + bridgeReaderDoerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0 * sizeof(VReoDoerFn *) ); + bridgeReaderCheckerFns[0] = (VReoCheckerFn) &CHECKER3_I0; + bridgeReaderDoerFns[0] = (VReoDoerFn) &DOER3_I0; + + bridge = &(bridges[CKT_BRIDGE_Broad_0]); + bridge->reader = &(islands[CKT_I0]); + bridge->readerType = Island; + bridge->numReaderCheckerFns = NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0; + bridge->readerCheckerFns = (VReoCheckerFn *) bridgeReaderCheckerFns; + bridge->readerDoerFns = (VReoDoerFn *) bridgeReaderDoerFns; + + /* + * Initialize Island 0: register Island 0 as a writer on + * bridge Broad_0Output1. + */ + bridgeWriterCheckerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output1 * sizeof(VReoCheckerFn *) ); + bridgeWriterDoerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output1 * sizeof(VReoDoerFn *) ); + bridgeWriterCheckerFns[0] = (VReoCheckerFn) &CHECKER3_I0; + bridgeWriterDoerFns[0] = (VReoDoerFn) &DOER3_I0; + + bridge = &(bridges[CKT_BRIDGE_Broad_0Output1]); + bridge->writer = &(islands[CKT_I0]); + bridge->writerType = Island; + bridge->numWriterCheckerFns = NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output1; + bridge->writerCheckerFns = (VReoCheckerFn *) bridgeWriterCheckerFns; + bridge->writerDoerFns = (VReoDoerFn *) bridgeWriterDoerFns; + + /* + * Initialize Island 0: register Island 0 as a writer on + * bridge Broad_0Output2. + */ + bridgeWriterCheckerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output2 * sizeof(VReoCheckerFn *) ); + bridgeWriterDoerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output2 * sizeof(VReoDoerFn *) ); + bridgeWriterCheckerFns[0] = (VReoCheckerFn) &CHECKER3_I0; + bridgeWriterDoerFns[0] = (VReoDoerFn) &DOER3_I0; + + bridge = &(bridges[CKT_BRIDGE_Broad_0Output2]); + bridge->writer = &(islands[CKT_I0]); + bridge->writerType = Island; + bridge->numWriterCheckerFns = NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output2; + bridge->writerCheckerFns = (VReoCheckerFn *) bridgeWriterCheckerFns; + bridge->writerDoerFns = (VReoDoerFn *) bridgeWriterDoerFns; + + /* + * Initialize Island 0: register Island 0 as a writer on + * bridge Out_1. + */ + bridgeWriterCheckerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Out_1 * sizeof(VReoCheckerFn *) ); + bridgeWriterDoerFns = PR_WL__malloc( NUM_I0_CHECKERS_INVOLVE_BRIDGE_Out_1 * sizeof(VReoDoerFn *) ); + bridgeWriterCheckerFns[0] = (VReoCheckerFn) &CHECKER3_I0; + bridgeWriterDoerFns[0] = (VReoDoerFn) &DOER3_I0; + + bridge = &(bridges[CKT_BRIDGE_Out_1]); + bridge->writer = &(islands[CKT_I0]); + bridge->writerType = Island; + bridge->numWriterCheckerFns = NUM_I0_CHECKERS_INVOLVE_BRIDGE_Out_1; + bridge->writerCheckerFns = (VReoCheckerFn *) bridgeWriterCheckerFns; + bridge->writerDoerFns = (VReoDoerFn *) bridgeWriterDoerFns; + + /* Initialize Island 1. */ + island = &(islands[CKT_I1]); + + island->numCheckerFns = 1; + island->numBridges = 3; + + island->checkerFns = PR_WL__malloc(island->numCheckerFns * sizeof(VReoCheckerFn)); + island->checkerFns[0] = &Checker_0__I1; + + island->doerFns = PR_WL__malloc(island->numCheckerFns * sizeof(VReoDoerFn)); + island->doerFns[0] = &Doer_0__I1; + + island->bridges = PR_WL__malloc(island->numBridges * sizeof(VReoBridge *)); + island->bridges[I1_BRIDGE_X_0Input0] = &(bridges[CKT_BRIDGE_X_0Input0]); + island->bridges[I1_BRIDGE_In_0] = &(bridges[CKT_BRIDGE_In_0]); + island->bridges[I1_BRIDGE_In_0Output1] = &(bridges[CKT_BRIDGE_In_0Output1]); + + /* + * Initialize Island 1: register Island 1 as a reader on + * bridge X_0Input0. + */ + bridgeReaderCheckerFns = PR_WL__malloc( NUM_I1_CHECKERS_INVOLVE_BRIDGE_X_0Input0 * sizeof(VReoCheckerFn *) ); + bridgeReaderDoerFns = PR_WL__malloc( NUM_I1_CHECKERS_INVOLVE_BRIDGE_X_0Input0 * sizeof(VReoDoerFn *) ); + bridgeReaderCheckerFns[0] = (VReoCheckerFn) &CHECKER2_I1; + bridgeReaderDoerFns[0] = (VReoDoerFn) &DOER2_I1; + + bridge = &(bridges[CKT_BRIDGE_X_0Input0]); + bridge->reader = &(islands[CKT_I1]); + bridge->readerType = Island; + bridge->numReaderCheckerFns = NUM_I1_CHECKERS_INVOLVE_BRIDGE_X_0Input0; + bridge->readerCheckerFns = (VReoCheckerFn *) bridgeReaderCheckerFns; + bridge->readerDoerFns = (VReoDoerFn *) bridgeReaderDoerFns; + + /* + * Initialize Island 1: register Island 1 as a reader on + * bridge In_0. + */ + bridgeReaderCheckerFns = PR_WL__malloc( NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0 * sizeof(VReoCheckerFn *) ); + bridgeReaderDoerFns = PR_WL__malloc( NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0 * sizeof(VReoDoerFn *) ); + bridgeReaderCheckerFns[0] = (VReoCheckerFn) &CHECKER2_I1; + bridgeReaderDoerFns[0] = (VReoDoerFn) &DOER2_I1; + + bridge = &(bridges[CKT_BRIDGE_In_0]); + bridge->reader = &(islands[CKT_I1]); + bridge->readerType = Island; + bridge->numReaderCheckerFns = NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0; + bridge->readerCheckerFns = (VReoCheckerFn *) bridgeReaderCheckerFns; + bridge->readerDoerFns = (VReoDoerFn *) bridgeReaderDoerFns; + + /* + * Initialize Island 1: register Island 1 as a writer on + * bridge In_0Output1. + */ + bridgeWriterCheckerFns = PR_WL__malloc( NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0Output1 * sizeof(VReoCheckerFn *) ); + bridgeWriterDoerFns = PR_WL__malloc( NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0Output1 * sizeof(VReoDoerFn *) ); + bridgeWriterCheckerFns[0] = (VReoCheckerFn) &CHECKER2_I1; + bridgeWriterDoerFns[0] = (VReoDoerFn) &DOER2_I1; + + bridge = &(bridges[CKT_BRIDGE_In_0Output1]); + bridge->writer = &(islands[CKT_I1]); + bridge->writerType = Island; + bridge->numWriterCheckerFns = NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0Output1; + bridge->writerCheckerFns = (VReoCheckerFn *) bridgeWriterCheckerFns; + bridge->writerDoerFns = (VReoDoerFn *) bridgeWriterDoerFns; + + /* Initialize Island 2. */ + island = &(islands[CKT_I2]); + + island->numCheckerFns = 1; + island->numBridges = 3; + + island->checkerFns = PR_WL__malloc(island->numCheckerFns * sizeof(VReoCheckerFn)); + island->checkerFns[0] = &Checker_0__I2; + + island->doerFns = PR_WL__malloc(island->numCheckerFns * sizeof(VReoDoerFn)); + island->doerFns[0] = &Doer_0__I2; + + island->bridges = PR_WL__malloc(island->numBridges * sizeof(VReoBridge *)); + island->bridges[I2_BRIDGE_In_1] = &(bridges[CKT_BRIDGE_In_1]); + island->bridges[I2_BRIDGE_X_1Input0] = &(bridges[CKT_BRIDGE_X_1Input0]); + island->bridges[I2_BRIDGE_In_1Output0] = &(bridges[CKT_BRIDGE_In_1Output0]); + + /* + * Initialize Island 2: register Island 2 as a reader on + * bridge In_1. + */ + bridgeReaderCheckerFns = PR_WL__malloc( NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1 * sizeof(VReoCheckerFn *) ); + bridgeReaderDoerFns = PR_WL__malloc( NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1 * sizeof(VReoDoerFn *) ); + bridgeReaderCheckerFns[0] = (VReoCheckerFn) &CHECKER3_I2; + bridgeReaderDoerFns[0] = (VReoDoerFn) &DOER3_I2; + + bridge = &(bridges[CKT_BRIDGE_In_1]); + bridge->reader = &(islands[CKT_I2]); + bridge->readerType = Island; + bridge->numReaderCheckerFns = NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1; + bridge->readerCheckerFns = (VReoCheckerFn *) bridgeReaderCheckerFns; + bridge->readerDoerFns = (VReoDoerFn *) bridgeReaderDoerFns; + + /* + * Initialize Island 2: register Island 2 as a reader on + * bridge X_1Input0. + */ + bridgeReaderCheckerFns = PR_WL__malloc( NUM_I2_CHECKERS_INVOLVE_BRIDGE_X_1Input0 * sizeof(VReoCheckerFn *) ); + bridgeReaderDoerFns = PR_WL__malloc( NUM_I2_CHECKERS_INVOLVE_BRIDGE_X_1Input0 * sizeof(VReoDoerFn *) ); + bridgeReaderCheckerFns[0] = (VReoCheckerFn) &CHECKER3_I2; + bridgeReaderDoerFns[0] = (VReoDoerFn) &DOER3_I2; + + bridge = &(bridges[CKT_BRIDGE_X_1Input0]); + bridge->reader = &(islands[CKT_I2]); + bridge->readerType = Island; + bridge->numReaderCheckerFns = NUM_I2_CHECKERS_INVOLVE_BRIDGE_X_1Input0; + bridge->readerCheckerFns = (VReoCheckerFn *) bridgeReaderCheckerFns; + bridge->readerDoerFns = (VReoDoerFn *) bridgeReaderDoerFns; + + /* + * Initialize Island 2: register Island 2 as a writer on + * bridge In_1Output0. + */ + bridgeWriterCheckerFns = PR_WL__malloc( NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1Output0 * sizeof(VReoCheckerFn *) ); + bridgeWriterDoerFns = PR_WL__malloc( NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1Output0 * sizeof(VReoDoerFn *) ); + bridgeWriterCheckerFns[0] = (VReoCheckerFn) &CHECKER3_I2; + bridgeWriterDoerFns[0] = (VReoDoerFn) &DOER3_I2; + + bridge = &(bridges[CKT_BRIDGE_In_1Output0]); + bridge->writer = &(islands[CKT_I2]); + bridge->writerType = Island; + bridge->numWriterCheckerFns = NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1Output0; + bridge->writerCheckerFns = (VReoCheckerFn *) bridgeWriterCheckerFns; + bridge->writerDoerFns = (VReoDoerFn *) bridgeWriterDoerFns; + + /* Initialize O1Island 0. */ + o1island = &(o1islands[CKT_O1I0]); + + o1island->numBridges = 3; + o1island->bridges = PR_WL__malloc(o1island->numBridges * sizeof(VReoBridge *)); + o1island->bridges[O1I0_BRIDGE_Out_0Input1] = &(bridges[CKT_BRIDGE_Out_0Input1]); + o1island->bridges[O1I0_BRIDGE_Out_0Input0] = &(bridges[CKT_BRIDGE_Out_0Input0]); + o1island->bridges[O1I0_BRIDGE_Out_0] = &(bridges[CKT_BRIDGE_Out_0]); + + /* + * Initialize O1Island 0: create queues (queue 0 holds puts of input + * bridges; queue 1 holds gets of the output bridge). + */ + offerQ0 = makePrivQ(); + offerQ1 = makePrivQ(); + + partnerQStruct0 = PR_WL__malloc( sizeof(VReoPartnerQStruct) ); + partnerQStruct0->numQs = 1; + partnerQStruct0->partnerQs = PR_WL__malloc( partnerQStruct0->numQs * sizeof(PrivQueueStruc *) ); + partnerQStruct0->doerFns = PR_WL__malloc( partnerQStruct0->numQs * sizeof(VReoO1islandDoerFn) ); + partnerQStruct0->doerFns[0] = &o1islandReadBridgeToWrittenBridgeDoer; + partnerQStruct0->partnerQs[0] = offerQ1; + + partnerQStruct1 = PR_WL__malloc( sizeof(VReoPartnerQStruct) ); + partnerQStruct1->numQs = 1; + partnerQStruct1->partnerQs = PR_WL__malloc( partnerQStruct1->numQs * sizeof(PrivQueueStruc *) ); + partnerQStruct1->doerFns = PR_WL__malloc( partnerQStruct1->numQs * sizeof(VReoO1islandDoerFn) ); + partnerQStruct1->doerFns[0] = &o1islandReadBridgeToWrittenBridgeDoer; + partnerQStruct1->partnerQs[0] = offerQ0; + + /* + * Initialize O1Island 0: register O1Island 0 as a reader on + * bridge Out_0Input1. + */ + bridge = &(bridges[CKT_BRIDGE_Out_0Input1]); + bridge->reader = &(o1island); + bridge->readerType = O1island; + bridge->readerPartnerQStruct = partnerQStruct0; + bridge->readerOfferQ = offerQ0; + + /* + * Initialize O1Island 0: register O1Island 0 as a reader on + * bridge Out_0Input0. + */ + bridge = &(bridges[CKT_BRIDGE_Out_0Input0]); + bridge->reader = &(o1island); + bridge->readerType = O1island; + bridge->readerPartnerQStruct = partnerQStruct0; + bridge->readerOfferQ = offerQ0; + + /* + * Initialize O1Island 0: register O1Island 0 as the only + * writer on bridge Out_0. + */ + bridge = &(bridges[CKT_BRIDGE_Out_0]); + bridge->writer = &(o1island); + bridge->writerType = O1island; + bridge->writerPartnerQStruct = partnerQStruct1; + bridge->writerOfferQ = offerQ1; + + // + // INITIALIZE QUEUES + // + + /* Assumption: (writerType != NULL) implies (writerType != VP) */ + bridge = &(bridges[CKT_BRIDGE_Out_0Input1]); + if (bridge->writerType != NULL && bridge->bridgeIsFull) + writePrivQ( bridge, bridge->readerOfferQ ); + + /* Assumption: (writerType != NULL) implies (writerType != VP) */ + bridge = &(bridges[CKT_BRIDGE_Out_0Input0]); + if (bridge->writerType != NULL && bridge->bridgeIsFull) + writePrivQ( bridge, bridge->readerOfferQ ); + + /* Assumption: (readerType != NULL) implies (readerType != VP) */ + bridge = &(bridges[CKT_BRIDGE_Out_0]); + if (bridge->readerType != NULL && !bridge->bridgeIsFull) + writePrivQ( bridge, bridge->writerOfferQ ); + + // + // INITIALIZE CIRCUIT + // + + /* Initialize circuit. */ + circuit->numIslands = NUM_ISLANDS; + circuit->numO1islands = NUM_O1ISLANDS; + circuit->numBridges = NUM_BRIDGES; + circuit->islands = islands; + circuit->o1islands = o1islands; + circuit->bridges = bridges; + circuit->boundaryBridges = boundaryBridges; + circuit->VPs = NULL; + + /* Return. */ + return (circuit); +} + +void create_VPs_w_init_and_connect( VReoCircuit *circuit, void **initDatums, + SlaveVP *animVP) + { + + /* Declare variables. */ + VReoBridge **boundaryBridges, *bridges, **bridgesForVP; + SlaveVP **VPs; + + TestAppProducerParams *prodParams; + TestAppConsumerParams *consParams; + + /* Initialize (boundary) bridges. */ + boundaryBridges = circuit->boundaryBridges; + bridges = circuit->bridges; + + /* Allocate memory for VPs. */ + VPs = PR_WL__malloc(NUM_VPs * sizeof(SlaveVP *)); + + /* Create Producer VP 0. */ + bridgesForVP = PR_WL__malloc(1 * sizeof(VReoBridge *)); + bridgesForVP[0] = boundaryBridges[CKT_VP_PROD0]; + + prodParams = PR_WL__malloc(sizeof(TestAppProducerParams)); + prodParams->inBridges = NULL; + prodParams->outBridges = bridgesForVP; + prodParams->initData = initDatums[CKT_VP_PROD0]; + + VPs[CKT_VP_PROD0] = VReo__create_VP(&producer_Fn, prodParams, circuit, animVP); + + boundaryBridges[CKT_VP_PROD0]->writer = VPs[CKT_VP_PROD0]; + boundaryBridges[CKT_VP_PROD0]->writerType = VP; + + /* Create Producer VP 1. */ + bridgesForVP = PR_WL__malloc(1 * sizeof(VReoBridge *)); + bridgesForVP[0] = boundaryBridges[CKT_VP_PROD1]; + + prodParams = PR_WL__malloc(sizeof(TestAppProducerParams)); + prodParams->inBridges = NULL; + prodParams->outBridges = bridgesForVP; + prodParams->initData = initDatums[CKT_VP_PROD1]; + + VPs[CKT_VP_PROD1] = VReo__create_VP(&producer_Fn, prodParams, circuit, animVP); + + boundaryBridges[CKT_VP_PROD1]->writer = VPs[CKT_VP_PROD1]; + boundaryBridges[CKT_VP_PROD1]->writerType = VP; + + /* Create Producer VP 2. */ + bridgesForVP = PR_WL__malloc(1 * sizeof(VReoBridge *)); + bridgesForVP[0] = boundaryBridges[CKT_VP_PROD2]; + + prodParams = PR_WL__malloc(sizeof(TestAppProducerParams)); + prodParams->inBridges = NULL; + prodParams->outBridges = bridgesForVP; + prodParams->initData = initDatums[CKT_VP_PROD2]; + + VPs[CKT_VP_PROD2] = VReo__create_VP(&producer_Fn, prodParams, circuit, animVP); + + boundaryBridges[CKT_VP_PROD2]->writer = VPs[CKT_VP_PROD2]; + boundaryBridges[CKT_VP_PROD2]->writerType = VP; + +// /* Create Consumer VP 0. */ +// consParams = PR_WL__malloc(sizeof(TestAppConsumerParams)); +// +// //bridgesForVP = PR_WL__malloc(1 * sizeof(VReoBridge *)); +// //bridgesForVP[0] = boundaryBridges[CKT_VP_CONS0]; +// +// bridgesForVP = PR_WL__malloc(2 * sizeof(VReoBridge *)); +// bridgesForVP[0] = bridges[CKT_BRIDGE_Out_0]; +// bridgesForVP[0] = bridges[CKT_BRIDGE_Out_1]; +// +// consParams->inBridges = bridgesForVP; +// consParams->outBridges = NULL; +// +// VPs[CKT_VP_CONS0] = VReo__create_VP(&consumer_Fn, consParams, circuit, animVP); +// boundaryBridges[CKT_VP_CONS0]->reader = VPs[CKT_VP_CONS0]; +// boundaryBridges[CKT_VP_CONS0]->readerType = VP; + +// /* Create Consumer VP 1. */ +// consParams = PR_WL__malloc(sizeof(TestAppConsumerParams)); +// +// //bridgesForVP = PR_WL__malloc(1 * sizeof(VReoBridge *)); +// //bridgesForVP[0] = boundaryBridges[CKT_VP_CONS1]; +// +// bridgesForVP = PR_WL__malloc(2 * sizeof(VReoBridge *)); +// bridgesForVP[0] = bridges[CKT_BRIDGE_Out_0]; +// bridgesForVP[0] = bridges[CKT_BRIDGE_Out_1]; +// +// consParams->inBridges = bridgesForVP; +// consParams->outBridges = NULL; +// +// VPs[CKT_VP_CONS1] = VReo__create_VP(&consumer_Fn, consParams, circuit, animVP); +// boundaryBridges[CKT_VP_CONS1]->reader = VPs[CKT_VP_CONS1]; +// boundaryBridges[CKT_VP_CONS1]->readerType = VP; + + /* Create Consumer VP. */ + consParams = PR_WL__malloc(sizeof(TestAppConsumerParams)); + + bridgesForVP = PR_WL__malloc(2 * sizeof(VReoBridge *)); + bridgesForVP[0] = &(bridges[CKT_BRIDGE_Out_0]); + bridgesForVP[1] = &(bridges[CKT_BRIDGE_Out_1]); + + consParams->inBridges = bridgesForVP; + consParams->outBridges = NULL; + consParams->initData = initDatums[CKT_VP_CONS0]; + + VPs[CKT_VP_CONS0] = VReo__create_VP(&consumer_Fn, consParams, circuit, animVP); + + bridges[CKT_BRIDGE_Out_0].reader = VPs[CKT_VP_CONS0]; + bridges[CKT_BRIDGE_Out_1].reader = VPs[CKT_VP_CONS0]; + bridges[CKT_BRIDGE_Out_0].readerType = VP; + bridges[CKT_BRIDGE_Out_1].readerType = VP; + + /* Start circuit. */ + VReo__start_circuit(circuit, animVP); +} + +//============================================================================== + +/* Checkers for Island 0. */ + +bool32 Checker_0__I0( VReoIsland *island ) { + VReoBridge *bridgeBroad_0Output1, *bridgeBroad_0Output2, *bridgeOut_1, *bridgeBroad_0; + bool32 satisfied; + + bridgeBroad_0Output1 = (island->bridges)[I0_BRIDGE_Broad_0Output1]; + bridgeBroad_0Output2 = (island->bridges)[I0_BRIDGE_Broad_0Output2]; + bridgeOut_1 = (island->bridges)[I0_BRIDGE_Out_1]; + bridgeBroad_0 = (island->bridges)[I0_BRIDGE_Broad_0]; + satisfied = READY_FOR_READ_BRIDGE_Broad_0 && READY_FOR_WRITE_BRIDGE_Broad_0Output1 && READY_FOR_WRITE_BRIDGE_Broad_0Output2 && READY_FOR_WRITE_BRIDGE_Out_1; + return satisfied; +} + +/* Checkers for Island 1. */ + +bool32 Checker_0__I1( VReoIsland *island ) { + VReoBridge *bridgeX_0Input0, *bridgeIn_0, *bridgeIn_0Output1; + bool32 satisfied; + + bridgeX_0Input0 = (island->bridges)[I1_BRIDGE_X_0Input0]; + bridgeIn_0 = (island->bridges)[I1_BRIDGE_In_0]; + bridgeIn_0Output1 = (island->bridges)[I1_BRIDGE_In_0Output1]; + satisfied = READY_FOR_READ_BRIDGE_X_0Input0 && READY_FOR_READ_BRIDGE_In_0 && READY_FOR_WRITE_BRIDGE_In_0Output1; + return satisfied; +} + +/* Checkers for Island 2. */ + +bool32 Checker_0__I2( VReoIsland *island ) { + VReoBridge *bridgeIn_1Output0, *bridgeIn_1, *bridgeX_1Input0; + bool32 satisfied; + + bridgeIn_1Output0 = (island->bridges)[I2_BRIDGE_In_1Output0]; + bridgeIn_1 = (island->bridges)[I2_BRIDGE_In_1]; + bridgeX_1Input0 = (island->bridges)[I2_BRIDGE_X_1Input0]; + satisfied = READY_FOR_READ_BRIDGE_In_1 && READY_FOR_READ_BRIDGE_X_1Input0 && READY_FOR_WRITE_BRIDGE_In_1Output0; + return satisfied; +} + +//============================================================================== + +/* Declaration of auxiliary doers. */ + +void Auxdoer_for_bridge_Broad_0( VReoBridge *bridge ); +void Auxdoer_for_bridge_In_0( VReoBridge *bridge ); +void Auxdoer_for_bridge_In_1( VReoBridge *bridge ); +void Auxdoer_for_bridge_Out_0( VReoBridge *bridge ); +void Auxdoer_for_bridge_Out_1( VReoBridge *bridge ); +void Auxdoer_for_bridge_In_0Output1( VReoBridge *bridge ); +void Auxdoer_for_bridge_Out_0Input1( VReoBridge *bridge ); + +void Auxdoer_for_bridge_Broad_0Output1( VReoBridge *bridge ); +void Auxdoer_for_bridge_X_0Input0( VReoBridge *bridge ); + +void Auxdoer_for_bridge_In_1Output0( VReoBridge *bridge ); +void Auxdoer_for_bridge_Out_0Input0( VReoBridge *bridge ); + +void Auxdoer_for_bridge_Broad_0Output2( VReoBridge *bridge ); +void Auxdoer_for_bridge_X_1Input0( VReoBridge *bridge ); + +/* Doers for Island 0. */ + +void Doer_0__I0( VReoIsland *island ) { + VReoBridge *bridgeBroad_0Output1, *bridgeBroad_0Output2, *bridgeOut_1, *bridgeBroad_0; + + /* Initialize bridges. */ + bridgeBroad_0Output1 = (island->bridges)[I0_BRIDGE_Broad_0Output1]; + bridgeBroad_0Output2 = (island->bridges)[I0_BRIDGE_Broad_0Output2]; + bridgeOut_1 = (island->bridges)[I0_BRIDGE_Out_1]; + bridgeBroad_0 = (island->bridges)[I0_BRIDGE_Broad_0]; + + /* Distribute data. */ + bridgeBroad_0Output1->buffer = bridgeBroad_0->buffer; + bridgeBroad_0Output2->buffer = bridgeBroad_0->buffer; + bridgeOut_1->buffer = bridgeBroad_0->buffer; + + /* Update bridge status. */ + bridgeBroad_0->bridgeIsFull = FALSE; + bridgeBroad_0Output1->bridgeIsFull = TRUE; + bridgeBroad_0Output2->bridgeIsFull = TRUE; + bridgeOut_1->bridgeIsFull = TRUE; + + /* Prepare reader VPs. */ + PR_PI__make_slave_ready_for_lang(bridgeOut_1->waitingReaderVP, VReo_MAGIC_NUMBER); + bridgeOut_1->waitingReaderVP->dataRetFromReq = bridgeOut_1->buffer; + bridgeOut_1->waitingReaderVP = NULL; + bridgeOut_1->bridgeIsFull = FALSE; + + /* Prepare writer VPs. */ + PR_PI__make_slave_ready_for_lang(bridgeBroad_0->waitingWriterVP, VReo_MAGIC_NUMBER); + bridgeBroad_0->waitingWriterVP = NULL; + + /* Call auxiliary doers to complete this transition. */ + Auxdoer_for_bridge_Broad_0Output1(bridgeBroad_0Output1); + Auxdoer_for_bridge_Broad_0Output2(bridgeBroad_0Output2); + Auxdoer_for_bridge_Out_1(bridgeOut_1); + Auxdoer_for_bridge_Broad_0(bridgeBroad_0); +} + +/* Doers for Island 1. */ + +void Doer_0__I1( VReoIsland *island ) { + VReoBridge *bridgeX_0Input0, *bridgeIn_0, *bridgeIn_0Output1; + + /* Initialize bridges. */ + bridgeX_0Input0 = (island->bridges)[I1_BRIDGE_X_0Input0]; + bridgeIn_0 = (island->bridges)[I1_BRIDGE_In_0]; + bridgeIn_0Output1 = (island->bridges)[I1_BRIDGE_In_0Output1]; + + /* Distribute data. */ + bridgeIn_0Output1->buffer = bridgeIn_0->buffer; + + /* Update bridge status. */ + bridgeX_0Input0->bridgeIsFull = FALSE; + bridgeIn_0->bridgeIsFull = FALSE; + bridgeIn_0Output1->bridgeIsFull = TRUE; + + /* Prepare reader VPs. */ + + /* Prepare writer VPs. */ + PR_PI__make_slave_ready_for_lang(bridgeIn_0->waitingWriterVP, VReo_MAGIC_NUMBER); + bridgeIn_0->waitingWriterVP = NULL; + + /* Call auxiliary doers to complete this transition. */ + Auxdoer_for_bridge_X_0Input0(bridgeX_0Input0); + Auxdoer_for_bridge_In_0(bridgeIn_0); + Auxdoer_for_bridge_In_0Output1(bridgeIn_0Output1); +} + +/* Doers for Island 2. */ + +void Doer_0__I2( VReoIsland *island ) { + VReoBridge *bridgeIn_1Output0, *bridgeIn_1, *bridgeX_1Input0; + + /* Initialize bridges. */ + bridgeIn_1Output0 = (island->bridges)[I2_BRIDGE_In_1Output0]; + bridgeIn_1 = (island->bridges)[I2_BRIDGE_In_1]; + bridgeX_1Input0 = (island->bridges)[I2_BRIDGE_X_1Input0]; + + /* Distribute data. */ + bridgeIn_1Output0->buffer = bridgeIn_1->buffer; + + /* Update bridge status. */ + bridgeIn_1->bridgeIsFull = FALSE; + bridgeX_1Input0->bridgeIsFull = FALSE; + bridgeIn_1Output0->bridgeIsFull = TRUE; + + /* Prepare reader VPs. */ + + /* Prepare writer VPs. */ + PR_PI__make_slave_ready_for_lang(bridgeIn_1->waitingWriterVP, VReo_MAGIC_NUMBER); + bridgeIn_1->waitingWriterVP = NULL; + + /* Call auxiliary doers to complete this transition. */ + Auxdoer_for_bridge_In_1Output0(bridgeIn_1Output0); + Auxdoer_for_bridge_In_1(bridgeIn_1); + Auxdoer_for_bridge_X_1Input0(bridgeX_1Input0); +} + +//============================================================================== + +/* Auxiliary doers for input bridges. */ + +void Auxdoer_for_bridge_Broad_0( VReoBridge *bridge ) { + ; +} + +void Auxdoer_for_bridge_In_0( VReoBridge *bridge ) { + ; +} + +void Auxdoer_for_bridge_In_1( VReoBridge *bridge ) { + ; +} + +/* Auxiliary doers for output bridges. */ + +void Auxdoer_for_bridge_Out_0( VReoBridge *bridge ) { + ; +} + +void Auxdoer_for_bridge_Out_1( VReoBridge *bridge ) { + ; +} + +/* Auxiliary doers for FIFO bridges. */ + +void Auxdoer_for_bridge_In_0Output1( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->readerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->reader; + numCheckerFns = bridge->numReaderCheckerFns; + checkerFns = bridge->readerCheckerFns; + doerFns = bridge->readerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->readerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->reader; + partnerQstruct = bridge->readerPartnerQStruct; + + VReo__check_an_o1island_that_reads_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} +void Auxdoer_for_bridge_Out_0Input1( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->writerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->writer; + numCheckerFns = bridge->numWriterCheckerFns; + checkerFns = bridge->writerCheckerFns; + doerFns = bridge->writerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->writerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->writer; + partnerQstruct = bridge->writerPartnerQStruct; + + VReo__check_an_o1island_that_writes_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} + +void Auxdoer_for_bridge_Broad_0Output1( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->readerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->reader; + numCheckerFns = bridge->numReaderCheckerFns; + checkerFns = bridge->readerCheckerFns; + doerFns = bridge->readerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->readerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->reader; + partnerQstruct = bridge->readerPartnerQStruct; + + VReo__check_an_o1island_that_reads_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} +void Auxdoer_for_bridge_X_0Input0( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->writerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->writer; + numCheckerFns = bridge->numWriterCheckerFns; + checkerFns = bridge->writerCheckerFns; + doerFns = bridge->writerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->writerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->writer; + partnerQstruct = bridge->writerPartnerQStruct; + + VReo__check_an_o1island_that_writes_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} + +void Auxdoer_for_bridge_In_1Output0( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->readerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->reader; + numCheckerFns = bridge->numReaderCheckerFns; + checkerFns = bridge->readerCheckerFns; + doerFns = bridge->readerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->readerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->reader; + partnerQstruct = bridge->readerPartnerQStruct; + + VReo__check_an_o1island_that_reads_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} +void Auxdoer_for_bridge_Out_0Input0( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->writerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->writer; + numCheckerFns = bridge->numWriterCheckerFns; + checkerFns = bridge->writerCheckerFns; + doerFns = bridge->writerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->writerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->writer; + partnerQstruct = bridge->writerPartnerQStruct; + + VReo__check_an_o1island_that_writes_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} + +void Auxdoer_for_bridge_Broad_0Output2( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->readerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->reader; + numCheckerFns = bridge->numReaderCheckerFns; + checkerFns = bridge->readerCheckerFns; + doerFns = bridge->readerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->readerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->reader; + partnerQstruct = bridge->readerPartnerQStruct; + + VReo__check_an_o1island_that_reads_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} +void Auxdoer_for_bridge_X_1Input0( VReoBridge *bridge ) { + int32 numCheckerFns; + VReoIsland *islandOnOtherSide; + VReoCheckerFn *checkerFns; + VReoDoerFn *doerFns; + + VReoO1island *o1islandOnOtherSide; + VReoPartnerQStruct *partnerQstruct; + + if (bridge->writerType == Island) { + islandOnOtherSide = (VReoIsland*) bridge->writer; + numCheckerFns = bridge->numWriterCheckerFns; + checkerFns = bridge->writerCheckerFns; + doerFns = bridge->writerDoerFns; + + VReo__check_an_island( islandOnOtherSide, numCheckerFns, checkerFns, doerFns ); + } + + else if (bridge->writerType == O1island) { + o1islandOnOtherSide = (VReoO1island *)bridge->writer; + partnerQstruct = bridge->writerPartnerQStruct; + + VReo__check_an_o1island_that_writes_bridge( o1islandOnOtherSide, bridge, partnerQstruct ); + } +} \ No newline at end of file diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/Circuit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/Circuit.h Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,158 @@ +#ifndef _Circuit_App1_H +#define _Circuit_App1_H + +//#include "PR_impl/PR.h" +//#include "VReo_impl/VReo.h" +#include +#include + +//============================================================================== + +/* Counts. */ +#define NUM_VPs 5 +#define NUM_PROD 3 +#define NUM_ISLANDS 3 +#define NUM_O1ISLANDS 1 +#define NUM_BRIDGES 9 +#define NUM_BOUNDARY_BRIDGES 5 + +/* Producer VPs attached to circuit. */ +#define CKT_VP_PROD0 0 +#define CKT_VP_PROD1 1 +#define CKT_VP_PROD2 2 + +/* Consumer VPs attached to circuit. */ +// #define CKT_VP_CONS0 (3+0) +// #define CKT_VP_CONS1 (3+1) +#define CKT_VP_CONS0 3 + +/* Islands in circuit. */ +#define CKT_I0 0 +#define CKT_I1 1 +#define CKT_I2 2 + +/* O1Islands in circuit. */ +#define CKT_O1I0 0 + +/* Bridges in circuit. */ +#define CKT_BRIDGE_Broad_0 0 +#define CKT_BRIDGE_In_0 1 +#define CKT_BRIDGE_In_1 2 +#define CKT_BRIDGE_Out_0 3 +#define CKT_BRIDGE_Out_1 4 + +#define CKT_BRIDGE_FIFO0 (5+0) +#define CKT_BRIDGE_In_0Output1 (5+0) +#define CKT_BRIDGE_Out_0Input1 (5+0) + +#define CKT_BRIDGE_FIFO1 (5+1) +#define CKT_BRIDGE_Broad_0Output1 (5+1) +#define CKT_BRIDGE_X_0Input0 (5+1) + +#define CKT_BRIDGE_FIFO2 (5+2) +#define CKT_BRIDGE_In_1Output0 (5+2) +#define CKT_BRIDGE_Out_0Input0 (5+2) + +#define CKT_BRIDGE_FIFO3 (5+3) +#define CKT_BRIDGE_Broad_0Output2 (5+3) +#define CKT_BRIDGE_X_1Input0 (5+3) + +/* Bridges in Island 0. */ +#define I0_BRIDGE_Broad_0Output1 0 +#define I0_BRIDGE_Broad_0Output2 1 +#define I0_BRIDGE_Out_1 2 +#define I0_BRIDGE_Broad_0 3 + +/* Bridges in Island 1. */ +#define I1_BRIDGE_X_0Input0 0 +#define I1_BRIDGE_In_0 1 +#define I1_BRIDGE_In_0Output1 2 + +/* Bridges in Island 2. */ +#define I2_BRIDGE_In_1Output0 0 +#define I2_BRIDGE_In_1 1 +#define I2_BRIDGE_X_1Input0 2 + +/* Bridges in O1Island 0. */ +#define O1I0_BRIDGE_Out_0 0 +#define O1I0_BRIDGE_Out_0Input1 1 +#define O1I0_BRIDGE_Out_0Input0 2 + +/* Readiness of boundary bridges. */ +#define READY_FOR_READ_BRIDGE_Broad_0 bridgeBroad_0->bridgeIsFull +#define READY_FOR_READ_BRIDGE_In_0 bridgeIn_0->bridgeIsFull +#define READY_FOR_READ_BRIDGE_In_1 bridgeIn_1->bridgeIsFull +#define READY_FOR_WRITE_BRIDGE_Out_0 bridgeOut_0->waitingReaderVP +#define READY_FOR_WRITE_BRIDGE_Out_1 bridgeOut_1->waitingReaderVP + +/* Readiness of bridges of FIFO 0. */ +#define READY_FOR_WRITE_BRIDGE_In_0Output1 !bridgeIn_0Output1->bridgeIsFull +#define READY_FOR_READ_BRIDGE_Out_0Input1 bridgeOut_0Input1->bridgeIsFull + +/* Readiness of bridges of FIFO 1. */ +#define READY_FOR_WRITE_BRIDGE_Broad_0Output1 !bridgeBroad_0Output1->bridgeIsFull +#define READY_FOR_READ_BRIDGE_X_0Input0 bridgeX_0Input0->bridgeIsFull + +/* Readiness of bridges of FIFO 2. */ +#define READY_FOR_WRITE_BRIDGE_In_1Output0 !bridgeIn_1Output0->bridgeIsFull +#define READY_FOR_READ_BRIDGE_Out_0Input0 bridgeOut_0Input0->bridgeIsFull + +/* Readiness of bridges of FIFO 3. */ +#define READY_FOR_WRITE_BRIDGE_Broad_0Output2 !bridgeBroad_0Output2->bridgeIsFull +#define READY_FOR_READ_BRIDGE_X_1Input0 bridgeX_1Input0->bridgeIsFull + +/* Number of checkers per bridge in Island 0. */ +#define NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output1 1 +#define NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0Output2 1 +#define NUM_I0_CHECKERS_INVOLVE_BRIDGE_Out_1 1 +#define NUM_I0_CHECKERS_INVOLVE_BRIDGE_Broad_0 1 + +/* Number of checkers per bridge in Island 1. */ +#define NUM_I1_CHECKERS_INVOLVE_BRIDGE_X_0Input0 1 +#define NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0 1 +#define NUM_I1_CHECKERS_INVOLVE_BRIDGE_In_0Output1 1 + +/* Number of checkers per bridge in Island 2. */ +#define NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1Output0 1 +#define NUM_I2_CHECKERS_INVOLVE_BRIDGE_In_1 1 +#define NUM_I2_CHECKERS_INVOLVE_BRIDGE_X_1Input0 1 + +/* Checkers and doers for Island 0. */ +#define CHECKER3_I0 Checker_0__I0 +#define DOER3_I0 Doer_0__I0 + +/* Checkers and doers for Island 1. */ +#define CHECKER2_I1 Checker_0__I1 +#define DOER2_I1 Doer_0__I1 + +/* Checkers and doers for Island 2. */ +#define CHECKER3_I2 Checker_0__I2 +#define DOER3_I2 Doer_0__I2 + +//============================================================================== + +/* Create VPs and connect. */ +void create_VPs_and_connect( VReoCircuit *circuit, SlaveVP *animVP ); + +/* Create circuit. */ +VReoCircuit * create_circuit( SlaveVP *animVP ); + +/* Checkers of Island 0. */ +bool32 Checker_0__I0( VReoIsland *island ); + +/* Checkers of Island 1. */ +bool32 Checker_0__I1( VReoIsland *island ); + +/* Checkers of Island 2. */ +bool32 Checker_0__I2( VReoIsland *island ); + +/* Doers of Island 0. */ +void Doer_0__I0( VReoIsland *island ); + +/* Doers of Island 1. */ +void Doer_0__I1( VReoIsland *island ); + +/* Doers of Island 2. */ +void Doer_0__I2( VReoIsland *island ); + +#endif /* _Circuit_App1_H */ \ No newline at end of file diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/DivideWork.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/DivideWork.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,79 @@ +/* + * Copyright 2009 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + + +#include "Reo__Matrix_Mult.h" +#include + +/*Divider chunks row-col pairs together, and creates a "workUnit" for each + * It takes the square root of the target number of pieces, and + * divides the number of rows/cols by that, to get the target number + * of rows/cols in a single piece. For now, only works with powers of 2, + * to keep the algorithms simple. + * It puts into this: + * the left and right matrices + * the start row and end row and start col and end col to be multiplied + * the length of the vectors + */ +WorkUnitParams ** +divideWork( Matrix *leftMatrix, Matrix *rightMatrix, int targetNumUnits ) + { + WorkUnitParams *workUnitParams, **workUnits; + Matrix *leftMatrix, *rightMatrix, *resultMatrix; + int retCode; + int targetDivisor, targetIncrement; + +// printf("start divide\n"); fflush(stdin); + + if( leftMatrix->numRows != rightMatrix->numCols ) + { printf("error: left num rows must == right num cols\n"); exit(0);} + if( leftMatrix->numRows % 4 != 0 ) + { printf("error: left num rows must be divisible by 4\n"); exit(0);} + + targetDivisor = (int)sqrt( targetNumUnits ); + targetIncrement = (int)(leftMatrix->numRows / targetDivisor); + if( targetDivisor * targetDivisor != targetNumUnits || + targetIncrement * targetDivisor != leftMatrix->numRows ) + { printf("error: the target number of units to be made must be a perfect square and it must evenly divide the left number of rows (vector length)\n"); + fflush(stdout); exit(0); + } + + + //make a data struct for each work unit, and fill it with params of work + //params are start and end row and col to be multiplied and length of a row + workUnits = PR__malloc( sizeof(WorkUnitParams) ); + int row, col, index = 0; + for( row = 0; row < leftMatrix->numRows; row += targetIncrement ) + { + for( col = 0; col < rightMatrix->numCols; col += targetIncrement ) + { + workUnitParams = PR__malloc( sizeof(WorkUnitParams) ); + workUnitParams->startRow = row; + workUnitParams->endRow = row + targetIncrement -1; + workUnitParams->startCol = col; + workUnitParams->endCol = col + targetIncrement -1; + workUnitParams->vectLength = leftMatrix->numCols; + workUnitParams->leftMatrix = leftMatrix; + workUnitParams->rightMatrix = rightMatrix; + + workUnits[ index ] = workUnitParams; + index += 1; + } + } + return workUnits; + } + + + + resultsParams = malloc( sizeof(ResultsParams) ); + resultsParams->numCols = rightMatrix->numCols; + resultsParams->numRows = leftMatrix->numRows; + + //=========== Set up global vars, including conds and mutexes =========== + globals = malloc( sizeof(MatrixMultGlobals) ); + //======================================================================== diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/Producer_and_Consumer.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/Producer_and_Consumer.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,192 @@ +#include +#include +#include "VReo__Test_App.h" + +/*The input to a VP's birth function is a struct that holds two arrays of + * pointers to bridges -- one for input bridges, one for output bridges + */ +void producer_Fn(void *_birthParams, SlaveVP *animVP) { + TestAppProducerParams *birthParams = (TestAppProducerParams *) _birthParams; + + //Tell the Reo tool that generates circuit about the bridges of this VP + //#Reo numInBridges 0 | numOutbridges 1 + VReoBridge **outBridges = birthParams->outBridges; + VReoBridge *bridge; + TestAppProdConsMsg *msg; + int32 i; + + DEBUG__printf(dbgAppFlow, "Producer on core: %d", animVP->coreAnimatedBy); + + bridge = outBridges[0]; + + + msg = PR__malloc(sizeof(TestAppProdConsMsg)); + msg->producerID = animVP->slaveNum; + + //A producer puts out 5 items, doing a print for each. + for (i = 0; i < NUM_ITER; i++) { + //msg = PR__malloc(sizeof(TestAppProdConsMsg)); + //msg->producerID = animVP->slaveNum; + msg->producedCnt = i + 1; + VReo__put_into_bridge(msg, bridge, animVP); + DEBUG__printf(dbgAppFlow, "Producer %d, put in %d", msg->producerID, + msg->producedCnt); + } + VReo__end_VP(animVP); +} + + +/*Accumulate the results of individual multiplies into the result matrix + * then increment the count of results. + * + *After the count reaches the point that all results have been received, it + * ends itself -- result matrix is returned by side effect inside the params. + */ +void consumer_Fn(void *_params, SlaveVP *animVP) { + ResultsParams *params = (ResultsParams *) _params; + + //The circuit creator sends the bridges this VP is connected to + // numInBridges 2 | numOutbridges 0 + VReoBridge **inBridges = params->inBridges; + VReoBridge **outBridges = params->outBridges; + VReoBridge *inBridge0, *inBridge1; + int32 i, j, got; + TestAppProdConsMsg *msg; + + DEBUG__printf(dbgAppFlow, "Consumer on core: %d", animVP->coreAnimatedBy); + + inBridge0 = inBridges[0]; + inBridge1 = inBridges[1]; + + + int numRows, numCols, numCells, count=0; + float32 *resultMatrixArray; + ProductResult *aResult; + VectorParams *aResult; + + + params = (ResultsParams *)_params; + numCols = params->numCols; + numRows = params->numRows; + numCells = numRows * numCols; + + resultMatrixArray = malloc( numCells * sizeof( float32 ) ); + params->resultMatrixArray = resultMatrixArray; + +// sleep(10); + NUM_PROD = params->numProducers; + int32 row, col; + + for (i = 0; i < NUM_ITER; i++) + { + for (j = 0; j < NUM_PROD; j++) + { + //get next result from a producer + aResult = (ProductResult *) VReo__get_from_bridge(inBridge0, animVP); + DEBUG__printf( dbgAppFlow, "Consumer got %d from %d", + aResult->producedCnt, aResult->producerID ); + aResArray = aResult->array; + + accumulateResult( resultArray, aResult->partialResultArray, + aResult->leftSubMatrix->origStartRow, + aResult->leftSubMatrix->numRows, + aResult->rightSubMatrix->origStartCol, + aResult->rightSubMatrix->numCols, + aResult->rightSubMatrix->origMatrix->numCols ); + + PR__free(aResult); + } + + //tell producers they can go on to next matrix + VReo__get_from_bridge(inBridge1, animVP); //doing a get triggers broadcast + } + VReo__end_VP(animVP); + } + +inline void +accumulateResult( float32 *resultArray, float32 *subMatrixPairResultArray, + int32 startRow, + int32 numRows, + int32 startCol, + int32 numCols, + int32 numOrigCols ) + { int32 row, col; + + for( row = 0; row < numRows; row++ ) + { + for( col = 0; col < numCols; col++ ) + { + resultArray[ (row + startRow) * numOrigCols + (col + startCol) ] += + subMatrixPairResultArray[ row * numCols + col ]; + } + } + + } + + + startRow = aResult->leftSubMatrix->origStartRow; + numRows = aResult->leftSubMatrix->numRows, + startCol = aResult->rightSubMatrix->origStartCol, + numCols = aResult->rightSubMatrix->numCols, + numOrigCols = aResult->rightSubMatrix->origMatrix->numCols + + for( row = 0; row < numRows; row++ ) + { + for( col = 0; col < numCols; col++ ) + { + resultArray[ (row + startRow) * numOrigCols + (col + startCol) ] += + aResArray[ row * numCols + col ]; + } + } + + +//===================================== +/*A Vector processor is created with an environment that holds two matrices, + * the row and col that it owns, and the name of a result gathering + * processor. + *It calculates its vector product then sends the result to the result + * processor, which puts it into the result matrix and returns that matrix + * when all is done. + */ +void * +calcVector( void *data ) + { + VectorParams *params; + int myRow, myCol, vectLength, pos; + float32 *leftMatrixArray, *rightMatrixArray, result = 0.0; + Matrix *leftMatrix, *rightMatrix; + + params = (VectorParams *)data; + myCol = params->myCol; + myRow = params->myRow; + vectLength = params->vectLength; + leftMatrix = params->leftMatrix; + rightMatrix = params->rightMatrix; + leftMatrixArray = leftMatrix->array; + rightMatrixArray = rightMatrix->array; + //===================== DEBUG ====================== + #ifdef PRINT_DEBUG_1 + if( myCol == 0 ) + printf("start vector: %d, %d\n", myRow, myCol ); fflush(stdin); + #endif + //==================================================== + + for( pos = 0; pos < vectLength; pos++ ) + { + result += *(leftMatrixArray + myRow * vectLength + pos) * + *(rightMatrixArray + pos * vectLength + myCol); + } + params->result = result; + + //Send result to results thread + pthread_mutex_lock( &(globals->vector_mutex) );//only get + //the lock when results thd is inside wait. + globals->currVector = params; + pthread_cond_signal( &(globals->vector_cond) ); + pthread_mutex_unlock( &(globals->vector_mutex) );//release + //wait-er -- cond_signal implemented such that wait-er gets lock, no other + + pthread_exit(0); + } + +//======================================= diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/Reo__Matrix_Mult.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/Reo__Matrix_Mult.h Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,96 @@ +#ifndef _VReo_TEST_APP_H_ +#define _VReo_TEST_APP_H_ + +#include + +#include +#include "Circuit.h" + + +extern int NUM_ITER; + +//=============================== Defines ============================== + +//============================== Structures ============================== +typedef struct + { + Matrix *leftMatrix; + Matrix *rightMatrix; + Matrix *resultMatrix; + } +DividerParams; + +typedef struct + { + int numRows; + int numCols; + } +ResultsParams; + +typedef struct + { + int myCol; + int myRow; + int vectLength; + Matrix *leftMatrix; + Matrix *rightMatrix; + float32 result; + } +VectorParams; + +typedef struct + { + //for communicating vector results to results Thd + pthread_mutex_t vector_mutex; + pthread_cond_t vector_cond; + VectorParams *currVector; + + //for communicating results array back to seed (divider) Thd + pthread_mutex_t results_mutex; + pthread_cond_t results_cond; + float32 *results; + + //for ensuring results thd has vector lock before making vector thds + pthread_mutex_t start_mutex; + pthread_cond_t start_cond; + + Matrix *rightMatrix; + Matrix *resultMatrix; + } +MatrixMultGlobals; + + +// NOTE: this is a birth function param. The first field of any structure +// that is passed as the argument to a birth function must be a pointer to +// the Reo circuit +typedef struct { //The first field must be pointer to a circuit (because is param to birth Fn) + VReoCircuit *circuit; //First field must ALWAYS be a pointer to a circuit + + VReoBridge **inBridges; //array of pointers into circuit's array of bridges + VReoBridge **outBridges; //array of pointers into circuit's array of bridges +} TestAppProducerParams; + +typedef struct { //The first field must be pointer to a circuit (because is param to birth Fn) + VReoCircuit *circuit; //First field must ALWAYS be a pointer to a circuit + + VReoBridge **inBridges; //array of pointers into circuit's array of bridges + VReoBridge **outBridges; //array of pointers into circuit's array of bridges +} TestAppConsumerParams; + +typedef struct { + int32 producerID; + int32 producedCnt; +} TestAppProdConsMsg; + +//============================= Processor Functions ========================= +void matrix_mult__seed_Fn(void *data, SlaveVP *animatingVP); //seed VP function +void producer_Fn(void *data, SlaveVP *animatingVP); +void consumer_Fn(void *data, SlaveVP *animatingVP); + +void *divideIntoVectors( void *data ); +void *calcVector( void *data ); +void *gatherResults( void *data ); + +//================================ Global Vars ============================== + +#endif diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/Result_Pr.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/Result_Pr.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,9 @@ +/* + * Copyright 2009 OpenSourceCodeStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + +#include "PThread__Matrix_Mult.h" diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/SeedVP.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/SeedVP.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,169 @@ +#include +#include + +#include "VReo__Test_App.h" + +#define NO_INPUT NULL + +// ============================================================================= + +//SELECT how the measurement is done +//only one must be enabled +#define MEASURE_TSC +//#define MEASURE_PERF + +#define saveTimeStampCountInto(low, high) \ + asm volatile("RDTSC; \ + movl %%eax, %0; \ + movl %%edx, %1;" \ + /* outputs */ : "=m" (low), "=m" (high)\ + /* inputs */ : \ + /* clobber */ : "%eax", "%edx" \ + ); + +#define saveLowTimeStampCountInto(low) \ + asm volatile("RDTSC; \ + movl %%eax, %0;" \ + /* outputs */ : "=m" (low) \ + /* inputs */ : \ + /* clobber */ : "%eax", "%edx" \ + ); + +union timeStamp { + uint32_t lowHigh[2]; //lowHigh[0] is low, lowHigh[1] is high + uint64_t total; +}; + +struct perfData { + uint64_t cycles; + uint64_t instructions; +}; + +//MEASURE_TSC should be mutually exclusive with MEASURE_PERF +#ifdef MEASURE_TSC +typedef union timeStamp MeasStruct; +#else +#ifdef MEASURE_PERF +typedef struct perfData MeasStruct; +#endif +#endif + + +//read and save current perf-counter readings for cycles and instrs +#ifdef MEASURE_PERF +#define takeAMeas(core, perfDataStruct) do{ \ + int cycles_fd = cycles_counter_fd[core]; \ + int nread; \ + \ + nread = read(cycles_fd,&(perfDataStruct.cycles),sizeof(perfDataStruct.cycles)); \ + if(nread<0){ \ + perror("Error reading cycles counter"); \ + cycles = 0; \ + } \ + } while (0) //macro magic for scoping +#else +#define takeAMeas(core, timeStampStruct) do{ \ + saveTimeStampCountInto(timeStampStruct.lowHigh[0], timeStampStruct.lowHigh[1]);\ + } while (0) //macro magic for scoping +#endif + +#ifdef MEASURE_PERF +int cycles_counter_fd[NUM_CORES]; +int instrs_counter_fd[NUM_CORES]; +int cycles_counter_main_fd; +#endif + +//=================================== +/* provide a millisecond-resolution timer for each system */ +#if defined(unix) || defined(__unix__) +#include +#include +unsigned long get_msec(void) { + static struct timeval timeval, first_timeval; + + gettimeofday(&timeval, 0); + if(first_timeval.tv_sec == 0) { + first_timeval = timeval; + return 0; + } + return (timeval.tv_sec - first_timeval.tv_sec) * 1000 + (timeval.tv_usec - first_timeval.tv_usec) / 1000; +} +#elif defined(__WIN32__) || defined(WIN32) +#include +unsigned long get_msec(void) { + return GetTickCount(); +} +#else +#error "I don't know how to measure time on your platform" +#endif + +// ============================================================================= + +/*The _params was passed into the create_process call inside main. + * + * the seed first starts up VReo, then it calls the create circuit Fn, + which returns a pointer to the circuit, then it calls create_VP three + times. The first, it hands it the pointer to the producer Fn, along with + a pointer to the circuit and an integer that indicates that it connects to + bridge 1 of the circuit. Second, it creates another producer, but connected + to bridge 2, then it creates a consumer connected to bridge 3. + + Then, it waits for the computation to end. + + A producer puts out 5 items, doing a print for each. The consumer consumes + 10 items, doing a print for each. + + Then each of them call "end_VP". + + That ends the computation, and the seed comes back, and calls "end_seed_VP" + + */ +void matrix_mult__seed_Fn(void *_params, SlaveVP *seedVP) + { + + /* Declare variables. */ + VReoCircuit *circuit; + + /* Log. */ + DEBUG__printf(dbgAppFlow, "start app"); + + /* Start Reo plug-in. */ + VReo__start(seedVP); + + + //take measurement before creation of threads, to get total exetime + MeasStruct benchStartMeas, benchEndMeas; + takeAMeas(0, benchStartMeas); + + /* Create circuit. */ + circuit = (VReoCircuit *) create_circuit(seedVP); + + /* Create VPs. */ + create_VPs_and_connect(circuit, seedVP); + + /* Wait for work to end. */ + VReo__wait_for_all_VReo_created_work_to_end(seedVP); + + /* Log. */ + DEBUG__printf(TRUE, "work done"); + + //work is all done, so take a measurement snapshot at end + takeAMeas(0, benchEndMeas); + + #ifdef MEASURE_PERF + uint64_t totalExeCycles = ( benchEndMeas.cycles - benchStartMeas.cycles); + printf("Total Execution: %lu\n", totalExeCycles); + #else + uint64_t totalExeCycles = (benchEndMeas.total - benchStartMeas.total); + printf("Total Cycles of Execution: %lu\n", totalExeCycles); + #endif + + fflush(stdout); + exit(0); + + /* Stop Reo plug-in. */ + VReo__shutdown(seedVP); + + /* Stop PR. */ + PR__end_process_from_inside(seedVP); +} diff -r 000000000000 -r c4b1849c05ef Reo__Matrix_Mult/Vector_Pr.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Reo__Matrix_Mult/Vector_Pr.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,10 @@ +/* + * Copyright 2009 OpenSourceCodeStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: SeanHalle@yahoo.com + * + */ + +#include "Reo__Matrix_Mult.h" + diff -r 000000000000 -r c4b1849c05ef main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.c Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,109 @@ +#include +#include +#include + +#include "Matrix_Mult.h" +#include "Reo__Matrix_Mult/Reo__Matrix_Mult.h" + +void set_up_performance_counters(); + +// ============================================================================= + +int NUM_ITER; + +MatrixMultGlobals *globals; + +int main(int argc, char **argv) + { Matrix *leftMatrix, *rightMatrix, *resultMatrix; + ParamBag *paramBag; + + DEBUG__printf(TRUE, "arguments: %s | %s", argv[0], argv[1]); + if(argc < 3) {printf("give num iter and path to param file on cmd line\n"); exit(1);} + NUM_ITER = atoi(argv[1]); + + //read parameters, from file whose path is given on command line + paramBag = makeParamBag(); + readParamFileIntoBag( argv[2], paramBag ); + initialize_Input_Matrices_Via( &leftMatrix, &rightMatrix, paramBag ); + + + printf("[reo] Settings: %i workers, %i iterations -- ", NUM_PROD, NUM_ITER); + + set_up_performance_counters(); + + PRProcess *matrixMultProcess; + PR_Main__start(); + PR_Main__set_app_info( "matrix multiply prod cons in Reo" ); + + PR_Main__set_input_info( getParamFromBag( "inputInfo", paramBag ) ); + + params->resultMatrix = malloc( numRows * numCols * sizeof(double) ); + params->workUnits = divideWork( leftInput, rightInput, numUnitsToMake ); + + matrixMultProcess = PR_Main__create_process(&matrix_mult__seed_Fn, params); + + PR_Main__wait_for_process_to_end(matrixMultProcess); + PR__Main__wait_for_all_activity_to_end(); + fflush(stdout); + PR_Main__shutdown(); + + exit(0); + } + +// ============================================================================= + +/*Initializes the performance counters, and opens the file descriptors used + * to read from the performance counters + */ +void set_up_performance_counters() { + int i; + +#ifdef MEASURE_PERF + //setup performance counters + struct perf_event_attr hw_event; + memset(&hw_event,0,sizeof(hw_event)); + hw_event.type = PERF_TYPE_HARDWARE; + hw_event.size = sizeof(hw_event); + hw_event.disabled = 0; + hw_event.freq = 0; + hw_event.inherit = 1; /* children inherit it */ + hw_event.pinned = 1; /* must always be on PMU */ + hw_event.exclusive = 0; /* only group on PMU */ + hw_event.exclude_user = 0; /* don't count user */ + hw_event.exclude_kernel = 1; /* ditto kernel */ + hw_event.exclude_hv = 1; /* ditto hypervisor */ + hw_event.exclude_idle = 1; /* don't count when idle */ + hw_event.mmap = 0; /* include mmap data */ + hw_event.comm = 0; /* include comm data */ + + for( i = 0; i < NUM_CORES; i++ ) + { + hw_event.config = PERF_COUNT_HW_CPU_CYCLES; //cycles + cycles_counter_fd[i] = syscall(__NR_perf_event_open, &hw_event, + 0,//pid_t pid, + i,//int cpu, + -1,//int group_fd, + 0//unsigned long flags + ); + if (cycles_counter_fd[i]<0) { + fprintf(stderr,"On core %d: ",i); + perror("Failed to open cycles counter"); + } + } + + int cycles_counter_main_fd; + hw_event.config = PERF_COUNT_HW_CPU_CYCLES; //cycles + hw_event.exclude_kernel=0; + cycles_counter_main_fd = syscall(__NR_perf_event_open, &hw_event, + 0,//pid_t pid, + -1,//int cpu, + -1,//int group_fd, + 0//unsigned long flags + ); + if (cycles_counter_main_fd<0) { + perror("Failed to open main cycles counter"); + } + +#endif +} + diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/Makefile Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Makefile-Debug.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Makefile-Debug.mk Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,143 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=gcc-4.6 +CXX=gcc-4.6 +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o \ + ${OBJECTDIR}/_ext/1539317932/ParamBag.o \ + ${OBJECTDIR}/_ext/1702716545/Circuit.o \ + ${OBJECTDIR}/_ext/1472/main.o \ + ${OBJECTDIR}/_ext/1702716545/Divide_Pr.o \ + ${OBJECTDIR}/_ext/1472/Matrix_Mult.o \ + ${OBJECTDIR}/_ext/1702716545/Vector_Pr.o \ + ${OBJECTDIR}/_ext/1702716545/Result_Pr.o \ + ${OBJECTDIR}/_ext/1702716545/EntryPoint.o \ + ${OBJECTDIR}/_ext/1702716545/SeedVP.o \ + ${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o: ../Reo__Matrix_Mult/Producer_and_Consumer.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o ../Reo__Matrix_Mult/Producer_and_Consumer.c + +${OBJECTDIR}/_ext/1539317932/ParamBag.o: ../ParamHelper/ParamBag.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1539317932 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1539317932/ParamBag.o ../ParamHelper/ParamBag.c + +${OBJECTDIR}/_ext/1702716545/Circuit.o: ../Reo__Matrix_Mult/Circuit.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Circuit.o ../Reo__Matrix_Mult/Circuit.c + +${OBJECTDIR}/_ext/1472/main.o: ../main.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1472 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1472/main.o ../main.c + +${OBJECTDIR}/_ext/1702716545/Divide_Pr.o: ../Reo__Matrix_Mult/Divide_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Divide_Pr.o ../Reo__Matrix_Mult/Divide_Pr.c + +${OBJECTDIR}/_ext/1472/Matrix_Mult.o: ../Matrix_Mult.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1472 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1472/Matrix_Mult.o ../Matrix_Mult.c + +${OBJECTDIR}/_ext/1702716545/Vector_Pr.o: ../Reo__Matrix_Mult/Vector_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Vector_Pr.o ../Reo__Matrix_Mult/Vector_Pr.c + +${OBJECTDIR}/_ext/1702716545/Result_Pr.o: ../Reo__Matrix_Mult/Result_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Result_Pr.o ../Reo__Matrix_Mult/Result_Pr.c + +${OBJECTDIR}/_ext/1702716545/EntryPoint.o: ../Reo__Matrix_Mult/EntryPoint.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/EntryPoint.o ../Reo__Matrix_Mult/EntryPoint.c + +${OBJECTDIR}/_ext/1702716545/SeedVP.o: ../Reo__Matrix_Mult/SeedVP.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/SeedVP.o ../Reo__Matrix_Mult/SeedVP.c + +${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o: ../ParamHelper/ReadParamsFromFile.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1539317932 + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o ../ParamHelper/ReadParamsFromFile.c + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + ${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Makefile-Debug_Sequential.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Makefile-Debug_Sequential.mk Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,143 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=gcc-4.6 +CXX=gcc-4.6 +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug_Sequential +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o \ + ${OBJECTDIR}/_ext/1539317932/ParamBag.o \ + ${OBJECTDIR}/_ext/1702716545/Circuit.o \ + ${OBJECTDIR}/_ext/1472/main.o \ + ${OBJECTDIR}/_ext/1702716545/Divide_Pr.o \ + ${OBJECTDIR}/_ext/1472/Matrix_Mult.o \ + ${OBJECTDIR}/_ext/1702716545/Vector_Pr.o \ + ${OBJECTDIR}/_ext/1702716545/Result_Pr.o \ + ${OBJECTDIR}/_ext/1702716545/EntryPoint.o \ + ${OBJECTDIR}/_ext/1702716545/SeedVP.o \ + ${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS=-L../../PR__lib + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o: ../Reo__Matrix_Mult/Producer_and_Consumer.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o ../Reo__Matrix_Mult/Producer_and_Consumer.c + +${OBJECTDIR}/_ext/1539317932/ParamBag.o: ../ParamHelper/ParamBag.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1539317932 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1539317932/ParamBag.o ../ParamHelper/ParamBag.c + +${OBJECTDIR}/_ext/1702716545/Circuit.o: ../Reo__Matrix_Mult/Circuit.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Circuit.o ../Reo__Matrix_Mult/Circuit.c + +${OBJECTDIR}/_ext/1472/main.o: ../main.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1472 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1472/main.o ../main.c + +${OBJECTDIR}/_ext/1702716545/Divide_Pr.o: ../Reo__Matrix_Mult/Divide_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Divide_Pr.o ../Reo__Matrix_Mult/Divide_Pr.c + +${OBJECTDIR}/_ext/1472/Matrix_Mult.o: ../Matrix_Mult.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1472 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1472/Matrix_Mult.o ../Matrix_Mult.c + +${OBJECTDIR}/_ext/1702716545/Vector_Pr.o: ../Reo__Matrix_Mult/Vector_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Vector_Pr.o ../Reo__Matrix_Mult/Vector_Pr.c + +${OBJECTDIR}/_ext/1702716545/Result_Pr.o: ../Reo__Matrix_Mult/Result_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Result_Pr.o ../Reo__Matrix_Mult/Result_Pr.c + +${OBJECTDIR}/_ext/1702716545/EntryPoint.o: ../Reo__Matrix_Mult/EntryPoint.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/EntryPoint.o ../Reo__Matrix_Mult/EntryPoint.c + +${OBJECTDIR}/_ext/1702716545/SeedVP.o: ../Reo__Matrix_Mult/SeedVP.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/SeedVP.o ../Reo__Matrix_Mult/SeedVP.c + +${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o: ../ParamHelper/ReadParamsFromFile.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1539317932 + ${RM} $@.d + $(COMPILE.c) -g -DDEBUG__SEQUENTIAL_MODE -I../.. -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o ../ParamHelper/ReadParamsFromFile.c + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + ${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Makefile-Release.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Makefile-Release.mk Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,143 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=gcc-4.6 +CXX=gcc-4.6 +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o \ + ${OBJECTDIR}/_ext/1539317932/ParamBag.o \ + ${OBJECTDIR}/_ext/1702716545/Circuit.o \ + ${OBJECTDIR}/_ext/1472/main.o \ + ${OBJECTDIR}/_ext/1702716545/Divide_Pr.o \ + ${OBJECTDIR}/_ext/1472/Matrix_Mult.o \ + ${OBJECTDIR}/_ext/1702716545/Vector_Pr.o \ + ${OBJECTDIR}/_ext/1702716545/Result_Pr.o \ + ${OBJECTDIR}/_ext/1702716545/EntryPoint.o \ + ${OBJECTDIR}/_ext/1702716545/SeedVP.o \ + ${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o: ../Reo__Matrix_Mult/Producer_and_Consumer.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Producer_and_Consumer.o ../Reo__Matrix_Mult/Producer_and_Consumer.c + +${OBJECTDIR}/_ext/1539317932/ParamBag.o: ../ParamHelper/ParamBag.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1539317932 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1539317932/ParamBag.o ../ParamHelper/ParamBag.c + +${OBJECTDIR}/_ext/1702716545/Circuit.o: ../Reo__Matrix_Mult/Circuit.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Circuit.o ../Reo__Matrix_Mult/Circuit.c + +${OBJECTDIR}/_ext/1472/main.o: ../main.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1472 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1472/main.o ../main.c + +${OBJECTDIR}/_ext/1702716545/Divide_Pr.o: ../Reo__Matrix_Mult/Divide_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Divide_Pr.o ../Reo__Matrix_Mult/Divide_Pr.c + +${OBJECTDIR}/_ext/1472/Matrix_Mult.o: ../Matrix_Mult.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1472 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1472/Matrix_Mult.o ../Matrix_Mult.c + +${OBJECTDIR}/_ext/1702716545/Vector_Pr.o: ../Reo__Matrix_Mult/Vector_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Vector_Pr.o ../Reo__Matrix_Mult/Vector_Pr.c + +${OBJECTDIR}/_ext/1702716545/Result_Pr.o: ../Reo__Matrix_Mult/Result_Pr.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/Result_Pr.o ../Reo__Matrix_Mult/Result_Pr.c + +${OBJECTDIR}/_ext/1702716545/EntryPoint.o: ../Reo__Matrix_Mult/EntryPoint.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/EntryPoint.o ../Reo__Matrix_Mult/EntryPoint.c + +${OBJECTDIR}/_ext/1702716545/SeedVP.o: ../Reo__Matrix_Mult/SeedVP.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1702716545 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1702716545/SeedVP.o ../Reo__Matrix_Mult/SeedVP.c + +${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o: ../ParamHelper/ReadParamsFromFile.c + ${MKDIR} -p ${OBJECTDIR}/_ext/1539317932 + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/_ext/1539317932/ReadParamsFromFile.o ../ParamHelper/ReadParamsFromFile.c + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + ${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Makefile-impl.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Makefile-impl.mk Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=nb__Reo_matrix_mult + +# Active Configuration +DEFAULTCONF=Debug +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Debug Release Debug_Sequential + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Makefile-variables.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Makefile-variables.mk Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,43 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=GNU-Linux-x86 +CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux-x86 +CND_ARTIFACT_NAME_Debug=nb__reo_matrix_mult +CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux-x86/nb__reo_matrix_mult +CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux-x86/package +CND_PACKAGE_NAME_Debug=nbreomatrixmult.tar +CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux-x86/package/nbreomatrixmult.tar +# Release configuration +CND_PLATFORM_Release=GNU-Linux-x86 +CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux-x86 +CND_ARTIFACT_NAME_Release=nb__reo_matrix_mult +CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux-x86/nb__reo_matrix_mult +CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux-x86/package +CND_PACKAGE_NAME_Release=nbreomatrixmult.tar +CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux-x86/package/nbreomatrixmult.tar +# Debug_Sequential configuration +CND_PLATFORM_Debug_Sequential=GNU-Linux-x86 +CND_ARTIFACT_DIR_Debug_Sequential=dist/Debug_Sequential/GNU-Linux-x86 +CND_ARTIFACT_NAME_Debug_Sequential=nb__reo_matrix_mult +CND_ARTIFACT_PATH_Debug_Sequential=dist/Debug_Sequential/GNU-Linux-x86/nb__reo_matrix_mult +CND_PACKAGE_DIR_Debug_Sequential=dist/Debug_Sequential/GNU-Linux-x86/package +CND_PACKAGE_NAME_Debug_Sequential=nbreomatrixmult.tar +CND_PACKAGE_PATH_Debug_Sequential=dist/Debug_Sequential/GNU-Linux-x86/package/nbreomatrixmult.tar +# +# include compiler specific variables +# +# dmake command +ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \ + (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk) +# +# gmake command +.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)) +# +include nbproject/private/Makefile-variables.mk diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Package-Debug.bash --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Package-Debug.bash Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,75 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult +OUTPUT_BASENAME=nb__reo_matrix_mult +PACKAGE_TOP_DIR=nbreomatrixmult/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/nbreomatrixmult/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nbreomatrixmult.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nbreomatrixmult.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Package-Debug_Sequential.bash --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Package-Debug_Sequential.bash Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,75 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug_Sequential +CND_DISTDIR=dist +CND_BUILDDIR=build +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult +OUTPUT_BASENAME=nb__reo_matrix_mult +PACKAGE_TOP_DIR=nbreomatrixmult/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/nbreomatrixmult/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nbreomatrixmult.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nbreomatrixmult.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/Package-Release.bash --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/Package-Release.bash Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,75 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nb__reo_matrix_mult +OUTPUT_BASENAME=nb__reo_matrix_mult +PACKAGE_TOP_DIR=nbreomatrixmult/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/nbreomatrixmult/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nbreomatrixmult.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nbreomatrixmult.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/configurations.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/configurations.xml Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,107 @@ + + + + + + + + + + ../ParamHelper/Param.h + ../ParamHelper/ParamBag.c + ../ParamHelper/ReadParamsFromFile.c + + + ../Reo__Matrix_Mult/Circuit.c + ../Reo__Matrix_Mult/Circuit.h + ../Reo__Matrix_Mult/Divide_Pr.c + ../Reo__Matrix_Mult/EntryPoint.c + ../Reo__Matrix_Mult/PThread__Matrix_Mult.h + ../Reo__Matrix_Mult/Producer_and_Consumer.c + ../Reo__Matrix_Mult/Result_Pr.c + ../Reo__Matrix_Mult/SeedVP.c + ../Reo__Matrix_Mult/VMS_primitive_data_types.h + ../Reo__Matrix_Mult/VReo__Test_App.h + ../Reo__Matrix_Mult/Vector_Pr.c + + ../Matrix_Mult.c + ../Matrix_Mult.h + ../main.c + + + + + Makefile + + + + ../ParamHelper + ../Reo__Matrix_Mult + + Makefile + + + + LOCAL_SOURCES + default + + + + + + + LOCAL_SOURCES + default + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + LOCAL_SOURCES + default + + + + + ../.. + + + DEBUG__SEQUENTIAL_MODE + + + + + ../../PR__lib + + + + + + diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/private/Makefile-variables.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/private/Makefile-variables.mk Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,8 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +# Debug configuration +# Release configuration +# Debug_Sequential configuration diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/private/configurations.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/private/configurations.xml Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,115 @@ + + + Makefile + + + + localhost + 2 + + + + + + + + + + + + + + + GizmoSimple + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 0 + 0 + + + + + + + localhost + 2 + + + + + + + + + + + + + + + GizmoSimple + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 0 + 0 + + + + + + + localhost + 2 + + + + + + + + + + + + + + + GizmoSimple + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + /home/kshalle/D/2__Work/1__Development/0__Code/PR/PR__ML_lib__sharedMem/Projects/Reo_Opt1__matrix_mult/dist + true + 0 + 0 + + + + + + + diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/private/private.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/private/private.xml Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,7 @@ + + + + 1 + 2 + + diff -r 000000000000 -r c4b1849c05ef nb__Reo_matrix_mult/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nb__Reo_matrix_mult/nbproject/project.xml Sun Feb 02 17:58:41 2014 -0800 @@ -0,0 +1,32 @@ + + + org.netbeans.modules.cnd.makeproject + + + nb__Reo_matrix_mult + c + + h + UTF-8 + + + ../ParamHelper + ../Reo__Matrix_Mult + + + + Debug + 1 + + + Release + 1 + + + Debug_Sequential + 1 + + + + +