@@ -14,10 +14,14 @@ def test_C_1x1():
1414 my_env = os .environ .copy ()
1515 my_env ['PYTHONPATH' ] = '../../..:.'
1616 cwd = '.'
17+ # set up new/empty file for output
18+ fname = 'step_7_C_out_1x1.txt'
19+ f = open (fname , 'w' )
20+ f .close ()
1721 num_procs = 1
1822 num_procs_space = 1
1923 cmd = ('mpirun -np ' + str (num_procs ) + ' python pySDC/tutorial/step_7/C_pySDC_with_PETSc.py '
20- + str (num_procs_space ) + ' ' + 'step_7_C_out_1x1.txt' ).split ()
24+ + str (num_procs_space ) + ' ' + fname ).split ()
2125 p = subprocess .Popen (cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , env = my_env , cwd = cwd )
2226 stdout = p .communicate ()[0 ]
2327 print ('STDOUT:{}' .format (stdout ))
@@ -30,10 +34,13 @@ def test_C_1x2():
3034 my_env = os .environ .copy ()
3135 my_env ['PYTHONPATH' ] = '../../..:.'
3236 cwd = '.'
37+ fname = 'step_7_C_out_1x2.txt'
38+ f = open (fname , 'w' )
39+ f .close ()
3340 num_procs = 2
3441 num_procs_space = 2
3542 cmd = ('mpirun -np ' + str (num_procs ) + ' python pySDC/tutorial/step_7/C_pySDC_with_PETSc.py '
36- + str (num_procs_space ) + ' ' + 'step_7_C_out_1x2.txt' ).split ()
43+ + str (num_procs_space ) + ' ' + fname ).split ()
3744 p = subprocess .Popen (cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , env = my_env , cwd = cwd )
3845 stdout = p .communicate ()[0 ]
3946 print ('STDOUT:{}' .format (stdout ))
@@ -46,10 +53,13 @@ def test_C_2x2():
4653 my_env = os .environ .copy ()
4754 my_env ['PYTHONPATH' ] = '../../..:.'
4855 cwd = '.'
56+ fname = 'step_7_C_out_2x2.txt'
57+ f = open (fname , 'w' )
58+ f .close ()
4959 num_procs = 4
5060 num_procs_space = 2
5161 cmd = ('mpirun -np ' + str (num_procs ) + ' python pySDC/tutorial/step_7/C_pySDC_with_PETSc.py '
52- + str (num_procs_space ) + ' ' + 'step_7_C_out_2x2.txt' ).split ()
62+ + str (num_procs_space ) + ' ' + fname ).split ()
5363 p = subprocess .Popen (cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , env = my_env , cwd = cwd )
5464 stdout = p .communicate ()[0 ]
5565 print ('STDOUT:{}' .format (stdout ))
0 commit comments