@@ -28,8 +28,18 @@ class PPCRunner:
28
28
def __init__ (self ):
29
29
self .work_dir = None
30
30
self .valgrind_cmd = "valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all"
31
- self .ocv_script_name = "setup_vars_opencv4.sh"
32
- self .ocv_script_path = "build/ppc_opencv/install/bin/" + self .ocv_script_name
31
+
32
+ if platform .system () == "Windows" :
33
+ self .ocv_script_name = "setup_vars_opencv4.cmd"
34
+ self .ocv_script_path = "build/ppc_opencv/install/" + self .ocv_script_name
35
+ else :
36
+ self .ocv_script_name = "setup_vars_opencv4.sh"
37
+ self .ocv_script_path = "build/ppc_opencv/install/bin/" + self .ocv_script_name
38
+
39
+ if platform .system () == "Windows" :
40
+ self .mpi_exec = "mpiexec"
41
+ else :
42
+ self .mpi_exec = "mpirun"
33
43
34
44
@staticmethod
35
45
def __get_project_path ():
@@ -39,6 +49,8 @@ def __get_project_path():
39
49
40
50
@staticmethod
41
51
def __source_script (script_path ):
52
+ if platform .system () == "Windows" :
53
+ return
42
54
command = f"bash -c 'source { script_path } && env'"
43
55
result = subprocess .run (command , stdout = subprocess .PIPE , shell = True , text = True )
44
56
if result .returncode == 0 :
@@ -62,7 +74,8 @@ def setup_env(self):
62
74
env_vars = self .__source_script (Path (_work_dir ) / self .ocv_script_name )
63
75
64
76
self .work_dir = Path (_work_dir )
65
- os .environ .update (env_vars )
77
+ if not platform .system () == "Windows" :
78
+ os .environ .update (env_vars )
66
79
67
80
@staticmethod
68
81
def __run_exec (command ):
@@ -83,11 +96,14 @@ def run_threads(self):
83
96
self .__run_exec (f"{ self .valgrind_cmd } { self .work_dir / 'seq_func_tests' } { self .__get_gtest_settings (1 )} " )
84
97
self .__run_exec (f"{ self .valgrind_cmd } { self .work_dir / 'stl_func_tests' } { self .__get_gtest_settings (1 )} " )
85
98
86
- self .__run_exec (f"{ self .work_dir / 'omp_func_tests' } { self .__get_gtest_settings (3 )} " )
87
99
self .__run_exec (f"{ self .work_dir / 'seq_func_tests' } { self .__get_gtest_settings (3 )} " )
88
100
self .__run_exec (f"{ self .work_dir / 'stl_func_tests' } { self .__get_gtest_settings (3 )} " )
89
101
self .__run_exec (f"{ self .work_dir / 'tbb_func_tests' } { self .__get_gtest_settings (3 )} " )
90
102
103
+ if os .environ .get ("CLANG_BUILD" ) == 1 :
104
+ return
105
+ self .__run_exec (f"{ self .work_dir / 'omp_func_tests' } { self .__get_gtest_settings (3 )} " )
106
+
91
107
def run_core (self ):
92
108
if platform .system () == "Linux" and not os .environ .get ("ASAN_RUN" ):
93
109
self .__run_exec (f"{ self .valgrind_cmd } { self .work_dir / 'core_func_tests' } { self .__get_gtest_settings (1 )} " )
@@ -97,24 +113,28 @@ def run_core(self):
97
113
self .__run_exec (f"{ self .work_dir / 'ref_func_tests' } { self .__get_gtest_settings (3 )} " )
98
114
99
115
def run_processes (self , additional_mpi_args ):
116
+ if os .environ .get ("CLANG_BUILD" ) == 1 :
117
+ return
118
+
100
119
proc_count = os .environ .get ("PROC_COUNT" )
101
120
if proc_count is None :
102
121
raise EnvironmentError ("Required environment variable 'PROC_COUNT' is not set." )
103
122
104
- mpi_running = f"mpirun { additional_mpi_args } -np { proc_count } "
123
+ mpi_running = f"{ self . mpi_exec } { additional_mpi_args } -np { proc_count } "
105
124
if not os .environ .get ("ASAN_RUN" ):
106
125
self .__run_exec (f"{ mpi_running } { self .work_dir / 'all_func_tests' } { self .__get_gtest_settings (10 )} " )
107
126
self .__run_exec (f"{ mpi_running } { self .work_dir / 'mpi_func_tests' } { self .__get_gtest_settings (10 )} " )
108
127
109
128
def run_performance (self ):
110
129
if not os .environ .get ("ASAN_RUN" ):
111
130
mpi_running = ""
112
- if platform .system () == "Linux" :
113
- mpi_running = "mpirun -np 4"
131
+ if platform .system () == "Linux" and platform . system () == "Windows" :
132
+ mpi_running = f" { self . mpi_exec } -np 4"
114
133
elif platform .system () == "Darwin" :
115
- mpi_running = "mpirun -np 2"
134
+ mpi_running = f" { self . mpi_exec } -np 2"
116
135
self .__run_exec (f"{ mpi_running } { self .work_dir / 'all_perf_tests' } { self .__get_gtest_settings (1 )} " )
117
136
self .__run_exec (f"{ mpi_running } { self .work_dir / 'mpi_perf_tests' } { self .__get_gtest_settings (1 )} " )
137
+
118
138
self .__run_exec (f"{ self .work_dir / 'omp_perf_tests' } { self .__get_gtest_settings (1 )} " )
119
139
self .__run_exec (f"{ self .work_dir / 'seq_perf_tests' } { self .__get_gtest_settings (1 )} " )
120
140
self .__run_exec (f"{ self .work_dir / 'stl_perf_tests' } { self .__get_gtest_settings (1 )} " )
0 commit comments