File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -238,13 +238,27 @@ class BaseXCppOpenMPTests(jupyter_kernel_test.KernelTests):
238238 #include <iostream>
239239 #include <clang/Interpreter/CppInterOp.h>
240240 Cpp::LoadLibrary("libomp");
241- printf("all done, with hopefully threads\n ");
241+ int main() {
242+ omp_set_num_threads(2);
243+ #pragma omp parallel
244+ {
245+ if (omp_get_thread_num() == 1) {
246+ printf("1");
247+ #pragma omp barrier
248+ }
249+ else if (omp_get_thread_num() == 0) {
250+ #pragma omp barrier
251+ printf("0");
252+ }
253+ }
254+ }
255+ main();
242256 """
243257
244258 def test_xcpp_omp (self ):
245259 self .flush_channels ()
246260 reply , output_msgs = self .execute_helper (code = self .code_omp ,timeout = 20 )
247- self .assertEqual (output_msgs [0 ]['content' ]['name ' ], 'stdout ' )
261+ self .assertEqual (output_msgs [0 ]['content' ]['text ' ], '10 \n ' )
248262
249263 kernel_names = ['xcpp17-omp' , 'xcpp20-omp' , 'xcpp23-omp' ]
250264
You can’t perform that action at this time.
0 commit comments