Github user SaintBacchus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2874#discussion_r19155846
  
    --- Diff: examples/src/main/scala/org/apache/spark/examples/SparkPi.scala 
---
    @@ -27,7 +27,7 @@ object SparkPi {
         val conf = new SparkConf().setAppName("Spark Pi")
         val spark = new SparkContext(conf)
         val slices = if (args.length > 0) args(0).toInt else 2
    -    val n = 100000 * slices
    +    val n = if (100000.toLong * slices > Int.MaxValue) Int.MaxValue - 1 
else 100000 * slices
    --- End diff --
    
    @srowen when the value n is larger than the Int.MaxValue, it's better to 
set just a small value for slices.But user inputting a big slices may just wish 
that the SparkPi can run for more time.So I just  limit the size of Seqs and do 
not modify the parallelism of the app.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to