Alright. It's a bit early but I couldnt wait.
1D Laplace, Dirchlet BC, FDM, No weight accelerator, No Parallelism
(See here for the actual problem description)
This is good and all, and I KNOW there are many OpenMPI-EC2 Backend ready for launch at my fingertips, but I am just curious how Spark can do this.
After hours of research, it seems that Spark can do this in 2+ way.
1. Application of Pagerank method:
- https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala
- If I strictly follow this, I have to always carry s[i-1] and s[i+1] with every s[i] in the same row,
- Since Spark does not allow .lookup/.filter inside .map, i.e. nested transformation/action
.map(lambda (k,v) : (k,v + someRDD.lookup(k)))
2. Use or Apply matrix multiplier:
- https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala
- If I follow this, I have to broadcast (-_-;;) entire solution vector (S), since it can only be local matrix. This is because actually the same problem with 1.
- Considering that S is the only actual vector in this situation (and it will be very large) this is not very practical
- I think the reason is that usual ML problems need to estimate "estimators, A in AS=B"
- While here we have simple, sparce, known but very large A and equally large unknown S to be solved
- Oh well, then why I am struggling with Spark at the first place? Ironically, currently this is the best solution from memory usage perspective.
- For 1: x3 for tridiagonal, x5 for pentadiagonal, x7 for..
- For 2: xC, C is number of clusters..
- For 3: x2 Maximum. If referenced, even less. (but not likely)
- But the conversion should take (significant) computing time.
There may be other ways for do this but matrix multiplier code gave me good reason to stop looking.
Other issues such as keep partitioning, repartitioning after every iterations. I will keep looking.
Anyway, after implemented these I will ask for help/comments to Spark User forum.
No comments:
Post a Comment