added nnodes variable when running on multiple nodes