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
38
using namespace
std;
39
using namespace
combblas
;
40
41
int
main
(
int
argc
,
char
*
argv
[])
42
{
43
int
nprocs, myrank;
44
MPI_Init
(&
argc
, &
argv
);
45
MPI_Comm_size
(
MPI_COMM_WORLD
,&nprocs);
46
MPI_Comm_rank
(
MPI_COMM_WORLD
,&myrank);
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]);
62
normalname
=
directory
+
"/"
+
normalname
;
63
transname
=
directory
+
"/"
+
transname
;
64
65
typedef
SpParMat <int, bool, SpDCCols<int,bool>
>
PARBOOLMAT
;
66
shared_ptr<CommGrid>
fullWorld
;
67
fullWorld
.reset(
new
CommGrid
(
MPI_COMM_WORLD
, 0, 0) );
68
69
PARBOOLMAT
A
(
fullWorld
);
70
PARBOOLMAT
AT
(
fullWorld
);
71
PARBOOLMAT
ATControl
(
fullWorld
);
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
}
86
MPI_Finalize
();
87
return
0;
88
}
main
int main(int argc, char *argv[])
Definition
TransposeTest.cpp:41
combblas::CommGrid
Definition
CommGrid.h:45
combblas::DistEdgeList
Definition
DistEdgeList.h:82
combblas::SpParHelper::Print
static void Print(const std::string &s)
Definition
SpParHelper.cpp:811
combblas
Definition
CCGrid.h:4
A
double A
time.h
ReleaseTests
TransposeTest.cpp
Generated by
1.9.8