Please don't change the SparkPi example to test this. SparkPi is meant to be a small example to show people how to use the API. You can add another example that saves to a file, or WordCount might already do it.