How to use mpirun to run an code which is already developed in multiprocessing style

First of all, using mshr to generate meshes inside a parallel (mpirun) code is not recommended.

To get anywhere near what you would like to do, i would split the mpi communicator in 2, as shown in

But then you should Also create your mesh ahead of time, and read it in with XDMFFile for efficiency