Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hama Wiki" for change notification.
The "SpMV" page has been changed by Mikalai Parafeniuk: http://wiki.apache.org/hama/SpMV?action=diff&rev1=10&rev2=11 Implementation can be found in my GitHub repository [[https://github.com/ParafeniukMikalaj/spmv]] and patch can be found in [[https://issues.apache.org/jira/browse/HAMA-524|Apache JIRA]] as soon as JIRA will become available. GitHub repository contains only classes related to SpMV. I considered two possible use cases of SpMV: 1. Usage in pair with `RandomMatrixGenerator`. 2. Usage with arbitrary text files. - In this section you will see how to use SpMV in this two cases. NOTE: currently SpMV is buggy, so output can be not correct. + In this section you will see how to use SpMV in this two cases. NOTE: currently SpMV is buggy, so output can be not correct. I propose the following directory structure for the following examples + {{{ + /user/hduser/spmv/matrix-seq + /user/hduser/spmv/matrix-txt + /user/hduser/spmv/result-seq + /user/hduser/spmv/result-txt + /user/hduser/spmv/vector-seq + /user/hduser/spmv/vector-txt + }}} + Suffix `seq` denotes that directory contains sequence files. Suffix `txt` denotes that directory contains human-readable text files. ==== Usage with RandomMatrixGenerator ==== `RandomMatrixGenerator` as a `SpMV` works with sequence file format. So, to multiply random matrix with random vector we will do the following: generate matrix and vector; convert matrix, vector and result to text file; view matrix, vector and result. This sequence is described by the following code snippet: {{{ @@ -90, +99 @@ {{{ 0 4 3 0 2 1 3 2 6 }}} + After that you should copy these files to HDFS. If you don't feel comfortable with HDFS please see [[http://hadoop.apache.org/common/docs/r0.20.0/hdfs_shell.html|this tutorial]]. After you have copied input matrix into `matrix-txt` and input vector into `vector-txt`, we are ready to start. The following code snippet shows, how you can multiply matrices in this mode. Explanations will be given below. - After that you should copy these files to HDFS. If you don't feel comfortable with HDFS please see [[http://hadoop.apache.org/common/docs/r0.20.0/hdfs_shell.html|this tutorial]]. I propose the following directory structure for this example - {{{ - /user/hduser/spmv/matrix-seq - /user/hduser/spmv/matrix-txt - /user/hduser/spmv/result-seq - /user/hduser/spmv/result-txt - /user/hduser/spmv/vector-seq - /user/hduser/spmv/vector-txt - }}} - Suffix `seq` denotes that directory contains sequence files. Suffix `txt` denotes that directory contains human-readable text files in format, described above. After you have copied input matrix into `matrix-txt` and input vector into `vector-txt`, we are ready to start. The following code snippet shows, how you can multiply matrices in this mode. Explanations will be given below. {{{ 1: jar hama-examples-0.6.0-SNAPSHOT.jar matrixtoseq /user/hduser/spmv/matrix-txt /user/hduser/spmv/matrix-seq sparse 4 2: bin/hama jar hama-examples-0.6.0-SNAPSHOT.jar matrixtoseq /user/hduser/spmv/vector-txt /user/hduser/spmv/vector-seq dense 4
