Skip to content

Commit 640dfde

Browse files
committed
Commit
1 parent b2275db commit 640dfde

26 files changed

+918
-784
lines changed

core/src/core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int main(int argc, char* argv[]) {
138138
syst += "\"";
139139
FILE* r = fopen("AllPaths.txt", "a");
140140
fclose(r);
141-
setenv("JAVA_HOME", "/usr/lib/jvm/jdk-15.0.2", true);
141+
setenv("JAVA_HOME", "/usr/lib/jvm/jdk-15", true);
142142
system(syst.c_str());
143143
string path = pwd;
144144
path += "/results/graph_AP_SPPF_INMEM.csv";

front/tests/spaced/test_graph1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ fn_0_basic_block_0_0 fn_0_basic_block_1_0 fn_0_basic_block_2_0 fn_1_basic_block_
1111
3 4
1212
5 6
1313
6 4
14-
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
1
2+
5
3+
S A B
4+
S A R
5+
R S B
6+
A a
7+
B b
8+
9+
10 20
10+
T T T T T T T T T T
11+
8 7 b
12+
6 3 c
13+
4 2 b
14+
3 2 b
15+
6 1 b
16+
1 9 b
17+
9 2 a
18+
4 5 c
19+
1 4 c
20+
4 8 b
21+
7 1 b
22+
6 4 c
23+
7 9 b
24+
5 2 c
25+
1 3 b
26+
6 1 c
27+
9 8 c
28+
7 4 c
29+
1 7 b
30+
2 8 c

front/tests/speed_tests/graph_generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import random
22
import sys
3-
fout = open("graph_generator.output", "w")
3+
fout = open("tests/speed_tests/graph_generator", "w")
44
fout.write("1\n5\n")
5-
fout.write("S AB \nS AR \nR SB \nA a \nB b\n")
5+
fout.write("S A B \nS A R \nR S B \nA a \nB b\n")
66
type = int(sys.argv[1]) #type of graph by density
77
n = int(sys.argv[2]) #number of vertices
88
if type == 0:
99
m = 2*n
1010
if type == 1:
1111
m = int(n**1.5)
1212
if type == 2:
13-
m = n**2/4
13+
m = int(n**2/4)
1414
if type == 3:
1515
m = n*(n-1)
1616
fout.write("\n")
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
0 100
2-
0 200
3-
0 300
4-
0 1000
5-
0 10000
6-
0 20000
7-
0 50000
8-
0 100000
1+
2 100
Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
#include <iostream>
2-
#include <fstream>
3-
#include <string>
4-
#include <time.h>
5-
int main()
6-
{
7-
int type = 0, n = 0;
8-
clock_t start1, end1, start2, end2;
9-
std::ifstream test_list("tests/speed_tests/list_graphs.txt");
10-
std::ofstream output("tests/speed_tests/test_speed.output");
11-
while(!test_list.eof()) {
12-
test_list >> type >> n;
13-
system(("python tests/speed_tests/graph_generator.py " + std::to_string(type) + " " + std::to_string(n)).c_str());
14-
start1 = clock(); // remember start clock
15-
system("(build/core graph_generator.output -fast) 2>> save.out");
16-
end1 = clock(); // remember end clock
17-
output << std::endl << std::endl;
18-
19-
start2 = clock(); // remember start clock
20-
system("(build/core graph_generator.output -slow) 2>> save.out");
21-
end2 = clock(); // remember end clock
22-
output << type << " " << n << " " << static_cast<double>(end1 - start1) / CLOCKS_PER_SEC << " " << static_cast<double>(end2 - start2) / CLOCKS_PER_SEC << std::endl;// write start-end clock
23-
output << start1 << " " << end1 << " " << start2 << " " << end2 << std::endl << std::endl;// write start-end clock
24-
}
25-
test_list.close();
26-
}
1+
#include <iostream>
2+
#include <fstream>
3+
#include <string>
4+
#include <time.h>
5+
int main()
6+
{
7+
int type = 0, n = 0;
8+
clock_t start1, end1, start2, end2, start3, end3, start4, end4;
9+
std::ifstream test_list("tests/speed_tests/list_graphs.txt");
10+
std::ofstream output("tests/speed_tests/test_speed.output");
11+
//while(!test_list.eof()) {
12+
//test_list >> type >> n;
13+
n = 10;
14+
system(("python tests/speed_tests/graph_generator.py " + std::to_string(type) + " " + std::to_string(n)).c_str());
15+
start1 = clock(); // remember start clock
16+
//system("(build/core graph_generator.output -fast) 2>> save.out");
17+
end1 = clock(); // remember end clock
18+
output << std::endl << std::endl;
19+
20+
start2 = clock(); // remember start clock
21+
//system("(build/core graph_generator.output -slow) 2>> save.out");
22+
end2 = clock(); // remember end clock
23+
output << std::endl << std::endl;
24+
25+
start3 = clock(); // remember start clock
26+
system("(build/core graph_generator.output -spaced_rhs -iguana) 2>> save.out");
27+
end3 = clock(); // remember end clock
28+
output << std::endl << std::endl;
29+
30+
output << type << " " << n << " " << static_cast<double>(end1 - start1) / CLOCKS_PER_SEC << " " << static_cast<double>(end2 - start2) / CLOCKS_PER_SEC << " " << static_cast<double>(end3 - start3) / CLOCKS_PER_SEC << std::endl;// write start-end clock
31+
output << start1 << " " << end1 << " " << start2 << " " << end2 << " " << start3 << " " << end3 << std::endl << std::endl;// write start-end clock
32+
//}
33+
test_list.close();
34+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
3+
4+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include <iostream>
2+
#include <fstream>
3+
#include <string>
4+
#include <time.h>
5+
#include <chrono>
6+
int main()
7+
{
8+
int type = 0, n = 0;
9+
std::ifstream test_list("tests/speed_tests/list_graphs.txt");
10+
std::ofstream output("tests/speed_tests/test_speed.output");
11+
while(!test_list.eof()) {
12+
test_list >> type >> n;
13+
system(("python tests/speed_tests/graph_generator.py " + std::to_string(type) + " " + std::to_string(n)).c_str());
14+
auto start1 = std::chrono::high_resolution_clock::now(); // remember start clock
15+
//system("(build/core tests/speed_tests/graph_generator -fast) 2>> save.out");
16+
auto end1 = std::chrono::high_resolution_clock::now(); // remember end clock
17+
output << std::endl << std::endl;
18+
19+
auto start2 = std::chrono::high_resolution_clock::now(); // remember start clock
20+
//system("(build/core tests/speed_tests/graph_generator -slow) 2>> save.out");
21+
auto end2 = std::chrono::high_resolution_clock::now(); // remember end clock
22+
output << std::endl << std::endl;
23+
24+
auto start3 = std::chrono::high_resolution_clock::now(); // remember start clock
25+
system("(build/core tests/speed_tests/graph_generator -spaced_rhs -iguana) > save.out");
26+
auto end3 = std::chrono::high_resolution_clock::now(); // remember end clock
27+
output << std::endl << std::endl;
28+
29+
output << type << " " << n << " " << std::chrono::duration_cast<std::chrono::microseconds>(end1 - start1).count() << " " << std::chrono::duration_cast<std::chrono::microseconds>(end2 - start2).count() << " " << std::chrono::duration_cast<std::chrono::microseconds>(end3 - start3).count() << std::endl;
30+
}
31+
test_list.close();
32+
}

front/tests/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ TEST_CASE("test_transl_core") {
292292
system(("build/transl tests/test_transl_core/" + test_graph_name).c_str());
293293
s = test_graph_name.substr(0, test_graph_name.rfind("."));
294294
system(("build/to_core tests/test_transl_core/.main" + s + ".dot").c_str());
295-
system(("build/core tests/test_transl_core/graph" + s + " -spaced_rhs -fast > tests/test_transl_core/output" + s).c_str());
295+
system(("build/core tests/test_transl_core/graph" + s + " -spaced_rhs -iguana > tests/test_transl_core/output" + s).c_str());
296296
}
297297
test_list.close();
298298
}

0 commit comments

Comments
 (0)