修訂 | 49211355a6e43c620050d865b41deb8a854befe1 (tree) |
---|---|
時間 | 2013-08-28 16:04:40 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Initialization of scalapack and blacs is changed. #31916
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/scalapack@1513 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -126,7 +126,7 @@ molds_lapack_int Lapack::Dsyevd_sca(double** matrix, double* eigenValues, molds_ | ||
126 | 126 | char order='R'; |
127 | 127 | molds_lapack_int npRow=2; // ToDo: change to dynamical setting |
128 | 128 | molds_lapack_int npCol=2; // ToDo: change to dynamical setting |
129 | - molds_lapack_int blockSize=3; // ToDo: change to dynamical setting | |
129 | + molds_lapack_int blockSize=8; // ToDo: change to dynamical setting | |
130 | 130 | |
131 | 131 | //tmporal values |
132 | 132 | molds_lapack_int intOne=1; |
@@ -143,10 +143,10 @@ molds_lapack_int Lapack::Dsyevd_sca(double** matrix, double* eigenValues, molds_ | ||
143 | 143 | molds_lapack_int mpiRank =intZero; |
144 | 144 | molds_lapack_int mpiSize =intZero; |
145 | 145 | |
146 | - // initialize blacs for calling scalapack | |
146 | + | |
147 | + // initialize blacs and scalapack | |
147 | 148 | blacs_pinfo_(&mpiRank, &mpiSize); |
148 | - blacs_get_(&iContext, &what, &val); | |
149 | - blacs_gridinit_(&iContext, &order, &npRow, &npCol); | |
149 | + sl_init_(&iContext, &npRow, &npCol); | |
150 | 150 | blacs_gridinfo_(&iContext, &npRow, &npCol, &myRow, &myCol); |
151 | 151 | |
152 | 152 | // calculate size of local matrix on each node |
@@ -180,6 +180,7 @@ molds_lapack_int Lapack::Dsyevd_sca(double** matrix, double* eigenValues, molds_ | ||
180 | 180 | molds_lapack_int ja=intOne; |
181 | 181 | molds_lapack_int iz=intOne; |
182 | 182 | molds_lapack_int jz=intOne; |
183 | + | |
183 | 184 | pdsyevd(&job, &uplo, &size, localMatrix, &ia, &ja, descA, tempEigenValues, localEigenVector, &iz, &jz ,descZ, tmpWork, &lwork, tmpIwork, &liwork, &info); |
184 | 185 | |
185 | 186 | // cll scalapack (pdsyevd) |
@@ -329,11 +330,6 @@ molds_lapack_int Lapack::Dsyevd(double** matrix, double* eigenValues, molds_lapa | ||
329 | 330 | molds_lapack_int mpiRank; |
330 | 331 | molds_lapack_int mpiSize; |
331 | 332 | blacs_pinfo_(&mpiRank, &mpiSize); |
332 | - if(mpiRank==0){ | |
333 | - for(molds_lapack_int i = 0; i < size; i++){ | |
334 | - printf("eig:%ld %e\n",i,eigenValues[i]); | |
335 | - } | |
336 | - } | |
337 | 333 | |
338 | 334 | //this->OutputLog(boost::format("size=%d lwork=%d liwork=%d k=%d info=%d\n") % size % lwork % liwork % k % info); |
339 | 335 |
@@ -41,6 +41,9 @@ void descinit_(MKL_INT* desc, | ||
41 | 41 | MKL_INT* ictxt, |
42 | 42 | MKL_INT* lld, |
43 | 43 | MKL_INT* info); |
44 | +void sl_init_(MKL_INT* iContext, | |
45 | + MKL_INT* npRow, | |
46 | + MKL_INT* npCol); | |
44 | 47 | } |
45 | 48 | /* |
46 | 49 | extern "C" { |