Eliminated unused variables, used std::min/max, renamed "try" variable
to "attempt" to avoid reserved word, moved declaration of MPI-specific
variables, added space between string literals intended for
concatenation, moved some variable declarations inside matching
preprocessor regions.