diff options
| author | leochanj105 <leochanj@live.unc.edu> | 2020-10-23 03:46:12 -0400 |
|---|---|---|
| committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-23 15:36:47 -0400 |
| commit | 010690950e295802405f2d538be859ef21bec155 (patch) | |
| tree | f9f3aca6925df6a96a19253293f89a2a8c736914 | |
| parent | 55277ec939322aecb03e9509d4400273910b7d36 (diff) | |
wip
wip
wip
wip
| -rw-r--r-- | SD-VBS/benchmarks/stitch/src/c/script_stitch.c | 12 | ||||
| -rw-r--r-- | SD-VBS/common/c/extra.h | 239 | ||||
| -rw-r--r-- | SD-VBS/common/makefiles/Makefile.common | 5 | ||||
| -rwxr-xr-x | all_pairs/bin/anagram | bin | 0 -> 185080 bytes | |||
| -rwxr-xr-x | all_pairs/bin/audiobeam | bin | 0 -> 129064 bytes | |||
| -rwxr-xr-x | all_pairs/bin/g723_enc | bin | 0 -> 101816 bytes | |||
| -rwxr-xr-x | all_pairs/bin/huff_dec | bin | 0 -> 96112 bytes | |||
| -rwxr-xr-x | baseline/bin/anagram | bin | 0 -> 179832 bytes | |||
| -rwxr-xr-x | baseline/bin/audiobeam | bin | 0 -> 123816 bytes | |||
| -rwxr-xr-x | baseline/bin/g723_enc | bin | 0 -> 100656 bytes | |||
| -rwxr-xr-x | baseline/bin/huff_dec | bin | 0 -> 94944 bytes | |||
| -rwxr-xr-x | dis/Makefile | 2 | ||||
| -rw-r--r-- | dis/sudo | 180 | ||||
| -rw-r--r-- | run_case_study.py | 119 |
14 files changed, 438 insertions, 119 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c index b7611f1..9310048 100644 --- a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c +++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c | |||
| @@ -23,6 +23,12 @@ int main(int argc, char* argv[]) | |||
| 23 | cols = Icur->width; | 23 | cols = Icur->width; |
| 24 | 24 | ||
| 25 | for_each_job { | 25 | for_each_job { |
| 26 | iFreeHandle(Icur); | ||
| 27 | fFreeHandle(v); | ||
| 28 | fFreeHandle(interestPnts); | ||
| 29 | fFreeHandle(int1); | ||
| 30 | fFreeHandle(int2); | ||
| 31 | fFreeHandle(Fcur); | ||
| 26 | v = harris(Icur); | 32 | v = harris(Icur); |
| 27 | interestPnts = getANMS(v, 24); | 33 | interestPnts = getANMS(v, 24); |
| 28 | int1 = fMallocHandle(interestPnts->height, 1); | 34 | int1 = fMallocHandle(interestPnts->height, 1); |
| @@ -49,12 +55,6 @@ int main(int argc, char* argv[]) | |||
| 49 | printf("Error in Stitch\n"); | 55 | printf("Error in Stitch\n"); |
| 50 | } | 56 | } |
| 51 | #endif | 57 | #endif |
| 52 | iFreeHandle(Icur); | ||
| 53 | fFreeHandle(v); | ||
| 54 | fFreeHandle(interestPnts); | ||
| 55 | fFreeHandle(int1); | ||
| 56 | fFreeHandle(int2); | ||
| 57 | fFreeHandle(Fcur); | ||
| 58 | WRITE_TO_FILE | 58 | WRITE_TO_FILE |
| 59 | return 0; | 59 | return 0; |
| 60 | } | 60 | } |
diff --git a/SD-VBS/common/c/extra.h b/SD-VBS/common/c/extra.h index 8c67b33..9c72064 100644 --- a/SD-VBS/common/c/extra.h +++ b/SD-VBS/common/c/extra.h | |||
| @@ -29,8 +29,8 @@ extern int sched_getcpu(); | |||
| 29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
| 30 | #endif | 30 | #endif |
| 31 | 31 | ||
| 32 | // This is a proxy for "case study mode" now | ||
| 32 | #define LITMUS 1 | 33 | #define LITMUS 1 |
| 33 | #define MC2 0 | ||
| 34 | #define MMDC_PROF 0 | 34 | #define MMDC_PROF 0 |
| 35 | 35 | ||
| 36 | #if LITMUS | 36 | #if LITMUS |
| @@ -41,18 +41,6 @@ extern int sched_getcpu(); | |||
| 41 | #include "/media/speedy/litmus/tools/mmdc/mmdc.h" | 41 | #include "/media/speedy/litmus/tools/mmdc/mmdc.h" |
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | #if LITMUS | ||
| 45 | #define SET_UP LOAD_PARAMS SETUP_LITMUS | ||
| 46 | #else | ||
| 47 | #define SET_UP LOAD_PARAMS | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #if MMDC_PROF | ||
| 51 | #define LOAD_PARAMS LOAD_PARAMS_ITRL SETUP_MMDC | ||
| 52 | #else | ||
| 53 | #define LOAD_PARAMS LOAD_PARAMS_ITRL | ||
| 54 | #endif | ||
| 55 | |||
| 56 | // Store state globally so that the job can be outside main() | 44 | // Store state globally so that the job can be outside main() |
| 57 | // Arrays use float as a comprimise between overflow and size | 45 | // Arrays use float as a comprimise between overflow and size |
| 58 | // Paired arrays use long longs as precision is more important for those times | 46 | // Paired arrays use long longs as precision is more important for those times |
| @@ -82,50 +70,72 @@ char *_rt_other_core; | |||
| 82 | char *_rt_barrier; | 70 | char *_rt_barrier; |
| 83 | sem_t *_rt_first_sem, *_rt_second_sem; | 71 | sem_t *_rt_first_sem, *_rt_second_sem; |
| 84 | int _rt_lock_id; | 72 | int _rt_lock_id; |
| 73 | #define _ID_SZ 128 | ||
| 74 | char _rt_sem1_name[_ID_SZ] = "/_libextra_first_sem-"; | ||
| 75 | char _rt_sem2_name[_ID_SZ] = "/_libextra_second_sem-"; | ||
| 76 | char _rt_shm_name[_ID_SZ] = "/_libextra_barrier-"; | ||
| 77 | #endif /* PAIRED */ | ||
| 78 | |||
| 79 | #if LITMUS | ||
| 80 | long unsigned int _rt_period; | ||
| 85 | #endif | 81 | #endif |
| 86 | 82 | ||
| 87 | static void _rt_load_params_itrl(int argc, char **argv) { | 83 | static void _rt_load_params_itrl(int argc, char **argv) { |
| 88 | #ifdef PAIRED | 84 | #ifdef PAIRED |
| 89 | if (argc != 8) { | 85 | if (argc != (8 + LITMUS*2) && argc != (9 + LITMUS*2)) { |
| 90 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <lockID>", argv[0]); | 86 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <save results?>", argv[0]); |
| 91 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); | ||
| 92 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); | ||
| 93 | fprintf(stderr, " <my core> UNUSED. Core is now auto-detected.\n"); | ||
| 94 | fprintf(stderr, " <other core> integer for logging. Core of paired task.\n"); | ||
| 95 | fprintf(stderr, " <other name> string for logging. Name of paired task.\n"); | ||
| 96 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); | ||
| 97 | fprintf(stderr, " <lockID> 1 to indicate this is pair member 1, otherwise pair member 2.\n"); | ||
| 98 | exit(1); | ||
| 99 | } | ||
| 100 | #else | 87 | #else |
| 101 | if (argc != 6) { | 88 | if (argc != (6 + LITMUS*2)) { |
| 102 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); | 89 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); |
| 90 | #endif /* PAIRED */ | ||
| 103 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); | 91 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); |
| 104 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); | 92 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); |
| 105 | fprintf(stderr, " <my core> UNUSED. Core is now auto-detected.\n"); | 93 | fprintf(stderr, " <my core> integer core number. Only used for LITMUS-RT.\n"); |
| 94 | #ifdef PAIRED | ||
| 95 | fprintf(stderr, " <other core> integer for logging. Core of paired task.\n"); | ||
| 96 | fprintf(stderr, " <other name> string for logging. Name of paired task.\n"); | ||
| 97 | #endif /* PAIRED */ | ||
| 106 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); | 98 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); |
| 107 | fprintf(stderr, " <save results?> 1 to save results, 0 to discard.\n"); | 99 | fprintf(stderr, " <save results?> 1 to save results, 0 to discard.\n"); |
| 100 | #ifdef PAIRED | ||
| 101 | fprintf(stderr, " <pairID> (optional).\n"); | ||
| 102 | #endif | ||
| 103 | #if LITMUS | ||
| 104 | fprintf(stderr, " <task period> in ms\n"); | ||
| 105 | fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n"); | ||
| 106 | #endif /* LITMUS */ | ||
| 108 | exit(1); | 107 | exit(1); |
| 109 | } | 108 | } |
| 110 | #endif | ||
| 111 | _rt_our_prog_name = argv[1]; | 109 | _rt_our_prog_name = argv[1]; |
| 112 | _rt_max_jobs = atol(argv[2]); | 110 | _rt_max_jobs = atol(argv[2]); |
| 111 | #if !LITMUS | ||
| 113 | _rt_core = sched_getcpu(); | 112 | _rt_core = sched_getcpu(); |
| 113 | #else | ||
| 114 | _rt_core = atoi(argv[3]); | ||
| 115 | #endif | ||
| 114 | #ifdef PAIRED | 116 | #ifdef PAIRED |
| 115 | _rt_other_core = argv[4]; | 117 | _rt_other_core = argv[4]; |
| 116 | _rt_other_prog_name = argv[5]; | 118 | _rt_other_prog_name = argv[5]; |
| 117 | _rt_run_id = argv[6]; | 119 | _rt_run_id = argv[6]; |
| 118 | _rt_lock_id = atoi(argv[7]); | 120 | _rt_will_output = atoi(argv[7]); |
| 119 | // The paired version doesn't support disabling output (legacy compatibility) | 121 | char *pairId; |
| 120 | _rt_will_output = 1; | 122 | int end; |
| 123 | if (argc > 8) { | ||
| 124 | pairId = argv[8]; | ||
| 125 | end = 8; | ||
| 126 | } else { | ||
| 127 | pairId = "none"; | ||
| 128 | end = 9; | ||
| 129 | } | ||
| 121 | #else | 130 | #else |
| 122 | _rt_other_core = "none"; | 131 | _rt_other_core = "none"; |
| 123 | _rt_other_prog_name = "none"; | 132 | _rt_other_prog_name = "none"; |
| 124 | _rt_run_id = argv[4]; | 133 | _rt_run_id = argv[4]; |
| 125 | _rt_will_output = atoi(argv[5]); | 134 | _rt_will_output = atoi(argv[5]); |
| 135 | int end = 6; | ||
| 126 | #endif /* PAIRED */ | 136 | #endif /* PAIRED */ |
| 127 | if (_rt_max_jobs < 0 && _rt_will_output != 0) { | 137 | if (_rt_max_jobs < 0 && _rt_will_output != 0) { |
| 128 | fprintf(stderr, "Infinite loops only supported when _rt_will_output is disabled!\n"); | 138 | fprintf(stderr, "Infinite loops only supported when output is disabled!\n"); |
| 129 | exit(1); | 139 | exit(1); |
| 130 | } | 140 | } |
| 131 | if (strlen(_rt_run_id) + 5 > _RT_FILENAME_LEN) { | 141 | if (strlen(_rt_run_id) + 5 > _RT_FILENAME_LEN) { |
| @@ -133,32 +143,54 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
| 133 | exit(1); | 143 | exit(1); |
| 134 | } | 144 | } |
| 135 | #ifdef PAIRED | 145 | #ifdef PAIRED |
| 146 | // __rt_sem2_name happens to be the longest | ||
| 147 | if (strlen(pairId) + strlen(_rt_sem2_name) > _ID_SZ) { | ||
| 148 | fprintf(stderr, "PairID is too long! Maximum length is %ld characters.\n", _ID_SZ - strlen(_rt_sem2_name)); | ||
| 149 | exit(1); | ||
| 150 | } | ||
