Skip to content

Commit

Permalink
Fix output from MP2 gradients
Browse files Browse the repository at this point in the history
Before, every process has created its own file writing some output. For runs with a large number of processes, the number of created files has grown accordingly. Using the MP2 logger, these files will not be created.
  • Loading branch information
Frederick Stein authored and fstein93 committed Dec 16, 2021
1 parent 8842aa3 commit 964a920
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/mp2_cphf.F
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ MODULE mp2_cphf
cp_fm_type
USE cp_gemm_interface, ONLY: cp_gemm
USE cp_log_handling, ONLY: cp_get_default_logger,&
cp_logger_get_default_unit_nr,&
cp_logger_type
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
cp_print_key_unit_nr
USE cp_para_types, ONLY: cp_para_env_type
USE dbcsr_api, ONLY: dbcsr_add,&
dbcsr_copy,&
Expand Down Expand Up @@ -1000,9 +1001,6 @@ SUBROUTINE update_mp2_forces(qs_env)

CALL timeset(routineN, handle)

logger => cp_get_default_logger()
iounit = cp_logger_get_default_unit_nr(logger)

NULLIFY (input, pw_env, matrix_s, rho, energy, force, virial, &
matrix_p_mp2, matrix_p_mp2_admm, matrix_ks, rho_core)
CALL get_qs_env(qs_env, &
Expand All @@ -1025,6 +1023,10 @@ SUBROUTINE update_mp2_forces(qs_env)
rho_core=rho_core, &
x_data=x_data)

logger => cp_get_default_logger()
iounit = cp_print_key_unit_nr(logger, input, "DFT%XC%WF_CORRELATION%MP2%MP2_INFO", &
extension=".mp2Log")

p_env => qs_env%mp2_env%ri_grad%p_env

CALL qs_rho_get(rho, rho_ao=rho_ao, rho_ao_kp=rho_ao_kp, rho_r=rho_r, rho_g=rho_g)
Expand Down Expand Up @@ -1585,6 +1587,9 @@ SUBROUTINE update_mp2_forces(qs_env)
CALL get_qs_env(qs_env, dispersion_env=dispersion_env)
CALL calculate_dispersion_pairpot(qs_env, dispersion_env, e_dummy, .TRUE.)
CALL cp_print_key_finished_output(iounit, logger, input, &
"DFT%XC%WF_CORRELATION%MP2%MP2_INFO")
CALL timestop(handle)
END SUBROUTINE update_mp2_forces
Expand Down

0 comments on commit 964a920

Please sign in to comment.