add mutex for mpi operations