mirror of
https://gitlab.com/scemama/qp_plugins_scemama.git
synced 2024-11-09 07:33:41 +01:00
Compare commits
No commits in common. "0c5b6834b17c64e9ef091f669f95a88de0b9d06f" and "c4794b62ba424b5b2034e8c9418471947a170b7e" have entirely different histories.
0c5b6834b1
...
c4794b62ba
@ -138,15 +138,15 @@ void compute_h_oo_chol_gpu(gpu_data* data, int igpu)
|
|||||||
double* d_cc_space_v_ov_chol = data[igpu].cc_space_v_ov_chol;
|
double* d_cc_space_v_ov_chol = data[igpu].cc_space_v_ov_chol;
|
||||||
|
|
||||||
double* d_tau_kau;
|
double* d_tau_kau;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tau_kau, cholesky_mo_num*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tau_kau, cholesky_mo_num*nV*nO * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_tmp_ovv;
|
double* d_tmp_ovv;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp_ovv, nO*nV*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp_ovv, nO*nV*nV * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_tmp_vov;
|
double* d_tmp_vov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp_vov, nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp_vov, nV*nO*nV * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -239,7 +239,7 @@ void compute_h_vo_chol_gpu(gpu_data* data, int igpu)
|
|||||||
cublasDcopy(handle, nV*nO, d_cc_space_f_vo, 1, d_H_vo, 1);
|
cublasDcopy(handle, nV*nO, d_cc_space_f_vo, 1, d_H_vo, 1);
|
||||||
|
|
||||||
double* d_tmp_k;
|
double* d_tmp_k;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp_k, cholesky_mo_num * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp_k, cholesky_mo_num * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 2.0;
|
alpha = 2.0;
|
||||||
@ -261,7 +261,7 @@ void compute_h_vo_chol_gpu(gpu_data* data, int igpu)
|
|||||||
cudaFree(d_tmp_k);
|
cudaFree(d_tmp_k);
|
||||||
|
|
||||||
double* d_tmp;
|
double* d_tmp;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp, cholesky_mo_num*nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp, cholesky_mo_num*nO*nO * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -273,7 +273,7 @@ void compute_h_vo_chol_gpu(gpu_data* data, int igpu)
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_tmp2;
|
double* d_tmp2;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp2, cholesky_mo_num*nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp2, cholesky_mo_num*nO*nO * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -344,11 +344,11 @@ void compute_h_vv_chol_gpu(gpu_data* data, int igpu)
|
|||||||
double* d_cc_space_v_ov_chol = data[igpu].cc_space_v_ov_chol;
|
double* d_cc_space_v_ov_chol = data[igpu].cc_space_v_ov_chol;
|
||||||
|
|
||||||
double* d_tau_kia;
|
double* d_tau_kia;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tau_kia, cholesky_mo_num*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tau_kia, cholesky_mo_num*nO*nV * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_tmp_oov;
|
double* d_tmp_oov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp_oov, nO*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp_oov, nO*nO*nV * sizeof(double));
|
||||||
assert(cudaStat == cudaSuccess);
|
assert(cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -433,7 +433,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
|
|
||||||
double* d_r2;
|
double* d_r2;
|
||||||
lda = nO * nO;
|
lda = nO * nO;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_r2, lda * nV * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_r2, lda * nV * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cudaMemset(d_r2, 0, nO*nO*nV*nV*sizeof(double));
|
cudaMemset(d_r2, 0, nO*nO*nV*nV*sizeof(double));
|
||||||
memset(r2, 0, nO*nO*nV*nV*sizeof(double));
|
memset(r2, 0, nO*nO*nV*nV*sizeof(double));
|
||||||
@ -458,7 +458,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
double* d_H_vv = data[igpu].H_vv;
|
double* d_H_vv = data[igpu].H_vv;
|
||||||
|
|
||||||
double* d_K1;
|
double* d_K1;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_K1, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_K1, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
#pragma omp sections
|
#pragma omp sections
|
||||||
@ -467,7 +467,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_J1;
|
double* d_J1;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_J1, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_J1, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -479,7 +479,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
|
|
||||||
|
|
||||||
double* d_X_ovoo;
|
double* d_X_ovoo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_ovoo, nO*nV*nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_ovoo, nO*nV*nO*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
alpha = 0.0;
|
alpha = 0.0;
|
||||||
beta = 1.0;
|
beta = 1.0;
|
||||||
@ -502,7 +502,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
|
|
||||||
|
|
||||||
double* d_Y_ovov;
|
double* d_Y_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -534,7 +534,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasSetStream(handle, NULL);
|
cublasSetStream(handle, NULL);
|
||||||
|
|
||||||
double* d_tmp_cc;
|
double* d_tmp_cc;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp_cc, cholesky_mo_num*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp_cc, cholesky_mo_num*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -546,7 +546,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_J1_tmp;
|
double* d_J1_tmp;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_J1_tmp, nV*nO*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_J1_tmp, nV*nO*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -578,7 +578,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cudaFree(d_J1_tmp);
|
cudaFree(d_J1_tmp);
|
||||||
|
|
||||||
double* d_X_voov;
|
double* d_X_voov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_voov, nV*nO*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_voov, nV*nO*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -612,7 +612,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasSetStream(handle, NULL);
|
cublasSetStream(handle, NULL);
|
||||||
|
|
||||||
double* d_Z_ovvo;
|
double* d_Z_ovvo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Z_ovvo, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Z_ovvo, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = -1.0;
|
alpha = -1.0;
|
||||||
@ -641,7 +641,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
}
|
}
|
||||||
|
|
||||||
double* d_Y_vovo;
|
double* d_Y_vovo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y_vovo, nV*nO*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y_vovo, nV*nO*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -657,7 +657,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
}
|
}
|
||||||
|
|
||||||
double* d_X_ovvo;
|
double* d_X_ovvo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_ovvo, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_ovvo, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -732,11 +732,11 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_X;
|
double* d_X;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X, nV*nO*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X, nV*nO*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_Y;
|
double* d_Y;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -771,7 +771,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasSetStream(handle, NULL);
|
cublasSetStream(handle, NULL);
|
||||||
|
|
||||||
double* d_Z;
|
double* d_Z;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Z, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Z, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -787,7 +787,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
|
|
||||||
|
|
||||||
double* d_t1v;
|
double* d_t1v;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_t1v, cholesky_mo_num*nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_t1v, cholesky_mo_num*nO*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -799,7 +799,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_K1tmp;
|
double* d_K1tmp;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_K1tmp, nO*nO*nV*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_K1tmp, nO*nO*nV*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -852,7 +852,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_Y_oooo;
|
double* d_Y_oooo;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_Y_oooo, nO*nO*nO*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_Y_oooo, nO*nO*nO*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -864,7 +864,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_A1;
|
double* d_A1;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_A1, nO*nO*nO*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_A1, nO*nO*nO*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -916,7 +916,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_g_vir;
|
double* d_g_vir;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_g_vir, nV*nV*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_g_vir, nV*nV*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasDcopy(handle, nV*nV, d_H_vv, 1, d_g_vir, 1);
|
cublasDcopy(handle, nV*nV, d_H_vv, 1, d_g_vir, 1);
|
||||||
|
|
||||||
@ -929,7 +929,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_tmp_k;
|
double* d_tmp_k;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_tmp_k, cholesky_mo_num*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_tmp_k, cholesky_mo_num*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
beta = 0.0;
|
beta = 0.0;
|
||||||
@ -949,7 +949,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cudaFree(d_tmp_k);
|
cudaFree(d_tmp_k);
|
||||||
|
|
||||||
double* d_tmp_vo;
|
double* d_tmp_vo;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_tmp_vo, cholesky_mo_num*nV*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_tmp_vo, cholesky_mo_num*nV*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
beta = 0.0;
|
beta = 0.0;
|
||||||
@ -960,7 +960,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_tmp_vo2;
|
double* d_tmp_vo2;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_tmp_vo2, cholesky_mo_num*nV*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_tmp_vo2, cholesky_mo_num*nV*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
for (size_t i=0 ; i<nO ; ++i) {
|
for (size_t i=0 ; i<nO ; ++i) {
|
||||||
cudaStreamCreate(&(stream[i]));
|
cudaStreamCreate(&(stream[i]));
|
||||||
@ -990,7 +990,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cudaFree(d_tmp_vo2);
|
cudaFree(d_tmp_vo2);
|
||||||
|
|
||||||
double* d_Y_oovv;
|
double* d_Y_oovv;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_Y_oovv, nO*nO*nV*nV*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_Y_oovv, nO*nO*nV*nV*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
beta = 0.0;
|
beta = 0.0;
|
||||||
@ -1035,12 +1035,12 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
{
|
{
|
||||||
double* d_g_occ;
|
double* d_g_occ;
|
||||||
lda = nO;
|
lda = nO;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_g_occ, nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_g_occ, nO*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasDcopy(handle, nO*nO, d_H_oo, 1, d_g_occ, 1);
|
cublasDcopy(handle, nO*nO, d_H_oo, 1, d_g_occ, 1);
|
||||||
|
|
||||||
double* d_X;
|
double* d_X;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X, cholesky_mo_num*sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X, cholesky_mo_num*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 2.0;
|
alpha = 2.0;
|
||||||
@ -1077,7 +1077,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_X_oovv;
|
double* d_X_oovv;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_oovv, nO*nO*nV*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_oovv, nO*nO*nV*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1130,11 +1130,11 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_X_vovv;
|
double* d_X_vovv;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_vovv, nV*nO*nV*BLOCK_SIZE * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_vovv, nV*nO*nV*BLOCK_SIZE * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_Y_oovv;
|
double* d_Y_oovv;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y_oovv, nO*nO*nV*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y_oovv, nO*nO*nV*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t iblock=0 ; iblock<nV ; iblock += BLOCK_SIZE) {
|
for (size_t iblock=0 ; iblock<nV ; iblock += BLOCK_SIZE) {
|
||||||
@ -1197,7 +1197,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_tcc2;
|
double* d_tcc2;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tcc2, cholesky_mo_num*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tcc2, cholesky_mo_num*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1209,7 +1209,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_T, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_tcc;
|
double* d_tcc;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tcc, cholesky_mo_num*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tcc, cholesky_mo_num*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1221,7 +1221,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||||
|
|
||||||
double* d_X_ovvo;
|
double* d_X_ovvo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_ovvo, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_ovvo, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1265,7 +1265,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_X_oovv;
|
double* d_X_oovv;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_oovv, nO*nO*nV*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_oovv, nO*nO*nV*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1296,7 +1296,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
}
|
}
|
||||||
|
|
||||||
double* d_X_vovo;
|
double* d_X_vovo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_vovo, nV*nO*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_vovo, nV*nO*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 0.0;
|
alpha = 0.0;
|
||||||
@ -1316,7 +1316,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasSetStream(handle, NULL);
|
cublasSetStream(handle, NULL);
|
||||||
|
|
||||||
double* d_Y_oovo;
|
double* d_Y_oovo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y_oovo, nO*nO*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y_oovo, nO*nO*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1382,12 +1382,12 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
{
|
{
|
||||||
double* d_J1;
|
double* d_J1;
|
||||||
lda = nO*nV;
|
lda = nO*nV;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_J1, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_J1, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(lda, nV*nO, sizeof(double), J1, lda, d_J1, lda);
|
cublasSetMatrix(lda, nV*nO, sizeof(double), J1, lda, d_J1, lda);
|
||||||
|
|
||||||
double* d_X_ovvo;
|
double* d_X_ovvo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_ovvo, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_ovvo, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -1411,7 +1411,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cudaFree(d_J1);
|
cudaFree(d_J1);
|
||||||
|
|
||||||
double* d_Y_voov;
|
double* d_Y_voov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y_voov, nV*nO*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y_voov, nV*nO*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -1434,7 +1434,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasSetStream(handle, NULL);
|
cublasSetStream(handle, NULL);
|
||||||
|
|
||||||
double* d_Z_ovov;
|
double* d_Z_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Z_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Z_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1479,11 +1479,11 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_X_ovov;
|
double* d_X_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_Y_ovov;
|
double* d_Y_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -1516,7 +1516,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasSetStream(handle, NULL);
|
cublasSetStream(handle, NULL);
|
||||||
|
|
||||||
double* d_Z_ovov;
|
double* d_Z_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Z_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Z_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1562,11 +1562,11 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_X_ovov;
|
double* d_X_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_Y_ovov;
|
double* d_Y_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Y_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Y_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
|
|
||||||
@ -1600,7 +1600,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasSetStream(handle, NULL);
|
cublasSetStream(handle, NULL);
|
||||||
|
|
||||||
double* d_Z_ovov;
|
double* d_Z_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_Z_ovov, nO*nV*nO*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_Z_ovov, nO*nV*nO*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
@ -1648,7 +1648,7 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
|
|
||||||
double* d_tmp_cc;
|
double* d_tmp_cc;
|
||||||
lda = cholesky_mo_num * nV;
|
lda = cholesky_mo_num * nV;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp_cc, lda * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp_cc, lda * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha=1.0; beta=0.0;
|
alpha=1.0; beta=0.0;
|
||||||
@ -1657,15 +1657,15 @@ void compute_r2_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, m, B, k, &beta, C, m);
|
cublasDgemm(handle, CUBLAS_OP_N, CUBLAS_OP_N, m, n, k, &alpha, A, m, B, k, &beta, C, m);
|
||||||
|
|
||||||
double* d_tmp_cc2;
|
double* d_tmp_cc2;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tmp_cc2, cholesky_mo_num*nV*sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tmp_cc2, cholesky_mo_num*nV*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_B1;
|
double* d_B1;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_B1, nV*nV*BLOCK_SIZE*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_B1, nV*nV*BLOCK_SIZE*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_tmpB1;
|
double* d_tmpB1;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_tmpB1, nV*BLOCK_SIZE*nV*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_tmpB1, nV*BLOCK_SIZE*nV*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
#pragma omp for
|
#pragma omp for
|
||||||
@ -1781,7 +1781,7 @@ void compute_r1_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
|
|
||||||
double* d_r1;
|
double* d_r1;
|
||||||
lda = nO ;
|
lda = nO ;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_r1, lda * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_r1, lda * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cudaMemset(d_r1, 0, nO*nV*sizeof(double));
|
cudaMemset(d_r1, 0, nO*nV*sizeof(double));
|
||||||
memset(r1, 0, nO*nV*sizeof(double));
|
memset(r1, 0, nO*nV*sizeof(double));
|
||||||
@ -1808,7 +1808,7 @@ void compute_r1_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDcopy(handle, nO*nV, d_cc_space_f_ov, 1, d_r1, 1);
|
cublasDcopy(handle, nO*nV, d_cc_space_f_ov, 1, d_r1, 1);
|
||||||
|
|
||||||
double* d_X_oo;
|
double* d_X_oo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_oo, nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_oo, nO*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = -2.0;
|
alpha = -2.0;
|
||||||
@ -1855,7 +1855,7 @@ void compute_r1_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_X_voov;
|
double* d_X_voov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_voov, nV* nO* nO* nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_voov, nV* nO* nO* nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
for (size_t i=0 ; i<nV ; ++i) {
|
for (size_t i=0 ; i<nV ; ++i) {
|
||||||
@ -1901,7 +1901,7 @@ void compute_r1_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_X_ovov;
|
double* d_X_ovov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_X_ovov, nO* nV* nO* nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_X_ovov, nO* nV* nO* nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasDcopy(handle, nO*nV*nO*nV, d_cc_space_v_ovov, 1, d_X_ovov, 1);
|
cublasDcopy(handle, nO*nV*nO*nV, d_cc_space_v_ovov, 1, d_X_ovov, 1);
|
||||||
|
|
||||||
@ -1939,7 +1939,7 @@ void compute_r1_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_T_vvoo;
|
double* d_T_vvoo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_T_vvoo, nV*nV*nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_T_vvoo, nV*nV*nO*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 0.0;
|
alpha = 0.0;
|
||||||
@ -1950,11 +1950,11 @@ void compute_r1_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
cublasDgeam(handle, CUBLAS_OP_N, CUBLAS_OP_T, nV*nV, nO*nO, &alpha, A, lda, &beta, B, ldb, C, ldc);
|
cublasDgeam(handle, CUBLAS_OP_N, CUBLAS_OP_T, nV*nV, nO*nO, &alpha, A, lda, &beta, B, ldb, C, ldc);
|
||||||
|
|
||||||
double* d_W_vvov;
|
double* d_W_vvov;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_W_vvov, nV*nV*nO*BLOCK_SIZE * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_W_vvov, nV*nV*nO*BLOCK_SIZE * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_W_vvov_tmp;
|
double* d_W_vvov_tmp;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_W_vvov_tmp, nV*nO*nV*BLOCK_SIZE * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_W_vvov_tmp, nV*nO*nV*BLOCK_SIZE * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
|
|
||||||
@ -2008,7 +2008,7 @@ void compute_r1_space_chol_gpu(gpu_data* data, int nO, int nV, double* t1, doubl
|
|||||||
#pragma omp section
|
#pragma omp section
|
||||||
{
|
{
|
||||||
double* d_W_oovo;
|
double* d_W_oovo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_W_oovo, nO*nO*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_W_oovo, nO*nO*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
alpha = 2.0;
|
alpha = 2.0;
|
||||||
|
@ -36,125 +36,125 @@ gpu_data* gpu_init(
|
|||||||
|
|
||||||
double* d_cc_space_v_oo_chol;
|
double* d_cc_space_v_oo_chol;
|
||||||
lda = cholesky_mo_num * nO;
|
lda = cholesky_mo_num * nO;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_oo_chol, lda * nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_oo_chol, lda * nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(cholesky_mo_num*nO, nO, sizeof(double), cc_space_v_oo_chol, lda, d_cc_space_v_oo_chol, lda);
|
cublasSetMatrix(cholesky_mo_num*nO, nO, sizeof(double), cc_space_v_oo_chol, lda, d_cc_space_v_oo_chol, lda);
|
||||||
|
|
||||||
double* d_cc_space_v_ov_chol;
|
double* d_cc_space_v_ov_chol;
|
||||||
lda = cholesky_mo_num * nO;
|
lda = cholesky_mo_num * nO;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_ov_chol, lda * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_ov_chol, lda * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(cholesky_mo_num*nO, nV, sizeof(double), cc_space_v_ov_chol, lda, d_cc_space_v_ov_chol, lda);
|
cublasSetMatrix(cholesky_mo_num*nO, nV, sizeof(double), cc_space_v_ov_chol, lda, d_cc_space_v_ov_chol, lda);
|
||||||
|
|
||||||
double* d_cc_space_v_vo_chol;
|
double* d_cc_space_v_vo_chol;
|
||||||
lda = cholesky_mo_num * nV;
|
lda = cholesky_mo_num * nV;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_vo_chol, lda * nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_vo_chol, lda * nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(cholesky_mo_num*nV, nO, sizeof(double), cc_space_v_vo_chol, lda, d_cc_space_v_vo_chol, lda);
|
cublasSetMatrix(cholesky_mo_num*nV, nO, sizeof(double), cc_space_v_vo_chol, lda, d_cc_space_v_vo_chol, lda);
|
||||||
|
|
||||||
double* d_cc_space_v_vv_chol;
|
double* d_cc_space_v_vv_chol;
|
||||||
lda = cholesky_mo_num * nV;
|
lda = cholesky_mo_num * nV;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_vv_chol, lda * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_vv_chol, lda * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(cholesky_mo_num*nV, nV, sizeof(double), cc_space_v_vv_chol, lda, d_cc_space_v_vv_chol, lda);
|
cublasSetMatrix(cholesky_mo_num*nV, nV, sizeof(double), cc_space_v_vv_chol, lda, d_cc_space_v_vv_chol, lda);
|
||||||
|
|
||||||
double* d_cc_space_v_oooo;
|
double* d_cc_space_v_oooo;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_v_oooo, nO*nO*nO*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_v_oooo, nO*nO*nO*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nO*nO, nO*nO, sizeof(double), cc_space_v_oooo, nO*nO, d_cc_space_v_oooo, nO*nO);
|
cublasSetMatrix(nO*nO, nO*nO, sizeof(double), cc_space_v_oooo, nO*nO, d_cc_space_v_oooo, nO*nO);
|
||||||
|
|
||||||
double* d_cc_space_v_vooo;
|
double* d_cc_space_v_vooo;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_v_vooo, nV*nO*nO*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_v_vooo, nV*nO*nO*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nV*nO, nO*nO, sizeof(double), cc_space_v_vooo, nV*nO, d_cc_space_v_vooo, nV*nO);
|
cublasSetMatrix(nV*nO, nO*nO, sizeof(double), cc_space_v_vooo, nV*nO, d_cc_space_v_vooo, nV*nO);
|
||||||
|
|
||||||
double* d_cc_space_v_voov;
|
double* d_cc_space_v_voov;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_v_voov, nV*nO*nO*nV*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_v_voov, nV*nO*nO*nV*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nV*nO, nO*nV, sizeof(double), cc_space_v_voov, nV*nO, d_cc_space_v_voov, nV*nO);
|
cublasSetMatrix(nV*nO, nO*nV, sizeof(double), cc_space_v_voov, nV*nO, d_cc_space_v_voov, nV*nO);
|
||||||
|
|
||||||
double* d_cc_space_v_oovv;
|
double* d_cc_space_v_oovv;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_v_oovv, nO*nO*nV*nV*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_v_oovv, nO*nO*nV*nV*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nO*nO, nV*nV, sizeof(double), cc_space_v_oovv, nO*nO, d_cc_space_v_oovv, nO*nO);
|
cublasSetMatrix(nO*nO, nV*nV, sizeof(double), cc_space_v_oovv, nO*nO, d_cc_space_v_oovv, nO*nO);
|
||||||
|
|
||||||
double* d_cc_space_v_vvoo;
|
double* d_cc_space_v_vvoo;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_v_vvoo, nV*nV*nO*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_v_vvoo, nV*nV*nO*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nV*nV, nO*nO, sizeof(double), cc_space_v_vvoo, nV*nV, d_cc_space_v_vvoo, nV*nV);
|
cublasSetMatrix(nV*nV, nO*nO, sizeof(double), cc_space_v_vvoo, nV*nV, d_cc_space_v_vvoo, nV*nV);
|
||||||
|
|
||||||
double* d_cc_space_v_oovo;
|
double* d_cc_space_v_oovo;
|
||||||
lda = nO*nO;
|
lda = nO*nO;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_oovo, nO*nO*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_oovo, nO*nO*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(lda, nV*nO, sizeof(double), cc_space_v_oovo, lda, d_cc_space_v_oovo, lda);
|
cublasSetMatrix(lda, nV*nO, sizeof(double), cc_space_v_oovo, lda, d_cc_space_v_oovo, lda);
|
||||||
|
|
||||||
double* d_cc_space_v_ovvo;
|
double* d_cc_space_v_ovvo;
|
||||||
lda = nO*nV;
|
lda = nO*nV;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_ovvo, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_ovvo, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(lda, nV*nO, sizeof(double), cc_space_v_ovvo, lda, d_cc_space_v_ovvo, lda);
|
cublasSetMatrix(lda, nV*nO, sizeof(double), cc_space_v_ovvo, lda, d_cc_space_v_ovvo, lda);
|
||||||
|
|
||||||
double* d_cc_space_v_ovov;
|
double* d_cc_space_v_ovov;
|
||||||
lda = nO*nV;
|
lda = nO*nV;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_ovov, nO*nV*nV*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_ovov, nO*nV*nV*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(lda, nV*nO, sizeof(double), cc_space_v_ovov, lda, d_cc_space_v_ovov, lda);
|
cublasSetMatrix(lda, nV*nO, sizeof(double), cc_space_v_ovov, lda, d_cc_space_v_ovov, lda);
|
||||||
|
|
||||||
double* d_cc_space_v_ovoo;
|
double* d_cc_space_v_ovoo;
|
||||||
lda = nO*nV;
|
lda = nO*nV;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_cc_space_v_ovoo, nO*nV*nO*nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_cc_space_v_ovoo, nO*nV*nO*nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(lda, nO*nO, sizeof(double), cc_space_v_ovoo, lda, d_cc_space_v_ovoo, lda);
|
cublasSetMatrix(lda, nO*nO, sizeof(double), cc_space_v_ovoo, lda, d_cc_space_v_ovoo, lda);
|
||||||
|
|
||||||
double* d_cc_space_f_oo;
|
double* d_cc_space_f_oo;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_f_oo, nO*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_f_oo, nO*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nO, nO, sizeof(double), cc_space_f_oo, nO, d_cc_space_f_oo, nO);
|
cublasSetMatrix(nO, nO, sizeof(double), cc_space_f_oo, nO, d_cc_space_f_oo, nO);
|
||||||
|
|
||||||
double* d_cc_space_f_vo;
|
double* d_cc_space_f_vo;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_f_vo, nV*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_f_vo, nV*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nV, nO, sizeof(double), cc_space_f_vo, nV, d_cc_space_f_vo, nV);
|
cublasSetMatrix(nV, nO, sizeof(double), cc_space_f_vo, nV, d_cc_space_f_vo, nV);
|
||||||
|
|
||||||
double* d_cc_space_f_ov;
|
double* d_cc_space_f_ov;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_f_ov, nV*nO*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_f_ov, nV*nO*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nO, nV, sizeof(double), cc_space_f_ov, nO, d_cc_space_f_ov, nO);
|
cublasSetMatrix(nO, nV, sizeof(double), cc_space_f_ov, nO, d_cc_space_f_ov, nO);
|
||||||
|
|
||||||
double* d_cc_space_f_vv;
|
double* d_cc_space_f_vv;
|
||||||
cudaStat = cudaMallocManaged((void**)&d_cc_space_f_vv, nV*nV*sizeof(double), 1);
|
cudaStat = cudaMalloc((void**)&d_cc_space_f_vv, nV*nV*sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
cublasSetMatrix(nV, nV, sizeof(double), cc_space_f_vv, nV, d_cc_space_f_vv, nV);
|
cublasSetMatrix(nV, nV, sizeof(double), cc_space_f_vv, nV, d_cc_space_f_vv, nV);
|
||||||
|
|
||||||
double* d_tau;
|
double* d_tau;
|
||||||
lda = nO * nO;
|
lda = nO * nO;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tau, lda * nV * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tau, lda * nV * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_tau_x;
|
double* d_tau_x;
|
||||||
lda = nO * nO;
|
lda = nO * nO;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_tau_x, lda * nV * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_tau_x, lda * nV * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_t1;
|
double* d_t1;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_t1, nO * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_t1, nO * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_t2;
|
double* d_t2;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_t2, nO*nO*nV*nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_t2, nO*nO*nV*nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_H_oo;
|
double* d_H_oo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_H_oo, nO * nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_H_oo, nO * nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_H_vo;
|
double* d_H_vo;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_H_vo, nV * nO * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_H_vo, nV * nO * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
double* d_H_vv;
|
double* d_H_vv;
|
||||||
cudaStat = cudaMallocManaged((void **)&d_H_vv, nV * nV * sizeof(double), 1);
|
cudaStat = cudaMalloc((void **)&d_H_vv, nV * nV * sizeof(double));
|
||||||
assert (cudaStat == cudaSuccess);
|
assert (cudaStat == cudaSuccess);
|
||||||
|
|
||||||
data[igpu].cc_space_v_oo_chol = d_cc_space_v_oo_chol;
|
data[igpu].cc_space_v_oo_chol = d_cc_space_v_oo_chol;
|
||||||
|
@ -16,79 +16,70 @@ BEGIN_PROVIDER [ double precision, alpha_coef, (0:1) ]
|
|||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, alpha_coef_r, (0:1,N_states) ]
|
BEGIN_PROVIDER [ double precision, alpha_coef_r, (0:1) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! SavCar-JCP-23, corrected for small mu
|
! SavCar-JCP-23, corrected for small mu
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: istate
|
|
||||||
double precision :: num, den
|
double precision :: num, den
|
||||||
double precision :: a0, b0, delta_E, E
|
double precision :: a0, b0, delta_E, E
|
||||||
|
|
||||||
do istate = 1,N_states
|
E = energy_mu + correction_alpha_1
|
||||||
delta_E = (energy_mu(istate) + correction_alpha_1(istate)) - energy_mu0(istate)
|
|
||||||
a0 = delta_E * correction_mu0(istate) + 2.d0/dsqrt(dacos(-1.d0))*(delta_E - correction_mu0(istate)) * mu_erf
|
|
||||||
b0 = correction_mu0(istate)*correction_mu0(istate)
|
|
||||||
|
|
||||||
num = 0.319820d0 + mu_erf * (1.063846d0 + mu_erf)
|
delta_E = E - energy_mu0
|
||||||
den = 0.487806d0 + mu_erf * (1.375439d0 + mu_erf)
|
|
||||||
alpha_coef_r(0,istate) = (a0 + mu_erf*num)/(b0 + mu_erf*den)
|
|
||||||
|
|
||||||
|
a0 = delta_E * correction_mu0 + 2.d0/dsqrt(dacos(-1.d0))*(delta_E - correction_mu0) * mu_erf
|
||||||
|
b0 = correction_mu0*correction_mu0
|
||||||
|
|
||||||
! delta_E = (energy_mu + correction_alpha_1) - energy_mu0
|
num = 0.319820d0 + mu_erf * (1.063846d0 + mu_erf)
|
||||||
! a0 = delta_E * correction_mu0 + 2.d0/dsqrt(dacos(-1.d0))*(delta_E - correction_mu0) * mu_erf
|
den = 0.487806d0 + mu_erf * (1.375439d0 + mu_erf)
|
||||||
! b0 = correction_mu0*correction_mu0
|
alpha_coef_r(0) = (a0 + mu_erf*num)/(b0 + mu_erf*den)
|
||||||
|
|
||||||
|
num = 0.113074d0 + mu_erf * (0.638308d0 + mu_erf)
|
||||||
|
den = 0.122652d0 + mu_erf * (0.674813d0 + mu_erf)
|
||||||
|
alpha_coef_r(1) = (a0 + mu_erf*num)/(b0 + mu_erf*den)
|
||||||
|
|
||||||
num = 0.113074d0 + mu_erf * (0.638308d0 + mu_erf)
|
|
||||||
den = 0.122652d0 + mu_erf * (0.674813d0 + mu_erf)
|
|
||||||
alpha_coef_r(1,istate) = (a0 + mu_erf*num)/(b0 + mu_erf*den)
|
|
||||||
enddo
|
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, energy_mu0, (N_states) ]
|
BEGIN_PROVIDER [ double precision, energy_mu0 ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! E(mu=0)
|
! E(mu=0)
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: l, istate
|
integer :: l
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
do istate = 1,N_states
|
energy_mu0 = 0.d0
|
||||||
energy_mu0(istate) = 0.d0
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
energy_mu0 += ddot(mo_num, one_e_dm_mo(1,l), 1, mo_one_e_integrals(1,l), 1)
|
||||||
energy_mu0(istate) += ddot(mo_num, one_e_dm_mo_alpha(1,l,istate), 1, mo_one_e_integrals(1,l), 1)
|
|
||||||
energy_mu0(istate) += ddot(mo_num, one_e_dm_mo_beta(1,l,istate), 1, mo_one_e_integrals(1,l), 1)
|
|
||||||
enddo
|
|
||||||
energy_mu0(istate) = energy_mu0(istate) + nuclear_repulsion
|
|
||||||
enddo
|
enddo
|
||||||
|
energy_mu0 = energy_mu0 + nuclear_repulsion
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, correction_alpha_0_r, (N_states) ]
|
BEGIN_PROVIDER [ double precision, correction_alpha_0_r ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! alpha_0r(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>
|
! alpha_0r(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: k,l, istate
|
integer :: k,l
|
||||||
double precision :: c0
|
double precision :: c0
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
do istate = 1,N_states
|
c0 = 0.5d0 * alpha_coef_r(0)
|
||||||
c0 = 0.5d0 * alpha_coef_r(0,istate)
|
correction_alpha_0_r = 0.d0
|
||||||
correction_alpha_0_r(istate) = 0.d0
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
do k=1,mo_num
|
||||||
do k=1,mo_num
|
correction_alpha_0_r += c0 * ddot (mo_num*mo_num, two_e_dm_mo(1,1,k,l), 1, W_bar_mu(1,1,k,l), 1)
|
||||||
correction_alpha_0_r += c0 * ddot (mo_num*mo_num, full_occ_2_rdm_spin_trace_mo(1,1,k,l,istate), 1, W_bar_mu(1,1,k,l), 1)
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, correction_alpha_1_r, (N_states) ]
|
BEGIN_PROVIDER [ double precision, correction_alpha_1_r ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! alpha_0(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_s + alpha_1(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_t
|
! alpha_0(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_s + alpha_1(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_t
|
||||||
@ -96,19 +87,17 @@ BEGIN_PROVIDER [ double precision, correction_alpha_1_r, (N_states) ]
|
|||||||
|
|
||||||
double precision :: c1, c0
|
double precision :: c1, c0
|
||||||
|
|
||||||
integer :: k,l, istate
|
integer :: k,l
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
do istate = 1,N_states
|
c0 = 0.5d0 * alpha_coef_r(0)
|
||||||
c0 = 0.5d0 * alpha_coef_r(0,istate)
|
c1 = 0.5d0 * alpha_coef_r(1)
|
||||||
c1 = 0.5d0 * alpha_coef_r(1,istate)
|
|
||||||
|
|
||||||
correction_alpha_1_r(istate) = 0.d0
|
correction_alpha_1_r = 0.d0
|
||||||
do l=1,mo_num
|
do l=1,mo_num
|
||||||
do k=1,mo_num
|
do k=1,mo_num
|
||||||
correction_alpha_1_r(istate) += c0 * ddot (mo_num*mo_num, two_e_dm_mo_singlet(1,1,k,l,istate), 1, W_bar_mu(1,1,k,l), 1)
|
correction_alpha_1_r += c0 * ddot (mo_num*mo_num, two_e_dm_mo_singlet(1,1,k,l), 1, W_bar_mu(1,1,k,l), 1)
|
||||||
correction_alpha_1_r(istate) += c1 * ddot (mo_num*mo_num, two_e_dm_mo_triplet(1,1,k,l,istate), 1, W_bar_mu(1,1,k,l), 1)
|
correction_alpha_1_r += c1 * ddot (mo_num*mo_num, two_e_dm_mo_triplet(1,1,k,l), 1, W_bar_mu(1,1,k,l), 1)
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
@ -1,37 +1,33 @@
|
|||||||
BEGIN_PROVIDER [ double precision, two_e_dm_mo_singlet, (mo_num, mo_num, mo_num, mo_num, N_states) ]
|
BEGIN_PROVIDER [ double precision, two_e_dm_mo_singlet, (mo_num, mo_num, mo_num, mo_num) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Ps(r1,r2,r1',r2') = 1/2 (P(r1,r2,r1',r2') + P(r1,r2,r2',r1'))
|
! Ps(r1,r2,r1',r2') = 1/2 (P(r1,r2,r1',r2') + P(r1,r2,r2',r1'))
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: i,j,k,l,istate
|
integer :: i,j,k,l
|
||||||
|
|
||||||
do istate = 1,N_states
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
do k=1,mo_num
|
||||||
do k=1,mo_num
|
do j=1,mo_num
|
||||||
do j=1,mo_num
|
do i=1,mo_num
|
||||||
do i=1,mo_num
|
two_e_dm_mo_singlet(i,j,k,l) = 0.5d0 * (two_e_dm_mo(i,j,k,l) + two_e_dm_mo(i,j,l,k))
|
||||||
two_e_dm_mo_singlet(i,j,k,l,istate) = 0.5d0 * (full_occ_2_rdm_spin_trace_mo(i,j,k,l,istate) + full_occ_2_rdm_spin_trace_mo(i,j,l,k,istate))
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, two_e_dm_mo_triplet, (mo_num, mo_num, mo_num, mo_num, N_states) ]
|
BEGIN_PROVIDER [ double precision, two_e_dm_mo_triplet, (mo_num, mo_num, mo_num, mo_num) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Ps(r1,r2,r1',r2') = 1/2 (P(r1,r2,r1',r2') - P(r1,r2,r2',r1'))
|
! Ps(r1,r2,r1',r2') = 1/2 (P(r1,r2,r1',r2') - P(r1,r2,r2',r1'))
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: i,j,k,l, istate
|
integer :: i,j,k,l
|
||||||
|
|
||||||
do istate = 1,N_states
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
do k=1,mo_num
|
||||||
do k=1,mo_num
|
do j=1,mo_num
|
||||||
do j=1,mo_num
|
do i=1,mo_num
|
||||||
do i=1,mo_num
|
two_e_dm_mo_triplet(i,j,k,l) = 0.5d0 * (two_e_dm_mo(i,j,k,l) - two_e_dm_mo(i,j,l,k))
|
||||||
two_e_dm_mo_triplet(i,j,k,l,istate) = 0.5d0 * (full_occ_2_rdm_spin_trace_mo(i,j,k,l,istate) - full_occ_2_rdm_spin_trace_mo(i,j,l,k,istate))
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
@ -55,7 +55,7 @@ BEGIN_PROVIDER [ double precision, W_bar_mu, (mo_num, mo_num, mo_num, mo_num) ]
|
|||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, energy_mu, (N_states) ]
|
BEGIN_PROVIDER [ double precision, energy_mu ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! E(mu)
|
! E(mu)
|
||||||
@ -63,45 +63,40 @@ BEGIN_PROVIDER [ double precision, energy_mu, (N_states) ]
|
|||||||
|
|
||||||
double precision :: one_e, two_e
|
double precision :: one_e, two_e
|
||||||
|
|
||||||
integer :: k,l, istate
|
integer :: k,l
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
do istate = 1,N_states
|
one_e = 0.d0
|
||||||
one_e = 0.d0
|
two_e = 0.d0
|
||||||
two_e = 0.d0
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
one_e += ddot(mo_num, one_e_dm_mo(1,l), 1, mo_one_e_integrals(1,l), 1)
|
||||||
one_e += ddot(mo_num, one_e_dm_mo_alpha(1,l,istate), 1, mo_one_e_integrals(1,l), 1)
|
do k=1,mo_num
|
||||||
one_e += ddot(mo_num, one_e_dm_mo_beta (1,l,istate), 1, mo_one_e_integrals(1,l), 1)
|
two_e += 0.5d0 * ddot (mo_num*mo_num, two_e_dm_mo(1,1,k,l), 1, W_mu(1,1,k,l), 1)
|
||||||
do k=1,mo_num
|
|
||||||
two_e += 0.5d0 * ddot (mo_num*mo_num, full_occ_2_rdm_spin_trace_mo(1,1,k,l,istate), 1, W_mu(1,1,k,l), 1)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
energy_mu(istate) = one_e + two_e + nuclear_repulsion
|
|
||||||
enddo
|
enddo
|
||||||
|
enddo
|
||||||
|
energy_mu = one_e + two_e + nuclear_repulsion
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, correction_alpha_0, (N_states) ]
|
BEGIN_PROVIDER [ double precision, correction_alpha_0 ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! alpha_0(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>
|
! alpha_0(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: k,l, istate
|
integer :: k,l
|
||||||
double precision :: c0
|
double precision :: c0
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
c0 = 0.5d0 * alpha_coef(0)
|
c0 = 0.5d0 * alpha_coef(0)
|
||||||
do istate=1,N_states
|
correction_alpha_0 = 0.d0
|
||||||
correction_alpha_0(istate) = 0.d0
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
do k=1,mo_num
|
||||||
do k=1,mo_num
|
correction_alpha_0 += c0 * ddot (mo_num*mo_num, two_e_dm_mo(1,1,k,l), 1, W_bar_mu(1,1,k,l), 1)
|
||||||
correction_alpha_0(istate) += c0 * ddot (mo_num*mo_num, full_occ_2_rdm_spin_trace_mo(1,1,k,l,istate), 1, W_bar_mu(1,1,k,l), 1)
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, correction_alpha_1, (N_states) ]
|
BEGIN_PROVIDER [ double precision, correction_alpha_1 ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! alpha_0(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_s + alpha_1(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_t
|
! alpha_0(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_s + alpha_1(mu) * <Psi(mu)|W_bar_mu|Psi(mu)>_t
|
||||||
@ -109,62 +104,55 @@ BEGIN_PROVIDER [ double precision, correction_alpha_1, (N_states) ]
|
|||||||
|
|
||||||
double precision :: c1, c0
|
double precision :: c1, c0
|
||||||
|
|
||||||
integer :: k,l, istate
|
integer :: k,l
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
c0 = 0.5d0 * alpha_coef(0)
|
c0 = 0.5d0 * alpha_coef(0)
|
||||||
c1 = 0.5d0 * alpha_coef(1)
|
c1 = 0.5d0 * alpha_coef(1)
|
||||||
|
|
||||||
do istate=1,N_states
|
correction_alpha_1 = 0.d0
|
||||||
correction_alpha_1(istate) = 0.d0
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
do k=1,mo_num
|
||||||
do k=1,mo_num
|
correction_alpha_1 += c0 * ddot (mo_num*mo_num, two_e_dm_mo_singlet(1,1,k,l), 1, W_bar_mu(1,1,k,l), 1)
|
||||||
correction_alpha_1(istate) += c0 * ddot (mo_num*mo_num, two_e_dm_mo_singlet(1,1,k,l,istate), 1, W_bar_mu(1,1,k,l), 1)
|
correction_alpha_1 += c1 * ddot (mo_num*mo_num, two_e_dm_mo_triplet(1,1,k,l), 1, W_bar_mu(1,1,k,l), 1)
|
||||||
correction_alpha_1(istate) += c1 * ddot (mo_num*mo_num, two_e_dm_mo_triplet(1,1,k,l,istate), 1, W_bar_mu(1,1,k,l), 1)
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, correction_mu, (N_states) ]
|
BEGIN_PROVIDER [ double precision, correction_mu ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! <Psi(mu)|W_bar_mu|Psi(mu)>
|
! <Psi(mu)|W_bar_mu|Psi(mu)>
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: k,l, istate
|
integer :: k,l
|
||||||
double precision :: c0
|
double precision :: c0
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
c0 = 0.5d0
|
c0 = 0.5d0
|
||||||
|
correction_mu = 0.d0
|
||||||
do istate=1,N_states
|
do l=1,mo_num
|
||||||
correction_mu(istate) = 0.d0
|
do k=1,mo_num
|
||||||
do l=1,mo_num
|
correction_mu += c0 * ddot (mo_num*mo_num, two_e_dm_mo(1,1,k,l), 1, W_bar_mu(1,1,k,l), 1)
|
||||||
do k=1,mo_num
|
|
||||||
correction_mu(istate) += c0 * ddot (mo_num*mo_num, full_occ_2_rdm_spin_trace_mo(1,1,k,l,istate), 1, W_bar_mu(1,1,k,l), 1)
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, correction_mu0, (N_states) ]
|
BEGIN_PROVIDER [ double precision, correction_mu0 ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! <Psi(mu)|W|Psi(mu)> : Should be <Psi(0)|W|Psi(0)>
|
! <Psi(mu)|W|Psi(mu)> : Should be <Psi(0)|W|Psi(0)>
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: k,l,istate
|
integer :: k,l
|
||||||
double precision :: c0
|
double precision :: c0
|
||||||
double precision, external :: ddot
|
double precision, external :: ddot
|
||||||
|
|
||||||
c0 = 0.5d0
|
c0 = 0.5d0
|
||||||
do istate=1,N_states
|
correction_mu0 = 0.d0
|
||||||
correction_mu0(istate) = 0.d0
|
do l=1,mo_num
|
||||||
do l=1,mo_num
|
do k=1,mo_num
|
||||||
do k=1,mo_num
|
correction_mu0 += c0 * ddot (mo_num*mo_num, two_e_dm_mo(1,1,k,l), 1, W_bar_mu0(1,1,k,l), 1)
|
||||||
correction_mu0(istate) += c0 * ddot (mo_num*mo_num, full_occ_2_rdm_spin_trace_mo(1,1,k,l,istate), 1, W_bar_mu0(1,1,k,l), 1)
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
@ -8,40 +8,27 @@ end
|
|||||||
|
|
||||||
subroutine run
|
subroutine run
|
||||||
implicit none
|
implicit none
|
||||||
integer :: istate
|
|
||||||
do istate=1,N_states
|
|
||||||
print *, '', istate
|
|
||||||
print *, 'State ', istate
|
|
||||||
print *, '---'
|
print *, '---'
|
||||||
print *, 'mu', mu_erf
|
print *, 'mu', mu_erf
|
||||||
print *, 'E(mu)', energy_mu(istate)
|
print *, 'E(mu)', energy_mu
|
||||||
print *, '---'
|
print *, '---'
|
||||||
print *, 'W_bar(mu)', correction_mu(istate)
|
print *, 'W_bar(mu)', correction_mu
|
||||||
print *, 'E(mu) + <W_bar(mu)>', energy_mu(istate) + correction_mu(istate)
|
print *, 'E(mu) + <W_bar(mu)>', energy_mu + correction_mu
|
||||||
print *, '---'
|
print *, '---'
|
||||||
print *, 'alpha_0', alpha_coef(0)
|
print *, 'alpha_0', alpha_coef(0)
|
||||||
print *, 'correction 0', correction_alpha_0(istate)
|
print *, 'correction 0', correction_alpha_0
|
||||||
print *, 'E(mu) + alpha_0 <W_bar(mu)> = ', energy_mu(istate) + correction_alpha_0(istate)
|
print *, 'E(mu) + alpha_0 <W_bar(mu)> = ', energy_mu + correction_alpha_0
|
||||||
print *, '---'
|
print *, '---'
|
||||||
print *, 'alpha_1', alpha_coef(1)
|
print *, 'alpha_1', alpha_coef(1)
|
||||||
print *, 'correction 1', correction_alpha_1(istate)
|
print *, 'correction 1', correction_alpha_1
|
||||||
print *, 'E(mu) + alpha_0 <W_bar(mu)>_s + alpha_1 <W_bar(mu)>_t = ', energy_mu(istate) + correction_alpha_1(istate)
|
print *, 'E(mu) + alpha_0 <W_bar(mu)>_s + alpha_1 <W_bar(mu)>_t = ', energy_mu + correction_alpha_1
|
||||||
print *, '---'
|
print *, '---'
|
||||||
print *, 'alpha_0_r', alpha_coef_r(0,istate)
|
print *, 'alpha_0_r', alpha_coef_r(0)
|
||||||
print *, 'correction 0', correction_alpha_0_r(istate)
|
print *, 'correction 0', correction_alpha_0_r
|
||||||
print *, 'E(mu) + alpha_0_r <W_bar(mu)> = ', energy_mu(istate) + correction_alpha_0_r(istate)
|
print *, 'E(mu) + alpha_0_r <W_bar(mu)> = ', energy_mu + correction_alpha_0_r
|
||||||
print *, '---'
|
print *, '---'
|
||||||
print *, 'alpha_1_r', alpha_coef_r(1,istate)
|
print *, 'alpha_1_r', alpha_coef_r(1)
|
||||||
print *, 'correction 1', correction_alpha_1_r(istate)
|
print *, 'correction 1', correction_alpha_1_r
|
||||||
print *, 'E(mu) + alpha_0_r <W_bar(mu)>_s + alpha_1_r <W_bar(mu)>_t = ', energy_mu(istate) + correction_alpha_1_r(istate)
|
print *, 'E(mu) + alpha_0_r <W_bar(mu)>_s + alpha_1_r <W_bar(mu)>_t = ', energy_mu + correction_alpha_1_r
|
||||||
print *, '---'
|
print *, '---'
|
||||||
|
|
||||||
|
|
||||||
print *,''
|
|
||||||
print '(''|'',A6,''|'',5(A20,''|''))', 'E(mu)', '<W>', 'E(mu) + <W>', 'E(mu) + \alpha_0<W>', &
|
|
||||||
'E(mu) + \alpha_0<W>_s + \alpha_1<W>_t', 'E(mu) + \alpha_0_r<W>_s + \alpha_1_r<W>_t'
|
|
||||||
print '(''|'',F6.2,''|'',5(F20.15,''|''))', mu_erf, energy_mu(istate), energy_mu(istate) + correction_mu(istate), energy_mu(istate) + &
|
|
||||||
correction_alpha_0(istate), energy_mu(istate) + correction_alpha_1(istate), energy_mu(istate) + &
|
|
||||||
correction_alpha_1_r(istate)
|
|
||||||
enddo
|
|
||||||
end
|
end
|
||||||
|
@ -29,8 +29,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_grid, (ao_num,-pseudo_lmax:pseudo_l
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
ao_pseudo_grid = 0.d0
|
ao_pseudo_grid = 0.d0
|
||||||
!$OMP PARALLEL DO DEFAULT(SHARED) &
|
|
||||||
!$OMP PRIVATE(j,k,c,l,i,a,n_a,g_a,m,y)
|
|
||||||
do j=1,pseudo_grid_size
|
do j=1,pseudo_grid_size
|
||||||
do k=1,nucl_num
|
do k=1,nucl_num
|
||||||
c(1:3) = nucl_coord(k,1:3)
|
c(1:3) = nucl_coord(k,1:3)
|
||||||
@ -50,7 +48,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_grid, (ao_num,-pseudo_lmax:pseudo_l
|
|||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
!$OMP END PARALLEL DO
|
|
||||||
deallocate(r)
|
deallocate(r)
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
@ -78,11 +75,54 @@ BEGIN_PROVIDER [ double precision, mo_pseudo_grid, (ao_num,-pseudo_lmax:pseudo_l
|
|||||||
double precision :: y
|
double precision :: y
|
||||||
double precision, allocatable :: r(:)
|
double precision, allocatable :: r(:)
|
||||||
|
|
||||||
|
allocate (r(pseudo_grid_size))
|
||||||
|
|
||||||
mo_pseudo_grid = 0.d0
|
dr = pseudo_grid_rmax/dble(pseudo_grid_size)
|
||||||
call dgemm('T','N', mo_num, (2*pseudo_lmax+1)*(pseudo_lmax+1)*nucl_num*pseudo_grid_size, &
|
r(1) = 0.d0
|
||||||
ao_num, 1.d0, mo_coef, size(mo_coef,1), ao_pseudo_grid, &
|
do j=2,pseudo_grid_size
|
||||||
size(ao_pseudo_grid,1), 0.d0, mo_pseudo_grid, size(mo_pseudo_grid,1))
|
r(j) = r(j-1) + dr
|
||||||
|
enddo
|
||||||
|
|
||||||
|
mo_pseudo_grid = 0.d0
|
||||||
|
do n=1,pseudo_grid_size
|
||||||
|
do k=1,nucl_num
|
||||||
|
do l=0,pseudo_lmax
|
||||||
|
do m=-l,l
|
||||||
|
do i=1,ao_num
|
||||||
|
if (dabs(ao_pseudo_grid(i,m,l,k,n)) < 1.e-12) then
|
||||||
|
cycle
|
||||||
|
endif
|
||||||
|
do j=1,mo_num
|
||||||
|
mo_pseudo_grid(j,m,l,k,n) = mo_pseudo_grid(j,m,l,k,n) + &
|
||||||
|
ao_pseudo_grid(i,m,l,k,n) * mo_coef(i,j)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
deallocate(r)
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
double precision function test_pseudo_grid_ao(i,j)
|
||||||
|
implicit none
|
||||||
|
integer, intent(in) :: i,j
|
||||||
|
integer :: k,l,m,n
|
||||||
|
double precision :: r, dr,u
|
||||||
|
dr = pseudo_grid_rmax/dble(pseudo_grid_size)
|
||||||
|
|
||||||
|
test_pseudo_grid_ao = 0.d0
|
||||||
|
r = 0.d0
|
||||||
|
do k=1,pseudo_grid_size
|
||||||
|
do n=1,nucl_num
|
||||||
|
do l = 0,pseudo_lmax
|
||||||
|
u = pseudo_v_kl(n,l,1) * exp(-pseudo_dz_kl(n,l,1)*r*r)* r*r*dr
|
||||||
|
do m=-l,l
|
||||||
|
test_pseudo_grid_ao += ao_pseudo_grid(i,m,l,n,k) * ao_pseudo_grid(j,m,l,n,k) * u
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
r = r+dr
|
||||||
|
enddo
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user