Commit f3461f2c authored by Patrick Shriwise's avatar Patrick Shriwise
Browse files

Convert mpi_executable to str before passing to subprocess

parent b223c749
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ class PyGriffin:

        if self.n_procs > 1:
            if self.config.mpi_enabled:
                cmd += [self.config.mpi_exec, '-n', str(self.n_procs)]
                cmd += [str(self.config.mpi_exec), '-n', str(self.n_procs)]
            else:
                msg = ("MPI is not enabled for this Griffin executable. "
                       "The n_procs argument will be ignored.")
@@ -83,7 +83,7 @@ class PyGriffin:
        if cwd is not None:
            cwd = Path(cwd)
        else:
            cwd = Path('.')
            cwd = Path(os.getcwd())

        if cwd and not cwd.is_dir():
            msg = ("Specified working directory "
@@ -102,13 +102,13 @@ class PyGriffin:
            with open(logfile, 'w') as OUT:
                p = subprocess.Popen(cmd,
                                     universal_newlines=True,
                                     cwd=str(cwd.resolve()),
                                     cwd=str(cwd),
                                     stdout=OUT,
                                     stderr=OUT)
        else:
                p = subprocess.Popen(cmd,
                                     universal_newlines=True,
                                     cwd=str(cwd.resolve()))
                                     cwd=str(cwd))
        p.wait()
        return p.returncode