COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
SplitMergeTest.cpp
Go to the documentation of this file.
1/****************************************************************/
2/* Parallel Combinatorial BLAS Library (for Graph Computations) */
3/* version 1.6 -------------------------------------------------*/
4/* date: 11/15/2016 --------------------------------------------*/
5/* authors: Ariful Azad, Aydin Buluc, Adam Lugowski ------------*/
6/****************************************************************/
7/*
8 Copyright (c) 2010-2016, 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#define NSPLITS 5
41
42int main(int argc, char* argv[])
43{
44 int nprocs, myrank;
45 MPI_Init(&argc, &argv);
48
49 {
51
52 double initiator[4] = {.57, .19, .19, .05};
54 DEL->GenGraph500Data(initiator, 12, 8, true, true ); // generate packed edges
55 SpParHelper::Print("Generated renamed edge lists\n");
56
57 // conversion from distributed edge list, keeps self-loops, sums duplicates
58 PSpMat_s32p64_Int G(*DEL, false);
59 delete DEL; // free memory before symmetricizing
60 SpParHelper::Print("Created Sparse Matrix (with int32 local indices and values)\n");
61
63 G_perproc.PrintInfo();
64
67 G_perproc.ColSplit(NSPLITS, splits);
68
70 G_perproc_reconstructed.ColConcatenate(splits);
71
72 G_perproc_reconstructed.PrintInfo();
73
75 {
76 cout << "ColSplit/ColConcatenate works" << endl;
77 }
78 else
79 {
80 cout << "ERROR" << endl;
81 }
82 }
84 return 0;
85}
int main()
Definition Driver.cpp:12
SpParMat< int64_t, int, SpDCCols< int32_t, int > > PSpMat_s32p64_Int
#define NSPLITS
void GenGraph500Data(double initiator[4], int log_numverts, int edgefactor, bool scramble=false, bool packed=false)
static void Print(const std::string &s)
int nprocs
Definition comms.cpp:55