Skip to content

Commit

Permalink
prepare for 0.2 release
Browse files Browse the repository at this point in the history
Refactor code, modify test path
  • Loading branch information
Myasuka committed Nov 2, 2015
1 parent 396e8b1 commit 5c139b4
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 189 deletions.
26 changes: 23 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,22 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18</version>
<version>2.18.1</version>
<configuration>
<skipTests>true</skipTests>
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
<include>**/*Suite.java</include>
</includes>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<environmentVariables>
<!--
Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes
launched by the tests have access to the correct test-time classpath.
-->
<SPARK_DIST_CLASSPATH>${test_classpath}</SPARK_DIST_CLASSPATH>
</environmentVariables>
</configuration>
</plugin>
<plugin>
Expand All @@ -291,7 +304,7 @@
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>${project.build.directory}/ToonaTestSuite.txt</filereports>
<filereports>MarlinTestSuite.txt</filereports>
<argLine>-Xmx3g -XX:MaxPermSize=${MaxPermGen} -XX:ReservedCodeCacheSize=512m</argLine>
<systemProperties>
<marlin.test.home>${session.executionRootDirectory}</marlin.test.home>
Expand All @@ -302,6 +315,13 @@
<spark.ui.showConsoleProgress>false</spark.ui.showConsoleProgress>
<spark.driver.allowMultipleContexts>true</spark.driver.allowMultipleContexts>
</systemProperties>
<environmentVariables>
<!--
Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes
launched by the tests have access to the correct test-time classpath.
-->
<SPARK_DIST_CLASSPATH>${test_classpath}</SPARK_DIST_CLASSPATH>
</environmentVariables>
</configuration>
<executions>
<execution>
Expand Down
12 changes: 5 additions & 7 deletions src/main/scala/edu/nju/pasalab/marlin/matrix/BlockMatrix.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ class BlockMatrix(
val mat = BDM.zeros[Double](m, n)
blocks.collect().foreach {
case (blkID, matrix) =>
val rowStart = blkID.row
val colStart = blkID.column
matrix.activeIterator.foreach {
case ((i, j), v) =>
mat(rowStart * mostBlkRowLen + i, colStart * mostBlkColLen + j) = v
}
val rowStart = blkID.row * mostBlkRowLen
val colStart = blkID.column * mostBlkColLen
mat(rowStart until rowStart + matrix.rows,
colStart until colStart + matrix.cols) := matrix
}
mat
}
Expand Down Expand Up @@ -302,7 +300,7 @@ class BlockMatrix(
}else {
(blkId.column + 1) * colBlkSize
}
(blkId, (blk.asInstanceOf[BDM[Double]] *
(BlockID(blkId.row, 0), (blk.asInstanceOf[BDM[Double]] *
Bb.value(startRow until endRow, ::)).asInstanceOf[BDM[Double]])
}.reduceByKey(_ + _)
new BlockMatrix(blocks, numRows(), B.cols, numBlksByRow(), numBlksByCol())
Expand Down
Loading

0 comments on commit 5c139b4

Please sign in to comment.