From a71fc97fd262e1b5770f827047ea60bbaf38d9a2 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Mon, 19 Oct 2020 01:09:53 -0400 Subject: Unify all the versions of extra.h into a single multipurpose header There was previously a huge amount of shared code that had to be copied back and forth. This should reduce the maintenance burden by containing all future changes to a single file. New unified library is fully backwards-compatible but also introduces and the easy-to-use `for_each_job` macro which replaces the specific `for(...) START_LOOP ... STOP_LOOP` format requirement and is generally much harder to abuse. New unified library also automatically cleans up its shared memory and semaphores, so this commit also removes the separate `cleanupSemaphores` binary. I also found a precursor of `extra.h` written by Sims in `litmusStuff.h`. This code is only interesting for historical purposes, so it is also removed in this commit. This commit also adds debug options to all the Makefiles and silences rm's complaints about non-existent files in make clean. --- baseline/source/litmusStuff.h | 80 ------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 baseline/source/litmusStuff.h (limited to 'baseline/source/litmusStuff.h') diff --git a/baseline/source/litmusStuff.h b/baseline/source/litmusStuff.h deleted file mode 100644 index dca2360..0000000 --- a/baseline/source/litmusStuff.h +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include <../litmus.h> - -#define L3_CACHE_SIZE (11264*1024) - -#define SAVE_RESULTS if(jobsComplete>-1) progTime[jobsComplete]=(end.tv_nsec-start.tv_nsec)+(1000000000*(end.tv_sec-start.tv_sec)); - - -#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]);\ - struct timespec start, end;\ - int jobsComplete;\ - long progTime[maxJobs*output];\ - char fileName[50];\ - char *bigArray;\ - strcpy(fileName, runID);\ - strcat(fileName, ".txt");\ - mlockall(MCL_CURRENT || MCL_FUTURE); - -#define WRITE_TO_FILE if (output){\ - munlockall();\ - FILE *fp=fopen(fileName, "a");\ - for(jobsComplete=0; jobsComplete