<commit_before>import subprocess 
import os
from pyclaw.solution import Solution

def acoustics2D(use_PETSc=True,kernel_language='Fortran',iplot=False,petscPlot=False,useController=True,htmlplot=False,soltype='classic', np =4):
    
    # Pathes needed to specify the output directory location
    pyclawPath = os.environ['PYCLAW'] 
    examplePath = pyclawPath + "/test/acoustics/2d/homogeneous"
    outputPath = examplePath + "/ParallelOutput"

    # clean the previous output
    run_command = "rm", "-r", outputPath
    p = subprocess.Popen(run_command)
    (stdout_data, ignore) = p.communicate()

    # run subprocess with the required number of processes
    run_command = "mpiexec", "-n", str(np) ,"python","-c", "import sys; sys.path.append('"+str(examplePath)+"'); import acoustics; acoustics.acoustics2D(use_PETSc=True, useController=True, outdir='"+str(outputPath)+"')"
    p = subprocess.Popen(run_command) 
    (stdout_data, ignore) = p.communicate()
    <commit_msg>redirect output and error<commit_after>import subprocess 
import os
from pyclaw.solution import Solution

def acoustics2D(use_PETSc=True,kernel_language='Fortran',iplot=False,petscPlot=False,useController=True,htmlplot=False,soltype='classic', np =4):
    
    # Pathes needed to specify the output directory location
    pyclawPath = os.environ['PYCLAW'] 
    examplePath = pyclawPath + "/test/acoustics/2d/homogeneous"
    outputPath = examplePath + "/ParallelOutput"

    # clean the previous output
    run_command = "rm", "-r", outputPath
    p = subprocess.Popen(run_command, stdout=subprocess.PIPE ,stderr=subprocess.STDOUT)
    (stdout_data, ignore) = p.communicate()

    # run subprocess with the required number of processes
    run_command = "mpiexec", "-n", str(np) ,"python","-c", "import sys; sys.path.append('"+str(examplePath)+"'); import acoustics; acoustics.acoustics2D(use_PETSc=True, useController=True, outdir='"+str(outputPath)+"')"
    p = subprocess.Popen(run_command, stdout=subprocess.PIPE ,stderr=subprocess.STDOUT) 
    (stdout_data, ignore) = p.communicate()
    
{'fraction_non_alphanumeric': 0.13018322082931533, 'fraction_numerical': 0.003857280617164899, 'mean_word_length': 5.212574850299402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7583817', 'n_tokens_mistral': 694, 'n_tokens_neox': 675, 'n_words': 141}