added -DNO_MPI option to build serial/multithreaded version