Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spark progress for concurrent jobs #7359

Closed
scottdraves opened this issue May 15, 2018 · 1 comment
Closed

spark progress for concurrent jobs #7359

scottdraves opened this issue May 15, 2018 · 1 comment

Comments

@scottdraves
Copy link
Contributor

import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global


val NUM_SAMPLES = 1000000
var count = 0

Future({
    count += spark.sparkContext.parallelize(1 to NUM_SAMPLES).map{i =>
        Thread.sleep(2)
        val x = Math.random()
        val y = Math.random()
        if (x*x + y*y < 1) 1 else 0
}.reduce(_ + _)})

Future({
    count += spark.sparkContext.parallelize(1 to NUM_SAMPLES).map{i =>
        Thread.sleep(2)
        val x = Math.random()
        val y = Math.random()
        if (x*x + y*y < 1) 1 else 0
}.reduce(_ + _)})

OutputCell.HIDDEN

should get 2 progress bars at the same time

@scottdraves
Copy link
Contributor Author

this looks like it is also fixed by #7415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants