...
After that you should copy these files to HDFS. If you don't feel comfortable with HDFS please see 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.
No Format |
---|
1: hama jar hama-examples-0.6.0-SNAPSHOT.jar$HAMA_EXAMPLES matrixtoseq /user/hduser/spmv$SPMV/matrix-txt $SPMV/user/hduser/spmv/matrix-seq sparse 4 2: bin/hama jar hama-examples-0.6.0-SNAPSHOT.jar$HAMA_EXAMPLES matrixtoseq $SPMV/user/hduser/spmv/vector-txt /user/hduser/spmv$SPMV/vector-seq dense 4 3: bin/hama jar hama-examples-0.6.0-SNAPSHOT.jar$HAMA_EXAMPLES spmv $SPMV/user/hduser/spmv/matrix-seq $SPMV/user/hduser/spmv/vector-seq /user/hduser/spmv/$SPMV/result-seq 4 4: ../hadoop/bin/hadoop dfs -rmr $SPMV/user/hduser/spmv/result-seq/part 5: bin/hama jar hama-examples-0.6.0-SNAPSHOT.jar$HAMA_EXAMPLES matrixtotext $SPMV/user/hduser/spmv/result-seq $SPMV/user/hduser/spmv/result-txt 6: ../hadoop/bin/hadoop dfs -cat /user/hduser/spmv$SPMV/result-txt/part-00000* 0 4 4 0 38.0 1 12.0 2 24.0 3 6.0 |
...