1 /*
2    Copyright (c) 2009-2014, Jack Poulson
3    All rights reserved.
4 
5    This file is part of Elemental and is under the BSD 2-Clause License,
6    which can be found in the LICENSE file in the root directory, or at
7    http://opensource.org/licenses/BSD-2-Clause
8 */
9 #pragma once
10 #ifndef ELEM_BLOCKDISTMATRIX_HPP
11 #define ELEM_BLOCKDISTMATRIX_HPP
12 
13 namespace elem {
14 
15 struct BlockDistData
16 {
17     Dist colDist, rowDist;
18     Int blockHeight, blockWidth;
19     Int colAlign, rowAlign;
20     Int colCut, rowCut;
21     Int root;  // relevant for [o ,o ]/[MD,* ]/[* ,MD]
22     const Grid* grid;
23 
24     template<typename T,Dist U,Dist V>
BlockDistDataelem::BlockDistData25     BlockDistData( const GeneralBlockDistMatrix<T,U,V>& A )
26     : colDist(U), rowDist(V),
27       blockHeight(A.BlockHeight()), blockWidth(A.BlockWidth()),
28       colAlign(A.ColAlign()), rowAlign(A.RowAlign()),
29       colCut(A.ColCut()), rowCut(A.RowCut()),
30       root(A.Root()), grid(&A.Grid())
31     { }
32 };
33 
34 } // namespace elem
35 
36 #include "./BlockDistMatrix/Abstract.hpp"
37 #include "./BlockDistMatrix/General.hpp"
38 #include "./BlockDistMatrix/CIRC_CIRC.hpp"
39 #include "./BlockDistMatrix/MC_MR.hpp"
40 #include "./BlockDistMatrix/MC_STAR.hpp"
41 #include "./BlockDistMatrix/MD_STAR.hpp"
42 #include "./BlockDistMatrix/MR_MC.hpp"
43 #include "./BlockDistMatrix/MR_STAR.hpp"
44 #include "./BlockDistMatrix/STAR_MC.hpp"
45 #include "./BlockDistMatrix/STAR_MD.hpp"
46 #include "./BlockDistMatrix/STAR_MR.hpp"
47 #include "./BlockDistMatrix/STAR_STAR.hpp"
48 #include "./BlockDistMatrix/STAR_VC.hpp"
49 #include "./BlockDistMatrix/STAR_VR.hpp"
50 #include "./BlockDistMatrix/VC_STAR.hpp"
51 #include "./BlockDistMatrix/VR_STAR.hpp"
52 
53 namespace elem {
54 
55 #ifdef ELEM_HAVE_SCALAPACK
56 template<typename T>
57 inline typename blacs::Desc
FillDesc(const BlockDistMatrix<T> & A,int context)58 FillDesc( const BlockDistMatrix<T>& A, int context )
59 {
60     if( A.ColCut() != 0 || A.RowCut() != 0 )
61         LogicError("Cannot produce a meaningful descriptor if nonzero cut");
62     typename blacs::Desc desc =
63         { 1, context, A.Height(), A.Width(), A.BlockHeight(), A.BlockWidth(),
64           A.ColAlign(), A.RowAlign(), A.LDim() };
65     return desc;
66 }
67 #endif
68 
69 } // namespace elem
70 
71 #endif // ifndef ELEM_BLOCKDISTMATRIX_HPP
72