COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
SpParMat3D.h
Go to the documentation of this file.
1#ifndef _SP_PAR_MAT_3D_H_
2#define _SP_PAR_MAT_3D_H_
3
4#include <iostream>
5#include <fstream>
6#include <cmath>
7#include <mpi.h>
8#include <vector>
9#include <iterator>
10
11#include "SpMat.h"
12#include "SpTuples.h"
13#include "SpDCCols.h"
14#include "CommGrid.h"
15#include "CommGrid3D.h"
16
17#include "MPIType.h"
18#include "LocArr.h"
19#include "SpDefs.h"
20#include "Deleter.h"
21#include "SpHelper.h"
22#include "SpParHelper.h"
23#include "FullyDistVec.h"
24#include "Friends.h"
25#include "Operations.h"
26#include "DistEdgeList.h"
27#include "mtSpGEMM.h"
28#include "MultiwayMerge.h"
29#include "CombBLAS.h"
30
31namespace combblas
32{
33
34 template <class IT, class NT, class DER>
35 class SpParMat3D{
36 public:
37 typedef typename DER::LocalIT LocalIT;
38 typedef typename DER::LocalNT LocalNT;
39 typedef IT GlobalIT;
40 typedef NT GlobalNT;
41
42 // Constructors
43 SpParMat3D (int nlayers);
44 SpParMat3D (const SpParMat < IT,NT,DER > & A2D, int nlayers, bool colsplit, bool special = false);
45 SpParMat3D (DER * myseq, std::shared_ptr<CommGrid3D> grid3d, bool colsplit, bool special = false);
46 SpParMat3D (const SpParMat3D <IT,NT,DER> & A3D, bool colsplit);
47
49
51
52 float LoadImbalance() const;
53 void FreeMemory();
54 void PrintInfo() const;
55
56 IT getnrow() const;
57 IT getncol() const;
58 IT getnnz() const;
59
60 std::shared_ptr< SpParMat<IT, NT, DER> > GetLayerMat() {return layermat;}
61 DER * seqptr() const {return layermat->seqptr();}
62 bool isSpecial() const {return special;}
63 bool isColSplit() const {return colsplit;}
64
65 template <typename LIT>
67
68 void LocalDim(IT total_m, IT total_n, IT &localm, IT& localn) const;
69
72 std::shared_ptr<CommGrid3D> getcommgrid() const { return commGrid3D; }
73 std::shared_ptr<CommGrid3D> getcommgrid3D() const {return commGrid3D;}
74
75 /* 3D SUMMA*/
76 template <typename SR, typename NUO, typename UDERO, typename IU, typename NU1, typename NU2, typename UDER1, typename UDER2>
78
79 /* Memory efficient 3D SUMMA*/
80 template <typename SR, typename NUO, typename UDERO, typename IU, typename NU1, typename NU2, typename UDER1, typename UDER2>
83
84 private:
85 std::shared_ptr<CommGrid3D> commGrid3D;
86 //SpParMat<IT, NT, DER>* layermat;
87 std::shared_ptr< SpParMat<IT, NT, DER> > layermat;
88 bool colsplit;
89 bool special;
90 int nlayers;
91
92 };
93
94
95}
96
97#include "SpParMat3D.cpp"
98
99#endif
100
Definition test.cpp:53
bool CheckSpParMatCompatibility()
friend SpParMat3D< IU, NUO, UDERO > Mult_AnXBn_SUMMA3D(SpParMat3D< IU, NU1, UDER1 > &A, SpParMat3D< IU, NU2, UDER2 > &B)
friend SpParMat3D< IU, NUO, UDERO > MemEfficientSpGEMM3D(SpParMat3D< IU, NU1, UDER1 > &A, SpParMat3D< IU, NU2, UDER2 > &B, int phases, NUO hardThreshold, IU selectNum, IU recoverNum, NUO recoverPct, int kselectVersion, int computationKernel, int64_t perProcessMemory)
void PrintInfo() const
SpParMat3D(int nlayers)
std::shared_ptr< SpParMat< IT, NT, DER > > GetLayerMat()
Definition SpParMat3D.h:60
void LocalDim(IT total_m, IT total_n, IT &localm, IT &localn) const
DER::LocalIT LocalIT
Definition SpParMat3D.h:37
float LoadImbalance() const
bool isSpecial() const
Definition SpParMat3D.h:62
int Owner(IT total_m, IT total_n, IT grow, IT gcol, LIT &lrow, LIT &lcol) const
std::shared_ptr< CommGrid3D > getcommgrid() const
Definition SpParMat3D.h:72
SpParMat3D(const SpParMat3D< IT, NT, DER > &A3D, bool colsplit)
DER * seqptr() const
Definition SpParMat3D.h:61
SpParMat< IT, NT, DER > Convert2D()
std::shared_ptr< CommGrid3D > getcommgrid3D() const
Definition SpParMat3D.h:73
SpParMat3D(const SpParMat< IT, NT, DER > &A2D, int nlayers, bool colsplit, bool special=false)
SpParMat3D(DER *myseq, std::shared_ptr< CommGrid3D > grid3d, bool colsplit, bool special=false)
void CalculateColSplitDistributionOfLayer(vector< typename DER::LocalIT > &divisions3d)
bool isColSplit() const
Definition SpParMat3D.h:63
DER::LocalNT LocalNT
Definition SpParMat3D.h:38
double A