The mpirun command is invoked when the user's group is 'set group' to group 650. When the rank 0 process creates files, they have group ownership 650. But the user's login group is group 1040. The child processes that get started on other nodes run with group 1040, and the files they create have group ownership 1040.
Is there a way to tell mpirun to start the child processes with the same uid and gid as the rank 0 process?