From 386b7d3366f1359a265da207a9cafa3edf553b64 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Mon, 7 Oct 2019 19:13:39 -0400 Subject: Reorganize and commit all the modified TACLeBench code and run scripts --- baseline/source/extra.h | 116 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 baseline/source/extra.h (limited to 'baseline/source/extra.h') diff --git a/baseline/source/extra.h b/baseline/source/extra.h new file mode 100644 index 0000000..ca92812 --- /dev/null +++ b/baseline/source/extra.h @@ -0,0 +1,116 @@ +#include +#include +#include +#include +#include +#include +#include + +#define L3_CACHE_SIZE (11264*1024) + + + +#define SET_UP char *thisProgram=argv[1];\ + int maxJobs=atoi(argv[2]);\ + char *thisCore=argv[3];\ + char *otherCore=argv[4];\ + char *otherProgram=argv[5];\ + char *runID=argv[6];\ + int output=atoi(argv[7]);\ + pid_t killMe;\ + struct timespec start, end;\ + int jobsComplete;\ + long progTime[maxJobs*output];\ + char fileName[50];\ + char *bigArray;\ + int wasteCount;\ + strcpy(fileName, runID);\ + strcat(fileName, ".txt");\ + mlockall(MCL_CURRENT || MCL_FUTURE); + + +//if output==0, endless loop +//avoids int overflow error with large numbers for background loops + +#define SAVE_RESULTS if(jobsComplete>-1) progTime[jobsComplete]=(end.tv_nsec-start.tv_nsec)+(1000000000*(end.tv_sec-start.tv_sec)); + +#define WRITE_TO_FILE if (output){\ + munlockall();\ + FILE *fp=fopen(fileName, "a");\ + if (fp == NULL) {\ + perror("Error opening file. \n");\ + exit(1);\ + }\ + for(jobsComplete=0; jobsComplete