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, &
73
74 type batch_p_t
75 class(batch_t), allocatable :: p
76 end type batch_p_t
77
78
79contains
80
81 ! -----------------------------------------------------
83 !
84 subroutine mesh_batch_nrm2(mesh, aa, nrm2, reduce)
85 class(mesh_t), intent(in) :: mesh
86 class(batch_t), intent(in) :: aa
87 real(real64), contiguous, intent(out) :: nrm2(:)
88 logical, optional, intent(in) :: reduce
89
90 push_sub(mesh_batch_nrm2)
91
92 if (aa%type() == type_float) then
93 call dpriv_mesh_batch_nrm2(mesh, aa, nrm2)
94 else
95 call zpriv_mesh_batch_nrm2(mesh, aa, nrm2)
96 end if
97
98 if (mesh%parallel_in_domains .and. optional_default(reduce, .true.)) then
99 nrm2(1:aa%nst) = nrm2(1:aa%nst)**2
100 call mesh%allreduce(nrm2, dim = aa%nst)
101 nrm2(1:aa%nst) = sqrt(nrm2(1:aa%nst))
102 end if
103
104 pop_sub(mesh_batch_nrm2)
105 end subroutine mesh_batch_nrm2
106
107#undef SPECIALIZED
108#include "undef.F90"
109#include "real.F90"
110#include "mesh_batch_inc.F90"
111
112#include "undef.F90"
113#include "complex.F90"
114#include "mesh_batch_inc.F90"
115
116! Specialized kernels for nst_linear=2
117#define SPECIALIZED 2
118#include "undef.F90"
119#include "real.F90"
120#include "mesh_batch_inc.F90"
121
122#include "undef.F90"
123#include "complex.F90"
124#include "mesh_batch_inc.F90"
125#undef SPECIALIZED
126
127! Specialized kernels for nst_linear=3
128#define SPECIALIZED 3
129#include "undef.F90"
130#include "real.F90"
131#include "mesh_batch_inc.F90"
132
133#include "undef.F90"
134#include "complex.F90"
135#include "mesh_batch_inc.F90"
136#undef SPECIALIZED
137
138! Specialized kernels for nst_linear=4
139#define SPECIALIZED 4
140#include "undef.F90"
141#include "real.F90"
142#include "mesh_batch_inc.F90"
143
144#include "undef.F90"
145#include "complex.F90"
146#include "mesh_batch_inc.F90"
147#undef SPECIALIZED
148
149! Specialized kernels for nst_linear=6
150#define SPECIALIZED 6
151#include "undef.F90"
152#include "real.F90"
153#include "mesh_batch_inc.F90"
154
155#include "undef.F90"
156#include "complex.F90"
157#include "mesh_batch_inc.F90"
158#undef SPECIALIZED
159
160! Specialized kernels for nst_linear=8
161#define SPECIALIZED 8
162#include "undef.F90"
163#include "real.F90"
164#include "mesh_batch_inc.F90"
165
166#include "undef.F90"
167#include "complex.F90"
168#include "mesh_batch_inc.F90"
169#undef SPECIALIZED
171! Co-density kernel, instantiated for all precisions (d, z, s, c)
172#include "undef.F90"
173#include "real.F90"
174#include "mesh_batch_codensity_inc.F90"
175
176#include "undef.F90"
177#include "complex.F90"
178#include "mesh_batch_codensity_inc.F90"
180#include "undef.F90"
181#include "real32.F90"
182#include "mesh_batch_codensity_inc.F90"
183
184#include "undef.F90"
185#include "complex32.F90"
186#include "mesh_batch_codensity_inc.F90"
187
188end module mesh_batch_oct_m
189
190!! Local Variables:
191!! mode: f90
192!! coding: utf-8
193!! 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 zmesh_batch_codensity(mesh, aa, bra, ist_bra, rho, rho_buffer)
calculate the co-densities
subroutine, public smesh_batch_codensity(mesh, aa, bra, ist_bra, rho, rho_buffer)
calculate the co-densities
subroutine, public cmesh_batch_codensity(mesh, aa, bra, ist_bra, rho, rho_buffer)
calculate the co-densities
subroutine, public dmesh_batch_dotp_matrix(mesh, aa, bb, dot, reduce)
Calculate the overlap matrix of two batches.
Definition: mesh_batch.F90:277
subroutine, public dmesh_batch_dotp_self(mesh, aa, dot, reduce)
calculate the overlap matrix of a batch with itself
Definition: mesh_batch.F90:545
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:180
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_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:888
subroutine, public dmesh_batch_codensity(mesh, aa, bra, ist_bra, rho, rho_buffer)
calculate the co-densities
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:661
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:136
int true(void)