change stopping condition(err->decrement),add options to use multithreading(openMP)