COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
TransposeTest.cpp
Go to the documentation of this file.
1/****************************************************************/
2/* Parallel Combinatorial BLAS Library (for Graph Computations) */
3/* version 1.5 -------------------------------------------------*/
4/* date: 10/09/2015 ---------------------------------------------*/
5/* authors: Ariful Azad, Aydin Buluc, Adam Lugowski ------------*/
6/****************************************************************/
7/*
8 Copyright (c) 2010-2015, The Regents of the University of California
9
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 THE SOFTWARE.
27 */
28
29#include <mpi.h>
30#include <sys/time.h>
31#include <iostream>
32#include <functional>
33#include <algorithm>
34#include <vector>
35#include <sstream>
36#include "CombBLAS/CombBLAS.h"
37
38using namespace std;
39using namespace combblas;
40
41int main(int argc, char* argv[])
42{
43 int nprocs, myrank;
44 MPI_Init(&argc, &argv);
47
48 if(argc < 4)
49 {
50 if(myrank == 0)
51 {
52 cout << "Usage: ./TransposeTest <BASEADDRESS> <Matrix> <MatrixTranspose>" << endl;
53 cout << "Input file <Matrix> and <MatrixTranspose> should be under <BASEADDRESS> in triples format" << endl;
54 }
55 MPI_Finalize();
56 return -1;
57 }
58 {
59 string directory(argv[1]);
60 string normalname(argv[2]);
61 string transname(argv[3]);
64
67 fullWorld.reset( new CommGrid(MPI_COMM_WORLD, 0, 0) );
68
72 A.ReadDistribute(normalname, 0); // read it from file, note that we use the transpose of "input" data
73 AT = A;
74 AT.Transpose();
75
76 ATControl.ReadDistribute(transname, 0);
77 if (ATControl == AT)
78 {
79 SpParHelper::Print("Transpose working correctly\n");
80 }
81 else
82 {
83 SpParHelper::Print("ERROR in transpose, go fix it!\n");
84 }
85 }
87 return 0;
88}
int main()
Definition Driver.cpp:12
static void Print(const std::string &s)
int nprocs
Definition comms.cpp:55
double A