summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'btl/libs/PBLAS')
-rw-r--r--btl/libs/PBLAS/main.cpp10
-rw-r--r--btl/libs/PBLAS/pblas.h10
-rw-r--r--btl/libs/PBLAS/pblas_interface.hh24
-rw-r--r--btl/libs/PBLAS/pblas_interface_impl.hh12
4 files changed, 30 insertions, 26 deletions
diff --git a/btl/libs/PBLAS/main.cpp b/btl/libs/PBLAS/main.cpp
index 4b64f12..a2aae2a 100644
--- a/btl/libs/PBLAS/main.cpp
+++ b/btl/libs/PBLAS/main.cpp
@@ -1,3 +1,5 @@
+#define DISTRIBUTED
+
#include "mpi.h"
#include "utilities.h"
#include "bench.hh"
@@ -5,9 +7,10 @@
#include <iostream>
//using namespace std;
-#include "blacsinit.hh"
#include "pblas_interface.hh"
+#include "blacsinit.hh"
#include "action_parallel_matrix_vector_product.hh"
+#include "action_parallel_lu_decomp.hh"
#include "action_parallel_axpy.hh"
#include <string>
@@ -19,8 +22,9 @@ int main(int argc, char **argv)
bool iamroot = blacsinit(&argc, &argv);
// distr_bench<Action_parallel_matrix_vector_product<pblas_interface<double> > >(10,MAX_MV,NB_POINT,!iamroot);
- distr_bench<Action_parallel_axpy<pblas_interface<REAL_TYPE> > >(10,MAX_MV,NB_POINT,!iamroot);
-// Action_parallel_axpy<pblas_interface<double> > action(8);
+// distr_bench<Action_parallel_axpy<pblas_interface<REAL_TYPE> > >(10,MAX_MV,NB_POINT,!iamroot);
+ distr_bench<Action_parallel_lu_decomp<pblas_interface<REAL_TYPE> > >(10,MAX_MV,NB_POINT,!iamroot);
+// Action_parallel_lu_decomp<pblas_interface<REAL_TYPE> > action(8);
// action.initialize();
// action.calculate();
// action.check_result();
diff --git a/btl/libs/PBLAS/pblas.h b/btl/libs/PBLAS/pblas.h
index adc6c91..2b5860e 100644
--- a/btl/libs/PBLAS/pblas.h
+++ b/btl/libs/PBLAS/pblas.h
@@ -6,7 +6,7 @@ extern "C" {
#endif
int numroc_(const int*, const int*, const int*, const int*, const int*);
- int descinit_(const int*, const int*, const int*, const int*, const int*, const int*, const int*, const int*, const int*, int*);
+ void descinit_(int*, const int*, const int*, const int*, const int*, const int*, const int*, const int*, const int*, int*);
/* Level 1 */
@@ -42,6 +42,14 @@ extern "C" {
);
+
+ /*************
+ * Scalapack *
+ *************/
+ void psgetrf_(const int*, const int*, float*, const int*, const int*, const int*, int*, int*);
+ void pdgetrf_(const int*, const int*, double*, const int*, const int*, const int*, int*, int*);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/btl/libs/PBLAS/pblas_interface.hh b/btl/libs/PBLAS/pblas_interface.hh
index b969e4e..cdfb70a 100644
--- a/btl/libs/PBLAS/pblas_interface.hh
+++ b/btl/libs/PBLAS/pblas_interface.hh
@@ -1,23 +1,3 @@
-//=====================================================
-// File : blas_interface.hh
-// Author : L. Plagne <laurent.plagne@edf.fr)>
-// Copyright (C) EDF R&D, lun sep 30 14:23:28 CEST 2002
-//=====================================================
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-//
-
#include "pblas.h"
#include "blacs_interface.hh"
@@ -32,7 +12,7 @@
template<class real> class pblas_interface;
-
+/*
static char notrans = 'N';
static char trans = 'T';
static char nonunit = 'N';
@@ -40,7 +20,7 @@ static char lower = 'L';
static char right = 'R';
static char left = 'L';
static int intone = 1;
-
+*/
#define SCALAR float
#define SCALAR_PREFIX s
diff --git a/btl/libs/PBLAS/pblas_interface_impl.hh b/btl/libs/PBLAS/pblas_interface_impl.hh
index b534a4e..c36c249 100644
--- a/btl/libs/PBLAS/pblas_interface_impl.hh
+++ b/btl/libs/PBLAS/pblas_interface_impl.hh
@@ -33,6 +33,7 @@ public:
real_type alpha = 1., beta = 0.;
int iONE = 1;
int myid, procnum;
+ const char notrans = 'N';
blacs_pinfo_(&myid, &procnum);
PBLAS_FUNC(gemv)(&notrans, &GlobalRows, &GlobalCols,
@@ -42,5 +43,16 @@ public:
);
}
+
+
+ static inline void parallel_lu_decomp(gene_matrix& X, const int* desc)
+ {
+ const int GlobalRows = desc[2], GlobalCols = desc[3];
+ const int iONE = 1;
+ int info;
+ std::vector<int> ipiv(desc[8] + desc[4]);
+ PBLAS_FUNC(getrf)(&GlobalRows, &GlobalCols, X, &iONE, &iONE, desc,
+ &ipiv[0], &info);
+ }
};