Program: 70076
Project: 70076
Buggy source:
/** 
 * Invokes an MPI method
 * @param mpiRunner
 * @param mpiBinary
 * @param values
 * @param streams
 * @param prefixes
 * @param taskSandboxWorkingDir
 * @return
 * @throws InvokeExecutionException
 */
public static Object invokeMPIMethod(String mpiRunner,String mpiBinary,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + mpiBinary);
  System.out.println("String_Node_Str" + taskSandboxWorkingDir.getAbsolutePath());
  String workers=System.getProperty(Constants.COMPSS_HOSTNAMES);
  String numNodes=System.getProperty(Constants.COMPSS_NUM_NODES);
  String computingUnits=System.getProperty(Constants.COMPSS_NUM_THREADS);
  String numProcs=String.valueOf(Integer.valueOf(numNodes) * Integer.valueOf(computingUnits));
  System.out.println("String_Node_Str" + workers);
  System.out.println("String_Node_Str" + numNodes);
  System.out.println("String_Node_Str" + computingUnits);
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_MPI_ARGS + binaryParams.size()];
  cmd[0]=mpiRunner;
  cmd[1]="String_Node_Str";
  cmd[2]=workers;
  cmd[3]="String_Node_Str";
  cmd[4]=numProcs;
  cmd[5]=mpiBinary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_MPI_ARGS + i]=binaryParams.get(i);
  }
  System.setProperty(OMP_NUM_THREADS,computingUnits);
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,streamValues,taskSandboxWorkingDir);
}

Fixed version (ground truth):
/** 
 * Invokes an MPI method
 * @param mpiRunner
 * @param mpiBinary
 * @param values
 * @param streams
 * @param prefixes
 * @param taskSandboxWorkingDir
 * @return
 * @throws InvokeExecutionException
 */
public static Object invokeMPIMethod(String mpiRunner,String mpiBinary,Object[] values,Stream[] streams,String[] prefixes,File taskSandboxWorkingDir,PrintStream defaultOutStream,PrintStream defaultErrStream) throws InvokeExecutionException {
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + mpiBinary);
  System.out.println("String_Node_Str" + taskSandboxWorkingDir.getAbsolutePath());
  String workers=System.getProperty(Constants.COMPSS_HOSTNAMES);
  String numNodes=System.getProperty(Constants.COMPSS_NUM_NODES);
  String computingUnits=System.getProperty(Constants.COMPSS_NUM_THREADS);
  String numProcs=String.valueOf(Integer.valueOf(numNodes) * Integer.valueOf(computingUnits));
  System.out.println("String_Node_Str" + workers);
  System.out.println("String_Node_Str" + numNodes);
  System.out.println("String_Node_Str" + computingUnits);
  StreamSTD streamValues=new StreamSTD();
  ArrayList<String> binaryParams=BinaryRunner.createCMDParametersFromValues(values,streams,prefixes,streamValues);
  String[] cmd=new String[NUM_BASE_MPI_ARGS + binaryParams.size()];
  cmd[0]=mpiRunner;
  cmd[1]="String_Node_Str";
  cmd[2]=workers;
  cmd[3]="String_Node_Str";
  cmd[4]=numProcs;
  cmd[5]=mpiBinary;
  for (int i=0; i < binaryParams.size(); ++i) {
    cmd[NUM_BASE_MPI_ARGS + i]=binaryParams.get(i);
  }
  System.setProperty(OMP_NUM_THREADS,computingUnits);
  System.out.print("String_Node_Str");
  for (int i=0; i < cmd.length; ++i) {
    System.out.print(cmd[i] + "String_Node_Str");
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + streamValues.getStdIn());
  System.out.println("String_Node_Str" + streamValues.getStdOut());
  System.out.println("String_Node_Str" + streamValues.getStdErr());
  return BinaryRunner.executeCMD(cmd,streamValues,taskSandboxWorkingDir,defaultOutStream,defaultErrStream);
}