diff options
65 files changed, 1196 insertions, 1383 deletions
| @@ -3,6 +3,9 @@ | |||
| 3 | *.txt.clean | 3 | *.txt.clean |
| 4 | # But not benchmark lists | 4 | # But not benchmark lists |
| 5 | !*Names.txt | 5 | !*Names.txt |
| 6 | # Special-case .txt handling for SD-VBS | ||
| 7 | **/12345.txt | ||
| 8 | !SD-VBS/benchmarks/**/*.txt | ||
| 6 | 9 | ||
| 7 | # Ignore DIS benchmark binaries | 10 | # Ignore DIS benchmark binaries |
| 8 | **/field | 11 | **/field |
| @@ -40,12 +43,7 @@ | |||
| 40 | **/statemate | 43 | **/statemate |
| 41 | **/susan | 44 | **/susan |
| 42 | 45 | ||
| 43 | # Ignore random walk benchmark | 46 | # Ignore SD-VBS binaries |
| 44 | **/random_walk | ||
| 45 | |||
| 46 | # Ignore misc debug and build outputs | ||
| 47 | **/.gdb_history | ||
| 48 | |||
| 49 | **/mser | 47 | **/mser |
| 50 | **/multi_ncut | 48 | **/multi_ncut |
| 51 | **/stitch | 49 | **/stitch |
| @@ -56,5 +54,10 @@ | |||
| 56 | **/sift | 54 | **/sift |
| 57 | **/localization | 55 | **/localization |
| 58 | **/disparity | 56 | **/disparity |
| 59 | **/12345.txt | 57 | |
| 60 | !SD-VBS/**/*.txt | 58 | # Ignore random walk benchmark |
| 59 | **/random_walk | ||
| 60 | |||
| 61 | # Ignore misc temporary files | ||
| 62 | **/.gdb_history | ||
| 63 | *.swp | ||
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ebc7523 --- /dev/null +++ b/.gitmodules | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | [submodule "smt_analysis/plotille"] | ||
| 2 | path = smt_analysis/plotille | ||
| 3 | url = https://github.com/tammoippen/plotille.git | ||
| 4 | [submodule "wbinvd"] | ||
| 5 | path = wbinvd | ||
| 6 | url = https://github.com/JoshuaJB/wbinvd.git | ||
diff --git a/SD-VBS/benchmarks/disparity/src/c/script_disparity.c b/SD-VBS/benchmarks/disparity/src/c/script_disparity.c index 431c02c..7d45ada 100644 --- a/SD-VBS/benchmarks/disparity/src/c/script_disparity.c +++ b/SD-VBS/benchmarks/disparity/src/c/script_disparity.c | |||
| @@ -28,9 +28,7 @@ int main(int argc, char* argv[]) | |||
| 28 | int WIN_SZ=8, SHIFT=64; | 28 | int WIN_SZ=8, SHIFT=64; |
| 29 | FILE* fp; | 29 | FILE* fp; |
| 30 | 30 | ||
| 31 | printf("Image 1: "); | ||
| 32 | scanf("%s", im1); | 31 | scanf("%s", im1); |
| 33 | printf("Image 2: "); | ||
| 34 | scanf("%s", im2); | 32 | scanf("%s", im2); |
| 35 | #ifdef CHECK | 33 | #ifdef CHECK |
| 36 | char checkFile[100] = "./expected_C.txt"; | 34 | char checkFile[100] = "./expected_C.txt"; |
| @@ -86,17 +84,15 @@ int main(int argc, char* argv[]) | |||
| 86 | Iright_moved = iSetArray(paddedRows, paddedCols, 0); | 84 | Iright_moved = iSetArray(paddedRows, paddedCols, 0); |
| 87 | 85 | ||
| 88 | range = iMallocHandle(1, 2); | 86 | range = iMallocHandle(1, 2); |
| 89 | printf("starting..\n"); | 87 | for_each_job { |
| 90 | for_each_job{ | 88 | retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT, |
| 91 | retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT, | 89 | minSAD, retDisp, halfWin, |
| 92 | minSAD, retDisp, halfWin, | 90 | IrightPadded, IleftPadded, Iright_moved, |
| 93 | IrightPadded, IleftPadded, Iright_moved, | 91 | retSAD, SAD, integralImg, |
| 94 | retSAD, SAD, integralImg, | 92 | range); |
| 95 | range); | ||
| 96 | } | 93 | } |
| 97 | printf("ending\n"); | ||
| 98 | 94 | ||
| 99 | #ifdef CHECK | 95 | #ifdef CHECK |
| 100 | /** Self checking - use expected.txt from data directory **/ | 96 | /** Self checking - use expected.txt from data directory **/ |
| 101 | { | 97 | { |
| 102 | int tol, ret=0; | 98 | int tol, ret=0; |
diff --git a/SD-VBS/benchmarks/localization/src/c/script_localization.c b/SD-VBS/benchmarks/localization/src/c/script_localization.c index 3392320..ed37132 100644 --- a/SD-VBS/benchmarks/localization/src/c/script_localization.c +++ b/SD-VBS/benchmarks/localization/src/c/script_localization.c | |||
| @@ -41,7 +41,6 @@ int main(int argc, char* argv[]) | |||
| 41 | 41 | ||
| 42 | char im1[100]; | 42 | char im1[100]; |
| 43 | 43 | ||
| 44 | printf("Input txt File: "); | ||
| 45 | scanf("%s", im1); | 44 | scanf("%s", im1); |
| 46 | 45 | ||
| 47 | fid = readFile(im1); | 46 | fid = readFile(im1); |
| @@ -83,11 +82,10 @@ int main(int argc, char* argv[]) | |||
| 83 | F2D *randn; | 82 | F2D *randn; |
| 84 | 83 | ||
| 85 | randn = randWrapper(n,3); | 84 | randn = randWrapper(n,3); |
| 86 | printf("start\n"); | 85 | for_each_job { |
| 87 | for_each_job{ | 86 | fResetArray(pos,n, 3, 0); |
| 88 | fResetArray(pos,n, 3, 0); | 87 | fResetArray(vel,n, 3, 0); |
| 89 | fResetArray(vel,n, 3, 0); | 88 | fResetArray(ones,n,1,1); |
| 90 | fResetArray(ones,n,1,1); | ||
| 91 | 89 | ||
| 92 | { | 90 | { |
| 93 | int j; | 91 | int j; |
| @@ -95,7 +93,7 @@ int main(int argc, char* argv[]) | |||
| 95 | for(j=0; j<3; j++) | 93 | for(j=0; j<3; j++) |
| 96 | subsref(vel, i, j) += subsref(randn,i,j) * STDDEV_ODOVel; | 94 | subsref(vel, i, j) += subsref(randn,i,j) * STDDEV_ODOVel; |
| 97 | 95 | ||
| 98 | } | 96 | } |
| 99 | 97 | ||
| 100 | 98 | ||
| 101 | 99 | ||
| @@ -486,17 +484,15 @@ int main(int argc, char* argv[]) | |||
| 486 | subsref(resultMat,1,icount) = velOut; | 484 | subsref(resultMat,1,icount) = velOut; |
| 487 | subsref(resultMat,2,icount) = posOut; | 485 | subsref(resultMat,2,icount) = posOut; |
| 488 | } | 486 | } |
| 489 | 487 | ||
| 490 | fFreeHandle(sData); | 488 | fFreeHandle(sData); |
| 491 | 489 | ||
| 492 | |||
| 493 | if (asubsref(isEOF,0) == 1) | 490 | if (asubsref(isEOF,0) == 1) |
| 494 | break; | 491 | break; |
| 495 | } | 492 | } |
| 496 | } | 493 | } |
| 497 | printf("end..\n"); | ||
| 498 | 494 | ||
| 499 | #ifdef CHECK | 495 | #ifdef CHECK |
| 500 | 496 | ||
| 501 | // Self checking - use expected.txt from data directory | 497 | // Self checking - use expected.txt from data directory |
| 502 | { | 498 | { |
diff --git a/SD-VBS/benchmarks/mser/src/c/script_mser.c b/SD-VBS/benchmarks/mser/src/c/script_mser.c index d4a98cd..3e98f86 100644 --- a/SD-VBS/benchmarks/mser/src/c/script_mser.c +++ b/SD-VBS/benchmarks/mser/src/c/script_mser.c | |||
| @@ -33,7 +33,6 @@ int main(int argc, char* argv[]) | |||
| 33 | 33 | ||
| 34 | int ndims, nel, gdl, nmer; | 34 | int ndims, nel, gdl, nmer; |
| 35 | 35 | ||
| 36 | printf("Input Image: "); | ||
| 37 | scanf("%s", im1); | 36 | scanf("%s", im1); |
| 38 | 37 | ||
| 39 | I = readImage(im1); | 38 | I = readImage(im1); |
| @@ -74,19 +73,17 @@ int main(int argc, char* argv[]) | |||
| 74 | 73 | ||
| 75 | 74 | ||
| 76 | out = iMallocHandle(1, nmer); | 75 | out = iMallocHandle(1, nmer); |
| 77 | printf("start\n"); | 76 | for_each_job { |
| 78 | for_each_job{ | ||
| 79 | idx = mser(It, 2, subs_pt, nsubs_pt, strides_pt, visited_pt, dims, | 77 | idx = mser(It, 2, subs_pt, nsubs_pt, strides_pt, visited_pt, dims, |
| 80 | joins_pt, | 78 | joins_pt, |
| 81 | regions_pt, | 79 | regions_pt, |
| 82 | pairs_pt, | 80 | pairs_pt, |
| 83 | forest_pt, | 81 | forest_pt, |
| 84 | acc_pt, ell_pt, | 82 | acc_pt, ell_pt, |
| 85 | out); | 83 | out); |
| 86 | } | 84 | } |
| 87 | printf("end..\n"); | 85 | |
| 88 | 86 | #ifdef CHECK | |
| 89 | #ifdef CHECK | ||
| 90 | /** Self checking - use expected.txt from data directory **/ | 87 | /** Self checking - use expected.txt from data directory **/ |
| 91 | { | 88 | { |
| 92 | int tol, ret=0; | 89 | int tol, ret=0; |
diff --git a/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c b/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c index e4f7912..77c6b71 100644 --- a/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c +++ b/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c | |||
| @@ -28,7 +28,6 @@ int main(int argc, char* argv[]) | |||
| 28 | 28 | ||
| 29 | F2D *imageOut, *tempOut; | 29 | F2D *imageOut, *tempOut; |
| 30 | F2D *edgeWeights, *in; | 30 | F2D *edgeWeights, *in; |
| 31 | printf("Input image: "); | ||
| 32 | scanf("%s", im1); | 31 | scanf("%s", im1); |
| 33 | im = readImage(im1); | 32 | im = readImage(im1); |
| 34 | 33 | ||
| @@ -50,13 +49,12 @@ int main(int argc, char* argv[]) | |||
| 50 | u->elts = (uni_elt*)malloc(sizeof(uni_elt)*num_vertices); | 49 | u->elts = (uni_elt*)malloc(sizeof(uni_elt)*num_vertices); |
| 51 | output = iMallocHandle(height, width); | 50 | output = iMallocHandle(height, width); |
| 52 | 51 | ||
| 53 | printf("start\n"); | ||
| 54 | for_each_job{ | 52 | for_each_job{ |
| 55 | seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output); | 53 | seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output); |
| 56 | out = seg; | 54 | out = seg; |
| 57 | } | 55 | } |
| 58 | printf("end..\n"); | 56 | |
| 59 | #ifdef CHECK | 57 | #ifdef CHECK |
| 60 | /** Self checking - use expected.txt from data directory **/ | 58 | /** Self checking - use expected.txt from data directory **/ |
| 61 | { | 59 | { |
| 62 | int ret=0; | 60 | int ret=0; |
diff --git a/SD-VBS/benchmarks/sift/src/c/script_sift.c b/SD-VBS/benchmarks/sift/src/c/script_sift.c index 0b2f106..ab39ae3 100644 --- a/SD-VBS/benchmarks/sift/src/c/script_sift.c +++ b/SD-VBS/benchmarks/sift/src/c/script_sift.c | |||
| @@ -45,7 +45,6 @@ int main(int argc, char* argv[]) | |||
| 45 | unsigned int* startTime, *endTime, *elapsed; | 45 | unsigned int* startTime, *endTime, *elapsed; |
| 46 | 46 | ||
| 47 | char imSrc[100]; | 47 | char imSrc[100]; |
| 48 | printf("Input image: "); | ||
| 49 | scanf("%s", imSrc); | 48 | scanf("%s", imSrc); |
| 50 | im = readImage(imSrc); | 49 | im = readImage(imSrc); |
| 51 | image = fiDeepCopy(im); | 50 | image = fiDeepCopy(im); |
| @@ -53,16 +52,14 @@ int main(int argc, char* argv[]) | |||
| 53 | cols = image->width; | 52 | cols = image->width; |
| 54 | 53 | ||
| 55 | 54 | ||
| 56 | printf("start\n"); | ||
| 57 | for_each_job{ | 55 | for_each_job{ |
| 58 | image = fiDeepCopy(im); | 56 | image = fiDeepCopy(im); |
| 59 | normalizeImage(image); | 57 | normalizeImage(image); |
| 60 | /** Extract sift features for the normalized image **/ | 58 | /** Extract sift features for the normalized image **/ |
| 61 | frames = sift(image); | 59 | frames = sift(image); |
| 62 | } | 60 | } |
| 63 | printf("end..\n"); | 61 | |
| 64 | 62 | #ifdef CHECK | |
| 65 | #ifdef CHECK | ||
| 66 | { | 63 | { |
| 67 | int ret=0; | 64 | int ret=0; |
| 68 | float tol = 0.2; | 65 | float tol = 0.2; |
diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c index 00c9a93..b7611f1 100644 --- a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c +++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c | |||
| @@ -16,16 +16,13 @@ int main(int argc, char* argv[]) | |||
| 16 | I2D *Icur; | 16 | I2D *Icur; |
| 17 | int i, j; | 17 | int i, j; |
| 18 | char im1[100], im2[100]; | 18 | char im1[100], im2[100]; |
| 19 | |||
| 20 | 19 | ||
| 21 | printf("Input image: "); | ||
| 22 | scanf("%s", im1); | 20 | scanf("%s", im1); |
| 23 | Icur = readImage(im1); | 21 | Icur = readImage(im1); |
| 24 | rows = Icur->height; | 22 | rows = Icur->height; |
| 25 | cols = Icur->width; | 23 | cols = Icur->width; |
| 26 | 24 | ||
| 27 | printf("start\n"); | 25 | for_each_job { |
| 28 | for_each_job{ | ||
| 29 | v = harris(Icur); | 26 | v = harris(Icur); |
| 30 | interestPnts = getANMS(v, 24); | 27 | interestPnts = getANMS(v, 24); |
| 31 | int1 = fMallocHandle(interestPnts->height, 1); | 28 | int1 = fMallocHandle(interestPnts->height, 1); |
| @@ -38,10 +35,8 @@ int main(int argc, char* argv[]) | |||
| 38 | 35 | ||
| 39 | Fcur = extractFeatures(Icur, int1, int2); | 36 | Fcur = extractFeatures(Icur, int1, int2); |
| 40 | } | 37 | } |
| 41 | printf("end..\n"); | ||
| 42 | |||
| 43 | 38 | ||
| 44 | #ifdef CHECK | 39 | #ifdef CHECK |
| 45 | /** Self checking - use expected.txt from data directory **/ | 40 | /** Self checking - use expected.txt from data directory **/ |
| 46 | { | 41 | { |
| 47 | int ret=0; | 42 | int ret=0; |
diff --git a/SD-VBS/benchmarks/svm/src/c/script_svm.c b/SD-VBS/benchmarks/svm/src/c/script_svm.c index 62a264d..f1ce963 100644 --- a/SD-VBS/benchmarks/svm/src/c/script_svm.c +++ b/SD-VBS/benchmarks/svm/src/c/script_svm.c | |||
| @@ -70,24 +70,23 @@ int main(int argc, char* argv[]) | |||
| 70 | #endif | 70 | #endif |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | printf("trn file 1: "); | 73 | // trn file 1 |
| 74 | scanf("%s", im1); | 74 | scanf("%s", im1); |
| 75 | trn1 = readFile(im1); | 75 | trn1 = readFile(im1); |
| 76 | 76 | ||
| 77 | printf("trn file 2: "); | 77 | // trn file 2 |
| 78 | scanf("%s", im1); | 78 | scanf("%s", im1); |
| 79 | trn2 = readFile(im1); | 79 | trn2 = readFile(im1); |
| 80 | 80 | ||
| 81 | printf("tst file 1: "); | 81 | // tst file 1 |
| 82 | scanf("%s", im1); | 82 | scanf("%s", im1); |
| 83 | tst1 = readFile(im1); | 83 | tst1 = readFile(im1); |
| 84 | 84 | ||
| 85 | printf("tst file 2: "); | 85 | // tst file 2 |
| 86 | scanf("%s", im1); | 86 | scanf("%s", im1); |
| 87 | tst2 = readFile(im1); | 87 | tst2 = readFile(im1); |
| 88 | 88 | ||
| 89 | printf("start.\n"); | 89 | for_each_job { |
| 90 | for_each_job{ | ||
| 91 | alpha = getAlphaFromTrainSet(N, trn1, trn2, iter); | 90 | alpha = getAlphaFromTrainSet(N, trn1, trn2, iter); |
| 92 | a_result = alpha->a_result; | 91 | a_result = alpha->a_result; |
| 93 | b_result = alpha->b_result; | 92 | b_result = alpha->b_result; |
| @@ -135,8 +134,8 @@ int main(int argc, char* argv[]) | |||
| 135 | asubsref(result,n) = maxs; | 134 | asubsref(result,n) = maxs; |
| 136 | } | 135 | } |
| 137 | } | 136 | } |
| 138 | printf("end..\n"); | 137 | |
| 139 | #ifdef CHECK | 138 | #ifdef CHECK |
| 140 | /** Self checking - use expected.txt from data directory **/ | 139 | /** Self checking - use expected.txt from data directory **/ |
| 141 | { | 140 | { |
| 142 | int ret=0; | 141 | int ret=0; |
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c index 01ddefd..2ebb423 100644 --- a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c +++ b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c | |||
| @@ -27,11 +27,10 @@ int main(int argc, char **argv) | |||
| 27 | image = fiDeepCopy(im); | 27 | image = fiDeepCopy(im); |
| 28 | init_params(data); | 28 | init_params(data); |
| 29 | 29 | ||
| 30 | printf("start.\n"); | 30 | for_each_job { |
| 31 | for_each_job{ | ||
| 32 | create_texture(image, data); | 31 | create_texture(image, data); |
| 33 | } | 32 | } |
| 34 | printf("end..\n"); | 33 | |
| 35 | #ifdef CHECK | 34 | #ifdef CHECK |
| 36 | { | 35 | { |
| 37 | int ret=0; | 36 | int ret=0; |
| @@ -59,7 +58,6 @@ I2D* parse_flags(int argc, char ** argv) | |||
| 59 | I2D* image; | 58 | I2D* image; |
| 60 | char fileNm[256]; | 59 | char fileNm[256]; |
| 61 | 60 | ||
| 62 | printf("Input image: "); | ||
| 63 | scanf("%s", fileNm); | 61 | scanf("%s", fileNm); |
| 64 | image = readImage(fileNm); | 62 | image = readImage(fileNm); |
| 65 | WIDTHin = image->width; | 63 | WIDTHin = image->width; |
| @@ -122,7 +120,7 @@ I2D* parse_flags(int argc, char ** argv) | |||
| 122 | localx = 5; | 120 | localx = 5; |
| 123 | localy = 5; | 121 | localy = 5; |
| 124 | #endif | 122 | #endif |
| 125 | printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin); | 123 | // printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin); |
| 126 | 124 | ||
| 127 | // xloopin = malloc(2*WIDTHin*sizeof(int)); | 125 | // xloopin = malloc(2*WIDTHin*sizeof(int)); |
| 128 | // yloopin = malloc(2*HEIGHTin*sizeof(int)); | 126 | // yloopin = malloc(2*HEIGHTin*sizeof(int)); |
diff --git a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c index bb48ace..c0af2d7 100644 --- a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c +++ b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c | |||
| @@ -93,22 +93,18 @@ int main(int argc, char* argv[]) | |||
| 93 | 93 | ||
| 94 | I2D* images[counter]; | 94 | I2D* images[counter]; |
| 95 | /** Read input image **/ | 95 | /** Read input image **/ |
| 96 | for(count=1; count<=counter; count++) | 96 | for(count=1; count<=counter; count++){ |
| 97 | { | 97 | /** Read Image **/ |
| 98 | /** Read image **/ | 98 | scanf("%s", im1); |
| 99 | printf("Input image %d: ", count); | ||
| 100 | scanf("%s", im1); | ||
| 101 | images[count - 1] = readImage(im1); | 99 | images[count - 1] = readImage(im1); |
| 102 | if(count == 1) Ic = readImage(im1); | 100 | if(count == 1) Ic = readImage(im1); |
| 103 | } | 101 | } |
| 104 | 102 | ||
| 105 | 103 | ||
| 106 | rows = Ic->height; | 104 | rows = Ic->height; |
| 107 | cols = Ic->width; | 105 | cols = Ic->width; |
| 108 | 106 | ||
| 109 | printf("start\n"); | 107 | for_each_job { |
| 110 | for_each_job{ | ||
| 111 | |||
| 112 | /** IMAGE PRE-PROCESSING **/ | 108 | /** IMAGE PRE-PROCESSING **/ |
| 113 | 109 | ||
| 114 | /** Blur the image to remove noise - weighted avergae filter **/ | 110 | /** Blur the image to remove noise - weighted avergae filter **/ |
| @@ -230,8 +226,7 @@ int main(int argc, char* argv[]) | |||
| 230 | fFreeHandle(newpoints); | 226 | fFreeHandle(newpoints); |
| 231 | } | 227 | } |
| 232 | } | 228 | } |
| 233 | printf("end..\n"); | 229 | #ifdef CHECK |
| 234 | #ifdef CHECK | ||
| 235 | /* Self checking */ | 230 | /* Self checking */ |
| 236 | { | 231 | { |
| 237 | int ret=0; | 232 | int ret=0; |
diff --git a/SD-VBS/common/makefiles/Makefile.common b/SD-VBS/common/makefiles/Makefile.common index 144adb2..964ece6 100644 --- a/SD-VBS/common/makefiles/Makefile.common +++ b/SD-VBS/common/makefiles/Makefile.common | |||
| @@ -18,7 +18,7 @@ endif | |||
| 18 | endif | 18 | endif |
| 19 | 19 | ||
| 20 | CC=gcc | 20 | CC=gcc |
| 21 | override CFLAGS += -DGCC -D$(INPUT) -pthread -DCHECK | 21 | override CFLAGS += -DGCC -D$(INPUT) -pthread -I../../../../.. |
| 22 | COMMON_DIR := $(TOP_DIR)/common/c | 22 | COMMON_DIR := $(TOP_DIR)/common/c |
| 23 | M_COMMON := $(TOP_DIR)/common/matlab | 23 | M_COMMON := $(TOP_DIR)/common/matlab |
| 24 | M_TOOLBOX=$(TOP_DIR)/common/toolbox | 24 | M_TOOLBOX=$(TOP_DIR)/common/toolbox |
| @@ -28,7 +28,11 @@ PRELOAD_TIMES_DIR := $(TOP_DIR)/preload-times/$(BMARK) | |||
| 28 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) | 28 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) |
| 29 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) | 29 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) |
| 30 | TOOL_DIR := $(TOP_DIR)/tools | 30 | TOOL_DIR := $(TOP_DIR)/tools |
| 31 | LIBLITMUS := /home/litmus/liblitmus | 31 | LIBLITMUS ?= /home/litmus/liblitmus |
| 32 | ifneq ($(shell grep "define LITMUS 1" ../../../../../extra.h),) | ||
| 33 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | ||
| 34 | override LDFLAGS += -L${LIBLITMUS} -llitmus | ||
| 35 | endif | ||
| 32 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. | 36 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. |
| 33 | 37 | ||
| 34 | # Variables exported from the benchmark specific Makefiles: | 38 | # Variables exported from the benchmark specific Makefiles: |
| @@ -55,8 +59,8 @@ COMMON_SRC := $(wildcard $(COMMON_DIR)/*.c) | |||
| 55 | # RULES | 59 | # RULES |
| 56 | 60 | ||
| 57 | EXE = | 61 | EXE = |
| 58 | INCLUDES = -I$(COMMON_DIR) -I$(C_DIR) -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 62 | INCLUDES = -I$(COMMON_DIR) -I$(C_DIR) |
| 59 | COMPILE_C = $(CC) $(CFLAGS) $(INCLUDES) -O2 | 63 | COMPILE_C = $(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDES) -O2 |
| 60 | #COMPILE_C = $(CC) $(CFLAGS) -DGENERATE_OUTPUT -lm -O2 $(INCLUDES) | 64 | #COMPILE_C = $(CC) $(CFLAGS) -DGENERATE_OUTPUT -lm -O2 $(INCLUDES) |
| 61 | COMPILE_G = $(CC) $(CFLAGS) -g -lm $(INCLUDES) | 65 | COMPILE_G = $(CC) $(CFLAGS) -g -lm $(INCLUDES) |
| 62 | COMPILE_PG = $(COMPILE_G) -pg | 66 | COMPILE_PG = $(COMPILE_G) -pg |
| @@ -107,7 +111,7 @@ compile-preload: | |||
| 107 | compile: $(C_SRC) | 111 | compile: $(C_SRC) |
| 108 | @echo | 112 | @echo |
| 109 | @echo -e "Benchmark\t\t- $(BMARK)" | 113 | @echo -e "Benchmark\t\t- $(BMARK)" |
| 110 | @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -L$(LIBLITMUS) -llitmus -lm -w -o $(BMARK)$(EXE) | 114 | @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -lm -w -o $(BMARK)$(EXE) |
| 111 | 115 | ||
| 112 | compile-prof: $(C_SRC) | 116 | compile-prof: $(C_SRC) |
| 113 | @echo | 117 | @echo |
diff --git a/SD-VBS/disparity_qcif b/SD-VBS/disparity_qcif new file mode 120000 index 0000000..9874fe6 --- /dev/null +++ b/SD-VBS/disparity_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/disparity/data/qcif/disparity \ No newline at end of file | |||
diff --git a/SD-VBS/localization_qcif b/SD-VBS/localization_qcif new file mode 120000 index 0000000..d81d27e --- /dev/null +++ b/SD-VBS/localization_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/localization/data/qcif/localization \ No newline at end of file | |||
diff --git a/SD-VBS/mser_qcif b/SD-VBS/mser_qcif new file mode 120000 index 0000000..8121c92 --- /dev/null +++ b/SD-VBS/mser_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/mser/data/qcif/mser \ No newline at end of file | |||
diff --git a/SD-VBS/multi_ncut_qcif b/SD-VBS/multi_ncut_qcif new file mode 120000 index 0000000..e3f755f --- /dev/null +++ b/SD-VBS/multi_ncut_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/multi_ncut/data/qcif/multi_ncut \ No newline at end of file | |||
diff --git a/SD-VBS/sd-vbsNames.txt b/SD-VBS/sd-vbsNames.txt new file mode 100644 index 0000000..23b168d --- /dev/null +++ b/SD-VBS/sd-vbsNames.txt | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | disparity_qcif echo -e "./benchmarks/disparity/data/qcif/1.bmp\\n./benchmarks/disparity/data/qcif/2.bmp" | ||
| 2 | localization_qcif echo "./benchmarks/localization/data/qcif/1.txt" | ||
| 3 | mser_qcif echo "./benchmarks/mser/data/qcif/1.bmp" | ||
| 4 | multi_ncut_qcif echo "./benchmarks/multi_ncut/data/qcif/1.bmp" | ||
| 5 | sift_qcif echo "./benchmarks/sift/data/qcif/1.bmp" | ||
| 6 | stitch_qcif echo "./benchmarks/stitch/data/qcif/1.bmp" | ||
| 7 | svm_qcif echo -e "./benchmarks/svm/data/qcif/d16trn_1.txt\\n./benchmarks/svm/data/qcif/d16trn_2.txt\\n./benchmarks/svm/data/qcif/d16tst_1.txt\\n./benchmarks/svm/data/qcif/d16tst_2.txt" | ||
| 8 | texture_synthesis_qcif echo "./benchmarks/texture_synthesis/data/qcif/1.bmp" | ||
| 9 | tracking_qcif echo -e "./benchmarks/tracking/data/qcif/1.bmp\\n./benchmarks/tracking/data/qcif/2.bmp\\n./benchmarks/tracking/data/qcif/3.bmp\\n./benchmarks/tracking/data/qcif/4.bmp" | ||
diff --git a/SD-VBS/sift_qcif b/SD-VBS/sift_qcif new file mode 120000 index 0000000..724930b --- /dev/null +++ b/SD-VBS/sift_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/sift/data/qcif/sift \ No newline at end of file | |||
diff --git a/SD-VBS/stitch_qcif b/SD-VBS/stitch_qcif new file mode 120000 index 0000000..0b05a84 --- /dev/null +++ b/SD-VBS/stitch_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/stitch/data/qcif/stitch \ No newline at end of file | |||
diff --git a/SD-VBS/svm_qcif b/SD-VBS/svm_qcif new file mode 120000 index 0000000..a8dc348 --- /dev/null +++ b/SD-VBS/svm_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/svm/data/qcif/svm \ No newline at end of file | |||
diff --git a/SD-VBS/texture_synthesis_qcif b/SD-VBS/texture_synthesis_qcif new file mode 120000 index 0000000..e198a53 --- /dev/null +++ b/SD-VBS/texture_synthesis_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/texture_synthesis/data/qcif/texture_synthesis \ No newline at end of file | |||
diff --git a/SD-VBS/tracking_qcif b/SD-VBS/tracking_qcif new file mode 120000 index 0000000..683191e --- /dev/null +++ b/SD-VBS/tracking_qcif | |||
| @@ -0,0 +1 @@ | |||
| benchmarks/tracking/data/qcif/tracking \ No newline at end of file | |||
diff --git a/all_pairs/Makefile b/all_pairs/Makefile index 0042372..592db70 100644 --- a/all_pairs/Makefile +++ b/all_pairs/Makefile | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | LIBLITMUS ?= /media/speedy/litmus/liblitmus | 1 | LIBLITMUS ?= /playpen/mc2/liblitmus |
| 2 | CC ?= gcc | 2 | CC ?= gcc |
| 3 | CFLAGS = -pthread -O2 -I.. -DPAIRED | 3 | override CFLAGS += -pthread -O2 -I.. -DPAIRED |
| 4 | LDFLAGS = -lrt | 4 | LDFLAGS += -lrt |
| 5 | COMMON = ../extra.h | 5 | COMMON = ../extra.h |
| 6 | 6 | ||
| 7 | # Handle cases where we're also profiling with the MMDC on the i.MX6Q | 7 | # Handle cases where we're also profiling with the MMDC on the i.MX6Q |
| @@ -11,8 +11,8 @@ endif | |||
| 11 | 11 | ||
| 12 | # Include all the LITMUS^RT headers if we're using it | 12 | # Include all the LITMUS^RT headers if we're using it |
| 13 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) | 13 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) |
| 14 | CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 14 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include |
| 15 | LDFLAGS += -L${LIBLITMUS} -llitmus | 15 | override LDFLAGS += -L${LIBLITMUS} -llitmus |
| 16 | endif | 16 | endif |
| 17 | 17 | ||
| 18 | all: bin/cjpeg_wrbmp bin/huff_enc bin/gsm_enc bin/dijkstra bin/h264_dec bin/susan bin/adpcm_enc bin/rijndael_dec bin/huff_dec bin/rijndael_enc bin/gsm_dec bin/anagram bin/epic bin/ammunition bin/g723_enc bin/ndes bin/petrinet bin/statemate bin/cjpeg_transupp bin/mpeg2 bin/fmref bin/audiobeam bin/adpcm_dec | 18 | all: bin/cjpeg_wrbmp bin/huff_enc bin/gsm_enc bin/dijkstra bin/h264_dec bin/susan bin/adpcm_enc bin/rijndael_dec bin/huff_dec bin/rijndael_enc bin/gsm_dec bin/anagram bin/epic bin/ammunition bin/g723_enc bin/ndes bin/petrinet bin/statemate bin/cjpeg_transupp bin/mpeg2 bin/fmref bin/audiobeam bin/adpcm_dec |
diff --git a/all_pairs/run_all_pairs.sh b/all_pairs/run_all_pairs.sh deleted file mode 100755 index 2260216..0000000 --- a/all_pairs/run_all_pairs.sh +++ /dev/null | |||
| @@ -1,168 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | userRunID=$4 | ||
| 7 | tacleNames=tacleNames.txt | ||
| 8 | |||
| 9 | if [ $# -lt 4 ]; then | ||
| 10 | echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | |||
| 14 | if [ $# -gt 4 ]; then | ||
| 15 | echo "Using alternate list of TACLe benchmarks from $5" | ||
| 16 | tacleNames=$5 | ||
| 17 | fi | ||
| 18 | |||
| 19 | if [ "$EUID" -ne 0 ] | ||
| 20 | then | ||
| 21 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 22 | exit | ||
| 23 | fi | ||
| 24 | |||
| 25 | echo "Making sure that binaries are up to date..." | ||
| 26 | while read i; do | ||
| 27 | make bin/$i | ||
| 28 | done < $tacleNames | ||
| 29 | echo "Done. Disabling real-time throttling..." | ||
| 30 | |||
| 31 | # Turn off rt throttling | ||
| 32 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 33 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 34 | |||
| 35 | # Redirect all interrupts to core 0 | ||
| 36 | i=0 | ||
| 37 | for IRQ in /proc/irq/* | ||
| 38 | do | ||
| 39 | # Skip default_smp_affinity | ||
| 40 | if [ -d $IRQ ]; then | ||
| 41 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 42 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 43 | fi | ||
| 44 | i=$(( $i + 1 )) | ||
| 45 | done | ||
| 46 | |||
| 47 | # Read the names of each benchmark | ||
| 48 | j=0 | ||
| 49 | while read i; do | ||
| 50 | tacleProg[$j]=$i | ||
| 51 | j=$(( $j + 1 )) | ||
| 52 | done < $tacleNames | ||
| 53 | |||
| 54 | echo "Done. Checking for wbinvd module..." | ||
| 55 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 56 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 57 | exit | ||
| 58 | fi | ||
| 59 | |||
| 60 | echo "Done. Setting cores $firstCore and $secondCore to 'performance'..." | ||
| 61 | echo "performance" > /sys/devices/system/cpu/cpu$firstCore/cpufreq/scaling_governor | ||
| 62 | echo "performance" > /sys/devices/system/cpu/cpu$secondCore/cpufreq/scaling_governor | ||
| 63 | |||
| 64 | # Enable L3 isolation | ||
| 65 | echo "Done. Enabling L3 isolation..." | ||
| 66 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 67 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 68 | echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 69 | echo $secondCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 70 | # Reset global bandwith control and remove L3 from global | ||
| 71 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 72 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 73 | # Alloc L3 to benchmark | ||
| 74 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 75 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 76 | echo "Done. Verifying configuration with user..." | ||
| 77 | |||
| 78 | # Generate file name string | ||
| 79 | # We append to this as we parse the environment settings | ||
| 80 | runID=$(date +"%b%d-%H") | ||
| 81 | |||
| 82 | # Confirm configuration with user | ||
| 83 | echo "=== Global Config ===" | ||
| 84 | cat /sys/fs/resctrl/schemata | ||
| 85 | echo "=== Core $firstCore and $secondCore Config ===" | ||
| 86 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 87 | if [[ $6 == "--contend" ]]; then | ||
| 88 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 89 | echo "ERROR: thrasher binary not fonud. Exiting..." | ||
| 90 | exit | ||
| 91 | fi | ||
| 92 | echo "Will run 6 contending tasks" | ||
| 93 | runID=$runID-c | ||
| 94 | else | ||
| 95 | runID=$runID-xc | ||
| 96 | fi | ||
| 97 | if uname -a | grep -q "mc2"; then | ||
| 98 | echo "MC^2 Autodetected. Cache coloring will be enabled." | ||
| 99 | runID=$runID-i | ||
| 100 | else | ||
| 101 | echo "MC^2 not detected. Cache coloring will be DISABLED." | ||
| 102 | runID=$runID-xi | ||
| 103 | fi | ||
| 104 | if pwd | grep -qi dis; then | ||
| 105 | echo "Autodetected DIS. Will use script-level looping." | ||
| 106 | fi | ||
| 107 | echo "Results will be saved as $runID-$userRunID-A.txt and $runID-$userRunID-B.txt" | ||
| 108 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 109 | read | ||
| 110 | |||
| 111 | # Start contending tasks | ||
| 112 | if [[ $6 == "--contend" ]]; then | ||
| 113 | echo "Done. Starting 6 contending tasks..." | ||
| 114 | # Run two contending tasks on each other CCX | ||
| 115 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 116 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 117 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 118 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 119 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 120 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 121 | fi | ||
| 122 | sleep 1 # Wait for contending tasks to start | ||
| 123 | echo "Done. Beginning benchmarks..." | ||
| 124 | |||
| 125 | num_tests=$(wc -l < $tacleNames) | ||
| 126 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 127 | do | ||
| 128 | for (( j = $i; j < $num_tests ; j++ )) #loop through programs | ||
| 129 | do | ||
| 130 | # If using DIS, we have to iterate in the script as DIS won't do it for us | ||
| 131 | pwd | grep -qi dis | ||
| 132 | iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))") | ||
| 133 | for ((k=0;k<=iters;k++)); do | ||
| 134 | # Autodetect MC^2 | ||
| 135 | if uname -a | grep -q "mc2"; then | ||
| 136 | chrt -r 97 numactl -m 0 taskset -c $firstCore ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $firstCore $secondCore ${tacleProg[$j]} $runID-$userRunID"-A" 1 & PID1=$!; | ||
| 137 | chrt -r 97 numactl -m 1 taskset -c $secondCore ./bin/${tacleProg[$j]} ${tacleProg[$j]} $maxJobs $secondCore $firstCore ${tacleProg[$i]} $runID-$userRunID"-B" 2 & PID2=$!; | ||
| 138 | else | ||
| 139 | chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $firstCore $secondCore ${tacleProg[$j]} $runID-$userRunID-A 1 & PID1=$!; | ||
| 140 | chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$j]} ${tacleProg[$j]} $maxJobs $secondCore $firstCore ${tacleProg[$i]} $runID-$userRunID-B 2 & PID2=$!; | ||
| 141 | fi | ||
| 142 | wait $PID1 $PID2 | ||
| 143 | done | ||
| 144 | echo ${tacleProg[$i]} ${tacleProg[$j]} | ||
| 145 | done | ||
| 146 | echo COMPLETE: ${tacleProg[$i]} | ||
| 147 | done | ||
| 148 | |||
| 149 | # End contending tasks | ||
| 150 | if [[ $6 == "--contend" ]]; then | ||
| 151 | killall thrasher | ||
| 152 | fi | ||
| 153 | |||
| 154 | # Remove semaphores from system | ||
| 155 | # Leaving them won't hurt these tests, but would be messy and is bad practice | ||
| 156 | # TODO: Do this directly in the benchmarks. They should clean up after themselves | ||
| 157 | ./bin/cleanupSemaphores | ||
| 158 | |||
| 159 | # Put smp_affinty back the way it was | ||
| 160 | i=0 | ||
| 161 | for IRQ in /proc/irq/* | ||
| 162 | do | ||
| 163 | if [ -d $IRQ ]; then | ||
| 164 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 165 | fi | ||
| 166 | i=$(( $i + 1 )) | ||
| 167 | done | ||
| 168 | |||
diff --git a/all_pairs/run_all_pairs_L3_ONLY.sh b/all_pairs/run_all_pairs_L3_ONLY.sh deleted file mode 100755 index 8ed5eeb..0000000 --- a/all_pairs/run_all_pairs_L3_ONLY.sh +++ /dev/null | |||
| @@ -1,170 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | userRunID=$4 | ||
| 7 | tacleNames=tacleNames.txt | ||
| 8 | |||
| 9 | if [ $# -lt 4 ]; then | ||
| 10 | echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | |||
| 14 | if [ $# -gt 4 ]; then | ||
| 15 | echo "Using alternate list of TACLe benchmarks from $5" | ||
| 16 | tacleNames=$5 | ||
| 17 | fi | ||
| 18 | |||
| 19 | if [ "$EUID" -ne 0 ] | ||
| 20 | then | ||
| 21 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 22 | exit | ||
| 23 | fi | ||
| 24 | |||
| 25 | echo "Making sure that binaries are up to date..." | ||
| 26 | while read i; do | ||
| 27 | make bin/$i | ||
| 28 | done < $tacleNames | ||
| 29 | echo "Done. Disabling real-time throttling..." | ||
| 30 | |||
| 31 | # Turn off rt throttling | ||
| 32 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 33 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 34 | |||
| 35 | # Redirect all interrupts to core 0 | ||
| 36 | i=0 | ||
| 37 | for IRQ in /proc/irq/* | ||
| 38 | do | ||
| 39 | # Skip default_smp_affinity | ||
| 40 | if [ -d $IRQ ]; then | ||
| 41 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 42 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 43 | fi | ||
| 44 | i=$(( $i + 1 )) | ||
| 45 | done | ||
| 46 | |||
| 47 | # Read the names of each benchmark | ||
| 48 | j=0 | ||
| 49 | while read i; do | ||
| 50 | tacleProg[$j]=$i | ||
| 51 | j=$(( $j + 1 )) | ||
| 52 | done < $tacleNames | ||
| 53 | |||
| 54 | echo "Done. Checking for wbinvd module..." | ||
| 55 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 56 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 57 | exit | ||
| 58 | fi | ||
| 59 | |||
| 60 | # Enable L3 isolation | ||
| 61 | echo "Done. Enabling L3 isolation..." | ||
| 62 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 63 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 64 | mkdir -p /sys/fs/resctrl/benchmarks2 | ||
| 65 | echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 66 | echo $secondCore > /sys/fs/resctrl/benchmarks2/cpus_list | ||
| 67 | # Reset global bandwith control and remove L3 from global | ||
| 68 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 69 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 70 | # Alloc half L3 to benchmark | ||
| 71 | echo "L3:0=0000;1=0000;2=0000;3=ff00" > /sys/fs/resctrl/benchmarks/schemata | ||
| 72 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 73 | # Alloc other half L3 to benchmark2 | ||
| 74 | echo "L3:0=0000;1=0000;2=0000;3=00ff" > /sys/fs/resctrl/benchmarks2/schemata | ||
| 75 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks2/schemata | ||
| 76 | echo "Done. Verifying configuration with user..." | ||
| 77 | |||
| 78 | # Generate file name string | ||
| 79 | # We append to this as we parse the environment settings | ||
| 80 | runID=$(date +"%b%d-%H") | ||
| 81 | |||
| 82 | # Confirm configuration with user | ||
| 83 | echo "=== Global Config ===" | ||
| 84 | cat /sys/fs/resctrl/schemata | ||
| 85 | echo "=== Core $firstCore Config ===" | ||
| 86 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 87 | echo "=== Core $secondCore Config ===" | ||
| 88 | cat /sys/fs/resctrl/benchmarks2/schemata | ||
| 89 | if [[ $6 == "--contend" ]]; then | ||
| 90 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 91 | echo "ERROR: thrasher binary not found. Exiting..." | ||
| 92 | exit | ||
| 93 | fi | ||
| 94 | echo "Will run 6 contending tasks" | ||
| 95 | runID=$runID-c | ||
| 96 | else | ||
| 97 | runID=$runID-xc | ||
| 98 | fi | ||
| 99 | if uname -a | grep -q "mc2"; then | ||
| 100 | echo "MC^2 Autodetected. Not supported by this script!." | ||
| 101 | exit | ||
| 102 | else | ||
| 103 | echo "MC^2 not detected. Cache coloring will be enabled in the L3 only.." | ||
| 104 | runID=$runID-i3 | ||
| 105 | fi | ||
| 106 | if pwd | grep -qi dis; then | ||
| 107 | echo "Autodetected DIS. Will use script-level looping." | ||
| 108 | fi | ||
| 109 | echo "Results will be saved as $runID-$userRunID-A.txt and $runID-$userRunID-B.txt" | ||
| 110 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 111 | read | ||
| 112 | |||
| 113 | # Start contending tasks | ||
| 114 | if [[ $6 == "--contend" ]]; then | ||
| 115 | echo "Done. Starting 6 contending tasks..." | ||
| 116 | # Run two contending tasks on each other CCX | ||
| 117 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 118 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 119 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 120 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 121 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 122 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 123 | fi | ||
| 124 | sleep 1 # Wait for contending tasks to start | ||
| 125 | echo "Done. Beginning benchmarks..." | ||
| 126 | |||
| 127 | num_tests=$(wc -l < $tacleNames) | ||
| 128 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 129 | do | ||
| 130 | for (( j = $i; j < $num_tests ; j++ )) #loop through programs | ||
| 131 | do | ||
| 132 | # If using DIS, we have to iterate in the script as DIS won't do it for us | ||
| 133 | pwd | grep -qi dis | ||
| 134 | iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))") | ||
| 135 | for ((k=0;k<=iters;k++)); do | ||
| 136 | # Autodetect MC^2 | ||
| 137 | if uname -a | grep -q "mc2"; then | ||
| 138 | chrt -r 97 numactl -m 0 taskset -c $firstCore ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $firstCore $secondCore ${tacleProg[$j]} $runID-$userRunID"-A" 1 & PID1=$!; | ||
| 139 | chrt -r 97 numactl -m 1 taskset -c $secondCore ./bin/${tacleProg[$j]} ${tacleProg[$j]} $maxJobs $secondCore $firstCore ${tacleProg[$i]} $runID-$userRunID"-B" 2 & PID2=$!; | ||
| 140 | else | ||
| 141 | chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $firstCore $secondCore ${tacleProg[$j]} $runID-$userRunID-A 1 & PID1=$!; | ||
| 142 | chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$j]} ${tacleProg[$j]} $maxJobs $secondCore $firstCore ${tacleProg[$i]} $runID-$userRunID-B 2 & PID2=$!; | ||
| 143 | fi | ||
| 144 | wait $PID1 $PID2 | ||
| 145 | done | ||
| 146 | echo ${tacleProg[$i]} ${tacleProg[$j]} | ||
| 147 | done | ||
| 148 | echo COMPLETE: ${tacleProg[$i]} | ||
| 149 | done | ||
| 150 | |||
| 151 | # End contending tasks | ||
| 152 | if [[ $6 == "--contend" ]]; then | ||
| 153 | killall thrasher | ||
| 154 | fi | ||
| 155 | |||
| 156 | # Remove semaphores from system | ||
| 157 | # Leaving them won't hurt these tests, but would be messy and is bad practice | ||
| 158 | # TODO: Do this directly in the benchmarks. They should clean up after themselves | ||
| 159 | ./bin/cleanupSemaphores | ||
| 160 | |||
| 161 | # Put smp_affinty back the way it was | ||
| 162 | i=0 | ||
| 163 | for IRQ in /proc/irq/* | ||
| 164 | do | ||
| 165 | if [ -d $IRQ ]; then | ||
| 166 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 167 | fi | ||
| 168 | i=$(( $i + 1 )) | ||
| 169 | done | ||
| 170 | |||
diff --git a/all_pairs/source/anagram/anagram.c b/all_pairs/source/anagram/anagram.c index fc8b6a8..feb9784 100644 --- a/all_pairs/source/anagram/anagram.c +++ b/all_pairs/source/anagram/anagram.c | |||
| @@ -305,10 +305,10 @@ void anagram_ReadDict( void ) | |||
| 305 | _Pragma( "loopbound min 1 max 5" ) | 305 | _Pragma( "loopbound min 1 max 5" ) |
| 306 | while ( anagram_dictionary[ i ][ strlen ] != 0 ) | 306 | while ( anagram_dictionary[ i ][ strlen ] != 0 ) |
| 307 | strlen ++; | 307 | strlen ++; |
| 308 | len += strlen + 2; | 308 | len += strlen + 3; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len ); | 311 | pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len + 1 ); |
| 312 | 312 | ||
| 313 | _Pragma( "loopbound min 2279 max 2279" ) | 313 | _Pragma( "loopbound min 2279 max 2279" ) |
| 314 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { | 314 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { |
| @@ -346,7 +346,7 @@ void anagram_init( void ) | |||
| 346 | int anagram_return( void ) | 346 | int anagram_return( void ) |
| 347 | { | 347 | { |
| 348 | int i; | 348 | int i; |
| 349 | char const *answer = "duke rip amy"; | 349 | char const *answer = "duke yip arm"; |
| 350 | 350 | ||
| 351 | for ( i = 0; i < 12; i++ ) | 351 | for ( i = 0; i < 12; i++ ) |
| 352 | if ( answer[ i ] != anagram_buffer[ i ] ) | 352 | if ( answer[ i ] != anagram_buffer[ i ] ) |
diff --git a/all_pairs/source/anagram/anagram_stdlib.c b/all_pairs/source/anagram/anagram_stdlib.c index c766a5e..5c9f3fc 100644 --- a/all_pairs/source/anagram/anagram_stdlib.c +++ b/all_pairs/source/anagram/anagram_stdlib.c | |||
| @@ -126,7 +126,7 @@ void anagram_qsort( void *va, unsigned long n, unsigned long es ) | |||
| 126 | 126 | ||
| 127 | 127 | ||
| 128 | /* This must be redefined for each new benchmark */ | 128 | /* This must be redefined for each new benchmark */ |
| 129 | #define ANAGRAM_HEAP_SIZE 18000 | 129 | #define ANAGRAM_HEAP_SIZE 20388 |
| 130 | 130 | ||
| 131 | static char anagram_simulated_heap[ANAGRAM_HEAP_SIZE]; | 131 | static char anagram_simulated_heap[ANAGRAM_HEAP_SIZE]; |
| 132 | static unsigned int anagram_freeHeapPos; | 132 | static unsigned int anagram_freeHeapPos; |
diff --git a/all_pairs/source/huff_enc/huff_enc.c b/all_pairs/source/huff_enc/huff_enc.c index f2db552..6a0b901 100644 --- a/all_pairs/source/huff_enc/huff_enc.c +++ b/all_pairs/source/huff_enc/huff_enc.c | |||
| @@ -153,6 +153,8 @@ void huff_enc_init( void ) | |||
| 153 | { | 153 | { |
| 154 | huff_enc_input_pos = 0; | 154 | huff_enc_input_pos = 0; |
| 155 | huff_enc_output_pos = 0; | 155 | huff_enc_output_pos = 0; |
| 156 | huff_enc_byte_nb_to_write = 0; | ||
| 157 | huff_enc_val_to_write = 0; | ||
| 156 | } | 158 | } |
| 157 | 159 | ||
| 158 | 160 | ||
diff --git a/all_pairs/source/rijndael_dec/rijndael_dec.c b/all_pairs/source/rijndael_dec/rijndael_dec.c index c8f606b..5c0bea8 100644 --- a/all_pairs/source/rijndael_dec/rijndael_dec.c +++ b/all_pairs/source/rijndael_dec/rijndael_dec.c | |||
| @@ -68,6 +68,7 @@ void rijndael_dec_init( void ) | |||
| 68 | rijndael_dec_fin.data = rijndael_dec_data; | 68 | rijndael_dec_fin.data = rijndael_dec_data; |
| 69 | rijndael_dec_fin.size = 32768; | 69 | rijndael_dec_fin.size = 32768; |
| 70 | rijndael_dec_fin.cur_pos = 0; | 70 | rijndael_dec_fin.cur_pos = 0; |
| 71 | rijndael_dec_checksum = 0; | ||
| 71 | 72 | ||
| 72 | unsigned i; | 73 | unsigned i; |
| 73 | volatile int x = 0; | 74 | volatile int x = 0; |
diff --git a/all_pairs/tacleNames.txt b/all_pairs/tacleNames.txt index 8f4845a..2e02966 100644 --- a/all_pairs/tacleNames.txt +++ b/all_pairs/tacleNames.txt | |||
| @@ -1,19 +1,23 @@ | |||
| 1 | petrinet | 1 | petrinet |
| 2 | ndes | ||
| 3 | statemate | 2 | statemate |
| 4 | adpcm_dec | 3 | ndes |
| 4 | h264_dec | ||
| 5 | huff_dec | ||
| 5 | cjpeg_wrbmp | 6 | cjpeg_wrbmp |
| 7 | fmref | ||
| 8 | audiobeam | ||
| 9 | adpcm_dec | ||
| 6 | adpcm_enc | 10 | adpcm_enc |
| 11 | g723_enc | ||
| 12 | huff_enc | ||
| 13 | gsm_dec | ||
| 7 | cjpeg_transupp | 14 | cjpeg_transupp |
| 8 | dijkstra | ||
| 9 | epic | 15 | epic |
| 10 | fmref | 16 | anagram |
| 11 | gsm_dec | ||
| 12 | h264_dec | ||
| 13 | huff_enc | ||
| 14 | rijndael_enc | 17 | rijndael_enc |
| 15 | rijndael_dec | 18 | rijndael_dec |
| 16 | gsm_enc | 19 | gsm_enc |
| 17 | susan | 20 | susan |
| 21 | dijkstra | ||
| 18 | ammunition | 22 | ammunition |
| 19 | mpeg2 | 23 | mpeg2 |
diff --git a/baseline/Makefile b/baseline/Makefile index 40b57f4..a929bc6 100644 --- a/baseline/Makefile +++ b/baseline/Makefile | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | LIBLITMUS ?= /media/speedy/litmus/liblitmus | 1 | LIBLITMUS ?= /playpen/mc2/liblitmus |
| 2 | CC ?= gcc | 2 | CC ?= gcc |
| 3 | CFLAGS = -pthread -O2 -I.. | 3 | override CFLAGS = -pthread -O2 -I.. |
| 4 | LDFLAGS = -lrt | 4 | LDFLAGS = -lrt |
| 5 | COMMON = ../extra.h | 5 | COMMON = ../extra.h |
| 6 | 6 | ||
| @@ -11,8 +11,8 @@ endif | |||
| 11 | 11 | ||
| 12 | # Include all the LITMUS^RT headers if we're using it | 12 | # Include all the LITMUS^RT headers if we're using it |
| 13 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) | 13 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) |
| 14 | CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 14 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include |
| 15 | LDFLAGS += -L${LIBLITMUS} -llitmus | 15 | override LDFLAGS += -L${LIBLITMUS} -llitmus |
| 16 | endif | 16 | endif |
| 17 | 17 | ||
| 18 | all: bin/cjpeg_wrbmp bin/huff_enc bin/gsm_enc bin/dijkstra bin/h264_dec bin/susan bin/adpcm_enc bin/rijndael_dec bin/huff_dec bin/rijndael_enc bin/gsm_dec bin/anagram bin/epic bin/ammunition bin/g723_enc bin/ndes bin/petrinet bin/statemate bin/cjpeg_transupp bin/mpeg2 bin/fmref bin/audiobeam bin/adpcm_dec | 18 | all: bin/cjpeg_wrbmp bin/huff_enc bin/gsm_enc bin/dijkstra bin/h264_dec bin/susan bin/adpcm_enc bin/rijndael_dec bin/huff_dec bin/rijndael_enc bin/gsm_dec bin/anagram bin/epic bin/ammunition bin/g723_enc bin/ndes bin/petrinet bin/statemate bin/cjpeg_transupp bin/mpeg2 bin/fmref bin/audiobeam bin/adpcm_dec |
diff --git a/baseline/run_baseline_L3_ONLY.sh b/baseline/run_baseline_L3_ONLY.sh deleted file mode 100755 index 4183653..0000000 --- a/baseline/run_baseline_L3_ONLY.sh +++ /dev/null | |||
| @@ -1,152 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | core=$1 | ||
| 4 | maxJobs=$2 | ||
| 5 | userRunID=$3 | ||
| 6 | tacleNames=tacleNames.txt | ||
| 7 | |||
| 8 | if [ $# -lt 3 ]; then | ||
| 9 | echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 10 | exit | ||
| 11 | fi | ||
| 12 | |||
| 13 | if [ $# -gt 3 ]; then | ||
| 14 | echo "Using alternate list of TACLe benchmarks from $4" | ||
| 15 | tacleNames=$4 | ||
| 16 | fi | ||
| 17 | |||
| 18 | if [ "$EUID" -ne 0 ] | ||
| 19 | then | ||
| 20 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 21 | exit | ||
| 22 | fi | ||
| 23 | |||
| 24 | echo "Making sure that binaries are up to date..." | ||
| 25 | while read i; do | ||
| 26 | make bin/$i | ||
| 27 | done < $tacleNames | ||
| 28 | echo "Done. Disabling real-time throttling..." | ||
| 29 | |||
| 30 | # Turn off rt throttling | ||
| 31 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 32 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 33 | |||
| 34 | # Redirect all interrupts to core 0 | ||
| 35 | i=0 | ||
| 36 | for IRQ in /proc/irq/* | ||
| 37 | do | ||
| 38 | # Skip default_smp_affinity | ||
| 39 | if [ -d $IRQ ]; then | ||
| 40 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 41 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 42 | fi | ||
| 43 | i=$(( $i + 1 )) | ||
| 44 | done | ||
| 45 | |||
| 46 | # Read the names of each benchmark | ||
| 47 | j=0 | ||
| 48 | while read i; do | ||
| 49 | tacleProg[$j]=$i | ||
| 50 | j=$(( $j + 1 )) | ||
| 51 | done < $tacleNames | ||
| 52 | |||
| 53 | echo "Done. Checking for wbinvd module..." | ||
| 54 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 55 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 56 | exit | ||
| 57 | fi | ||
| 58 | |||
| 59 | # Enable L3 isolation | ||
| 60 | echo "Done. Enabling L3 isolation..." | ||
| 61 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 62 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 63 | echo $1 > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 64 | # Reset global bandwith control and remove L3 from global | ||
| 65 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 66 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 67 | # Alloc L3 to benchmark | ||
| 68 | echo "L3:0=0000;1=0000;2=0000;3=00ff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 69 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 70 | echo "Done. Verifying configuration with user..." | ||
| 71 | |||
| 72 | # Generate file name string | ||
| 73 | # We append to this as we parse the environment settings | ||
| 74 | runID=$(date +"%b%d-%H") | ||
| 75 | |||
| 76 | # Confirm configuration with user | ||
| 77 | echo "=== Global Config ===" | ||
| 78 | cat /sys/fs/resctrl/schemata | ||
| 79 | echo "=== Core $1 Config ===" | ||
| 80 | cat /sys/fs/resctrl/benchmarks/cpus_list | ||
| 81 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 82 | if [[ $5 == "--contend" ]]; then | ||
| 83 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 84 | echo "ERROR: thrasher binary not fonud. Exiting..." | ||
| 85 | exit | ||
| 86 | fi | ||
| 87 | echo "Will run 6 contending tasks" | ||
| 88 | runID=$runID-c | ||
| 89 | else | ||
| 90 | runID=$runID-xc | ||
| 91 | fi | ||
| 92 | if uname -a | grep -q "mc2"; then | ||
| 93 | echo "MC^2 Autodetected. NOT SUPPORTED. Exiting..." | ||
| 94 | exit | ||
| 95 | else | ||
| 96 | echo "MC^2 not detected. 50% L3 allocation enabled." | ||
| 97 | runID=$runID-i3 | ||
| 98 | fi | ||
| 99 | if pwd | grep -qi dis; then | ||
| 100 | echo "Autodetected DIS. Will use script-level looping." | ||
| 101 | fi | ||
| 102 | echo "Results will be saved as $runID-$userRunID.txt" | ||
| 103 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 104 | read | ||
| 105 | |||
| 106 | # Start contending tasks | ||
| 107 | if [[ $5 == "--contend" ]]; then | ||
| 108 | echo "Done. Starting 6 contending tasks..." | ||
| 109 | # Run two contending tasks on each other CCX | ||
| 110 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 111 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 112 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 113 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 114 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 115 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 116 | fi | ||
| 117 | sleep 1 # Wait for contending tasks to start | ||
| 118 | echo "Done. Beginning benchmarks..." | ||
| 119 | |||
| 120 | num_tests=$(wc -l < $tacleNames) | ||
| 121 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 122 | do | ||
| 123 | # If using DIS, we have to iterate in the script as DIS won't do it for us | ||
| 124 | pwd | grep -qi dis | ||
| 125 | iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))") | ||
| 126 | for ((k=0;k<=iters;k++)); do | ||
| 127 | # Check if we're using LITMUS^RT or not | ||
| 128 | if [[ -f source/extra.h ]] && grep -q "#define LITMUS 1" source/extra.h; then | ||
| 129 | ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | ||
| 130 | else | ||
| 131 | # Interleave memory allocations between all nodes (only 1 node w/out MC^2) | ||
| 132 | chrt -r 97 numactl --interleave=all taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | ||
| 133 | fi | ||
| 134 | done | ||
| 135 | echo COMPLETE: ${tacleProg[$i]} | ||
| 136 | done | ||
| 137 | |||
| 138 | # End contending tasks | ||
| 139 | if [[ $5 == "--contend" ]]; then | ||
| 140 | killall thrasher | ||
| 141 | fi | ||
| 142 | |||
| 143 | # Put smp_affinty back the way it was | ||
| 144 | i=0 | ||
| 145 | for IRQ in /proc/irq/* | ||
| 146 | do | ||
| 147 | if [ -d $IRQ ]; then | ||
| 148 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 149 | fi | ||
| 150 | i=$(( $i + 1 )) | ||
| 151 | done | ||
| 152 | |||
diff --git a/baseline/source/anagram/anagram.c b/baseline/source/anagram/anagram.c index fc8b6a8..feb9784 100644 --- a/baseline/source/anagram/anagram.c +++ b/baseline/source/anagram/anagram.c | |||
| @@ -305,10 +305,10 @@ void anagram_ReadDict( void ) | |||
| 305 | _Pragma( "loopbound min 1 max 5" ) | 305 | _Pragma( "loopbound min 1 max 5" ) |
| 306 | while ( anagram_dictionary[ i ][ strlen ] != 0 ) | 306 | while ( anagram_dictionary[ i ][ strlen ] != 0 ) |
| 307 | strlen ++; | 307 | strlen ++; |
| 308 | len += strlen + 2; | 308 | len += strlen + 3; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len ); | 311 | pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len + 1 ); |
| 312 | 312 | ||
| 313 | _Pragma( "loopbound min 2279 max 2279" ) | 313 | _Pragma( "loopbound min 2279 max 2279" ) |
| 314 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { | 314 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { |
| @@ -346,7 +346,7 @@ void anagram_init( void ) | |||
| 346 | int anagram_return( void ) | 346 | int anagram_return( void ) |
| 347 | { | 347 | { |
| 348 | int i; | 348 | int i; |
| 349 | char const *answer = "duke rip amy"; | 349 | char const *answer = "duke yip arm"; |
| 350 | 350 | ||
| 351 | for ( i = 0; i < 12; i++ ) | 351 | for ( i = 0; i < 12; i++ ) |
| 352 | if ( answer[ i ] != anagram_buffer[ i ] ) | 352 | if ( answer[ i ] != anagram_buffer[ i ] ) |
diff --git a/baseline/source/anagram/anagram_stdlib.c b/baseline/source/anagram/anagram_stdlib.c index c766a5e..5c9f3fc 100644 --- a/baseline/source/anagram/anagram_stdlib.c +++ b/baseline/source/anagram/anagram_stdlib.c | |||
| @@ -126,7 +126,7 @@ void anagram_qsort( void *va, unsigned long n, unsigned long es ) | |||
| 126 | 126 | ||
| 127 | 127 | ||
| 128 | /* This must be redefined for each new benchmark */ | 128 | /* This must be redefined for each new benchmark */ |
| 129 | #define ANAGRAM_HEAP_SIZE 18000 | 129 | #define ANAGRAM_HEAP_SIZE 20388 |
| 130 | 130 | ||
| 131 | static char anagram_simulated_heap[ANAGRAM_HEAP_SIZE]; | 131 | static char anagram_simulated_heap[ANAGRAM_HEAP_SIZE]; |
| 132 | static unsigned int anagram_freeHeapPos; | 132 | static unsigned int anagram_freeHeapPos; |
diff --git a/baseline/source/huff_enc/huff_enc.c b/baseline/source/huff_enc/huff_enc.c index f2db552..6a0b901 100644 --- a/baseline/source/huff_enc/huff_enc.c +++ b/baseline/source/huff_enc/huff_enc.c | |||
| @@ -153,6 +153,8 @@ void huff_enc_init( void ) | |||
| 153 | { | 153 | { |
| 154 | huff_enc_input_pos = 0; | 154 | huff_enc_input_pos = 0; |
| 155 | huff_enc_output_pos = 0; | 155 | huff_enc_output_pos = 0; |
| 156 | huff_enc_byte_nb_to_write = 0; | ||
| 157 | huff_enc_val_to_write = 0; | ||
| 156 | } | 158 | } |
| 157 | 159 | ||
| 158 | 160 | ||
diff --git a/baseline/source/rijndael_dec/rijndael_dec.c b/baseline/source/rijndael_dec/rijndael_dec.c index c8f606b..5c0bea8 100644 --- a/baseline/source/rijndael_dec/rijndael_dec.c +++ b/baseline/source/rijndael_dec/rijndael_dec.c | |||
| @@ -68,6 +68,7 @@ void rijndael_dec_init( void ) | |||
| 68 | rijndael_dec_fin.data = rijndael_dec_data; | 68 | rijndael_dec_fin.data = rijndael_dec_data; |
| 69 | rijndael_dec_fin.size = 32768; | 69 | rijndael_dec_fin.size = 32768; |
| 70 | rijndael_dec_fin.cur_pos = 0; | 70 | rijndael_dec_fin.cur_pos = 0; |
| 71 | rijndael_dec_checksum = 0; | ||
| 71 | 72 | ||
| 72 | unsigned i; | 73 | unsigned i; |
| 73 | volatile int x = 0; | 74 | volatile int x = 0; |
diff --git a/baseline/summarize.py b/baseline/summarize.py deleted file mode 100755 index 82f82d9..0000000 --- a/baseline/summarize.py +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | #!/usr/bin/python3 | ||
| 2 | import sys | ||
| 3 | |||
| 4 | f = sys.argv[1] | ||
| 5 | res = {} | ||
| 6 | mem_res = {} | ||
| 7 | memw_res = {} | ||
| 8 | samples = {} | ||
| 9 | |||
| 10 | with open(f) as fp: | ||
| 11 | for line in fp: | ||
| 12 | s = line.split() | ||
| 13 | if s[0] not in res: | ||
| 14 | print(s[0]) | ||
| 15 | res[s[0]] = int(s[5]) | ||
| 16 | mem_res[s[0]] = int(s[8]) | ||
| 17 | memw_res[s[0]] = int(s[9]) | ||
| 18 | samples[s[0]] =int(s[4]) | ||
| 19 | else: | ||
| 20 | res[s[0]] += int(s[5]) | ||
| 21 | mem_res[s[0]] += int(s[8]) | ||
| 22 | memw_res[s[0]] += int(s[9]) | ||
| 23 | |||
| 24 | print("Average times:") | ||
| 25 | for r in res.keys(): | ||
| 26 | print(res[r]/samples[r]) | ||
| 27 | |||
| 28 | print("Average memory read:") | ||
| 29 | for r in mem_res.keys(): | ||
| 30 | print(mem_res[r]/samples[r]) | ||
| 31 | |||
| 32 | print("Average memory write:") | ||
| 33 | for r in memw_res.keys(): | ||
| 34 | print(memw_res[r]/samples[r]) | ||
diff --git a/baseline/tacleNames.txt b/baseline/tacleNames.txt index 8f4845a..2e02966 100644 --- a/baseline/tacleNames.txt +++ b/baseline/tacleNames.txt | |||
| @@ -1,19 +1,23 @@ | |||
| 1 | petrinet | 1 | petrinet |
| 2 | ndes | ||
| 3 | statemate | 2 | statemate |
| 4 | adpcm_dec | 3 | ndes |
| 4 | h264_dec | ||
| 5 | huff_dec | ||
| 5 | cjpeg_wrbmp | 6 | cjpeg_wrbmp |
| 7 | fmref | ||
| 8 | audiobeam | ||
| 9 | adpcm_dec | ||
| 6 | adpcm_enc | 10 | adpcm_enc |
| 11 | g723_enc | ||
| 12 | huff_enc | ||
| 13 | gsm_dec | ||
| 7 | cjpeg_transupp | 14 | cjpeg_transupp |
| 8 | dijkstra | ||
| 9 | epic | 15 | epic |
| 10 | fmref | 16 | anagram |
| 11 | gsm_dec | ||
| 12 | h264_dec | ||
| 13 | huff_enc | ||
| 14 | rijndael_enc | 17 | rijndael_enc |
| 15 | rijndael_dec | 18 | rijndael_dec |
| 16 | gsm_enc | 19 | gsm_enc |
| 17 | susan | 20 | susan |
| 21 | dijkstra | ||
| 18 | ammunition | 22 | ammunition |
| 19 | mpeg2 | 23 | mpeg2 |
diff --git a/dis/Makefile b/dis/Makefile index df93116..d18761b 100755 --- a/dis/Makefile +++ b/dis/Makefile | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | # Build the DIS benchmarks with all-pairs or unpaired instrumentation | 2 | # Build the DIS benchmarks with all-pairs or unpaired instrumentation |
| 3 | # (I know that this Makefile is mildly evil and breaks so many rules | 3 | # (I know that this Makefile is mildly evil and breaks so many rules |
| 4 | # that a good Makefile should follow. Sorry - at least I have one.) | 4 | # that a good Makefile should follow. Sorry - at least I have one.) |
| 5 | LIBLITMUS ?= /media/speedy/litmus/liblitmus | 5 | LIBLITMUS ?= /playpen/mc2/liblitmus |
| 6 | CC ?= gcc | 6 | CC ?= gcc |
| 7 | CFLAGS += -pthread -O2 -I.. | 7 | override CFLAGS += -pthread -O2 -I.. |
| 8 | LDFLAGS = -lrt -lm | 8 | LDFLAGS = -lrt -lm |
| 9 | COMMON = ../extra.h | 9 | COMMON = ../extra.h |
| 10 | 10 | ||
| @@ -15,8 +15,8 @@ endif | |||
| 15 | 15 | ||
| 16 | # Include all the LITMUS^RT headers if we're using it | 16 | # Include all the LITMUS^RT headers if we're using it |
| 17 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) | 17 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) |
| 18 | CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 18 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include |
| 19 | LDFLAGS += -L${LIBLITMUS} -llitmus | 19 | override LDFLAGS += -L${LIBLITMUS} -llitmus |
| 20 | endif | 20 | endif |
| 21 | 21 | ||
| 22 | all: baseline | 22 | all: baseline |
diff --git a/dis/bin/field_2mb b/dis/bin/field_2mb deleted file mode 100755 index 31f2a8d..0000000 --- a/dis/bin/field_2mb +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | taskset -c 0 ./gen_input.py field inputs/Field/in0 2097152 | ./field $@ | ||
diff --git a/dis/bin/matrix_2mb b/dis/bin/matrix_2mb deleted file mode 100755 index 72710ab..0000000 --- a/dis/bin/matrix_2mb +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | taskset -c 0 ./gen_input.py matrix inputs/Matrix/in4 2097152 | ./matrix $@ > /dev/null | ||
diff --git a/dis/bin/neighborhood_2mb b/dis/bin/neighborhood_2mb deleted file mode 100755 index 226bd98..0000000 --- a/dis/bin/neighborhood_2mb +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | taskset -c 0 ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 | ./neighborhood $@ > /dev/null | ||
diff --git a/dis/bin/pointer_2mb b/dis/bin/pointer_2mb deleted file mode 100755 index 3ce8f2b..0000000 --- a/dis/bin/pointer_2mb +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | taskset -c 0 ./gen_input.py pointer inputs/Pointer/in0 2097152 | ./pointer $@ | ||
diff --git a/dis/bin/transitive_2mb b/dis/bin/transitive_2mb deleted file mode 100755 index b8bcf5a..0000000 --- a/dis/bin/transitive_2mb +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | taskset -c 0 ./gen_input.py transitive inputs/Transitive/in0 2097152 | ./transitive $@ | ||
diff --git a/dis/bin/update_2mb b/dis/bin/update_2mb deleted file mode 100755 index 3bc33f4..0000000 --- a/dis/bin/update_2mb +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | taskset -c 0 ./gen_input.py update inputs/Update/in0 2097152 | ./update $@ | ||
diff --git a/dis/dis2MbInNames.txt b/dis/dis2MbInNames.txt new file mode 100644 index 0000000..00e6a22 --- /dev/null +++ b/dis/dis2MbInNames.txt | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | field ./gen_input.py field inputs/Field/in0 2097152 | ||
| 2 | matrix ./gen_input.py matrix inputs/Matrix/in0 2097152 | ||
| 3 | neighborhood ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 | ||
| 4 | pointer ./gen_input.py pointer inputs/Pointer/in0 2097152 | ||
| 5 | transitive ./gen_input.py transitive inputs/Transitive/in0 2097152 | ||
| 6 | update ./gen_input.py update inputs/Update/in0 2097152 | ||
diff --git a/dis/disPairs2MbInNames.txt b/dis/disPairs2MbInNames.txt new file mode 100644 index 0000000..a45ead4 --- /dev/null +++ b/dis/disPairs2MbInNames.txt | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | field_all ./gen_input.py field inputs/Field/in0 2097152 | ||
| 2 | matrix_all ./gen_input.py matrix inputs/Matrix/in0 2097152 | ||
| 3 | neighborhood_all ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 | ||
| 4 | pointer_all ./gen_input.py pointer inputs/Pointer/in0 2097152 | ||
| 5 | transitive_all ./gen_input.py transitive inputs/Transitive/in0 2097152 | ||
| 6 | update_all ./gen_input.py update inputs/Update/in0 2097152 | ||
diff --git a/dis/run_dis.sh b/dis/run_dis.sh deleted file mode 100755 index 78745ec..0000000 --- a/dis/run_dis.sh +++ /dev/null | |||
| @@ -1,92 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | core=$1 | ||
| 4 | maxJobs=$2 | ||
| 5 | runID=$3 | ||
| 6 | benchmark=${4,} | ||
| 7 | template_input=inputs/$4/in0 | ||
| 8 | wss_settings=inputs/WSSS | ||
| 9 | cache_settings=inputs/caches | ||
| 10 | |||
| 11 | if [ $# -lt 4 ]; then | ||
| 12 | echo "Usage $0 <core ID> <number of iterations> <run ID> <benchmark> [template input] [DIS WSS file] [DIS cache file]" | ||
| 13 | exit | ||
| 14 | fi | ||
| 15 | |||
| 16 | if [ $# -gt 4 ]; then | ||
| 17 | echo "Using alternate input template from $5" | ||
| 18 | template_input=$5 | ||
| 19 | fi | ||
| 20 | |||
| 21 | if [ $# -gt 5 ]; then | ||
| 22 | echo "Using alternate WSS settings from $6" | ||
| 23 | wss_settings=$6 | ||
| 24 | fi | ||
| 25 | |||
| 26 | if [ $# -gt 6 ]; then | ||
| 27 | echo "Using alternate cache settings from $7" | ||
| 28 | cache_settings=$7 | ||
| 29 | fi | ||
| 30 | |||
| 31 | echo "Making sure that binary is up to date..." | ||
| 32 | make $benchmark | ||
| 33 | echo "Done. Disabling real-time throttling..." | ||
| 34 | |||
| 35 | # Turn off rt throttling | ||
| 36 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 37 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 38 | |||
| 39 | # Redirect all interrupts to core 0 | ||
| 40 | i=0 | ||
| 41 | for IRQ in /proc/irq/* | ||
| 42 | do | ||
| 43 | # Skip default_smp_affinity | ||
| 44 | if [ -d $IRQ ]; then | ||
| 45 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 46 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 47 | fi | ||
| 48 | i=$(( $i + 1 )) | ||
| 49 | done | ||
| 50 | |||
| 51 | echo "Done. Checking for wbinvd module..." | ||
| 52 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 53 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 54 | exit | ||
| 55 | fi | ||
| 56 | |||
| 57 | # Enable L3 isolation | ||
| 58 | echo "Done. Enabling L3 isolation..." | ||
| 59 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 60 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 61 | echo $1 > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 62 | # Reset global bandwith control and remove L3 from global | ||
| 63 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 64 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 65 | # Alloc L3 to benchmark | ||
| 66 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 67 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 68 | echo "Done. Beginning benchmarks..." | ||
| 69 | |||
| 70 | # Execute the benchmark for each WSS and cache config | ||
| 71 | while read j; do | ||
| 72 | echo $j > /sys/fs/resctrl/benchmarks/schemata | ||
| 73 | while read i; do | ||
| 74 | if grep -q "#define LITMUS 1" ../baseline/source/extra.h; then | ||
| 75 | echo "Using LITMUS-RT!" | ||
| 76 | ./gen_input.py $benchmark $template_input $i | numactl -m 0 ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 | ||
| 77 | else | ||
| 78 | ./gen_input.py $benchmark $template_input $i | chrt -r 97 numactl -m 0 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 | ||
| 79 | fi | ||
| 80 | done < $wss_settings | ||
| 81 | done < $cache_settings | ||
| 82 | |||
| 83 | # Put IRQs back as they were | ||
| 84 | i=0 | ||
| 85 | for IRQ in /proc/irq/* | ||
| 86 | do | ||
| 87 | if [ -d $IRQ ]; then | ||
| 88 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 89 | fi | ||
| 90 | i=$(( $i + 1 )) | ||
| 91 | done | ||
| 92 | |||
diff --git a/dis/setup_mem_and_global.sh b/dis/setup_mem_and_global.sh deleted file mode 100755 index 6bddb2f..0000000 --- a/dis/setup_mem_and_global.sh +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | # Setup group | ||
| 2 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 3 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 4 | echo 15 > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 5 | echo 31 > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 6 | # Remove mem from global domain and assign to local | ||
| 7 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 8 | echo "L3:0=ffff;1=ffff;2=ffff;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 9 | if [[ $1 == "--bandwith" ]]; then | ||
| 10 | # Remove bandwidth from global domain | ||
| 11 | echo "MB:0=2;1=2;2=2;3=2" > /sys/fs/resctrl/schemata | ||
| 12 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 13 | else | ||
| 14 | # Disable bandwidth control | ||
| 15 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 16 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 17 | fi | ||
| 18 | echo "=== Global Config ===" | ||
| 19 | cat /sys/fs/resctrl/schemata | ||
| 20 | echo "=== Core 15 & 31 Config ===" | ||
| 21 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 22 | |||
| @@ -29,8 +29,13 @@ extern int sched_getcpu(); | |||
| 29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
| 30 | #endif | 30 | #endif |
| 31 | 31 | ||
| 32 | <<<<<<< HEAD | ||
| 32 | #define LITMUS 1 | 33 | #define LITMUS 1 |
| 33 | #define MC2 0 | 34 | #define MC2 0 |
| 35 | ======= | ||
| 36 | // This is a proxy for "case study mode" now | ||
| 37 | #define LITMUS 0 | ||
| 38 | >>>>>>> rtas20-wip | ||
| 34 | #define MMDC_PROF 0 | 39 | #define MMDC_PROF 0 |
| 35 | 40 | ||
| 36 | #if LITMUS | 41 | #if LITMUS |
| @@ -41,18 +46,6 @@ extern int sched_getcpu(); | |||
| 41 | #include "/media/speedy/litmus/tools/mmdc/mmdc.h" | 46 | #include "/media/speedy/litmus/tools/mmdc/mmdc.h" |
| 42 | #endif | 47 | #endif |
| 43 | 48 | ||
| 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() | 49 | // Store state globally so that the job can be outside main() |
| 57 | // Arrays use float as a comprimise between overflow and size | 50 | // Arrays use float as a comprimise between overflow and size |
| 58 | // Paired arrays use long longs as precision is more important for those times | 51 | // Paired arrays use long longs as precision is more important for those times |
| @@ -82,50 +75,72 @@ char *_rt_other_core; | |||
| 82 | char *_rt_barrier; | 75 | char *_rt_barrier; |
| 83 | sem_t *_rt_first_sem, *_rt_second_sem; | 76 | sem_t *_rt_first_sem, *_rt_second_sem; |
| 84 | int _rt_lock_id; | 77 | int _rt_lock_id; |
| 78 | #define _ID_SZ 128 | ||
| 79 | char _rt_sem1_name[_ID_SZ] = "/_libextra_first_sem-"; | ||
| 80 | char _rt_sem2_name[_ID_SZ] = "/_libextra_second_sem-"; | ||
| 81 | char _rt_shm_name[_ID_SZ] = "/_libextra_barrier-"; | ||
| 82 | #endif /* PAIRED */ | ||
| 83 | |||
| 84 | #if LITMUS | ||
| 85 | long unsigned int _rt_period; | ||
| 85 | #endif | 86 | #endif |
| 86 | 87 | ||
| 87 | static void _rt_load_params_itrl(int argc, char **argv) { | 88 | static void _rt_load_params_itrl(int argc, char **argv) { |
| 88 | #ifdef PAIRED | 89 | #ifdef PAIRED |
| 89 | if (argc != 8) { | 90 | 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]); | 91 | 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 | 92 | #else |
| 101 | if (argc != 6) { | 93 | if (argc != (6 + LITMUS*2)) { |
| 102 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); | 94 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); |
| 95 | #endif /* PAIRED */ | ||
| 103 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); | 96 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); |
| 104 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); | 97 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); |
| 105 | fprintf(stderr, " <my core> UNUSED. Core is now auto-detected.\n"); | 98 | fprintf(stderr, " <my core> integer core number. Only used for LITMUS-RT.\n"); |
| 99 | #ifdef PAIRED | ||
| 100 | fprintf(stderr, " <other core> integer for logging. Core of paired task.\n"); | ||
| 101 | fprintf(stderr, " <other name> string for logging. Name of paired task.\n"); | ||
| 102 | #endif /* PAIRED */ | ||
| 106 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); | 103 | 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"); | 104 | fprintf(stderr, " <save results?> 1 to save results, 0 to discard.\n"); |
| 105 | #ifdef PAIRED | ||
| 106 | fprintf(stderr, " <pairID> (optional).\n"); | ||
| 107 | #endif | ||
| 108 | #if LITMUS | ||
| 109 | fprintf(stderr, " <task period> in ms\n"); | ||
| 110 | fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n"); | ||
| 111 | #endif /* LITMUS */ | ||
| 108 | exit(1); | 112 | exit(1); |
| 109 | } | 113 | } |
| 110 | #endif | ||
| 111 | _rt_our_prog_name = argv[1]; | 114 | _rt_our_prog_name = argv[1]; |
| 112 | _rt_max_jobs = atol(argv[2]); | 115 | _rt_max_jobs = atol(argv[2]); |
| 116 | #if !LITMUS | ||
| 113 | _rt_core = sched_getcpu(); | 117 | _rt_core = sched_getcpu(); |
| 118 | #else | ||
| 119 | _rt_core = atoi(argv[3]); | ||
| 120 | #endif | ||
| 114 | #ifdef PAIRED | 121 | #ifdef PAIRED |
| 115 | _rt_other_core = argv[4]; | 122 | _rt_other_core = argv[4]; |
| 116 | _rt_other_prog_name = argv[5]; | 123 | _rt_other_prog_name = argv[5]; |
| 117 | _rt_run_id = argv[6]; | 124 | _rt_run_id = argv[6]; |
| 118 | _rt_lock_id = atoi(argv[7]); | 125 | _rt_will_output = atoi(argv[7]); |
| 119 | // The paired version doesn't support disabling output (legacy compatibility) | 126 | char *pairId; |
| 120 | _rt_will_output = 1; | 127 | int end; |
| 128 | if (argc > 8) { | ||
| 129 | pairId = argv[8]; | ||
| 130 | end = 8; | ||
| 131 | } else { | ||
| 132 | pairId = "none"; | ||
| 133 | end = 9; | ||
| 134 | } | ||
| 121 | #else | 135 | #else |
| 122 | _rt_other_core = "none"; | 136 | _rt_other_core = "none"; |
| 123 | _rt_other_prog_name = "none"; | 137 | _rt_other_prog_name = "none"; |
| 124 | _rt_run_id = argv[4]; | 138 | _rt_run_id = argv[4]; |
| 125 | _rt_will_output = atoi(argv[5]); | 139 | _rt_will_output = atoi(argv[5]); |
| 140 | int end = 6; | ||
| 126 | #endif /* PAIRED */ | 141 | #endif /* PAIRED */ |
| 127 | if (_rt_max_jobs < 0 && _rt_will_output != 0) { | 142 | if (_rt_max_jobs < 0 && _rt_will_output != 0) { |
| 128 | fprintf(stderr, "Infinite loops only supported when _rt_will_output is disabled!\n"); | 143 | fprintf(stderr, "Infinite loops only supported when output is disabled!\n"); |
| 129 | exit(1); | 144 | exit(1); |
| 130 | } | 145 | } |
| 131 | if (strlen(_rt_run_id) + 5 > _RT_FILENAME_LEN) { | 146 | if (strlen(_rt_run_id) + 5 > _RT_FILENAME_LEN) { |
| @@ -133,32 +148,54 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
| 133 | exit(1); | 148 | exit(1); |
| 134 | } | 149 | } |
| 135 | #ifdef PAIRED | 150 | #ifdef PAIRED |
| 151 | // __rt_sem2_name happens to be the longest | ||
| 152 | if (strlen(pairId) + strlen(_rt_sem2_name) > _ID_SZ) { | ||
| 153 | fprintf(stderr, "PairID is too long! Maximum length is %ld characters.\n", _ID_SZ - strlen(_rt_sem2_name)); | ||
| 154 | exit(1); | ||
| 155 | } | ||
| 136 | _rt_start_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); | 156 | _rt_start_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); |
| 137 | _rt_end_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); | 157 | _rt_end_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); |
| 138 | if (!_rt_end_time || !_rt_start_time) { | 158 | if (!_rt_end_time || !_rt_start_time) { |
| 139 | perror("Unable to allocate buffers for execution times"); | 159 | perror("Unable to allocate buffers for execution times"); |
| 140 | exit(1); | 160 | exit(1); |
| 141 | } | 161 | } |
| 142 | _rt_first_sem = sem_open("/_libextra_first_sem", O_CREAT, 644, 0); | 162 | // Use PairID to create unique semaphore and shared memory paths |
| 143 | _rt_second_sem = sem_open("/_libextra_second_sem", O_CREAT, 644, 0); | 163 | strcat(_rt_sem1_name, pairId); |
| 164 | strcat(_rt_sem2_name, pairId); | ||
| 165 | strcat(_rt_shm_name, pairId); | ||
| 166 | _rt_first_sem = sem_open(_rt_sem1_name, O_CREAT, 644, 0); | ||
| 167 | _rt_second_sem = sem_open(_rt_sem2_name, O_CREAT, 644, 0); | ||
| 144 | if (_rt_first_sem == SEM_FAILED || _rt_second_sem == SEM_FAILED) { | 168 | if (_rt_first_sem == SEM_FAILED || _rt_second_sem == SEM_FAILED) { |
| 145 | perror("Error while creating semaphores"); | 169 | perror("Error while creating semaphores"); |
| 146 | exit(1); | 170 | exit(1); |
| 147 | } | 171 | } |
| 148 | int barrier_file = shm_open("/_libextra_barrier", O_CREAT | O_RDWR, 644); | 172 | // Create shared memory for barrier synchronization and infer lock ID |
| 173 | int barrier_file = shm_open(_rt_shm_name, O_CREAT | O_RDWR | O_EXCL, 644); | ||
| 174 | if (barrier_file == -1) { | ||
| 175 | // File already existed - we're the 2nd program and thus lock ID 2 | ||
| 176 | _rt_lock_id = 2; | ||
| 177 | barrier_file = shm_open(_rt_shm_name, O_CREAT | O_RDWR, 644); | ||
| 178 | } else { | ||
| 179 | _rt_lock_id = 1; | ||
| 180 | } | ||
| 149 | if (barrier_file == -1) { | 181 | if (barrier_file == -1) { |
| 150 | perror("Error while creating shared memory for barrier synchronization"); | 182 | perror("Error while creating shared memory for barrier synchronization"); |
| 151 | exit(1); | 183 | exit(1); |
| 152 | } | 184 | } |
| 153 | if (ftruncate(barrier_file, 1) == -1) { | 185 | if (ftruncate(barrier_file, 2) == -1) { |
| 154 | perror("Error while setting size of shared memory for barrier synchronization"); | 186 | perror("Error while setting size of shared memory for barrier synchronization"); |
| 155 | exit(1); | 187 | exit(1); |
| 156 | } | 188 | } |
| 157 | _rt_barrier = mmap(NULL, 1, PROT_WRITE, MAP_SHARED, barrier_file, 0); | 189 | _rt_barrier = mmap(NULL, 2, PROT_WRITE, MAP_SHARED, barrier_file, 0); |
| 158 | if (_rt_barrier == MAP_FAILED) { | 190 | if (_rt_barrier == MAP_FAILED) { |
| 159 | perror("Error while mapping shared memory for barrier synchronization"); | 191 | perror("Error while mapping shared memory for barrier synchronization"); |
| 160 | exit(1); | 192 | exit(1); |
| 161 | } | 193 | } |
| 194 | // If we're the 2nd user of this barrier, mark it as in-use | ||
| 195 | if (_rt_lock_id == 2 && !__sync_bool_compare_and_swap(_rt_barrier+1, 0, 1)) { | ||
| 196 | fprintf(stderr, "Pair ID already in use!\n"); | ||
| 197 | exit(1); | ||
| 198 | } | ||
| 162 | *_rt_barrier = 0; | 199 | *_rt_barrier = 0; |
| 163 | #else | 200 | #else |
| 164 | _rt_exec_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(float)); | 201 | _rt_exec_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(float)); |
| @@ -169,8 +206,46 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
| 169 | #endif /* PAIRED */ | 206 | #endif /* PAIRED */ |
| 170 | _rt_jobs_complete = 0; | 207 | _rt_jobs_complete = 0; |
| 171 | mlockall(MCL_CURRENT || MCL_FUTURE); | 208 | mlockall(MCL_CURRENT || MCL_FUTURE); |
| 209 | #if LITMUS | ||
| 210 | _rt_period = strtoul(argv[end], NULL, 10); | ||
| 211 | unsigned int crit = atoi(argv[end+1]); | ||
| 212 | unsigned int wait = 1; | ||
| 213 | if (be_migrate_to_domain(_rt_core) < 0) { | ||
| 214 | perror("Unable to migrate to specified CPU"); | ||
| 215 | exit(1); | ||
| 216 | } | ||
| 217 | struct rt_task rt_param; | ||
| 218 | init_rt_task_param(&rt_param); | ||
| 219 | rt_param.exec_cost = 0; // We disable budget enforcement, so this doesn't matter | ||
| 220 | rt_param.period = ms2ns(_rt_period); | ||
| 221 | rt_param.relative_deadline = 0; | ||
| 222 | rt_param.phase = 0; | ||
| 223 | rt_param.priority = LITMUS_LOWEST_PRIORITY; | ||
| 224 | rt_param.cls = crit; | ||
| 225 | rt_param.release_policy = TASK_PERIODIC; | ||
| 226 | rt_param.budget_policy = NO_ENFORCEMENT; | ||
| 227 | rt_param.cpu = _rt_core; | ||
| 228 | if (set_rt_task_param(gettid(), &rt_param) < 0) { | ||
| 229 | perror("Unable to set real-time parameters"); | ||
| 230 | exit(1); | ||
| 231 | } | ||
| 232 | if (init_litmus() != 0) { | ||
| 233 | perror("init_litmus failed"); | ||
| 234 | exit(1); | ||
| 235 | } | ||
| 236 | if (task_mode(LITMUS_RT_TASK) != 0) { | ||
| 237 | perror("Unable to become real-time task"); | ||
| 238 | exit(1); | ||
| 239 | } | ||
| 240 | if (wait && wait_for_ts_release() != 0) { | ||
| 241 | perror("Unable to wait for taskset release"); | ||
| 242 | exit(1); | ||
| 243 | } | ||
| 244 | #endif /* LITMUS */ | ||
| 245 | #if MMDC_PROF | ||
| 246 | SETUP_MMDC | ||
| 247 | #endif | ||
| 172 | } | 248 | } |
| 173 | #define LOAD_PARAMS_ITRL _rt_load_params_itrl(argc, argv); | ||
| 174 | 249 | ||
| 175 | #define SETUP_MMDC \ | 250 | #define SETUP_MMDC \ |
| 176 | _rt_mmdc_read = calloc(_rt_max_jobs * _rt_will_output, sizeof(float));\ | 251 | _rt_mmdc_read = calloc(_rt_max_jobs * _rt_will_output, sizeof(float));\ |
| @@ -194,6 +269,7 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
| 194 | mmdc->madpcr1 = axi_arm1;\ | 269 | mmdc->madpcr1 = axi_arm1;\ |
| 195 | msync(&(mmdc->madpcr1),4,MS_SYNC); | 270 | msync(&(mmdc->madpcr1),4,MS_SYNC); |
| 196 | 271 | ||
| 272 | <<<<<<< HEAD | ||
| 197 | #define SETUP_LITMUS \ | 273 | #define SETUP_LITMUS \ |
| 198 | unsigned int wait = 0; \ | 274 | unsigned int wait = 0; \ |
| 199 | if (be_migrate_to_domain(_rt_core) < 0) { \ | 275 | if (be_migrate_to_domain(_rt_core) < 0) { \ |
| @@ -242,6 +318,8 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
| 242 | exit(1); \ | 318 | exit(1); \ |
| 243 | } \ | 319 | } \ |
| 244 | 320 | ||
| 321 | ======= | ||
| 322 | >>>>>>> rtas20-wip | ||
| 245 | #if __arm__ | 323 | #if __arm__ |
| 246 | // On ARM, manually flush the cache | 324 | // On ARM, manually flush the cache |
| 247 | #define FLUSH_CACHES \ | 325 | #define FLUSH_CACHES \ |
| @@ -305,28 +383,28 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
| 305 | 383 | ||
| 306 | // Buffer timing result from a single job | 384 | // Buffer timing result from a single job |
| 307 | static void _rt_save_job_result() { | 385 | static void _rt_save_job_result() { |
| 386 | if (!_rt_will_output) | ||
| 387 | return; | ||
| 308 | if (_rt_jobs_complete >= _rt_max_jobs) { | 388 | if (_rt_jobs_complete >= _rt_max_jobs) { |
| 309 | fprintf(stderr, "Max jobs setting too small! Trying to record job #%ld when we only have space for %ld jobs. Exiting...\n", _rt_jobs_complete, _rt_max_jobs); | 389 | fprintf(stderr, "Max jobs setting too small! Trying to record job #%ld when we only have space for %ld jobs. Exiting...\n", _rt_jobs_complete, _rt_max_jobs); |
| 310 | exit(1); | 390 | exit(1); |
| 311 | } | 391 | } |
| 312 | if (_rt_jobs_complete > -1 && _rt_will_output) { | ||
| 313 | #ifdef PAIRED | 392 | #ifdef PAIRED |
| 314 | _rt_start_time[_rt_jobs_complete] = _rt_start.tv_sec; | 393 | _rt_start_time[_rt_jobs_complete] = _rt_start.tv_sec; |
| 315 | _rt_start_time[_rt_jobs_complete] *= _BILLION; | 394 | _rt_start_time[_rt_jobs_complete] *= _BILLION; |
| 316 | _rt_start_time[_rt_jobs_complete] += _rt_start.tv_nsec; | 395 | _rt_start_time[_rt_jobs_complete] += _rt_start.tv_nsec; |
| 317 | _rt_end_time[_rt_jobs_complete] = _rt_end.tv_sec; | 396 | _rt_end_time[_rt_jobs_complete] = _rt_end.tv_sec; |
| 318 | _rt_end_time[_rt_jobs_complete] *= _BILLION; | 397 | _rt_end_time[_rt_jobs_complete] *= _BILLION; |
| 319 | _rt_end_time[_rt_jobs_complete] += _rt_end.tv_nsec; | 398 | _rt_end_time[_rt_jobs_complete] += _rt_end.tv_nsec; |
| 320 | #else | 399 | #else |
| 321 | _rt_exec_time[_rt_jobs_complete] = _rt_end.tv_sec - _rt_start.tv_sec; | 400 | _rt_exec_time[_rt_jobs_complete] = _rt_end.tv_sec - _rt_start.tv_sec; |
| 322 | _rt_exec_time[_rt_jobs_complete] *= _BILLION; | 401 | _rt_exec_time[_rt_jobs_complete] *= _BILLION; |
| 323 | _rt_exec_time[_rt_jobs_complete] += _rt_end.tv_nsec - _rt_start.tv_nsec; | 402 | _rt_exec_time[_rt_jobs_complete] += _rt_end.tv_nsec - _rt_start.tv_nsec; |
| 324 | #endif /* PAIRED */ | 403 | #endif /* PAIRED */ |
| 325 | #if MMDC_PROF | 404 | #if MMDC_PROF |
| 326 | _rt_mmdc_read[_rt_jobs_complete] = mmdc_res.read_bytes; | 405 | _rt_mmdc_read[_rt_jobs_complete] = mmdc_res.read_bytes; |
| 327 | _rt_mmdc_write[_rt_jobs_complete] = mmdc_res.write_bytes; | 406 | _rt_mmdc_write[_rt_jobs_complete] = mmdc_res.write_bytes; |
| 328 | #endif | 407 | #endif /* MMDC_PROF */ |
| 329 | } | ||
| 330 | } | 408 | } |
| 331 | 409 | ||
| 332 | // Save all buffered timing results to disk | 410 | // Save all buffered timing results to disk |
| @@ -365,13 +443,16 @@ static void _rt_write_to_file() { | |||
| 365 | fclose(fp); | 443 | fclose(fp); |
| 366 | out: | 444 | out: |
| 367 | #if LITMUS | 445 | #if LITMUS |
| 368 | CLEANUP_LITMUS | 446 | if (task_mode(BACKGROUND_TASK) != 0) { |
| 447 | perror("Unable to become a real-time task"); | ||
| 448 | exit(1); | ||
| 449 | } | ||
| 369 | #endif /* LITMUS */ | 450 | #endif /* LITMUS */ |
| 370 | #ifdef PAIRED | 451 | #ifdef PAIRED |
| 371 | munmap(_rt_barrier, 1); | 452 | munmap(_rt_barrier, 2); |
| 372 | shm_unlink("/_libextra_barrier"); | 453 | sem_unlink(_rt_sem1_name); |
| 373 | sem_unlink("/_libextra_first_sem"); | 454 | sem_unlink(_rt_sem2_name); |
| 374 | sem_unlink("/_libextra_second_sem"); | 455 | shm_unlink(_rt_shm_name); |
| 375 | free(_rt_start_time); | 456 | free(_rt_start_time); |
| 376 | free(_rt_end_time); | 457 | free(_rt_end_time); |
| 377 | #else | 458 | #else |
| @@ -396,7 +477,9 @@ static void _rt_start_loop() { | |||
| 396 | FIRST_UNLOCK | 477 | FIRST_UNLOCK |
| 397 | FIRST_LOCK | 478 | FIRST_LOCK |
| 398 | #endif /* PAIRED */ | 479 | #endif /* PAIRED */ |
| 480 | #if !LITMUS | ||
| 399 | FLUSH_CACHES | 481 | FLUSH_CACHES |
| 482 | #endif | ||
| 400 | #ifdef PAIRED | 483 | #ifdef PAIRED |
| 401 | BARRIER_SYNC | 484 | BARRIER_SYNC |
| 402 | #endif /* PAIRED */ | 485 | #endif /* PAIRED */ |
| @@ -444,7 +527,7 @@ static void _rt_stop_loop() { | |||
| 444 | * result. We use this to call our void function from inside a comparison. | 527 | * result. We use this to call our void function from inside a comparison. |
| 445 | */ | 528 | */ |
| 446 | #define for_each_job \ | 529 | #define for_each_job \ |
| 447 | for (; _rt_jobs_complete < _rt_max_jobs && (_rt_start_loop(),1); \ | 530 | for (; (_rt_max_jobs == -1 || _rt_jobs_complete < _rt_max_jobs) && (_rt_start_loop(),1); \ |
| 448 | _rt_stop_loop()) | 531 | _rt_stop_loop()) |
| 449 | 532 | ||
| 450 | /****** Legacy API ****** | 533 | /****** Legacy API ****** |
| @@ -466,6 +549,7 @@ static void _rt_stop_loop() { | |||
| 466 | * able to read them. | 549 | * able to read them. |
| 467 | */ | 550 | */ |
| 468 | static int jobsComplete = 0; | 551 | static int jobsComplete = 0; |
| 552 | #define SET_UP _rt_load_params_itrl(argc, argv); | ||
| 469 | #define START_LOOP _rt_start_loop(); | 553 | #define START_LOOP _rt_start_loop(); |
| 470 | #define STOP_LOOP _rt_stop_loop(); | 554 | #define STOP_LOOP _rt_stop_loop(); |
| 471 | #define WRITE_TO_FILE _rt_write_to_file(); | 555 | #define WRITE_TO_FILE _rt_write_to_file(); |
diff --git a/run_all_dis.sh b/run_all_dis.sh deleted file mode 100755 index 5a6b6e1..0000000 --- a/run_all_dis.sh +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Run baselines for all the DIS tasks | ||
| 3 | if [ "$EUID" -ne 0 ] | ||
| 4 | then | ||
| 5 | echo "You need to be root to enable cache way and interrupt isolation!" | ||
| 6 | exit | ||
| 7 | fi | ||
| 8 | |||
| 9 | if uname -a | grep -q "mc2"; then | ||
| 10 | echo "MC^2 detected! Cache isolation will be enabled" | ||
| 11 | iso="i" | ||
| 12 | else | ||
| 13 | echo "MC^2 not detected." | ||
| 14 | iso="xi" | ||
| 15 | fi | ||
| 16 | |||
| 17 | datestring=$(date +"%b%d-%H") | ||
| 18 | if ! grep -q irqaffinity /proc/cmdline; then | ||
| 19 | /playpen/move_interrupts_off_core15.sh | ||
| 20 | else | ||
| 21 | echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor | ||
| 22 | fi | ||
| 23 | WSSS=WSSS_maxstride2mb | ||
| 24 | caches=caches_all | ||
| 25 | # Consider re-enabling this only if you're interested in exploring bandwidth effects | ||
| 26 | #./setup_mem_and_global.sh | ||
| 27 | if [[ $1 == "--contend" ]]; then | ||
| 28 | echo "Will run 6 contending tasks" | ||
| 29 | echo "Files will be named $datestring-<benchmark name>-c-"$iso".txt" | ||
| 30 | echo "Please verify the above settings. Press enter to continue..." | ||
| 31 | read | ||
| 32 | # Run two contending tasks on each other CCX | ||
| 33 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 34 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 35 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 36 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 37 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 38 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 39 | ./run_dis.sh 15 10 $datestring-field-c-$iso Field inputs/Field/in0 inputs/$WSSS inputs/$caches | ||
| 40 | ./postproc.sh $datestring-field-c-$iso | ||
| 41 | ./run_dis.sh 15 10 $datestring-matrix-c-$iso Matrix inputs/Matrix/in0 inputs/$WSSS inputs/$caches | ||
| 42 | ./postproc.sh $datestring-matrix-c-$iso | ||
| 43 | ./run_dis.sh 15 10 $datestring-neighborhood-c-$iso Neighborhood inputs/Neighborhood/in0 inputs/$WSSS inputs/$caches | ||
| 44 | ./postproc.sh $datestring-neighborhood-c-$iso | ||
| 45 | ./run_dis.sh 15 10 $datestring-pointer-c-$iso Pointer inputs/Pointer/in0 inputs/$WSSS inputs/$caches | ||
| 46 | ./postproc.sh $datestring-pointer-c-$iso | ||
| 47 | ./run_dis.sh 15 10 $datestring-transitive-c-$iso Transitive inputs/Transitive/in0 inputs/$WSSS inputs/$caches | ||
| 48 | ./postproc.sh $datestring-transitive-c-$iso | ||
| 49 | ./run_dis.sh 15 10 $datestring-update-c-$iso Update inputs/Update/in0 inputs/$WSSS inputs/$caches | ||
| 50 | ./postproc.sh $datestring-update-c-$iso | ||
| 51 | killall thrasher | ||
| 52 | else | ||
| 53 | echo "Will run no contending tasks (use --contend for contending tasks)" | ||
| 54 | echo "Files will be named $datestring-<benchmark name>-xc-"$iso".txt" | ||
| 55 | echo "Please verify the above settings. Press enter to continue..." | ||
| 56 | read | ||
| 57 | killall thrasher | ||
| 58 | ./run_dis.sh 15 10 $datestring-field-xc-$iso Field inputs/Field/in0 inputs/$WSSS inputs/$caches | ||
| 59 | ./postproc.sh $datestring-field-xc-$iso | ||
| 60 | ./run_dis.sh 15 10 $datestring-matrix-xc-$iso Matrix inputs/Matrix/in0 inputs/$WSSS inputs/$caches | ||
| 61 | ./postproc.sh $datestring-matrix-xc-$iso | ||
| 62 | ./run_dis.sh 15 10 $datestring-neighborhood-xc-$iso Neighborhood inputs/Neighborhood/in0 inputs/$WSSS inputs/$caches | ||
| 63 | ./postproc.sh $datestring-neighborhood-xc-$iso | ||
| 64 | ./run_dis.sh 15 10 $datestring-pointer-xc-$iso Pointer inputs/Pointer/in0 inputs/$WSSS inputs/$caches | ||
| 65 | ./postproc.sh $datestring-pointer-xc-$iso | ||
| 66 | ./run_dis.sh 15 10 $datestring-transitive-xc-$iso Transitive inputs/Transitive/in0 inputs/$WSSS inputs/$caches | ||
| 67 | ./postproc.sh $datestring-transitive-xc-$iso | ||
| 68 | ./run_dis.sh 15 10 $datestring-update-xc-$iso Update inputs/Update/in0 inputs/$WSSS inputs/$caches | ||
| 69 | ./postproc.sh $datestring-update-xc-$iso | ||
| 70 | fi | ||
diff --git a/run_all_sd-vbs.sh b/run_all_sd-vbs.sh new file mode 100755 index 0000000..1f5948d --- /dev/null +++ b/run_all_sd-vbs.sh | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Copyright 2020 Joshua Bakita | ||
| 3 | # Runs SD-VBS in every configuration needed | ||
| 4 | # for the paper and schedulability studies | ||
| 5 | |||
| 6 | maxJobs=$1 | ||
| 7 | runID=$2 | ||
| 8 | |||
| 9 | if [ $# -lt 2 ]; then | ||
| 10 | echo "Usage $0 <number of iterations> <run ID>" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | if [[ "$EUID" != 0 ]]; then | ||
| 14 | echo "You need to be root to enable spatial isolation!" | ||
| 15 | exit | ||
| 16 | fi | ||
| 17 | date | ||
| 18 | |||
| 19 | # Run the pairs baseline and some comparisons to examine the effect of less cache | ||
| 20 | echo "Building benchmarks in unpaired configuration..." | ||
| 21 | cd SD-VBS/benchmarks | ||
| 22 | make compile -j30 > /dev/null # Suppress noisy output | ||
| 23 | cd .. | ||
| 24 | echo "Done. Running experiments..." | ||
| 25 | # Full L3, full L2 - xi is the baseline for the pairs | ||
| 26 | baseXI=SD-VBS/$(date +"%b%d-%H")-c-xi-$runID.txt | ||
| 27 | echo "" | ../run_bench.sh -m base -p 15 -l $maxJobs -b sd-vbsNames.txt -B -I xi $runID | ||
| 28 | # Half L3, full L2 - i3 sees effect of half L3 | ||
| 29 | baseI3=SD-VBS/$(date +"%b%d-%H")-c-i3-$runID.txt | ||
| 30 | echo "" | ../run_bench.sh -m base -p 15 -l $maxJobs -b sd-vbsNames.txt -B -I i3 $runID | ||
| 31 | # Half L3, half L2 - additional effect of half L2 | ||
| 32 | baseI=SD-VBS/$(date +"%b%d-%H")-c-i-$runID.txt | ||
| 33 | echo "" | ../run_bench.sh -m base -p 15 -l $maxJobs -b sd-vbsNames.txt -B -I i $runID | ||
| 34 | date | ||
| 35 | |||
| 36 | # Run the Level-C pairs | ||
| 37 | pairC=SD-VBS/$(date +"%b%d-%H")-c-xi-async-$runID.txt | ||
| 38 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b sd-vbsNames.txt -B -I xi -A $runID | ||
| 39 | date | ||
| 40 | |||
| 41 | # Run the Level-A/-B pairs | ||
| 42 | echo "Building benchmarks in paired configuration..." | ||
| 43 | cd benchmarks | ||
| 44 | make CFLAGS=-DPAIRED compile -j30 > /dev/null # Suppress noisy output | ||
| 45 | cd .. | ||
| 46 | echo "Done. Continuing experiments..." | ||
| 47 | # No cache isolation | ||
| 48 | pairXI=SD-VBS/$(date +"%b%d-%H")-c-xi-$runID"-A.txt and -B.txt" | ||
| 49 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b sd-vbsNames.txt -B -I xi $runID | ||
| 50 | # Shared L2, split L3 | ||
| 51 | pairI3=SD-VBS/$(date +"%b%d-%H")-c-i3-$runID"-A.txt and -B.txt" | ||
| 52 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b sd-vbsNames.txt -B -I i3 $runID | ||
| 53 | # Split L2, split L3 | ||
| 54 | pairI=SD-VBS/$(date +"%b%d-%H")-c-i-$runID"-A.txt and -B.txt" | ||
| 55 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b sd-vbsNames.txt -B -I i $runID | ||
| 56 | date | ||
| 57 | |||
| 58 | echo "==== DONE ====" | ||
| 59 | echo "Results are in:" | ||
| 60 | echo "- $baseXI" | ||
| 61 | echo "- $baseI3" | ||
| 62 | echo "- $baseI" | ||
| 63 | echo "- $pairXI" | ||
| 64 | echo "- $pairI3" | ||
| 65 | echo "- $pairI" | ||
| 66 | echo "- $pairC" | ||
| 67 | |||
diff --git a/run_all_tacle.sh b/run_all_tacle.sh new file mode 100755 index 0000000..51a9c24 --- /dev/null +++ b/run_all_tacle.sh | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Copyright 2020 Joshua Bakita | ||
| 3 | # Runs TACLeBench in every configuration needed | ||
| 4 | # for the paper and schedulability studies | ||
| 5 | |||
| 6 | maxJobs=$1 | ||
| 7 | runID=$2 | ||
| 8 | |||
| 9 | if [ $# -lt 2 ]; then | ||
| 10 | echo "Usage $0 <number of iterations> <run ID>" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | if [[ "$EUID" != 0 ]]; then | ||
| 14 | echo "You need to be root to enable spatial isolation!" | ||
| 15 | exit | ||
| 16 | fi | ||
| 17 | date | ||
| 18 | |||
| 19 | # Run the pairs baseline and some comparisons to examine the effect of less cache | ||
| 20 | cd baseline | ||
| 21 | make all -j32 | ||
| 22 | # Full L3, full L2 - xi is the baseline for the pairs | ||
| 23 | baseXI=baseline/$(date +"%b%d-%H")-c-xi-$runID.txt | ||
| 24 | echo "" | ../run_bench.sh -m base -p 15 -l $maxJobs -b tacleNames.txt -B -I xi $runID | ||
| 25 | # Half L3, full L2 - i3 sees effect of half L3 | ||
| 26 | baseI3=baseline/$(date +"%b%d-%H")-c-i3-$runID.txt | ||
| 27 | echo "" | ../run_bench.sh -m base -p 15 -l $maxJobs -b tacleNames.txt -B -I i3 $runID | ||
| 28 | # Half L3, half L2 - additional effect of half L2 | ||
| 29 | baseI=baseline/$(date +"%b%d-%H")-c-i-$runID.txt | ||
| 30 | echo "" | ../run_bench.sh -m base -p 15 -l $maxJobs -b tacleNames.txt -B -I i $runID | ||
| 31 | date | ||
| 32 | |||
| 33 | # Run the Level-A/-B pairs | ||
| 34 | cd ../all_pairs | ||
| 35 | make all -j32 | ||
| 36 | # No cache isolation | ||
| 37 | pairXI=all_pairs/$(date +"%b%d-%H")-c-xi-$runID"-A.txt and -B.txt" | ||
| 38 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b tacleNames.txt -B -I xi $runID | ||
| 39 | # Shared L2, split L3 | ||
| 40 | pairI3=all_pairs/$(date +"%b%d-%H")-c-i3-$runID"-A.txt and -B.txt" | ||
| 41 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b tacleNames.txt -B -I i3 $runID | ||
| 42 | # Split L2, split L3 | ||
| 43 | pairI=all_pairs/$(date +"%b%d-%H")-c-i-$runID"-A.txt and -B.txt" | ||
| 44 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b tacleNames.txt -B -I i $runID | ||
| 45 | date | ||
| 46 | |||
| 47 | # Run the Level-C pairs | ||
| 48 | cd ../baseline | ||
| 49 | pairC=baseline/$(date +"%b%d-%H")-c-xi-async-$runID.txt | ||
| 50 | echo "" | ../run_bench.sh -m pair -p 15 -P 31 -l $maxJobs -b tacleNames.txt -B -I xi -A $runID | ||
| 51 | date | ||
| 52 | |||
| 53 | echo "==== DONE ====" | ||
| 54 | echo "Results are in:" | ||
| 55 | echo "- $baseXI" | ||
| 56 | echo "- $baseI3" | ||
| 57 | echo "- $baseI" | ||
| 58 | echo "- $pairXI" | ||
| 59 | echo "- $pairI3" | ||
| 60 | echo "- $pairI" | ||
| 61 | echo "- $pairC" | ||
| 62 | |||
diff --git a/run_bench.sh b/run_bench.sh index c5b67b6..ddc6bcc 100755 --- a/run_bench.sh +++ b/run_bench.sh | |||
| @@ -1,30 +1,162 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | # Copyright 2020 Joshua Bakita | ||
| 3 | # A unified script for timing: | ||
| 4 | # - SMT pairs with synchronous launches (hard real-time methodolgy) | ||
| 5 | # - SMT pairs with asynchronous launches (soft real-time methodolgy) | ||
| 6 | # - Unpaired tasks | ||
| 7 | # - The cache alloc vs WSS setting exploration for DIS | ||
| 8 | # These can all be done with: | ||
| 9 | # - No cache management | ||
| 10 | # - L3 cache splitting | ||
| 11 | # - L2+L3 cache splitting (if OS supported) | ||
| 2 | 12 | ||
| 3 | core=$1 | 13 | if grep -q "#define LITMUS 1" ../extra.h ./extra.h 2> /dev/null; then |
| 4 | maxJobs=$2 | 14 | LITMUS=1 |
| 5 | userRunID=$3 | 15 | fi |
| 6 | tacleNames=tacleNames.txt | 16 | |
| 17 | if [ $# -lt 5 ]; then | ||
| 18 | echo "Usage $0 -m MODE -p CPU -l LOOPS -b FILE [-B] [-I] RUN_ID" | ||
| 19 | echo " -m base|dis|pair Which benchmarking mode to use" | ||
| 20 | echo " -p CPU Which CPU to run each benchmark on" | ||
| 21 | echo " -l LOOPS How many loops of each benchmark to do" | ||
| 22 | echo " -b FILE List of benchmarks to execute. Optional tab-" | ||
| 23 | echo " delimited 2nd column specifies an input" | ||
| 24 | echo " generation command (fed to bench via stdin)" | ||
| 25 | echo " -B Enable background contenders on other CCXes" | ||
| 26 | echo " -I xi|i3|i Isolation mode: none (xi) (default), way-based" | ||
| 27 | echo " L3-only (i3), or color-based L2+L3 (i)" | ||
| 28 | echo "Mode base requires no additional options." | ||
| 29 | echo "Mode dis does not support the 2nd col. of -b and needs:" | ||
| 30 | echo " -W FILE List of working set sizes to pass gen_input.py" | ||
| 31 | echo " -T FILE Input template to pass to gen_input.py" | ||
| 32 | echo " -C FILE List of cache configurations to test" | ||
| 33 | echo "Mode pair options:" | ||
| 34 | echo " -P CPU CPU to run the 2nd benchmark on" | ||
| 35 | echo " -A Async. (Don't synchronize the pair at job" | ||
| 36 | echo " boundries.) Typically used SMT in soft realtime" | ||
| 37 | fi | ||
| 38 | |||
| 39 | # Name options similarly to rtspin | ||
| 40 | while getopts “m:p:l:b:BI:W:T:C:P:A” opt; do | ||
| 41 | case $opt in | ||
| 42 | # Required | ||
| 43 | m) mode=$OPTARG ;; | ||
| 44 | p) core=$OPTARG ;; | ||
| 45 | l) maxJobs=$OPTARG ;; | ||
| 46 | b) benchNames=$OPTARG ;; | ||
| 47 | # Optional | ||
| 48 | B) contend=1 ;; | ||
| 49 | I) iso_mode=$OPTARG ;; | ||
| 50 | # DIS | ||
| 51 | W) wss_settings=$OPTARG ;; | ||
| 52 | T) template_input=$OPTARG ;; | ||
| 53 | C) cache_settings=$OPTARG ;; | ||
| 54 | # Pair | ||
| 55 | P) core_two=$OPTARG ;; | ||
| 56 | A) async=1 ;; | ||
| 57 | esac | ||
| 58 | done | ||
| 59 | # Reset to read operands | ||
| 60 | shift $((OPTIND -1)) | ||
| 61 | userRunID=$1 | ||
| 62 | |||
| 63 | # Required argument checking | ||
| 64 | if [[ "$mode" != "base" && "$mode" != "dis" && $mode != pair ]]; then | ||
| 65 | echo "Invalid argument: MODE must be either 'base' or 'dis'" | ||
| 66 | exit | ||
| 67 | fi | ||
| 68 | if [[ ! -v core ]] || [[ ! -v maxJobs ]] || [[ ! -v benchNames ]]; then | ||
| 69 | echo "Missing argument: -p, -l, and -b are required" | ||
| 70 | exit | ||
| 71 | fi | ||
| 72 | if [[ ! -f "$benchNames" ]]; then | ||
| 73 | echo "Invalid argument: $benchNames des not exist" | ||
| 74 | exit | ||
| 75 | fi | ||
| 76 | if [[ ! -v userRunID ]]; then | ||
| 77 | echo "Missing argument: RUN_ID is required" | ||
| 78 | exit | ||
| 79 | fi | ||
| 80 | |||
| 81 | # DIS argument checking | ||
| 82 | if [[ "$mode" == "dis" ]] && [[ ! -v wss_settings || ! -v template_input || -z $cache_settings ]]; then | ||
| 83 | echo "Missing argument: DIS needs -W FILE -T FILE and -C FILE" | ||
| 84 | exit | ||
| 85 | fi | ||
| 86 | if [[ "$mode" == "dis" ]] && [[ ! -f "$wss_settings" ]]; then | ||
| 87 | echo "Invalid argument: $wss_settings does not exist" | ||
| 88 | exit | ||
| 89 | fi | ||
| 90 | if [[ "$mode" == "dis" ]] && [[ ! -f "$template_input" ]]; then | ||
| 91 | echo "Invalid argument: $template_input does not exist" | ||
| 92 | exit | ||
| 93 | fi | ||
| 94 | if [[ "$mode" == "dis" ]] && [[ ! -f "$cache_settings" ]]; then | ||
| 95 | echo "Invalid argument: $cache_settings does not exist" | ||
| 96 | exit | ||
| 97 | fi | ||
| 7 | 98 | ||
| 8 | if [ $# -lt 3 ]; then | 99 | # Pair argument checking |
| 9 | echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | 100 | if [[ "$mode" == "pair" && ! -v core_two ]]; then |
| 101 | echo "Missing argument: mode=pair reqires -P" | ||
| 102 | exit | ||
| 103 | fi | ||
| 104 | if [[ "$mode" != "pair" ]] && [[ -v async || -v core_two ]]; then | ||
| 105 | echo "Invalid argument: -A and -P require mode=pair" | ||
| 10 | exit | 106 | exit |
| 11 | fi | 107 | fi |
| 12 | 108 | ||
| 13 | if [ $# -gt 3 ]; then | 109 | # Additional checks |
| 14 | echo "Using alternate list of TACLe benchmarks from $4" | 110 | if [[ $userRunID == "" ]]; then |
| 15 | tacleNames=$4 | 111 | echo "Missing argument: a run ID is required" |
| 112 | exit | ||
| 113 | fi | ||
| 114 | if [[ -v contend && ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 115 | echo "ERROR: cannot find thrasher binary for -B. Exiting..." | ||
| 116 | exit | ||
| 117 | fi | ||
| 118 | if [[ $iso_mode == "i" && ! $(uname -a | grep "mc2") ]]; then | ||
| 119 | echo "Isolation mode 'i' requires the MC^2 kernel. Exiting..." | ||
| 120 | exit | ||
| 16 | fi | 121 | fi |
| 17 | 122 | ||
| 18 | if [ "$EUID" -ne 0 ] | 123 | # Check permissions and update state |
| 19 | then | 124 | if [[ "$EUID" != 0 ]]; then |
| 20 | echo "You need to be root to enable interrupt isolation and real-time execution!" | 125 | echo "You need to be root to enable interrupt isolation and real-time execution!" |
| 21 | exit | 126 | exit |
| 22 | fi | 127 | fi |
| 23 | 128 | ||
| 24 | echo "Making sure that binaries are up to date..." | 129 | echo "Loading benchmark names and input..." |
| 130 | |||
| 131 | # Read the names of each benchmark and load input. | ||
| 132 | # This might look a bit scary, but all it does is | ||
| 133 | # separate the two fields (1 or more tabs in-between), | ||
| 134 | # save the benchmark name, and execute the input | ||
| 135 | # command (storing its output in-memory for later). | ||
| 136 | j=0 | ||
| 137 | IFS=$'\r\n' | ||
| 25 | while read i; do | 138 | while read i; do |
| 26 | make bin/$i | 139 | bench[$j]=$(echo $i | tr -s "\t" | cut -f1) |
| 27 | done < $tacleNames | 140 | input[$j]=$(eval $(echo $i | tr -s "\t" | cut -s -f2)) |
| 141 | j=$(( $j + 1 )) | ||
| 142 | done < $benchNames | ||
| 143 | echo "Making sure that binaries are up to date..." | ||
| 144 | |||
| 145 | for b in ${bench[@]}; do | ||
| 146 | # Build "bin/bench" if bin directory | ||
| 147 | if [[ -d bin ]]; then | ||
| 148 | make bin/$b | ||
| 149 | fi | ||
| 150 | # If that failed, try a different name | ||
| 151 | if [[ "$?" != 0 || ! -d bin ]]; then | ||
| 152 | make $b | ||
| 153 | fi | ||
| 154 | # If bench is still not in bin or curr dir, fail | ||
| 155 | if [[ ! -f "./$b" && ! -f "./bin/$b" ]]; then | ||
| 156 | echo "Unable to find benchmark $b" | ||
| 157 | exit | ||
| 158 | fi | ||
| 159 | done | ||
| 28 | echo "Done. Disabling real-time throttling..." | 160 | echo "Done. Disabling real-time throttling..." |
| 29 | 161 | ||
| 30 | # Turn off rt throttling | 162 | # Turn off rt throttling |
| @@ -43,12 +175,34 @@ do | |||
| 43 | i=$(( $i + 1 )) | 175 | i=$(( $i + 1 )) |
| 44 | done | 176 | done |
| 45 | 177 | ||
| 46 | # Read the names of each benchmark | 178 | echo "Done. Creating cleanup handler..." |
| 47 | j=0 | 179 | function cleanup { |
| 48 | while read i; do | 180 | # End contending tasks |
| 49 | tacleProg[$j]=$i | 181 | if [[ -v contend ]]; then |
| 50 | j=$(( $j + 1 )) | 182 | killall thrasher |
| 51 | done < $tacleNames | 183 | fi |
| 184 | |||
| 185 | # Restore cache access to everyone | ||
| 186 | echo "L3:0=ffff;1=ffff;2=ffff;3=ffff" > /sys/fs/resctrl/schemata | ||
| 187 | if [[ -e /sys/fs/resctrl/benchmarks ]]; then | ||
| 188 | echo "" > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 189 | fi | ||
| 190 | if [[ -e /sys/fs/resctrl/benchmarks2 ]]; then | ||
| 191 | echo "" > /sys/fs/resctrl/benchmarks2/cpus_list | ||
| 192 | fi | ||
| 193 | |||
| 194 | # Put smp_affinty back the way it was | ||
| 195 | i=0 | ||
| 196 | for IRQ in /proc/irq/* | ||
| 197 | do | ||
| 198 | if [ -d $IRQ ]; then | ||
| 199 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 200 | fi | ||
| 201 | i=$(( $i + 1 )) | ||
| 202 | done | ||
| 203 | } | ||
| 204 | # This sets the cleanup function to be called when we exit for any reason | ||
| 205 | trap cleanup EXIT | ||
| 52 | 206 | ||
| 53 | echo "Done. Checking for wbinvd module..." | 207 | echo "Done. Checking for wbinvd module..." |
| 54 | if [[ ! -f "/proc/wbinvd" ]]; then | 208 | if [[ ! -f "/proc/wbinvd" ]]; then |
| @@ -56,21 +210,51 @@ if [[ ! -f "/proc/wbinvd" ]]; then | |||
| 56 | exit | 210 | exit |
| 57 | fi | 211 | fi |
| 58 | 212 | ||
| 59 | echo "Done. Setting cores $firstCore and $secondCore to 'performance'..." | 213 | echo "Done. Setting cores to 'performance'..." |
| 60 | echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor | 214 | echo "performance" > /sys/devices/system/cpu/cpu$core/cpufreq/scaling_governor |
| 61 | echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governo | 215 | if [[ -v core_two ]]; then |
| 216 | echo "performance" > /sys/devices/system/cpu/cpu$core_two/cpufreq/scaling_governor | ||
| 217 | fi | ||
| 62 | 218 | ||
| 63 | # Enable L3 isolation | 219 | # Enable L3 isolation |
| 64 | echo "Done. Enabling L3 isolation..." | 220 | echo "Done. Setting up L3 isolation..." |
| 65 | mount -t resctrl resctrl /sys/fs/resctrl | 221 | mount -t resctrl resctrl /sys/fs/resctrl |
| 66 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 67 | echo $1 > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 68 | # Reset global bandwith control and remove L3 from global | 222 | # Reset global bandwith control and remove L3 from global |
| 69 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | 223 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata |
| 70 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | 224 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata |
| 71 | # Alloc L3 to benchmark | 225 | # Alloc L3 to benchmark |
| 72 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | 226 | # (this logic is safe when $core_two is empty) |
| 73 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | 227 | if [[ $iso_mode == "i" ]]; then |
| 228 | # With "i" we rely on numactl to do isolation | ||
| 229 | # Full L3 access from both cores | ||
| 230 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 231 | # Must write both at the same time. Appends unsupported! | ||
| 232 | echo $core,$core_two > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 233 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 234 | # But each core is bound to its own numa mem node | ||
| 235 | numa_arg0="--membind=0" | ||
| 236 | numa_arg1="--membind=1" | ||
| 237 | elif [[ $iso_mode == "i3" ]]; then | ||
| 238 | # With "i3" we rely on resctrl to do isolation | ||
| 239 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 240 | mkdir -p /sys/fs/resctrl/benchmarks2 | ||
| 241 | echo $core > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 242 | echo $core_two > /sys/fs/resctrl/benchmarks2/cpus_list | ||
| 243 | echo "L3:0=0000;1=0000;2=0000;3=ff00" > /sys/fs/resctrl/benchmarks/schemata | ||
| 244 | echo "L3:0=0000;1=0000;2=0000;3=00ff" > /sys/fs/resctrl/benchmarks2/schemata | ||
| 245 | # Disable numa-based isolation | ||
| 246 | numa_arg0="--interleave=all" | ||
| 247 | numa_arg1="--interleave=all" | ||
| 248 | else | ||
| 249 | iso_mode="xi" | ||
| 250 | # No isolation via numactl or resctrl | ||
| 251 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 252 | echo $core,$core_two > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 253 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 254 | # Disable numa-based isolation | ||
| 255 | numa_arg0="--interleave=all" | ||
| 256 | numa_arg1="--interleave=all" | ||
| 257 | fi | ||
| 74 | echo "Done. Verifying configuration with user..." | 258 | echo "Done. Verifying configuration with user..." |
| 75 | 259 | ||
| 76 | # Generate file name string | 260 | # Generate file name string |
| @@ -80,34 +264,47 @@ runID=$(date +"%b%d-%H") | |||
| 80 | # Confirm configuration with user | 264 | # Confirm configuration with user |
| 81 | echo "=== Global Config ===" | 265 | echo "=== Global Config ===" |
| 82 | cat /sys/fs/resctrl/schemata | 266 | cat /sys/fs/resctrl/schemata |
| 83 | echo "=== Core $1 Config ===" | 267 | echo "=== NUMA Config ===" |
| 268 | echo " '$numa_arg0' and '$numa_arg1'" | ||
| 269 | echo "=== Core $(cat /sys/fs/resctrl/benchmarks/cpus_list) Config ===" | ||
| 84 | cat /sys/fs/resctrl/benchmarks/schemata | 270 | cat /sys/fs/resctrl/benchmarks/schemata |
| 85 | if [[ $5 == "--contend" ]]; then | 271 | if [[ -v core_two && $(cat /sys/fs/resctrl/benchmarks2/cpus_list) ]]; then |
| 86 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | 272 | echo "=== Core $(cat /sys/fs/resctrl/benchmarks2/cpus_list) Config ===" |
| 87 | echo "ERROR: thrasher binary not fonud. Exiting..." | 273 | cat /sys/fs/resctrl/benchmarks2/schemata |
| 88 | exit | 274 | fi |
| 89 | fi | 275 | |
| 276 | if [[ -v contend ]]; then | ||
| 90 | echo "Will run 6 contending tasks" | 277 | echo "Will run 6 contending tasks" |
| 91 | runID=$runID-c | 278 | runID=$runID-c |
| 92 | else | 279 | else |
| 93 | runID=$runID-xc | 280 | runID=$runID-xc |
| 94 | fi | 281 | fi |
| 95 | if uname -a | grep -q "mc2"; then | 282 | |
| 96 | echo "MC^2 Autodetected. Cache coloring and interleaving will be enabled." | 283 | runID=$runID-$iso_mode |
| 97 | runID=$runID-i | 284 | |
| 285 | if [[ -v async ]]; then | ||
| 286 | echo "Will use asynchronous job pairing" | ||
| 287 | runID=$runID-async | ||
| 288 | fi | ||
| 289 | |||
| 290 | if [[ $mode == "pair" && ! -v async ]]; then | ||
| 291 | echo "Results will be saved as $runID-$userRunID-A.txt and $runID-$userRunID-B.txt" | ||
| 98 | else | 292 | else |
| 99 | echo "MC^2 not detected." | 293 | echo "Results will be saved as $runID-$userRunID.txt" |
| 100 | runID=$runID-xi | ||
| 101 | fi | 294 | fi |
| 102 | if pwd | grep -qi dis; then | 295 | |
| 103 | echo "Autodetected DIS. Will use script-level looping." | 296 | if [[ $core == 0 || "$core_two" == 0 ]]; then |
| 297 | echo "!!!!! DANGER !!!!!" | ||
| 298 | echo "! Running real-time tasks on core 0 will conflict with interrupt" | ||
| 299 | echo "! handling and likely freeze your system! Only continue if you know" | ||
| 300 | echo "! exactly what you're doing!!" | ||
| 301 | echo "!!!!!!!!!!!!!!!!!!" | ||
| 104 | fi | 302 | fi |
| 105 | echo "Results will be saved as $runID-$userRunID.txt" | ||
| 106 | echo "Press enter to confirm environment, Ctrl-C to exit..." | 303 | echo "Press enter to confirm environment, Ctrl-C to exit..." |
| 107 | read | 304 | read |
| 108 | 305 | ||
| 109 | # Start contending tasks | 306 | # Start contending tasks |
| 110 | if [[ $5 == "--contend" ]]; then | 307 | if [[ -v contend ]]; then |
| 111 | echo "Done. Starting 6 contending tasks..." | 308 | echo "Done. Starting 6 contending tasks..." |
| 112 | # Run two contending tasks on each other CCX | 309 | # Run two contending tasks on each other CCX |
| 113 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | 310 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & |
| @@ -120,37 +317,82 @@ fi | |||
| 120 | sleep 1 # Wait for contending tasks to start | 317 | sleep 1 # Wait for contending tasks to start |
| 121 | echo "Done. Beginning benchmarks..." | 318 | echo "Done. Beginning benchmarks..." |
| 122 | 319 | ||
| 123 | num_tests=$(wc -l < $tacleNames) | 320 | # Output coloring |
| 124 | for (( i = 0; i < $num_tests ; i++ )) | 321 | FAIL_COLOR="\033[0;31m" |
| 125 | do | 322 | GOOD_COLOR="\033[0;32m" |
| 126 | # If using DIS, we have to iterate in the script as DIS won't do it for us | 323 | RESET_COLOR="\033[0m" |
| 127 | pwd | grep -qi dis | 324 | |
| 128 | iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))") | 325 | # For each benchmark |
| 129 | for ((k=0;k<=iters;k++)); do | 326 | for (( i = 0; i < ${#bench[@]} ; i++ )); do |
| 327 | # Search for the benchmark in this directory, than /bin | ||
| 328 | if [[ -f ${bench[$i]} ]]; then | ||
| 329 | prefix="." | ||
| 330 | else | ||
| 331 | prefix="./bin" | ||
| 332 | fi | ||
| 333 | if [[ "$mode" == "base" ]]; then | ||
| 334 | # Just run the benchmark if TACLeBench | ||
| 130 | # Check if we're using LITMUS^RT or not | 335 | # Check if we're using LITMUS^RT or not |
| 131 | if [[ -f source/extra.h ]] && grep -q "#define LITMUS 1" source/extra.h; then | 336 | if [[ -v $LITMUS ]]; then |
| 132 | ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | 337 | echo "${input[$i]}" | numactl $numa_arg0 $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $runID-$userRunID 1 |
| 133 | else | 338 | else |
| 134 | # Interleave memory allocations between all nodes (only 1 node w/out MC^2) | 339 | # Remember: Unpaired tasks always get access to all colors (so we --interleave all) |
| 135 | chrt -r 97 numactl --interleave=all taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | 340 | echo "${input[$i]}" | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $runID-$userRunID 1 |
| 136 | #chrt -r 97 numactl -m 0 taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID-NOINTERLEAVE 1 | ||
| 137 | fi | 341 | fi |
| 138 | done | 342 | elif [[ "$mode" == "dis" ]]; then |
| 139 | echo COMPLETE: ${tacleProg[$i]} | 343 | # Loop through each WSS and cache config if DIS |
| 140 | done | 344 | while read j; do # For cache setting |
| 141 | 345 | echo $j > /sys/fs/resctrl/benchmarks/schemata | |
| 142 | # End contending tasks | 346 | while read ii; do # For WSS setting |
| 143 | if [[ $5 == "--contend" ]]; then | 347 | if [[ -v $LITMUS ]]; then |
| 144 | killall thrasher | 348 | ./gen_input.py ${bench[$i]} inputs/${bench[$i]^}/$template_input $ii | numactl $numa_arg0 $prefix/${bench[$i]} $bench[$i]}-$ii-$j $maxJobs $core $runID 1 |
| 145 | fi | 349 | else |
| 146 | 350 | ./gen_input.py ${bench[$i]} inputs/${bench[$i]^}/$template_input $ii | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]}-$ii-$j $maxJobs $core $runID 1 | |
| 147 | # Put smp_affinty back the way it was | 351 | fi |
| 148 | i=0 | 352 | done < $wss_settings |
| 149 | for IRQ in /proc/irq/* | 353 | done < $cache_settings |
| 150 | do | 354 | elif [[ "$mode" == "pair" ]]; then |
| 151 | if [ -d $IRQ ]; then | 355 | # Only async truly needs to do all-pairs |
| 152 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | 356 | if [[ ! -v async ]]; then |
| 357 | start=$i | ||
| 358 | else | ||
| 359 | start=0 | ||
| 360 | fi | ||
| 361 | for (( j = $start; j < ${#bench[@]} ; j++ )); do | ||
| 362 | if [[ ! -v async ]]; then | ||
| 363 | # Synchronize between pairs - original hard real-time SMT approach | ||
| 364 | if [[ -v $LITMUS ]]; then | ||
| 365 | echo "${input[$i]}" | numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $core_two ${bench[$j]} $runID-$userRunID-A 1 & PID1=$!; | ||
| 366 | echo "${input[$j]}" | numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$j]} ${bench[$j]} $maxJobs $core_two $core ${bench[$i]} $runID-$userRunID-B 2 & PID2=$!; | ||
| 367 | else | ||
| 368 | echo "${input[$i]}" | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $core_two ${bench[$j]} $runID-$userRunID-A 1 & PID1=$!; | ||
| 369 | echo "${input[$j]}" | chrt -r 97 numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$j]} ${bench[$j]} $maxJobs $core_two $core ${bench[$i]} $runID-$userRunID-B 2 & PID2=$!; | ||
| 370 | fi | ||
| 371 | # We launched them asynchronously, so we have to wait | ||
| 372 | wait $PID1 $PID2 | ||
| 373 | else | ||
| 374 | # No synchronization between pairs - original soft real-time SMT approach | ||
| 375 | if [[ -v $LITMUS ]]; then | ||
| 376 | echo "${input[$j]}" | numactl $numa_arg0 taskset -c $core $prefix/${bench[$j]} ${bench[$j]} -1 $core NULL 0 & PID1=$!; | ||
| 377 | echo "${input[$i]}" | numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$i]} ${bench[$i]}"+"${bench[$j]} $maxJobs $core_two $runID-$userRunID 1 & PID2=$!; | ||
| 378 | else | ||
| 379 | echo "${input[$j]}" | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$j]} ${bench[$j]} -1 $core NULL 0 & PID1=$!; | ||
| 380 | echo "${input[$i]}" | chrt -r 97 numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$i]} ${bench[$i]}"+"${bench[$j]} $maxJobs $core_two $runID-$userRunID 1 & PID2=$!; | ||
| 381 | fi | ||
| 382 | wait $PID2 | ||
| 383 | kill $PID1 | ||
| 384 | fi | ||
| 385 | if [[ $? != 0 ]]; then | ||
| 386 | echo -e ${FAIL_COLOR}FAILED${RESET_COLOR}: ${bench[$i]} ${bench[$j]} | ||
| 387 | else | ||
| 388 | echo -e ${GOOD_COLOR}COMPLETE${RESET_COLOR}: ${bench[$i]} ${bench[$j]} | ||
| 389 | fi | ||
| 390 | done | ||
| 391 | fi | ||
| 392 | if [[ $? != 0 ]]; then | ||
| 393 | echo -e ${FAIL_COLOR}FAILED${RESET_COLOR}: ${bench[$i]} | ||
| 394 | else | ||
| 395 | echo -e ${GOOD_COLOR}COMPLETE${RESET_COLOR}: ${bench[$i]} | ||
| 153 | fi | 396 | fi |
| 154 | i=$(( $i + 1 )) | ||
| 155 | done | 397 | done |
| 156 | 398 | ||
diff --git a/run_dis_cache_vs_wss.sh b/run_dis_cache_vs_wss.sh new file mode 100755 index 0000000..2a7991e --- /dev/null +++ b/run_dis_cache_vs_wss.sh | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Run baselines for all the DIS tasks | ||
| 3 | if [ "$EUID" -ne 0 ] | ||
| 4 | then | ||
| 5 | echo "You need to be root to enable cache way and interrupt isolation!" | ||
| 6 | exit | ||
| 7 | fi | ||
| 8 | |||
| 9 | if uname -a | grep -q "mc2"; then | ||
| 10 | echo "MC^2 detected! Cache isolation will be enabled" | ||
| 11 | iso="i" | ||
| 12 | else | ||
| 13 | echo "MC^2 not detected." | ||
| 14 | iso="xi" | ||
| 15 | fi | ||
| 16 | |||
| 17 | cd dis | ||
| 18 | |||
| 19 | WSSS=WSSS_maxstride2mb | ||
| 20 | caches=caches_all | ||
| 21 | if [[ $1 == "--contend" ]]; then | ||
| 22 | echo "Will run 6 contending tasks" | ||
| 23 | echo "Files will be named $datestring-<benchmark name>-10-c-"$iso".txt" | ||
| 24 | echo "Please verify the above settings. Press enter to continue..." | ||
| 25 | read | ||
| 26 | echo "field" > /tmp/disNames.txt | ||
| 27 | ../run_bench.sh -p 15 -B -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 field-10 | ||
| 28 | ./postproc.sh $datestring-field-10-c-$iso | ||
| 29 | echo "matrix" > /tmp/disNames.txt | ||
| 30 | ../run_bench.sh -p 15 -B -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 matrix-10 | ||
| 31 | ./postproc.sh $datestring-matrix-10-c-$iso | ||
| 32 | echo "neighborhood" > /tmp/disNames.txt | ||
| 33 | ../run_bench.sh -p 15 -B -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 neighborhood-10 | ||
| 34 | ./postproc.sh $datestring-neighborhood-10-c-$iso | ||
| 35 | echo "pointer" > /tmp/disNames.txt | ||
| 36 | ../run_bench.sh -p 15 -B -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 pointer-10 | ||
| 37 | ./postproc.sh $datestring-pointer-10-c-$iso | ||
| 38 | echo "transitive" > /tmp/disNames.txt | ||
| 39 | ../run_bench.sh -p 15 -B -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 transitive-10 | ||
| 40 | ./postproc.sh $datestring-transitive-10-c-$iso | ||
| 41 | echo "update" > /tmp/disNames.txt | ||
| 42 | ../run_bench.sh -p 15 -B -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 update-10 | ||
| 43 | ./postproc.sh $datestring-update-10-c-$iso | ||
| 44 | else | ||
| 45 | echo "Will run no contending tasks (use --contend for contending tasks)" | ||
| 46 | echo "Files will be named $datestring-<benchmark name>-10-xc-"$iso".txt" | ||
| 47 | echo "Please verify the above settings. Press enter to continue..." | ||
| 48 | read | ||
| 49 | echo "field" > /tmp/disNames.txt | ||
| 50 | ../run_bench.sh -p 15 -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 field-10 | ||
| 51 | ./postproc.sh $datestring-field-10-xc-$iso | ||
| 52 | echo "matrix" > /tmp/disNames.txt | ||
| 53 | ../run_bench.sh -p 15 -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 matrix-10 | ||
| 54 | ./postproc.sh $datestring-matrix-10-xc-$iso | ||
| 55 | echo "neighborhood" > /tmp/disNames.txt | ||
| 56 | ../run_bench.sh -p 15 -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 neighborhood-10 | ||
| 57 | ./postproc.sh $datestring-neighborhood-10-xc-$iso | ||
| 58 | echo "pointer" > /tmp/disNames.txt | ||
| 59 | ../run_bench.sh -p 15 -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 pointer-10 | ||
| 60 | ./postproc.sh $datestring-pointer-10-xc-$iso | ||
| 61 | echo "transitive" > /tmp/disNames.txt | ||
| 62 | ../run_bench.sh -p 15 -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 transitive-10 | ||
| 63 | ./postproc.sh $datestring-transitive-10-xc-$iso | ||
| 64 | echo "update" > /tmp/disNames.txt | ||
| 65 | ../run_bench.sh -p 15 -l 10 -b /tmp/disNames.txt -W WSSS -C caches -T in0 update-10 | ||
| 66 | ./postproc.sh $datestring-update-10-xc-$iso | ||
| 67 | fi | ||
diff --git a/run_everything.sh b/run_everything.sh deleted file mode 100755 index 8d46ad7..0000000 --- a/run_everything.sh +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | maxJobs=$1 | ||
| 4 | runID=$2 | ||
| 5 | |||
| 6 | if [ $# -lt 2 ]; then | ||
| 7 | echo "Usage $0 <number of iterations> <run ID>" | ||
| 8 | exit | ||
| 9 | fi | ||
| 10 | |||
| 11 | date | ||
| 12 | cd baseline | ||
| 13 | make all | ||
| 14 | ../interference-benchmark/deactivateCoresSMT.bash | ||
| 15 | ./run_baseline.sh 15 $maxJobs $runID | ||
| 16 | date | ||
| 17 | cd ../all_pairs | ||
| 18 | ../../interference-benchmark/activateCores.bash | ||
| 19 | make all | ||
| 20 | ./run_all_pairs.sh 15 31 $maxJobs $runID | ||
| 21 | date | ||
diff --git a/run_tacle_rtss20.sh b/run_tacle_rtss20.sh deleted file mode 100755 index 6770c55..0000000 --- a/run_tacle_rtss20.sh +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Copyright 2020 Joshua Bakita | ||
| 3 | # This script runs the baselines and Level-A/B and Level-C all_pairs for TACLe w/out MC^2 | ||
| 4 | |||
| 5 | if uname -a | grep -q mc2; then | ||
| 6 | echo "You need to run this without MC^2!" | ||
| 7 | exit | ||
| 8 | fi | ||
| 9 | |||
| 10 | if [ "$EUID" -ne 0 ]; then | ||
| 11 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 12 | exit | ||
| 13 | fi | ||
| 14 | |||
| 15 | echo "This will run the contended and uncontended TACLe baseline, all-pairs, and Level-C micro-benchamarks in non-interactive mode." | ||
| 16 | echo "Please press enter to confirm (Ctrl-C to abort)..." | ||
| 17 | read | ||
| 18 | |||
| 19 | echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor | ||
| 20 | echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governor | ||
| 21 | |||
| 22 | cd baseline | ||
| 23 | baseNo=baseline/$(date +"%b%d-%H")-xc-xi-1k.txt | ||
| 24 | echo "" | ./run_baseline.sh 15 1001 1k ../all_pairs/tacleNames.txt | ||
| 25 | baseYes=baseline/$(date +"%b%d-%H")-c-xi-1k.txt | ||
| 26 | echo "" | ./run_baseline.sh 15 1001 1k ../all_pairs/tacleNames.txt --contend | ||
| 27 | |||
| 28 | cd ../all_pairs | ||
| 29 | pairsNo=all_pairs/$(date +"%b%d-%H")-xc-xi-1k | ||
| 30 | echo "" | ./run_all_pairs.sh 15 31 1001 1k ./tacleNames.txt | ||
| 31 | pairsYes=all_pairs/$(date +"%b%d-%H")-c-xi-1k | ||
| 32 | echo "" | ./run_all_pairs.sh 15 31 1001 1k ./tacleNames.txt --contend | ||
| 33 | |||
| 34 | cd ../baseline | ||
| 35 | echo "" | ../smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh 15 31 1001 1k ./tacleNames.txt | ||
| 36 | cNo=all_pairs/$(date +"%b%d-%H")-xc-xi-1k-LC-TACLe.txt | ||
| 37 | echo "" | ../smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh 15 31 1001 1k ./tacleNames.txt --contend | ||
| 38 | cYes=all_pairs/$(date +"%b%d-%H")-c-xi-1k-LC-TACLe.txt | ||
| 39 | |||
| 40 | echo "==== DONE ===" | ||
| 41 | echo "Results are in:" | ||
| 42 | echo "- "$baseNo | ||
| 43 | echo "- "$baseYes | ||
| 44 | echo "- "$pairsNo" (A/B)" | ||
| 45 | echo "- "$pairsYes" (A/B)" | ||
| 46 | echo "- "$cNo | ||
| 47 | echo "- "$cYes | ||
| 48 | |||
diff --git a/smt_analysis/computeLCslowdown.py b/smt_analysis/computeLCslowdown.py new file mode 100755 index 0000000..bcd22da --- /dev/null +++ b/smt_analysis/computeLCslowdown.py | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | #!/usr/bin/python3 | ||
| 2 | import numpy as np | ||
| 3 | import sys | ||
| 4 | import plotille.plotille as plt | ||
| 5 | from libSMT import * | ||
| 6 | TIMING_ERROR = 1000 #ns | ||
| 7 | ASYNC_FORMAT = False | ||
| 8 | |||
| 9 | def print_usage(): | ||
| 10 | print("This program takes in the all-pairs and baseline SMT data and computes the worst-case slowdown against any other task when SMT is enabled.", file=sys.stderr) | ||
| 11 | print("Level-A/B usage: {} <file -A> <file -B> <baseline file>".format(sys.argv[0]), file=sys.stderr) | ||
| 12 | print("Level-C usage: {} <continuous pairs> <baseline file>".format(sys.argv[0]), file=sys.stderr) | ||
| 13 | |||
| 14 | # Check that we got the right number of parameters | ||
| 15 | if len(sys.argv) < 3: | ||
| 16 | print_usage() | ||
| 17 | exit() | ||
| 18 | |||
| 19 | if len(sys.argv) > 3: | ||
| 20 | print("Reading file using synchronous pair format...") | ||
| 21 | print("Are you sure you want to do this? For the RTAS'21 paper, L-A/-B pairs should use the other script.") | ||
| 22 | input("Press enter to continue, Ctrl+C to exit...") | ||
| 23 | else: | ||
| 24 | print("Reading file using asynchronous pair format...") | ||
| 25 | ASYNC_FORMAT = True | ||
| 26 | |||
| 27 | assert_valid_input_files(sys.argv[1:-1], print_usage) | ||
| 28 | |||
| 29 | # Pull in the data | ||
| 30 | if not ASYNC_FORMAT: | ||
| 31 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[3]) | ||
| 32 | paired_times, paired_offsets, name_to_idx, idx_to_name = load_paired(sys.argv[1], sys.argv[2], len(list(baseline_times.keys()))) | ||
| 33 | for key in baseline_times: | ||
| 34 | print(key,max(baseline_times[key])) | ||
| 35 | else: | ||
| 36 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[2]) | ||
| 37 | paired_times, name_to_idx, idx_to_name = load_fake_paired(sys.argv[1]) | ||
| 38 | |||
| 39 | # We work iff the baseline was run for the same set of benchmarks as the pairs were | ||
| 40 | assert_base_and_pair_keys_match(baseline_times, name_to_idx) | ||
| 41 | |||
| 42 | # Only consider benchmarks that are at least an order of magnitude longer than the timing error | ||
| 43 | reliableNames = [] | ||
| 44 | for i in range(0, len(name_to_idx)): | ||
| 45 | benchmark = idx_to_name[i] | ||
| 46 | if min(baseline_times[benchmark]) > TIMING_ERROR * 10: | ||
| 47 | reliableNames.append(benchmark) | ||
| 48 | |||
| 49 | # Compute worst-case SMT slowdown for each benchmark | ||
| 50 | print("Bench Mi") | ||
| 51 | # Print rows | ||
| 52 | sample_f = np.mean # Change this to np.mean to use mean values in Mi generation | ||
| 53 | M_vals = [] | ||
| 54 | for b1 in reliableNames: | ||
| 55 | print("{:<14.14}:".format(b1), end=" ") | ||
| 56 | max_mi = 0 | ||
| 57 | # Scan through everyone we ran against and find our maximum slowdown | ||
| 58 | for b2 in reliableNames: | ||
| 59 | time_with_smt = sample_f(paired_times[name_to_idx[b1]][name_to_idx[b2]]) | ||
| 60 | time_wout_smt = sample_f(baseline_times[b1]) | ||
| 61 | M = time_with_smt / time_wout_smt | ||
| 62 | max_mi = max(max_mi, M) | ||
| 63 | print("{:>10.3}".format(max_mi), end=" ") | ||
| 64 | M_vals.append(max_mi) | ||
| 65 | print("") | ||
| 66 | # Print some statistics about the distribution | ||
| 67 | print("Average: {:>5.3} with standard deviation {:>5.3} using `{}`".format(np.mean(M_vals), np.std(M_vals), sample_f.__name__)) | ||
| 68 | Ms = np.asarray(M_vals, dtype=np.float32) | ||
| 69 | print(np.sum(Ms <= 1), "of", len(M_vals), "M_i values are at most one -", 100*np.sum(Ms <= 1)/len(M_vals), "percent") | ||
| 70 | print(np.sum(Ms > 2), "of", len(M_vals), "M_i values are greater than two -", 100*np.sum(Ms > 2)/len(M_vals), "percent") | ||
| 71 | M_vals_to_plot = Ms | ||
| 72 | |||
| 73 | print(plt.hist(M_vals_to_plot, bins=10)) | ||
diff --git a/smt_analysis/computeSMTslowdown.py b/smt_analysis/computeSMTslowdown.py new file mode 100755 index 0000000..805def1 --- /dev/null +++ b/smt_analysis/computeSMTslowdown.py | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | #!/usr/bin/python3 | ||
| 2 | from typing import List, Any | ||
| 3 | import numpy as np | ||
| 4 | from scipy import stats | ||
| 5 | import sys | ||
| 6 | import plotille.plotille as plt | ||
| 7 | TIMING_ERROR = 1000 #ns | ||
| 8 | LEVEL_C_ANALYSIS = False | ||
| 9 | from libSMT import * | ||
| 10 | |||
| 11 | def print_usage(): | ||
| 12 | print("This program takes in the all-pairs and baseline SMT data and computes how much each program is slowed when SMT in enabled.", file=sys.stderr) | ||
| 13 | print("Level-A/B usage: {} <file -A> <file -B> <baseline file> --cij".format(sys.argv[0]), file=sys.stderr) | ||
| 14 | print("Level-C usage: {} <continuous pairs> <baseline file>".format(sys.argv[0]), file=sys.stderr) | ||
| 15 | |||
| 16 | # Check that we got the right number of parameters | ||
| 17 | if len(sys.argv) < 3: | ||
| 18 | print_usage() | ||
| 19 | exit() | ||
| 20 | |||
| 21 | if len(sys.argv) > 3: | ||
| 22 | print("Analyzing results using Level-A/B methodology...") | ||
| 23 | else: | ||
| 24 | print("Analyzing results using Level-C methodology...") | ||
| 25 | LEVEL_C_ANALYSIS = True | ||
| 26 | |||
| 27 | assert_valid_input_files(sys.argv[1:-1], print_usage); | ||
| 28 | |||
| 29 | # Print Cij values rather than Mij | ||
| 30 | TIMES_ONLY = len(sys.argv) > 4 and "--cij" in sys.argv[4] | ||
| 31 | OK_PAIRS_ONLY = len(sys.argv) > 4 and "--cij-ok" in sys.argv[4] | ||
| 32 | |||
| 33 | # Pull in the data | ||
| 34 | if not LEVEL_C_ANALYSIS: | ||
| 35 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[3]) | ||
| 36 | paired_times, paired_offsets, name_to_idx, idx_to_name = load_paired(sys.argv[1], sys.argv[2], len(list(baseline_times.keys()))) | ||
| 37 | for key in baseline_times: | ||
| 38 | print(key,max(baseline_times[key])) | ||
| 39 | else: | ||
| 40 | # Paired times use an abuse of the baseline file format | ||
| 41 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[2]) | ||
| 42 | paired_times, name_to_idx, idx_to_name = load_fake_paired(sys.argv[1]) | ||
| 43 | |||
| 44 | # We work iff the baseline was run for the same set of benchmarks as the pairs were | ||
| 45 | assert_base_and_pair_keys_match(baseline_times, name_to_idx) | ||
| 46 | |||
| 47 | # Only consider benchmarks that are at least an order of magnitude longer than the timing error | ||
| 48 | reliableNames = [] | ||
| 49 | for i in range(0, len(name_to_idx)): | ||
| 50 | benchmark = idx_to_name[i] | ||
| 51 | if min(baseline_times[benchmark]) > TIMING_ERROR * 10: | ||
| 52 | reliableNames.append(benchmark) | ||
| 53 | |||
| 54 | # Compute SMT slowdown for each benchmark | ||
| 55 | # Output format: table, each row is one benchmark and each column is one benchmark | ||
| 56 | # each cell is base1 + base2*m = pair solved for m, aka (pair - base1) / base2 | ||
| 57 | # Print table header | ||
| 58 | print("Bench ", end=" ") | ||
| 59 | for name in reliableNames: | ||
| 60 | if not TIMES_ONLY: print("{:<10.10}".format(name), end=" ") | ||
| 61 | if TIMES_ONLY: print("{:<12.12}".format(name), end=" ") | ||
| 62 | print() | ||
| 63 | # Print rows | ||
| 64 | sample_f = max # Change this to np.mean to use mean values in Mij generation | ||
| 65 | M_vals = [] | ||
| 66 | for b1 in reliableNames: | ||
| 67 | if not TIMES_ONLY: print("{:<14.14}:".format(b1), end=" ") | ||
| 68 | if TIMES_ONLY: print("{:<14.14}:".format(b1), end=" ") | ||
| 69 | for b2 in reliableNames: | ||
| 70 | if not LEVEL_C_ANALYSIS: | ||
| 71 | Ci = max(sample_f(baseline_times[b1]), sample_f(baseline_times[b2])) | ||
| 72 | Cj = min(sample_f(baseline_times[b1]), sample_f(baseline_times[b2])) | ||
| 73 | Cij = sample_f(paired_times[name_to_idx[b1]][name_to_idx[b2]]) | ||
| 74 | if False: | ||
| 75 | M = np.std(paired_times[name_to_idx[b1]][name_to_idx[b2]]) / np.mean(paired_times[name_to_idx[b1]][name_to_idx[b2]]) | ||
| 76 | else: | ||
| 77 | M = (Cij - Ci) / Cj | ||
| 78 | if Cij and Cj * 10 > Ci: # We don't pair tasks with more than a 10x difference in length | ||
| 79 | M_vals.append(M) | ||
| 80 | if not TIMES_ONLY: print("{:>10.3}".format(M), end=" ") | ||
| 81 | else: | ||
| 82 | if not TIMES_ONLY: print("{:>10}".format("N/A"), end=" ") | ||
| 83 | |||
| 84 | if TIMES_ONLY and (not OK_PAIRS_ONLY or Cj * 10 > Ci): | ||
| 85 | print("{:>12}".format(Cij), end=" ") | ||
| 86 | elif OK_PAIRS_ONLY and Cj * 10 <= Ci: | ||
| 87 | print("{:>12}".format("0"), end=" ") | ||
| 88 | |||
| 89 | else: | ||
| 90 | time_with_smt = sample_f(paired_times[name_to_idx[b1]][name_to_idx[b2]]) | ||
| 91 | time_wout_smt = sample_f(baseline_times[b1]) | ||
| 92 | M = time_with_smt / time_wout_smt | ||
| 93 | M_vals.append(M) | ||
| 94 | print("{:>10.3}".format(M), end=" ") | ||
| 95 | print("") | ||
| 96 | # Print some statistics about the distribution | ||
| 97 | print("Average: {:>5.3} with standard deviation {:>5.3} using `{}`".format(np.mean(M_vals), np.std(M_vals), sample_f.__name__)) | ||
| 98 | Ms = np.asarray(M_vals, dtype=np.float32) | ||
| 99 | if not LEVEL_C_ANALYSIS: | ||
| 100 | print(np.sum(Ms <= 0), "of", len(M_vals), "M_i:j values are at most zero -", 100*np.sum(Ms <= 0)/len(M_vals), "percent") | ||
| 101 | print(np.sum(Ms > 1), "of", len(M_vals), "M_i:j values are greater than one -", 100*np.sum(Ms > 1)/len(M_vals), "percent") | ||
| 102 | M_vals_to_plot = Ms[np.logical_and(Ms > 0, Ms <= 1)] | ||
| 103 | else: | ||
| 104 | print(np.sum(Ms <= 1), "of", len(M_vals), "M_i:j values are at most one -", 100*np.sum(Ms <= 1)/len(M_vals), "percent") | ||
| 105 | print(np.sum(Ms > 2), "of", len(M_vals), "M_i:j values are greater than two -", 100*np.sum(Ms > 2)/len(M_vals), "percent") | ||
| 106 | M_vals_to_plot = Ms | ||
| 107 | |||
| 108 | print("Using Sim's analysis, average: {:>5.3} with standard deviation {:>5.3} using `{}`".format(np.mean(list(M_vals_to_plot)), np.std(list(M_vals_to_plot)), sample_f.__name__)) | ||
| 109 | print(plt.hist(M_vals_to_plot, bins=10)) | ||
| 110 | |||
| 111 | ##### BELOW TEXT IS OLD OFFSET CODE (patched) ##### | ||
| 112 | ## This still works, but is hacky and deprecated ## | ||
| 113 | ## PearsonR doesn't work though ## | ||
| 114 | if not LEVEL_C_ANALYSIS and False: | ||
| 115 | benchmarkNames = idx_to_name | ||
| 116 | benchmarkCount = len(benchmarkNames) | ||
| 117 | numJobs = len(paired_times[0][0]) | ||
| 118 | |||
| 119 | reliableNames=["ndes", "cjpeg_wrbmp", "adpcm_enc", "cjpeg_transupp", "epic", "gsm_dec", "h264_dec", "huff_enc", "rijndael_enc", "rijndael_dec", "gsm_enc", "ammunition", "mpeg2"] | ||
| 120 | |||
| 121 | #stats.pearsonr(time[b1][b2], oList), | ||
| 122 | |||
| 123 | with open("weakRelPairs_offset.csv", mode="w+") as f3: | ||
| 124 | print("Benchmark1", "Benchmark2", "minOffset", "maxOffset", "meanOffset", "meddOffset", "stdOffset", "minLength", "maxLength", sep=",", file=f3) | ||
| 125 | for b1 in range (0, benchmarkCount): | ||
| 126 | for b2 in range (0, benchmarkCount): | ||
| 127 | if benchmarkNames[b1] in reliableNames and benchmarkNames[b2] in reliableNames: | ||
| 128 | #exclude last job due to inccurate timing | ||
| 129 | oList = paired_offsets[b1][b2][:numJobs-1] | ||
| 130 | jList = paired_times[b1][b2][:numJobs-1] | ||
| 131 | # plt.scatter(oList, jList) | ||
| 132 | # plt.title(benchmarkNames[b1] + ", " + benchmarkNames[b2]) | ||
| 133 | # plt.show() | ||
| 134 | # print(benchmarkNames[b1], benchmarkNames[b2], min(oList), max(oList), np.mean(oList), np.median(oList), np.std(oList), stats.pearsonr(jList, oList), stats.spearmanr(jList, oList), sep=",", file=f3) | ||
| 135 | print(benchmarkNames[b1], benchmarkNames[b2], min(oList), max(oList), np.mean(oList), np.median(oList), np.std(oList), min(jList), max(jList), sep=",", file=f3) | ||
| 136 | """ | ||
| 137 | #with open("reliableGraphs.csv", mode="x") as f3: | ||
| 138 | for b1 in range(0, benchmarkCount): | ||
| 139 | for b2 in range(0, benchmarkCount): | ||
| 140 | if benchmarkNames[b1] in reliableNames and benchmarkNames[b2] in reliableNames: | ||
| 141 | oList = offset[b1][b2][:numJobs - 1] | ||
| 142 | jList=time[b1][b2][:numJobs-1] | ||
| 143 | # offset, time scatterplot | ||
| 144 | plt.scatter(oList, jList) | ||
| 145 | plt.title(benchmarkNames[b1] + " " + benchmarkNames[b2] + " Offsets v. Time") | ||
| 146 | plt.show() | ||
| 147 | #time histogram | ||
| 148 | #plt.hist(jList, bins=10) | ||
| 149 | #plt.title(benchmarkNames[b1] + benchmarkNames[b2] + "Completion Times") | ||
| 150 | #plt.show() | ||
| 151 | #offset histogram | ||
| 152 | #plt.hist(oList, bins=10) | ||
| 153 | #plt.title(benchmarkNames[b1] + benchmarkNames[b2] + "Offsets") | ||
| 154 | #plt.show() | ||
| 155 | """ | ||
diff --git a/smt_analysis/libSMT.py b/smt_analysis/libSMT.py new file mode 100755 index 0000000..cca2fce --- /dev/null +++ b/smt_analysis/libSMT.py | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | import numpy as np | ||
| 2 | import sys | ||
| 3 | import os | ||
| 4 | |||
| 5 | def assert_valid_input_files(names, on_fail): | ||
| 6 | # Check that all input files are valid | ||
| 7 | for f in names: | ||
| 8 | if not os.path.exists(f) or os.path.getsize(f) == 0: | ||
| 9 | print("ERROR: File '{}' does not exist or is empty".format(f), file=sys.stderr); | ||
| 10 | on_fail() | ||
| 11 | exit() | ||
| 12 | |||
| 13 | # This parses the result data from unthreaded timing experiments | ||
| 14 | # @param f File name to load | ||
| 15 | # @returns res Map of benchmark name to sample count | ||
| 16 | # @returns samples Map of benchmark name to list of execution time samples | ||
| 17 | # @returns max_res May of benchmark to maximum execution time among all samples for that benchmark | ||
| 18 | def load_baseline(f): | ||
| 19 | # constants for columns of baseline data files | ||
| 20 | TOTAL_NS = 5 | ||
| 21 | BENCH_NAME = 0 | ||
| 22 | SAMPLES = 4 | ||
| 23 | |||
| 24 | # Load baseline data. This logic is based off the summarize programs | ||
| 25 | res = {} # Map of benchmark to list of all execution time samples | ||
| 26 | samples = {} # Map of benchmark name to sample count | ||
| 27 | max_res = {} # Map of benchmark name to maximum execution time | ||
| 28 | |||
| 29 | with open(f) as fp: | ||
| 30 | for line in fp: | ||
| 31 | s = line.split() | ||
| 32 | if s[BENCH_NAME] not in res: | ||
| 33 | res[s[BENCH_NAME]] = list([int(s[TOTAL_NS])]) | ||
| 34 | samples[s[BENCH_NAME]] = int(s[SAMPLES]) | ||
| 35 | max_res[s[BENCH_NAME]] = int(s[TOTAL_NS]) | ||
| 36 | else: | ||
| 37 | res[s[BENCH_NAME]].append(int(s[TOTAL_NS])) | ||
| 38 | max_res[s[BENCH_NAME]] = max(int(s[TOTAL_NS]), max_res[s[BENCH_NAME]]) | ||
| 39 | return res, samples, max_res | ||
| 40 | |||
| 41 | # This parses the result data from paired, threaded timing experiements | ||
| 42 | # @param file1 The -A file name | ||
| 43 | # @param file2 The -B file name | ||
| 44 | # @returns time 2D array of benchmark IDs to list of total container execution times | ||
| 45 | # @returns offset 2D array of benchmark IDs to list of differences between the start | ||
| 46 | # of the first and the start of the second benchmark | ||
| 47 | # @returns name_to_idx Map of benchmark names to benchmark IDs | ||
| 48 | # @returns idx_to_name List which when indexed with benchmark ID will yield the benchmark name | ||
| 49 | def load_paired(file1, file2, benchmarkCount): | ||
| 50 | # constants for columns of paired data files | ||
| 51 | FIRST_PROG = 0 | ||
| 52 | SECOND_PROG = 1 | ||
| 53 | FIRST_CORE = 2 | ||
| 54 | SECOND_CORE = 3 | ||
| 55 | TRIALS = 4 | ||
| 56 | START_S = 5 # Start seconds | ||
| 57 | START_N = 6 # Start nanoseconds | ||
| 58 | END_S = 7 # End seconds | ||
| 59 | END_N = 8 # End nanoseconds | ||
| 60 | RUN_ID = 9 | ||
| 61 | JOB_NUM = 10 | ||
| 62 | |||
| 63 | with open(file1) as f1: | ||
| 64 | numJobs = int(f1.readline().split()[TRIALS]) | ||
| 65 | assert numJobs > 0 | ||
| 66 | assert benchmarkCount > 0 | ||
| 67 | |||
| 68 | # Total times of each container | ||
| 69 | time=[[[0 for x in range(numJobs)]for y in range(benchmarkCount)]for z in range(benchmarkCount)] | ||
| 70 | # Difference in time between when the first and the second task start in the container | ||
| 71 | offset=[[[0 for x in range(numJobs)]for y in range(benchmarkCount)]for z in range(benchmarkCount)] | ||
| 72 | |||
| 73 | # Some aggregate counters that we update as we go along | ||
| 74 | avg_off = 0 | ||
| 75 | avg_off_samp = 0 | ||
| 76 | |||
| 77 | # Load paired data | ||
| 78 | bench1 = 0 # Index to what's the current first benchmark being examined | ||
| 79 | bench2 = 0 # Index to what's the current second benchmark being examined | ||
| 80 | |||
| 81 | name_to_idx = {} | ||
| 82 | idx_to_name = [0 for x in range(benchmarkCount)] | ||
| 83 | |||
| 84 | job_idx = 0 | ||
| 85 | with open(file1) as f1, open(file2) as f2: | ||
| 86 | for line1, line2 in zip(f1, f2): | ||
| 87 | lineArr1 = line1.split() | ||
| 88 | lineArr2 = line2.split() | ||
| 89 | start1 = int(lineArr1[START_S]) * 10**9 + int(lineArr1[START_N]) | ||
| 90 | start2 = int(lineArr2[START_S]) * 10**9 + int(lineArr2[START_N]) | ||
| 91 | minStart = min(start1, start2) | ||
| 92 | end1 = int(lineArr1[END_S]) * 10**9 + int(lineArr1[END_N]) | ||
| 93 | end2 = int(lineArr2[END_S]) * 10**9 + int(lineArr2[END_N]) | ||
| 94 | maxEnd = max(end1, end2) | ||
| 95 | # Time actually co-scheduled is minEnd - maxStart, but Sims uses a different model | ||
| 96 | # time[bench1][bench2][int(lineArr1[JOB_NUM])] = maxEnd - minStart | ||
| 97 | time[bench1][bench2][job_idx] = maxEnd - minStart | ||
| 98 | if lineArr1[SECOND_PROG] == "h264_dec" and lineArr2[JOB_NUM] == 0: | ||
| 99 | print(maxEnd - minStart) | ||
| 100 | # Compute offset: if first job starts at t=0, when does second start? | ||
| 101 | # offset[bench1][bench2][int(lineArr1[JOB_NUM])] = abs(start2-start1) | ||
| 102 | offset[bench1][bench2][job_idx] = abs(start2-start1) | ||
| 103 | # Compute some running statistics | ||
| 104 | avg_off += abs(start2-start1) | ||
| 105 | avg_off_samp += 1 | ||
| 106 | # Increment to the next benchmark, this is weird because of the zip() | ||
| 107 | # This is doubly weird because our results are an upper trianguler matrix | ||
| 108 | if job_idx == numJobs - 1: #int(lineArr1[JOB_NUM]) == numJobs - 1: | ||
| 109 | if bench2 < benchmarkCount-1: | ||
| 110 | bench2 = bench2 + 1 | ||
| 111 | job_idx = 0 | ||
| 112 | else: | ||
| 113 | name_to_idx[lineArr1[FIRST_PROG]] = bench1 | ||
| 114 | idx_to_name[bench1] = lineArr1[FIRST_PROG] | ||
| 115 | bench1 = bench1 + 1 | ||
| 116 | bench2 = bench1 # bench1 will never again appear as bench2 | ||
| 117 | job_idx = 0 | ||
| 118 | else: | ||
| 119 | job_idx += 1 | ||
| 120 | print("Average offset is: " + str(avg_off/avg_off_samp) + "ns") | ||
| 121 | return time, offset, name_to_idx, idx_to_name | ||
| 122 | |||
| 123 | # Paired times use an abuse of the baseline file format | ||
| 124 | def load_fake_paired(fake_paired_filename): | ||
| 125 | paired_times_raw, _, _ = load_baseline(fake_paired_filename) | ||
| 126 | benchmarkCount = int(np.sqrt(len(list(paired_times_raw.keys())))) | ||
| 127 | numJobs = len(next(iter(paired_times_raw.values()))) | ||
| 128 | paired_times=[[[0 for x in range(numJobs)]for y in range(benchmarkCount)]for z in range(benchmarkCount)] | ||
| 129 | idx_to_name=[] | ||
| 130 | name_to_idx={} | ||
| 131 | bench1 = -1 | ||
| 132 | #Generate the indexing approach | ||
| 133 | for pair in sorted(paired_times_raw.keys()): | ||
| 134 | [bench1name, bench2name] = pair.split('+') # Benchmark name is pair concatenated together with a '+' delimiter | ||
| 135 | if bench1 == -1 or bench1name != idx_to_name[-1]: | ||
| 136 | idx_to_name.append(bench1name) | ||
| 137 | name_to_idx[bench1name] = len(idx_to_name) - 1 | ||
| 138 | bench1 += 1 | ||
| 139 | # Populate the array | ||
| 140 | for bench1 in range(len(idx_to_name)): | ||
| 141 | for bench2 in range(len(idx_to_name)): | ||
| 142 | paired_times[bench1][bench2] = paired_times_raw[idx_to_name[bench1]+"+"+idx_to_name[bench2]] | ||
| 143 | return paired_times, name_to_idx, idx_to_name | ||
| 144 | |||
| 145 | def assert_base_and_pair_keys_match(baseline_times, name_to_idx): | ||
| 146 | if sorted(baseline_times.keys()) != sorted(name_to_idx.keys()): | ||
| 147 | print("ERROR: The baseline and paired experiments were over a different set of benchmarks!", file=sys.stderr) | ||
| 148 | print("Baseline keys:", baseline_times.keys(), file=sys.stderr) | ||
| 149 | print("Paired keys:", name_to_idx.keys(), file=sys.stderr) | ||
| 150 | exit(); | ||
| 151 | |||
diff --git a/smt_analysis/plotille b/smt_analysis/plotille new file mode 160000 | |||
| Subproject 41f50df2f5b499425465f506a9aae5acf1a39c0 | |||
diff --git a/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh b/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh deleted file mode 100755 index 2ac3fc1..0000000 --- a/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh +++ /dev/null | |||
| @@ -1,175 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | userRunID=$4 | ||
| 7 | tacleNames=tacleNames.txt | ||
| 8 | |||
| 9 | if [ $# -lt 4 ]; then | ||
| 10 | echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | |||
| 14 | if [ $# -gt 4 ]; then | ||
| 15 | echo "Using alternate list of TACLe benchmarks from $5" | ||
| 16 | tacleNames=$5 | ||
| 17 | fi | ||
| 18 | |||
| 19 | if [ "$EUID" -ne 0 ] | ||
| 20 | then | ||
| 21 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 22 | exit | ||
| 23 | fi | ||
| 24 | |||
| 25 | echo "Making sure that binaries are up to date..." | ||
| 26 | while read i; do | ||
| 27 | make bin/$i | ||
| 28 | done < $tacleNames | ||
| 29 | echo "Done. Disabling real-time throttling..." | ||
| 30 | |||
| 31 | # Turn off rt throttling | ||
| 32 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 33 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 34 | |||
| 35 | # Redirect all interrupts to core 0 | ||
| 36 | i=0 | ||
| 37 | for IRQ in /proc/irq/* | ||
| 38 | do | ||
| 39 | # Skip default_smp_affinity | ||
| 40 | if [ -d $IRQ ]; then | ||
| 41 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 42 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 43 | fi | ||
| 44 | i=$(( $i + 1 )) | ||
| 45 | done | ||
| 46 | |||
| 47 | # Read the names of each benchmark | ||
| 48 | j=0 | ||
| 49 | while read i; do | ||
| 50 | tacleProg[$j]=$i | ||
| 51 | j=$(( $j + 1 )) | ||
| 52 | done < $tacleNames | ||
| 53 | |||
| 54 | echo "Done. Checking for wbinvd module..." | ||
| 55 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 56 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 57 | exit | ||
| 58 | fi | ||
| 59 | |||
| 60 | # Enable L3 isolation | ||
| 61 | echo "Done. Enabling L3 isolation..." | ||
| 62 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 63 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 64 | echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 65 | echo $secondCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 66 | # Reset global bandwith control and remove L3 from global | ||
| 67 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 68 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 69 | # Alloc L3 to benchmark | ||
| 70 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 71 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 72 | echo "Done. Verifying configuration with user..." | ||
| 73 | |||
| 74 | # Generate file name string | ||
| 75 | # We append to this as we parse the environment settings | ||
| 76 | runID=$(date +"%b%d-%H") | ||
| 77 | |||
| 78 | # Confirm configuration with user | ||
| 79 | echo "=== Global Config ===" | ||
| 80 | cat /sys/fs/resctrl/schemata | ||
| 81 | echo "=== Core $firstCore and $secondCore Config ===" | ||
| 82 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 83 | if [[ $6 == "--contend" ]]; then | ||
| 84 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 85 | echo "ERROR: thrasher binary not fonud. Exiting..." | ||
| 86 | exit | ||
| 87 | fi | ||
| 88 | echo "Will run 6 contending tasks" | ||
| 89 | runID=$runID-c | ||
| 90 | else | ||
| 91 | runID=$runID-xc | ||
| 92 | fi | ||
| 93 | if uname -a | grep -q "mc2"; then | ||
| 94 | echo "MC^2 Autodetected. Cache coloring will be DISABLED." | ||
| 95 | runID=$runID-i | ||
| 96 | else | ||
| 97 | echo "MC^2 not detected. Cache coloring will be DISABLED." | ||
| 98 | runID=$runID-xi | ||
| 99 | fi | ||
| 100 | echo "Results will be saved as $runID-$userRunID-LC-DIS.txt" | ||
| 101 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 102 | read | ||
| 103 | |||
| 104 | # Start contending tasks | ||
| 105 | if [[ $6 == "--contend" ]]; then | ||
| 106 | echo "Done. Starting 6 contending tasks..." | ||
| 107 | # Run two contending tasks on each other CCX | ||
| 108 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 109 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 110 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 111 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 112 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 113 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 114 | fi | ||
| 115 | sleep 1 # Wait for contending tasks to start | ||
| 116 | echo "Done. Beginning benchmarks..." | ||
| 117 | |||
| 118 | num_tests=$(wc -l < $tacleNames) | ||
| 119 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 120 | do | ||
| 121 | # For level-C analysis, we must run all vs all | ||
| 122 | for (( j = 0; j < $num_tests ; j++ )) #loop through programs | ||
| 123 | do | ||
| 124 | # Autodetect MC^2 | ||
| 125 | # Get DIS to loop continuously in the background by infinite restarts | ||
| 126 | if uname -a | grep -q "mc2"; then | ||
| 127 | bash -c "while true; do chrt -r 97 numactl --interleave=all taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 &> /dev/null; done" & PID1=$!; | ||
| 128 | else | ||
| 129 | bash -c "while true; do chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 &> /dev/null; done" & PID1=$!; | ||
| 130 | fi | ||
| 131 | # Each sample runs in its own process | ||
| 132 | for ((k=0;k<=maxJobs;k++)); do | ||
| 133 | if uname -a | grep -q "mc2"; then | ||
| 134 | chrt -r 97 numactl --interleave=all taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-DIS 1 & PID2=$!; | ||
| 135 | else | ||
| 136 | chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-DIS 1 & PID2=$!; | ||
| 137 | fi | ||
| 138 | done | ||
| 139 | # The paired task runs continuously in this configuration, so we have | ||
| 140 | # to kill it once the task that we're measuring finishes. | ||
| 141 | wait $PID2 | ||
| 142 | kill $PID1 | ||
| 143 | # Killing bash will not kill its children by default - work aronud that here | ||
| 144 | killall transitive &> /dev/null | ||
| 145 | killall matrix &> /dev/null | ||
| 146 | killall pointer &> /dev/null | ||
| 147 | killall field &> /dev/null | ||
| 148 | killall neighborhood &> /dev/null | ||
| 149 | killall update &> /dev/null | ||
| 150 | killall gen_input.py &> /dev/null | ||
| 151 | echo ${tacleProg[$i]} ${tacleProg[$j]} | ||
| 152 | done | ||
| 153 | echo COMPLETE: ${tacleProg[$i]} | ||
| 154 | done | ||
| 155 | |||
| 156 | # End contending tasks | ||
| 157 | if [[ $6 == "--contend" ]]; then | ||
| 158 | killall thrasher | ||
| 159 | fi | ||
| 160 | |||
| 161 | # Remove semaphores from system | ||
| 162 | # Leaving them won't hurt these tests, but would be messy and is bad practice | ||
| 163 | # TODO: Do this directly in the benchmarks. They should clean up after themselves | ||
| 164 | ./bin/cleanupSemaphores | ||
| 165 | |||
| 166 | # Put smp_affinty back the way it was | ||
| 167 | i=0 | ||
| 168 | for IRQ in /proc/irq/* | ||
| 169 | do | ||
| 170 | if [ -d $IRQ ]; then | ||
| 171 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 172 | fi | ||
| 173 | i=$(( $i + 1 )) | ||
| 174 | done | ||
| 175 | |||
diff --git a/smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh b/smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh deleted file mode 100755 index 923dba0..0000000 --- a/smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh +++ /dev/null | |||
| @@ -1,161 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | userRunID=$4 | ||
| 7 | tacleNames=tacleNames.txt | ||
| 8 | |||
| 9 | if [ $# -lt 4 ]; then | ||
| 10 | echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | |||
| 14 | if [ $# -gt 4 ]; then | ||
| 15 | echo "Using alternate list of TACLe benchmarks from $5" | ||
| 16 | tacleNames=$5 | ||
| 17 | fi | ||
| 18 | |||
| 19 | if [ "$EUID" -ne 0 ] | ||
| 20 | then | ||
| 21 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 22 | exit | ||
| 23 | fi | ||
| 24 | |||
| 25 | echo "Making sure that binaries are up to date..." | ||
| 26 | while read i; do | ||
| 27 | make bin/$i | ||
| 28 | done < $tacleNames | ||
| 29 | echo "Done. Disabling real-time throttling..." | ||
| 30 | |||
| 31 | # Turn off rt throttling | ||
| 32 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 33 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 34 | |||
| 35 | # Redirect all interrupts to core 0 | ||
| 36 | i=0 | ||
| 37 | for IRQ in /proc/irq/* | ||
| 38 | do | ||
| 39 | # Skip default_smp_affinity | ||
| 40 | if [ -d $IRQ ]; then | ||
| 41 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 42 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 43 | fi | ||
| 44 | i=$(( $i + 1 )) | ||
| 45 | done | ||
| 46 | |||
| 47 | # Read the names of each benchmark | ||
| 48 | j=0 | ||
| 49 | while read i; do | ||
| 50 | tacleProg[$j]=$i | ||
| 51 | j=$(( $j + 1 )) | ||
| 52 | done < $tacleNames | ||
| 53 | |||
| 54 | echo "Done. Checking for wbinvd module..." | ||
| 55 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 56 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 57 | exit | ||
| 58 | fi | ||
| 59 | |||
| 60 | # Enable L3 isolation | ||
| 61 | echo "Done. Enabling L3 isolation..." | ||
| 62 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 63 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 64 | echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 65 | echo $secondCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 66 | # Reset global bandwith control and remove L3 from global | ||
| 67 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 68 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 69 | # Alloc L3 to benchmark | ||
| 70 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 71 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 72 | echo "Done. Verifying configuration with user..." | ||
| 73 | |||
| 74 | # Generate file name string | ||
| 75 | # We append to this as we parse the environment settings | ||
| 76 | runID=$(date +"%b%d-%H") | ||
| 77 | |||
| 78 | # Confirm configuration with user | ||
| 79 | echo "=== Global Config ===" | ||
| 80 | cat /sys/fs/resctrl/schemata | ||
| 81 | echo "=== Core $firstCore and $secondCore Config ===" | ||
| 82 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 83 | if [[ $6 == "--contend" ]]; then | ||
| 84 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 85 | echo "ERROR: thrasher binary not fonud. Exiting..." | ||
| 86 | exit | ||
| 87 | fi | ||
| 88 | echo "Will run 6 contending tasks" | ||
| 89 | runID=$runID-c | ||
| 90 | else | ||
| 91 | runID=$runID-xc | ||
| 92 | fi | ||
| 93 | if uname -a | grep -q "mc2"; then | ||
| 94 | echo "MC^2 Autodetected. Cache coloring will be DISABLED." | ||
| 95 | runID=$runID-i | ||
| 96 | else | ||
| 97 | echo "MC^2 not detected. Cache coloring will be DISABLED." | ||
| 98 | runID=$runID-xi | ||
| 99 | fi | ||
| 100 | echo "Results will be saved as $runID-$userRunID-LC-TACLe.txt" | ||
| 101 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 102 | read | ||
| 103 | |||
| 104 | # Start contending tasks | ||
| 105 | if [[ $6 == "--contend" ]]; then | ||
| 106 | echo "Done. Starting 6 contending tasks..." | ||
| 107 | # Run two contending tasks on each other CCX | ||
| 108 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 109 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 110 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 111 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 112 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 113 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 114 | fi | ||
| 115 | sleep 1 # Wait for contending tasks to start | ||
| 116 | echo "Done. Beginning benchmarks..." | ||
| 117 | |||
| 118 | num_tests=$(wc -l < $tacleNames) | ||
| 119 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 120 | do | ||
| 121 | # For level-C analysis, we must run all vs all | ||
| 122 | for (( j = 0; j < $num_tests ; j++ )) #loop through programs | ||
| 123 | do | ||
| 124 | # Autodetect MC^2 | ||
| 125 | if uname -a | grep -q "mc2"; then | ||
| 126 | # -1 loops means loop forever | ||
| 127 | chrt -r 97 numactl --interleave=all taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 & PID1=$!; | ||
| 128 | chrt -r 97 numactl --interleave=all taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-TACLe 1 & PID2=$!; | ||
| 129 | else | ||
| 130 | chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 & PID1=$!; | ||
| 131 | chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-TACLe 1 & PID2=$!; | ||
| 132 | fi | ||
| 133 | # The paired task runs continuously in this configuration, so we have | ||
| 134 | # to kill it once the task that we're measuring finishes. | ||
| 135 | wait $PID2 | ||
| 136 | kill $PID1 | ||
| 137 | echo ${tacleProg[$i]} ${tacleProg[$j]} | ||
| 138 | done | ||
| 139 | echo COMPLETE: ${tacleProg[$i]} | ||
| 140 | done | ||
| 141 | |||
| 142 | # End contending tasks | ||
| 143 | if [[ $6 == "--contend" ]]; then | ||
| 144 | killall thrasher | ||
| 145 | fi | ||
| 146 | |||
| 147 | # Remove semaphores from system | ||
| 148 | # Leaving them won't hurt these tests, but would be messy and is bad practice | ||
| 149 | # TODO: Do this directly in the benchmarks. They should clean up after themselves | ||
| 150 | ./bin/cleanupSemaphores | ||
| 151 | |||
| 152 | # Put smp_affinty back the way it was | ||
| 153 | i=0 | ||
| 154 | for IRQ in /proc/irq/* | ||
| 155 | do | ||
| 156 | if [ -d $IRQ ]; then | ||
| 157 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 158 | fi | ||
| 159 | i=$(( $i + 1 )) | ||
| 160 | done | ||
| 161 | |||
diff --git a/dis/summarize.py b/summarize.py index 31dcccc..2183c41 100755 --- a/dis/summarize.py +++ b/summarize.py | |||
| @@ -50,19 +50,28 @@ def percentile(N, percent, key=lambda x:x): | |||
| 50 | d1 = key(N[int(c)]) * (k-f) | 50 | d1 = key(N[int(c)]) * (k-f) |
| 51 | return d0+d1 | 51 | return d0+d1 |
| 52 | ## end of http://code.activestate.com/recipes/511478/ }}} | 52 | ## end of http://code.activestate.com/recipes/511478/ }}} |
| 53 | def memstring(memr, memw, samples): | ||
| 54 | if memr or memw: | ||
| 55 | return "\t{:>12.f}\t{:>12.f}".format(memr/samples, memw/samples) | ||
| 56 | else: | ||
| 57 | return "" | ||
| 53 | avg_max = 0 | 58 | avg_max = 0 |
| 54 | avg_99th = 0 | 59 | avg_99th = 0 |
| 55 | avg_avg = 0 | 60 | avg_avg = 0 |
| 56 | print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t") | 61 | # Only include memory info in the header if relevant |
| 62 | if mem_res[s[0]] == 0: | ||
| 63 | print("Name\t\tAverage\t\tMax\t\t99th %") | ||
| 64 | else: | ||
| 65 | print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t") | ||
| 57 | for r in sorted(res.keys()): | 66 | for r in sorted(res.keys()): |
| 58 | # print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r])) | 67 | # print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r])) |
| 59 | avg_avg += sum(res[r])/len(res[r]) | 68 | avg_avg += sum(res[r])/len(res[r]) |
| 60 | avg_max += max(res[r]) | 69 | avg_max += max(res[r]) |
| 61 | avg_99th += percentile(sorted(res[r]), 0.99) | 70 | avg_99th += percentile(sorted(res[r]), 0.99) |
| 62 | if len(sys.argv) > 2 and sys.argv[2] == "--inf-precision": | 71 | if len(sys.argv) > 2 and sys.argv[2] == "--inf-precision": |
| 63 | print("{:12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r])) | 72 | print("{:12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99)) + memstring(mem_res[r], memw_res[r], samples[r])) |
| 64 | else: | 73 | else: |
| 65 | print("{:12.12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r])) | 74 | print("{:12.12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99)) + memstring(mem_res[r], memw_res[r], samples[r])) |
| 66 | 75 | ||
| 67 | print("Average average:", avg_avg/len(res.keys())) | 76 | print("Average average:", avg_avg/len(res.keys())) |
| 68 | print("Average max:", avg_max/len(res.keys())) | 77 | print("Average max:", avg_max/len(res.keys())) |
diff --git a/wbinvd b/wbinvd new file mode 160000 | |||
| Subproject 912e9a22c23da6f5b1af13e410ee74d9b27146a | |||
