There's an issue using openmpi3 in docker containers. The symptom was lots of warning messages like Read -1, expected <someNumber>, errno =1 when running on more than one processor.
It's discussed and workarounds given here open-mpi/ompi#4948. Short version: pass an argument --cap-add=SYS_PTRACE to the docker run command.