40 char sdt[D_FileNameMax] =
"";
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++) {
53 v0[i][j] =
v0[i + 1][j];
60 fprintf(
stdoutMPI,
"Using SCALAPACK\n\n");
61 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
62 MPI_Comm_size(MPI_COMM_WORLD, &size);
63 MPI_Dims_create(size,2,dims);
64 nprow=dims[0]; npcol=dims[1];
66 blacs_pinfo_(&iam, &nprocs);
67 blacs_get_(&i_negone, &i_zero, &ictxt);
68 blacs_gridinit_(&ictxt,
"R", &nprow, &npcol);
69 blacs_gridinfo_(&ictxt, &nprow, &npcol, &myrow, &mycol);
71 mb = GetBlockSize(xMsize, size);
73 mp = numroc_(&xMsize, &mb, &myrow, &i_zero, &nprow);
74 nq = numroc_(&xMsize, &mb, &mycol, &i_zero, &npcol);
75 Z_vec = malloc(mp*nq*
sizeof(std::complex<double>));
84 diag_scalapack_cmp(xMsize, Ham,
v0, Z_vec, descZ_vec);
95 if(diag_magma_cmp(xMsize, Ham,
v0,
v1, X->
Def.
iNGPU) != 0) {
100 fprintf(
stdoutMPI,
"Warning: MAGMA is not used in this calculation.");
104 for (i = 0; i < i_max; i++) {
105 for (j = 0; j < i_max; j++) {
106 v0[i + 1][j] =
v1[i][j];
110 strcpy(sdt,
"Eigenvalue.dat");
114 for (i = 0; i < i_max; i++) {
115 fprintf(fp,
" %ld %.10lf \n", i, X->
Phys.
energy[i]);
struct DefineList Def
Definision of system (Hamiltonian) etc.
int nproc
Number of processors, defined in InitializeMPI()
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
int ZHEEVall(int xNsize, std::complex< double > **A, double *r, std::complex< double > **vec)
obtain eigenvalues and eigenvectors of Hermite matrix A
std::complex< double > ** v0
int iNGPU
GPU mode ( only for FullDiag )
struct PhysList Phys
Physical quantities.
std::complex< double > ** v1
double * energy
Expectation value of the total energy.
int myrank
Process ID, defined in InitializeMPI()
struct CheckList Check
Size of the Hilbert space.
long int idim_max
The dimension of the Hilbert space of this process.
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.