Octopus
mesh_batch.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
24 use accel_oct_m
26 use batch_oct_m
28 use blas_oct_m
29 use iso_c_binding
30 use debug_oct_m
31 use global_oct_m
34 use math_oct_m
35 use mesh_oct_m
38 use mpi_oct_m
41#if defined(HAVE_OPENMP)
42 use omp_lib
43#endif
47 use types_oct_m
48
49 implicit none
50
51 private
52 public :: &
53 batch_p_t, &
71
72 type batch_p_t
73 class(batch_t), allocatable :: p
74 end type batch_p_t
75
76
77contains
78
79 ! -----------------------------------------------------
81 !
82 subroutine mesh_batch_nrm2(mesh, aa, nrm2, reduce)
83 class(mesh_t), intent(in) :: mesh
84 class(batch_t), intent(in) :: aa
85 real(real64), contiguous, intent(out) :: nrm2(:)
86 logical, optional, intent(in) :: reduce
87
88 push_sub(mesh_batch_nrm2)
89
90 if (aa%type() == type_float) then
91 call dpriv_mesh_batch_nrm2(mesh, aa, nrm2)
92 else
93 call zpriv_mesh_batch_nrm2(mesh, aa, nrm2)
94 end if
95
96 if (mesh%parallel_in_domains .and. optional_default(reduce, .true.)) then
97 nrm2(1:aa%nst) = nrm2(1:aa%nst)**2
98 call mesh%allreduce(nrm2, dim = aa%nst)
99 nrm2(1:aa%nst) = sqrt(nrm2(1:aa%nst))
100 end if
101
102 pop_sub(mesh_batch_nrm2)
103 end subroutine mesh_batch_nrm2
104
105#undef SPECIALIZED
106#include "undef.F90"
107#include "real.F90"
108#include "mesh_batch_inc.F90"
109
110#include "undef.F90"
111#include "complex.F90"
112#include "mesh_batch_inc.F90"
113
114! Specialized kernels for nst_linear=2
115#define SPECIALIZED 2
116#include "undef.F90"
117#include "real.F90"
118#include "mesh_batch_inc.F90"
119
120#include "undef.F90"
121#include "complex.F90"
122#include "mesh_batch_inc.F90"
123#undef SPECIALIZED
124
125! Specialized kernels for nst_linear=3
126#define SPECIALIZED 3
127#include "undef.F90"
128#include "real.F90"
129#include "mesh_batch_inc.F90"
130
131#include "undef.F90"
132#include "complex.F90"
133#include "mesh_batch_inc.F90"
134#undef SPECIALIZED
135
136! Specialized kernels for nst_linear=4
137#define SPECIALIZED 4
138#include "undef.F90"
139#include "real.F90"
140#include "mesh_batch_inc.F90"
141
142#include "undef.F90"
143#include "complex.F90"
144#include "mesh_batch_inc.F90"
145#undef SPECIALIZED
146
147! Specialized kernels for nst_linear=6
148#define SPECIALIZED 6
149#include "undef.F90"
150#include "real.F90"
151#include "mesh_batch_inc.F90"
152
153#include "undef.F90"
154#include "complex.F90"
155#include "mesh_batch_inc.F90"
156#undef SPECIALIZED
157
158! Specialized kernels for nst_linear=8
159#define SPECIALIZED 8
160#include "undef.F90"
161#include "real.F90"
162#include "mesh_batch_inc.F90"
163
164#include "undef.F90"
165#include "complex.F90"
166#include "mesh_batch_inc.F90"
167#undef SPECIALIZED
169end module mesh_batch_oct_m
170
171!! Local Variables:
172!! mode: f90
173!! coding: utf-8
174!! End:
double sqrt(double __x) __attribute__((__nothrow__
This module implements batches of mesh functions.
Definition: batch.F90:135
This module implements common operations on batches of mesh functions.
Definition: batch_ops.F90:118
This module contains interfaces for BLAS routines You should not use these routines directly....
Definition: blas.F90:120
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:117
This module defines functions over batches of mesh functions.
Definition: mesh_batch.F90:118
subroutine, public dmesh_batch_dotp_matrix(mesh, aa, bb, dot, reduce)
Calculate the overlap matrix of two batches.
Definition: mesh_batch.F90:273
subroutine, public dmesh_batch_codensity(mesh, aa, psi, rho)
calculate the co-densities
subroutine, public dmesh_batch_dotp_self(mesh, aa, dot, reduce)
calculate the overlap matrix of a batch with itself
Definition: mesh_batch.F90:536
subroutine, public mesh_batch_nrm2(mesh, aa, nrm2, reduce)
Calculate the norms (norm2, not the square!) of a batch of mesh functions.
Definition: mesh_batch.F90:178
subroutine, public zmesh_batch_exchange_points(mesh, aa, forward_map, backward_map)
This functions exchanges points of a mesh according to a certain map. Two possible maps can be given....
subroutine, public zmesh_batch_dotp_vector(mesh, aa, bb, dot, reduce, cproduct)
A simple switch between specialized kernels and generic kernels.
subroutine zpriv_mesh_batch_nrm2(mesh, aa, nrm2)
This function should not be called directly, but through mesh_batch_nrm2.
subroutine, public zmesh_batch_dotp_matrix(mesh, aa, bb, dot, reduce)
Calculate the overlap matrix of two batches.
subroutine, public zmesh_batch_normalize(mesh, psib, norm)
Normalize a batch.
subroutine, public dmesh_batch_orthogonalization(mesh, nst, psib, phib, normalize, overlap, norm, gs_scheme, full_batch)
Orthonormalizes states of phib to the orbitals of nst batches of psi.
subroutine, public zmesh_batch_orthogonalization(mesh, nst, psib, phib, normalize, overlap, norm, gs_scheme, full_batch)
Orthonormalizes states of phib to the orbitals of nst batches of psi.
subroutine, public dmesh_batch_exchange_points(mesh, aa, forward_map, backward_map)
This functions exchanges points of a mesh according to a certain map. Two possible maps can be given....
subroutine, public zmesh_batch_codensity(mesh, aa, psi, rho)
calculate the co-densities
subroutine, public zmesh_batch_mf_dotp(mesh, aa, psi, dot, reduce, nst)
calculate the dot products between a batch and a vector of mesh functions
subroutine, public dmesh_batch_mf_dotp(mesh, aa, psi, dot, reduce, nst)
calculate the dot products between a batch and a vector of mesh functions
Definition: mesh_batch.F90:856
subroutine dpriv_mesh_batch_nrm2(mesh, aa, nrm2)
This function should not be called directly, but through mesh_batch_nrm2.
subroutine, public zmesh_batch_dotp_self(mesh, aa, dot, reduce)
calculate the overlap matrix of a batch with itself
subroutine, public dmesh_batch_normalize(mesh, psib, norm)
Normalize a batch.
subroutine, public dmesh_batch_dotp_vector(mesh, aa, bb, dot, reduce, cproduct)
A simple switch between specialized kernels and generic kernels.
Definition: mesh_batch.F90:652
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
This module handles the communicators for the various parallelization strategies.
Definition: multicomm.F90:147
Some general things and nomenclature:
Definition: par_vec.F90:173
type(type_t), parameter, public type_float
Definition: types.F90:135
int true(void)