Cut and paste this into a file, chmod +x it, and run it as mpi_to_mpisim mpi_prog.c > mpisim_prog.c ---------------------------- #! /bin/csh -f # converts mpi_init to mpi_init__ cat $1 | sed 's/MAIN__/main/g' | \ sed 's/\(mpi_[a-z][a-z]*\)[ ]*(/\1__\(/g' | \ sed 's/\(mpi_[a-z][a-z]*_[a-z][a-z]*\)[ ]*(/\1__\(/g'