From 2fe6d2ac2d362e03877c85871d5096b2057c75f5 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Thu, 1 Feb 2024 10:08:51 +0100 Subject: [PATCH] kpt_is_local interface Signed-off-by: Cristian Le --- src/states/states_elec.F90 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/states/states_elec.F90 b/src/states/states_elec.F90 index a56add3b5c..767a56eb01 100644 --- a/src/states/states_elec.F90 +++ b/src/states/states_elec.F90 @@ -86,6 +86,7 @@ module states_elec_oct_m states_elec_calc_quantities, & state_is_local, & state_kpt_is_local, & + kpt_is_local, & states_elec_choose_kpoints, & states_elec_distribute_nodes, & states_elec_wfns_memory, & @@ -2324,12 +2325,25 @@ contains PUSH_SUB(state_kpt_is_local) - state_kpt_is_local = ist >= st%st_start .and. ist <= st%st_end .and. & - ik >= st%d%kpt%start .and. ik <= st%d%kpt%end + state_kpt_is_local = state_is_local(st, ist) .and. kpt_is_local(st, ik) POP_SUB(state_kpt_is_local) end function state_kpt_is_local + ! --------------------------------------------------------- + !> check whether a given kpoint (ik) is on the local node + ! + logical function kpt_is_local(st, ik) + type(states_elec_t), intent(in) :: st + integer, intent(in) :: ik + + PUSH_SUB(kpt_is_local) + + kpt_is_local = ik >= st%d%kpt%start .and. ik <= st%d%kpt%end + + POP_SUB(kpt_is_local) + end function kpt_is_local + ! --------------------------------------------------------- !> return the memory usage of a states_elec_t object -- GitLab