Customize invocation of Python interpreter in Run dialog / MPI?
Hi,
I would like to run a Python script that uses MPI (more specifically, mpi4py) through the Run dialog. Programs using MPI should be started using MPI implementation specific script, but let's assume that it's just `mpirun -np 4 python script.py` for the purpose of the argument (valid for OpenMPI). The number 4 stands for the number of MPI processes to spawn.
I can select an interpreter in the Run dialog, add command line arguments, and also customize commands that are run before it starts, but how can I customize the invocation of the interpreter itself? I want PyCharm to start it as `mpirun -np 4 /srv/myvirtualenv/bin/python script.py –arguments` through the MPI wrapper instead of just `/srv/myvirtualenv/bin/python script.py –arguments`.
Thanks!
I would like to run a Python script that uses MPI (more specifically, mpi4py) through the Run dialog. Programs using MPI should be started using MPI implementation specific script, but let's assume that it's just `mpirun -np 4 python script.py` for the purpose of the argument (valid for OpenMPI). The number 4 stands for the number of MPI processes to spawn.
I can select an interpreter in the Run dialog, add command line arguments, and also customize commands that are run before it starts, but how can I customize the invocation of the interpreter itself? I want PyCharm to start it as `mpirun -np 4 /srv/myvirtualenv/bin/python script.py –arguments` through the MPI wrapper instead of just `/srv/myvirtualenv/bin/python script.py –arguments`.
Thanks!
6 comments
Sort by
Date
Votes

You might be able to achieve your aim using "External Tools". However I agree it should be able to specify exact command executed in run configuration.

Right, I could also make a wrapper script and add it as a Python interpreter binary... I guess I should create a feature request in the issue tracker then. I was wondering if I'm missing something obvious.

The feature request in Tracker is welcome.

For this to work you need also support for macros in run/debug configurations (in this case you need macro with the path to the interpreter). I created such an issue recently - see Add support for macros in run/debug configurations

Hi Dmitry, thanks! Reported as http://youtrack.jetbrains.com/issue/PY-11438 . As a search revealed something similar was already requested awhile ago: http://youtrack.jetbrains.com/issue/PY-2784 .

The feature request in Tracker is welcome.
Please sign in to leave a comment.