Matrix Operations

Andrey andrey.l... at gmail.com
Sun Jan 23 17:19:28 UTC 2011


Dear cp2k developers,

I have the code, which works without errors:
1)
   TYPE(cp_dbcsr_p_type), DIMENSION(:),  POINTER  :: exx_kernel
   TYPE (qs_energy_type), POINTER           :: exx_energy

.....
1            NULLIFY(exx_energy, exx_kernel)
2             CALL allocate_qs_energy(exx_energy)
3
4            CALL
cp_dbcsr_allocate_matrix_set(exx_kernel,nspins,error=error)
5             DO ispin=1,nspins
6                ALLOCATE(exx_kernel(ispin)%matrix)
7                 CALL cp_dbcsr_init(exx_kernel(ispin)
%matrix,error=error)
8            END DO
9
10          CALL deallocate_qs_energy(exx_energy)
......

2)  When CALL cp_dbcsr_deallocate_matrix_set(exx_kernel,error=error)
added,
              .....
9                CALL
cp_dbcsr_deallocate_matrix_set(exx_kernel,error=error)
10              CALL deallocate_qs_energy(exx_energy) ASSERTION
FAILED: F

program finishes well, but noncritical error messages appear.

 dbcsr_error_print_stack
 error%msg=
 Matrix not
initialized

 error%routine=
 
dbcsr_release

 error%etype=           1
 error%level=           1
 error%line=         413
 error%stack%level=           0
 dbcsr_error_stack_size=          10



3)  If CALL cp_dbcsr_set(exx_kernel(ispin)%matrix,0.0_dp,error=error)
is set (between lines 7 and 8)
then program does not pass it and crashes at this point.

 forrtl: severe (174): SIGSEGV, segmentation fault occurred

Could you, please, help me to understand what is wrong in my code.


More information about the CP2K-user mailing list