Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
elpa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
elpa
elpa
Commits
4e4a7074
Commit
4e4a7074
authored
Jul 16, 2018
by
Pavel Kus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complex case handled by cannon algorithm as well
parent
dbcf4fe0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
11 deletions
+67
-11
src/elpa_generalized/cannon_forw.c
src/elpa_generalized/cannon_forw.c
+59
-0
src/elpa_impl_generalized_transform_template.F90
src/elpa_impl_generalized_transform_template.F90
+0
-9
src/general/precision_macros.h
src/general/precision_macros.h
+2
-2
src/general/precision_typedefs.h
src/general/precision_typedefs.h
+6
-0
No files found.
src/elpa_generalized/cannon_forw.c
View file @
4e4a7074
...
...
@@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <complex.h>
// most of the file is not compiled if not using MPI
#ifdef WITH_MPI
...
...
@@ -58,6 +59,54 @@ void cannons_reduction_c_d(double* A, double* U, int local_rows, int local_cols,
void
cannons_reduction_c_f
(
float
*
A
,
float
*
U
,
int
local_rows
,
int
local_cols
,
int
*
a_desc
,
float
*
Res
,
int
ToStore
,
int
row_comm
,
int
col_comm
);
#define COMPLEXCASE 1
#define DOUBLE_PRECISION 1
#include "../general/precision_macros.h"
#include "cannon_forw_template.c"
#undef DOUBLE_PRECISION
#undef COMPLEXCASE
//***********************************************************************************************************
/*
!f> interface
!f> subroutine cannons_reduction_dc(A, U, local_rows, local_cols, a_desc, Res, toStore, row_comm, col_comm) &
!f> bind(C, name="cannons_reduction_c_dc")
!f> use, intrinsic :: iso_c_binding
!f> complex(c_double) :: A(local_rows, local_cols), U(local_rows, local_cols), Res(local_rows, local_cols)
!f> !type(c_ptr), value :: A, U, Res
!f> integer(kind=c_int) :: a_desc(9)
!f> integer(kind=c_int),value :: local_rows, local_cols
!f> integer(kind=c_int),value :: row_comm, col_comm, ToStore
!f> end subroutine
!f> end interface
*/
void
cannons_reduction_c_dc
(
double
complex
*
A
,
double
complex
*
U
,
int
local_rows
,
int
local_cols
,
int
*
a_desc
,
double
complex
*
Res
,
int
ToStore
,
int
row_comm
,
int
col_comm
);
#define COMPLEXCASE 1
#define SINGLE_PRECISION 1
#include "../general/precision_macros.h"
#include "cannon_forw_template.c"
#undef SINGLE_PRECISION
#undef COMPLEXCASE
//***********************************************************************************************************
/*
!f> interface
!f> subroutine cannons_reduction_fc(A, U, local_rows, local_cols, a_desc, Res, toStore, row_comm, col_comm) &
!f> bind(C, name="cannons_reduction_c_fc")
!f> use, intrinsic :: iso_c_binding
!f> complex(c_float) :: A(local_rows, local_cols), U(local_rows, local_cols), Res(local_rows, local_cols)
!f> !type(c_ptr), value :: A, U, Res
!f> integer(kind=c_int) :: a_desc(9)
!f> integer(kind=c_int),value :: local_rows, local_cols
!f> integer(kind=c_int),value :: row_comm, col_comm, ToStore
!f> end subroutine
!f> end interface
*/
void
cannons_reduction_c_fc
(
float
complex
*
A
,
float
complex
*
U
,
int
local_rows
,
int
local_cols
,
int
*
a_desc
,
float
complex
*
Res
,
int
ToStore
,
int
row_comm
,
int
col_comm
);
#else
// Just because of the Intel preprocessor
// TODO do something with it
...
...
@@ -70,4 +119,14 @@ void cannons_reduction_c_f(float* A, float* U, int local_rows, int local_cols, i
float
*
Res
,
int
ToStore
,
int
row_comm
,
int
col_comm
)
{
}
void
cannons_reduction_c_dc
(
double
complex
*
A
,
double
complex
*
U
,
int
local_rows
,
int
local_cols
,
int
*
a_desc
,
double
complex
*
Res
,
int
ToStore
,
int
row_comm
,
int
col_comm
)
{
}
void
cannons_reduction_c_fc
(
float
complex
*
A
,
float
complex
*
U
,
int
local_rows
,
int
local_cols
,
int
*
a_desc
,
float
complex
*
Res
,
int
ToStore
,
int
row_comm
,
int
col_comm
)
{
}
#endif
src/elpa_impl_generalized_transform_template.F90
View file @
4e4a7074
...
...
@@ -34,13 +34,6 @@
call
self
%
timer_start
(
"transform_generalized()"
)
call
self
%
get
(
"cannon_for_generalized"
,
use_cannon
,
error
)
#if !defined(REALCASE)
if
(
my_p
==
0
)
then
write
(
*
,
*
)
"Cannons algorithm can be used only for real at the moment"
write
(
*
,
*
)
"Switching to elpa Hermitian and scalapack"
end
if
use_cannon
=
0
#endif
#if !defined(WITH_MPI)
if
(
my_p
==
0
)
then
...
...
@@ -81,14 +74,12 @@
call
self
%
timer_start
(
"cannons_reduction"
)
#if defined(REALCASE)
! BEWARE! even though tmp is output from the routine, it has to be zero on input!
tmp
=
0.0_rck
call
cannons_reduction_
&
&
ELPA_IMPL_SUFFIX
&
&(
a
,
b
,
self
%
local_nrows
,
self
%
local_ncols
,
&
sc_desc
,
tmp
,
BuffLevelInt
,
mpi_comm_rows
,
mpi_comm_cols
)
#endif
call
self
%
timer_stop
(
"cannons_reduction"
)
a
(
1
:
self
%
local_nrows
,
1
:
self
%
local_ncols
)
=
tmp
(
1
:
self
%
local_nrows
,
1
:
self
%
local_ncols
)
...
...
src/general/precision_macros.h
View file @
4e4a7074
...
...
@@ -271,7 +271,7 @@
#define C_GEMM zgemm_
#define C_LACPY zlacpy_
#define C_PLACPY pzlacpy_
#define C_PTRAN pztran_
#define C_PTRAN pztran
c
_
#define PRECISION_TRTRI ZTRTRI
#define PRECISION_POTRF ZPOTRF
...
...
@@ -335,7 +335,7 @@
#define C_GEMM cgemm_
#define C_LACPY clacpy_
#define C_PLACPY pclacpy_
#define C_PTRAN pctran_
#define C_PTRAN pctran
c
_
#define PRECISION_TRTRI CTRTRI
#define PRECISION_POTRF CPOTRF
...
...
src/general/precision_typedefs.h
View file @
4e4a7074
#ifdef REALCASE
#ifdef DOUBLE_PRECISION
//typedef double math_type;
#undef math_type
#define math_type double
#endif
#ifdef SINGLE_PRECISION
//typedef float math_type;
#undef math_type
#define math_type float
#endif
#endif
#ifdef COMPLEXCASE
#ifdef DOUBLE_PRECISION
#undef math_type
#define math_type double complex
#endif
#ifdef SINGLE_PRECISION
#undef math_type
#define math_type float complex
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment