diff main.c @ 3:a6b3cab179b1

Added no-measurments option for platforms without support. Added static X86, ARM and basic Kalray build support. This branch requires the longjmp versions of libprt and libvreo
author Philipe Louchtch - de Raadt
date Sat, 12 Jul 2014 20:21:47 +0200
parents 1b61e0c00512
children
line diff
     1.1 --- a/main.c	Wed Feb 19 09:27:10 2014 -0800
     1.2 +++ b/main.c	Sat Jul 12 20:21:47 2014 +0200
     1.3 @@ -1,4 +1,9 @@
     1.4 -#include <malloc.h>
     1.5 +#ifdef RTEMS
     1.6 +
     1.7 +#include <mppa/osconfig.h>
     1.8 +
     1.9 +#endif
    1.10 +
    1.11  #include <stdlib.h>
    1.12  #include <PR__include/PR__WL.h>
    1.13  
    1.14 @@ -9,10 +14,9 @@
    1.15  
    1.16  // =============================================================================
    1.17  
    1.18 -int NUM_ITER;
    1.19 +int numIterations;
    1.20  
    1.21 -
    1.22 -int main(int argc, char **argv) 
    1.23 +int main(int argc, char **argv)
    1.24   { Matrix      *leftMatrix, *rightMatrix, *resultMatrix;
    1.25     ParamBag    *paramBag;
    1.26     MatrixMultWorkUnit **workUnits;
    1.27 @@ -24,10 +28,10 @@
    1.28     
    1.29           DEBUG__printf(TRUE, "arguments --  numIter: %s | path: %s", argv[1], argv[2] );
    1.30     if(argc < 3) {printf("give: num iter and path to param file on cmd line\n"); exit(1);}
    1.31 -   NUM_ITER = atoi(argv[1]);
    1.32 -   numUnitsToMake = NUM_PROD;  //defined by Reo circuit generator
    1.33 +   numIterations = atoi(argv[1]);
    1.34 +   numUnitsToMake = NUM_PROD-1;  //defined by Reo circuit generator
    1.35     
    1.36 -         printf("[reo] Settings: %i workers, %i iterations | file: %s \n", NUM_PROD, NUM_ITER, argv[2]);
    1.37 +         printf("[reo] Settings: %i workers, %i iterations | file: %s \n", NUM_PROD, numIterations, argv[2]);
    1.38  
    1.39           set_up_performance_counters();
    1.40     
    1.41 @@ -57,32 +61,20 @@
    1.42   * VPs, as they are created.
    1.43   *Need a dummy work unit added to end of work-unit array, to avoid a seg
    1.44   * fault -- just did a bad hack inside divideWork.
    1.45 -   //Now, create params struct for each producer -- holds work unit
    1.46 -   for( vpIdx=0; vpIdx<numUnitsToMake; vpIdx++)
    1.47 -    {
    1.48 -      vpParams = PR__malloc( sizeof(VPParams) );
    1.49 -      prodParams = PR__malloc( sizeof(ProdParams) );
    1.50 -      
    1.51 -      vpParams->initData = prodParams; 
    1.52 -      vpParamsArray[vpIdx] = vpParams;
    1.53 -    }
    1.54 -  //create params for consumer
    1.55 -           
    1.56 -   vpParams = PR__malloc( sizeof(VPParams) );
    1.57 -     = malloc( sizeof(ProdParams) );
    1.58 -      
    1.59 -   vpParams->initData = 
    1.60 -   vpParamsArray[vpIdx] = vpParams; //this last entry is for the consumer
    1.61 -*/
    1.62 -   
    1.63 + */  
    1.64     matrixMultProcess = PR__create_process( &matrix_mult__seed_Fn, 
    1.65                                                  workUnits );
    1.66     
    1.67     PR__wait_for_process_to_end(matrixMultProcess);
    1.68     PR__wait_for_all_activity_to_end();
    1.69 +         DEBUG__printf(dbgAppFlow, "activity ended, about to call PR__shutdown");
    1.70     fflush(stdout);
    1.71     PR__shutdown();
    1.72 -   
    1.73 +
    1.74 +   printf("Something with done..\n\n");
    1.75 +   usleep(1000);
    1.76 +   fflush(stdout);
    1.77 +
    1.78     exit(0);
    1.79   }
    1.80