Skip to content

Commit

Permalink
add return check in auto test
Browse files Browse the repository at this point in the history
Addresses #647.
  • Loading branch information
PeiMu committed Mar 12, 2023
1 parent ecddf3e commit 6ce3fbc
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 8 deletions.
46 changes: 46 additions & 0 deletions analysis/statistics/564462fc89e7b4efa0ad273cc243c085fdb5f9a7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

changeset: 1452:564462fc89e7b4efa0ad273cc243c085fdb5f9a7
char kNewtonVersion[] = "0.3-alpha-1452 (564462fc89e7b4efa0ad273cc243c085fdb5f9a7) (build 03-11-2023-18:[email protected]_64)";
\n./src/noisy/noisy-linux-EN -O0 applications/noisy/helloWorld.n -s
\n./src/newton/newton-linux-EN -v 0 -eP applications/newton/invariants/ViolinWithTemperatureDependence-pigroups.nt

Informational Report:
---------------------
Invariant "ViolinWithTemperatureDependenceForPiGroups" has 2 unique kernels, each with 2 column(s)...

Kernel 0 is a valid kernel:

1 1
-0.5 -0
1 0
0.5 0
0 -1
-0 -1


The ordering of parameters is: P1 P0 P3 P2 P4 P5

Pi group 0, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^( 0) P5^(-0)

Pi group 0, Pi 1 is: P0^(-0) P1^( 1) P2^( 0) P3^( 0) P4^(-1) P5^(-1)


Kernel 1 is a valid kernel:

1 0
-0.5 1
1 -2
0.5 -1
-0 -2
0 -2


The ordering of parameters is: P1 P0 P3 P2 P4 P5

Pi group 1, Pi 0 is: P0^(-0.5) P1^( 1) P2^(0.5) P3^( 1) P4^(-0) P5^( 0)

Pi group 1, Pi 1 is: P0^( 1) P1^( 0) P2^(-1) P3^(-2) P4^(-2) P5^(-2)




32 changes: 24 additions & 8 deletions applications/newton/llvm-ir/performance_test/auto_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <sstream>
#include <vector>

const size_t iteration_num = 5;
const size_t result_num = 5;
const size_t iteration_num = 10;
const size_t result_num = 10;

struct perfData {
int64_t inst_count_avg;
Expand Down Expand Up @@ -93,13 +93,19 @@ std::pair<int64_t, int64_t> processDataPerf(const std::string test_case, const s

// perf command
std::string cmd = "make " + test_case + " >& compile.log";
system(cmd.data());
int command_return = system(cmd.data());
if (command_return != 0) {
return std::make_pair(0, 0);
}
cmd.clear();
cmd = "perf stat -B ./main_out " + params;

cmd += "if=/dev/zero of=/dev/null count=1000000";
cmd += " 2>&1 | tee tmp.log";
system(cmd.data());
command_return = system(cmd.data());
if (command_return != 0) {
return std::make_pair(0, 0);
}
std::ifstream ifs("tmp.log");
if (!ifs.is_open()) {
std::cout << "error opening tmp.log";
Expand Down Expand Up @@ -134,11 +140,17 @@ std::pair<double, std::vector<double>> processDataTimer(const std::string test_c

// perf command
std::string cmd = "make " + test_case + " >& compile.log";
system(cmd.data());
int command_return = system(cmd.data());
if (command_return != 0) {
return std::make_pair(0, std::vector<double>(0));
}
cmd.clear();
cmd = "./main_out " + params;
cmd += " 2>&1 | tee tmp.log";
system(cmd.data());
command_return = system(cmd.data());
if (command_return != 0) {
return std::make_pair(0, std::vector<double>(0));
}
std::ifstream ifs("tmp.log");
if (!ifs.is_open()) {
std::cout << "error opening tmp.log";
Expand Down Expand Up @@ -210,14 +222,18 @@ int64_t exactNumber() {

int64_t getIrLines() {
std::string cmd = "wc -l out.ll >& tmp.log";
system(cmd.data());
int command_return = system(cmd.data());
if (command_return != 0)
return 0;

return exactNumber();
}

int64_t getLibSize() {
std::string cmd = "wc -c libout.a >& tmp.log";
system(cmd.data());
int command_return = system(cmd.data());
if (command_return != 0)
return 0;

return exactNumber();
}
Expand Down

0 comments on commit 6ce3fbc

Please sign in to comment.