16 #include "lapack_diag.h" 17 #include "matrixlapack.h" 20 #include "matrixlapack_magma.h" 23 #include "matrixscalapack.h" 41 long int i, j, i_max, xMsize;
43 int rank, size, nprocs, nprow, npcol, myrow, mycol, ictxt;
44 int i_negone=-1, i_zero=0, iam;
45 long int mb, nb, mp, nq;
51 for (i = 0; i < i_max; i++) {
52 for (j = 0; j < i_max; j++) {
54 Ham[i][j] =
Ham[i + 1][j + 1];
66 fprintf(
stdoutMPI,
"Using SCALAPACK\n\n");
67 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
68 MPI_Comm_size(MPI_COMM_WORLD, &size);
69 MPI_Dims_create(size,2,dims);
70 nprow=dims[0]; npcol=dims[1];
72 blacs_pinfo_(&iam, &nprocs);
73 blacs_get_(&i_negone, &i_zero, &ictxt);
74 blacs_gridinit_(&ictxt,
"R", &nprow, &npcol);
75 blacs_gridinfo_(&ictxt, &nprow, &npcol, &myrow, &mycol);
77 mb = GetBlockSize(xMsize, size);
79 mp = numroc_(&xMsize, &mb, &myrow, &i_zero, &nprow);
80 nq = numroc_(&xMsize, &mb, &mycol, &i_zero, &npcol);
81 Z_vec = malloc(mp*nq*
sizeof(complex
double));
90 diag_scalapack_cmp(xMsize,
Ham,
v0, Z_vec, descZ_vec);
106 fprintf(
stdoutMPI,
"Warning: MAGMA is not used in this calculation.");
121 for (i = 0; i < i_max; i++) {
122 fprintf(fp,
" %ld %.10lf \n", i, creal(
v0[i]));
struct DefineList Def
Definision of system (Hamiltonian) etc.
unsigned long int idim_max
The dimension of the Hilbert space of this process.
int lapack_diag(struct BindStruct *X)
performing full diagonalization using lapack
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.
int iNGPU
GPU mode ( only for FullDiag )
int ZHEEVall(int xNsize, double complex **A, double complex *r, double complex **vec)
obtain eigenvalues and eigenvectors of Hermite matrix A
int nproc
Number of processors, defined in InitializeMPI()
const char * cFileNameEigenvalue_Lanczos
int myrank
Process ID, defined in InitializeMPI()
struct CheckList Check
Size of the Hilbert space.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()