Hello Rishank,
It's possible that you might have to uninstall mpich, but I'm not sure. There *shouldn't* be a fundamental reason why you can't have both installed and just use one of them, but there might be technical reasons why it doesn't work.
It is possible to have both installed at the same time. However things then become fragile. Ubuntu will declare one as the "default" using either the "alternatives" system (which is why eg /usr/bin/mpi and /usr/bin/mpicc point to files in /etc/alternatives/). This however does not include things like eg hdf5 which come in flavor packages hdf5-openmpi, hdf5-mpich, hdf5-serial each of which has libraries libhdf5_{openmpi,mpich,serial}.so. Then there's always the possibility something being wrong in the package setup.
Thus having multiple MPI stacks installed at the same time, while possible, is outside of the realm of cases easily supported by our automated setup and would likely require a hand-crafted option list similar to the ones used on clusters. Eg setting
MPI_DIR = /usr/lib/x86_64-linux-gnu/openmpi MPI_INC_DIRS = /usr/lib/x86_64-linux-gnu/openmpi/include MPI_LIB_DIRS = /usr/lib/x86_64-linux-gnu/openmpi/lib MPI_LIBS = mpi
*may* work (though see my note above about libraries that can use MPI). Note that this still assumes that the mpirun found in $PATH is the one that matches the used MPI stack, ie OpenMPI's so it may require changes to the run script as well.
Thus the simplest solution is likely to make sure only one MPI stack (OpenMPI or MPICH) is installed and uninstall the other one.
Yours, Roland