Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
elpa
elpa
Commits
f4f7a7eb
Commit
f4f7a7eb
authored
Jul 13, 2018
by
Pavel Kus
Browse files
simplyfying cannons interface
parent
95cb4b69
Changes
3
Show whitespace changes
Inline
Side-by-side
src/elpa_generalized/cannon_back_real_double.c
View file @
f4f7a7eb
...
...
@@ -441,28 +441,29 @@ void d_cannons_triang_rectangular(double* U, double* B, int np_rows, int np_cols
//***********************************************************************************************************
/*
!f> interface
!f> subroutine cannons_triang_rectangular(U, B, local_rows, local_cols, np_rows, np_cols, my_prow, my_pcol, u_desc, b_desc, &
!f> Res, row_comm, col_comm) &
!f> subroutine cannons_triang_rectangular(U, B, local_rows, local_cols, u_desc, b_desc, Res, row_comm, col_comm) &
!f> bind(C, name="d_cannons_triang_rectangular_c")
!f> use, intrinsic :: iso_c_binding
!f> real(c_double) :: U(local_rows, local_cols), B(local_rows, local_cols), Res(local_rows, local_cols)
!f> integer(kind=c_int) :: u_desc(9), b_desc(9)
!f> integer(kind=c_int),value :: local_rows, local_cols
!f> integer(kind=c_int),value
:: np_rows, np_cols, my_prow, my_pcol,
row_comm, col_comm
!f> integer(kind=c_int),value
::
row_comm, col_comm
!f> end subroutine
!f> end interface
*/
void
d_cannons_triang_rectangular_c
(
double
*
U
,
double
*
B
,
int
local_rows
,
int
local_cols
,
int
np_rows
,
int
np_cols
,
int
my_prow
,
int
my_pcol
,
int
*
u_desc
,
int
*
b_desc
,
double
*
Res
,
int
row_comm
,
int
col_comm
)
void
d_cannons_triang_rectangular_c
(
double
*
U
,
double
*
B
,
int
local_rows
,
int
local_cols
,
int
*
u_desc
,
int
*
b_desc
,
double
*
Res
,
int
row_comm
,
int
col_comm
)
{
#ifdef WITH_MPI
MPI_Comm
c_row_comm
=
MPI_Comm_f2c
(
row_comm
);
MPI_Comm
c_col_comm
=
MPI_Comm_f2c
(
col_comm
);
// int c_my_prow, c_my_pcol;
// MPI_Comm_rank(c_row_comm, &c_my_prow);
// MPI_Comm_rank(c_col_comm, &c_my_pcol);
// printf("FORT<->C row: %d<->%d, col: %d<->%d\n", my_prow, c_my_prow, my_pcol, c_my_pcol);
int
my_prow
,
my_pcol
,
np_rows
,
np_cols
;
MPI_Comm_rank
(
c_row_comm
,
&
my_prow
);
MPI_Comm_size
(
c_row_comm
,
&
np_rows
);
MPI_Comm_rank
(
c_col_comm
,
&
my_pcol
);
MPI_Comm_size
(
c_col_comm
,
&
np_cols
);
// BEWARE
// in the cannons algorithm, column and row communicators are exchanged
...
...
src/elpa_generalized/cannon_forw_real_double.c
View file @
f4f7a7eb
...
...
@@ -903,29 +903,29 @@ void d_cannons_reduction(double* A, double* U, int np_rows, int np_cols, int my_
//***********************************************************************************************************
/*
!f> interface
!f> subroutine cannons_reduction(A, U, local_rows, local_cols, np_rows, np_cols, my_prow, my_pcol, a_desc, &
!f> Res, toStore, row_comm, col_comm) &
!f> subroutine cannons_reduction(A, U, local_rows, local_cols, a_desc, Res, toStore, row_comm, col_comm) &
!f> bind(C, name="d_cannons_reduction_c")
!f> use, intrinsic :: iso_c_binding
!f> real(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 ::
np_rows, np_cols, my_prow, my_pcol,
row_comm, col_comm, ToStore
!f> integer(kind=c_int),value :: row_comm, col_comm, ToStore
!f> end subroutine
!f> end interface
*/
void
d_cannons_reduction_c
(
double
*
A
,
double
*
U
,
int
local_rows
,
int
local_cols
,
int
np_rows
,
int
np_cols
,
int
my_prow
,
int
my_pcol
,
int
*
a_desc
,
void
d_cannons_reduction_c
(
double
*
A
,
double
*
U
,
int
local_rows
,
int
local_cols
,
int
*
a_desc
,
double
*
Res
,
int
ToStore
,
int
row_comm
,
int
col_comm
)
{
#ifdef WITH_MPI
MPI_Comm
c_row_comm
=
MPI_Comm_f2c
(
row_comm
);
MPI_Comm
c_col_comm
=
MPI_Comm_f2c
(
col_comm
);
// int c_my_prow, c_my_pcol;
// MPI_Comm_rank(c_row_comm, &c_my_prow);
// MPI_Comm_rank(c_col_comm, &c_my_pcol);
// printf("FORT<->C row: %d<->%d, col: %d<->%d\n", my_prow, c_my_prow, my_pcol, c_my_pcol);
int
my_prow
,
my_pcol
,
np_rows
,
np_cols
;
MPI_Comm_rank
(
c_row_comm
,
&
my_prow
);
MPI_Comm_size
(
c_row_comm
,
&
np_rows
);
MPI_Comm_rank
(
c_col_comm
,
&
my_pcol
);
MPI_Comm_size
(
c_col_comm
,
&
np_cols
);
// BEWARE
// in the cannons algorithm, column and row communicators are exchanged
...
...
src/elpa_impl_generalized_transform_template.F90
View file @
f4f7a7eb
...
...
@@ -84,7 +84,7 @@
#if defined(REALCASE) && defined(DOUBLE_PRECISION)
! BEWARE! even though tmp is output from the routine, it has to be zero on input!
tmp
=
0.0_rck
call
cannons_reduction
(
a
,
b
,
self
%
local_nrows
,
self
%
local_ncols
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
,
&
call
cannons_reduction
(
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"
)
...
...
@@ -174,7 +174,7 @@
if
(
use_cannon
==
1
)
then
#if defined(REALCASE) && defined(DOUBLE_PRECISION)
call
cannons_triang_rectangular
(
b
,
q
,
self
%
local_nrows
,
self
%
local_ncols
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
,
&
call
cannons_triang_rectangular
(
b
,
q
,
self
%
local_nrows
,
self
%
local_ncols
,
&
sc_desc
,
sc_desc_ev
,
tmp
,
mpi_comm_rows
,
mpi_comm_cols
);
q
(
1
:
self
%
local_nrows
,
1
:
self
%
local_ncols
)
=
tmp
(
1
:
self
%
local_nrows
,
1
:
self
%
local_ncols
)
...
...
Write
Preview
Supports
Markdown
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