pthreads and mpi adapted to receive output filename and show CPU time and memory