Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
elsi-devel
elsi-interface
Commits
496f91b1
Commit
496f91b1
authored
May 27, 2020
by
Victor Yu
Browse files
Get new unit for opening files
Fixes
#43
parent
7f96b0ee
Changes
6
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
496f91b1
...
...
@@ -9,19 +9,19 @@
*
Updated redistributed ELPA source code to version 2020.05.001, which supports
single precision calculations, autotuning of runtime parameters, and (NVIDIA)
GPU acceleration.
*
The updated ELPA code can not be compiled with the NAG Fortran compiler, due
to the use of GNU extentions in ELPA.
### PEXSI
*
AAA method has become the default pole expansion method in PEXSI.
*
Increased default number of poles from 20 to 30.
*
Improved accuracy of pole expansion based on minimax approximation.
*
Improved accuracy of pole expansion based on minimax
rational
approximation.
*
Updated redistributed (PT-)SCOTCH source code to version 6.0.9.
### SLEPc-SIPs
*
Interface compatible with PETSc 3.13 and SLEPc 3.13.
### Known issues
*
The ELPA code can not be compiled with the NAG Fortran compiler, due to the
use of GNU extentions in ELPA.
*
ELPA AVX kernels cannot be built with the PGI compiler suite due to incomplete
support of AVX intrinsics in PGI.
*
Depending on the choice of k-points, the complex PEXSI solver may randomly
...
...
CMakeLists.txt
View file @
496f91b1
...
...
@@ -7,7 +7,7 @@ SET(elsi_URL "http://elsi-interchange.org")
SET
(
elsi_EMAIL
"elsi-team@duke.edu"
)
SET
(
elsi_LICENSE
"BSD 3"
)
SET
(
elsi_DESCRIPTION
"Electronic Structure Infrastructure"
)
SET
(
elsi_DATESTAMP
"2020052
5
"
)
SET
(
elsi_DATESTAMP
"2020052
7
"
)
### CMake modules ###
LIST
(
APPEND CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/cmake
)
...
...
src/elsi_input.f90
View file @
496f91b1
...
...
@@ -11,6 +11,7 @@ module ELSI_INPUT
use
ELSI_DATATYPE
,
only
:
elsi_handle
,
elsi_basic_t
use
ELSI_MPI
,
only
:
elsi_stop
use
ELSI_OUTPUT
,
only
:
elsi_get_unit
use
ELSI_PRECISION
,
only
:
r8
,
i4
use
ELSI_SET
,
only
:
elsi_set_output
,
elsi_set_output_log
,
elsi_set_zero_def
,&
elsi_set_sparsity_mask
,
elsi_set_illcond_check
,
elsi_set_illcond_tol
,&
...
...
@@ -48,6 +49,7 @@ subroutine elsi_set_input_file(eh,f_name)
integer
(
kind
=
i4
)
::
i
integer
(
kind
=
i4
)
::
ierr
integer
(
kind
=
i4
)
::
val_i4
integer
(
kind
=
i4
)
::
f_unit
logical
::
kwd_found
character
(
len
=
200
)
::
msg
character
(
len
=
20
)
::
kwd
...
...
@@ -57,7 +59,9 @@ subroutine elsi_set_input_file(eh,f_name)
call
elsi_check_init
(
eh
%
bh
,
eh
%
handle_init
,
caller
)
open
(
313
,
file
=
f_name
,
status
=
"old"
,
iostat
=
ierr
)
call
elsi_get_unit
(
f_unit
)
open
(
f_unit
,
file
=
f_name
,
status
=
"old"
,
iostat
=
ierr
)
if
(
ierr
/
=
0
)
then
write
(
msg
,
"(2A)"
)
"Failed to open input file "
,
trim
(
f_name
)
...
...
@@ -66,7 +70,7 @@ subroutine elsi_set_input_file(eh,f_name)
do
! Read in a line
read
(
313
,
"(A)"
,
iostat
=
ierr
)
msg
read
(
f_unit
,
"(A)"
,
iostat
=
ierr
)
msg
if
(
ierr
<
0
)
then
! EOF
...
...
@@ -290,7 +294,7 @@ subroutine elsi_set_input_file(eh,f_name)
end
select
end
do
close
(
313
)
close
(
f_unit
)
end
subroutine
...
...
src/elsi_output.f90
View file @
496f91b1
...
...
@@ -27,6 +27,7 @@ module ELSI_OUTPUT
public
::
elsi_say
public
::
elsi_add_log
public
::
elsi_get_time
public
::
elsi_get_unit
public
::
fjson_close_file
public
::
fjson_finish_array
public
::
fjson_get_datetime_rfc3339
...
...
@@ -68,12 +69,15 @@ subroutine elsi_add_log(ph,bh,jh,dt0,t0,caller)
real
(
kind
=
r8
)
::
t1
integer
(
kind
=
i4
)
::
solver_use
integer
(
kind
=
i4
)
::
f_unit
character
(
len
=
20
)
::
solver_tag
character
(
len
=
29
)
::
dt_record
if
(
bh
%
print_json
>
0
)
then
if
(
.not.
bh
%
json_init
)
then
call
fjson_open_file
(
jh
,
66
,
"elsi_log.json"
)
call
elsi_get_unit
(
f_unit
)
call
fjson_open_file
(
jh
,
f_unit
,
"elsi_log.json"
)
call
fjson_start_array
(
jh
)
bh
%
json_init
=
.true.
...
...
@@ -596,4 +600,28 @@ subroutine elsi_get_time(wtime)
end
subroutine
!>
!! Find an unused unit.
!!
subroutine
elsi_get_unit
(
new_unit
)
implicit
none
integer
(
kind
=
i4
),
intent
(
out
)
::
new_unit
integer
(
kind
=
i4
)
::
iu
logical
::
is_open
do
iu
=
100
,
9999
inquire
(
iu
,
opened
=
is_open
)
if
(
.not.
is_open
)
then
exit
end
if
end
do
new_unit
=
iu
end
subroutine
end
module
ELSI_OUTPUT
src/elsi_pexsi.f90
View file @
496f91b1
...
...
@@ -334,7 +334,6 @@ subroutine elsi_solve_pexsi_real(ph,bh,row_ind,col_ptr,ne_vec,ham,ovlp,dm)
else
ph
%
pexsi_options
%
muMin0
=
shifts
(
aux_min
)
ph
%
pexsi_options
%
muMax0
=
shifts
(
aux_max
)
mu_range
=
ph
%
pexsi_options
%
muMax0
-
ph
%
pexsi_options
%
muMin0
end
if
end
do
...
...
@@ -810,7 +809,6 @@ subroutine elsi_solve_pexsi_cmplx(ph,bh,row_ind,col_ptr,ne_vec,ham,ovlp,dm)
else
ph
%
pexsi_options
%
muMin0
=
shifts
(
aux_min
)
ph
%
pexsi_options
%
muMax0
=
shifts
(
aux_max
)
mu_range
=
ph
%
pexsi_options
%
muMax0
-
ph
%
pexsi_options
%
muMin0
end
if
end
do
...
...
src/elsi_rw.f90
View file @
496f91b1
...
...
@@ -17,6 +17,7 @@ module ELSI_RW
use
ELSI_MPI
,
only
:
elsi_stop
,
MPI_SUM
,
MPI_REAL8
,
MPI_COMPLEX16
,
MPI_INTEGER4
,&
MPI_MODE_RDONLY
,
MPI_MODE_WRONLY
,
MPI_MODE_CREATE
,
MPI_INFO_NULL
,&
MPI_STATUS_IGNORE
use
ELSI_OUTPUT
,
only
:
elsi_get_unit
use
ELSI_PRECISION
,
only
:
r8
,
i4
,
i8
use
ELSI_REDIST
,
only
:
elsi_blacs_to_mask
,
elsi_blacs_to_sips_hs_dim
,&
elsi_blacs_to_sips_hs
,
elsi_sips_to_blacs_dm
...
...
@@ -1425,6 +1426,7 @@ subroutine elsi_read_mat_dim_sp(rwh,f_name,n_electron,n_basis,n_lrow,n_lcol)
integer
(
kind
=
i4
),
intent
(
out
)
::
n_lcol
!< Local number of columns
integer
(
kind
=
i4
)
::
header
(
HEADER_SIZE
)
integer
(
kind
=
i4
)
::
f_unit
integer
(
kind
=
i8
)
::
offset
integer
(
kind
=
i8
)
::
ierr
character
(
len
=
200
)
::
msg
...
...
@@ -1432,7 +1434,9 @@ subroutine elsi_read_mat_dim_sp(rwh,f_name,n_electron,n_basis,n_lrow,n_lcol)
character
(
len
=*
),
parameter
::
caller
=
"elsi_read_mat_dim_sp"
! Open file
open
(
99
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
status
=
"old"
,&
call
elsi_get_unit
(
f_unit
)
open
(
f_unit
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
status
=
"old"
,&
iostat
=
ierr
)
if
(
ierr
/
=
0
)
then
...
...
@@ -1443,9 +1447,9 @@ subroutine elsi_read_mat_dim_sp(rwh,f_name,n_electron,n_basis,n_lrow,n_lcol)
! Read header
offset
=
1
read
(
unit
=
99
,
pos
=
offset
)
header
read
(
f_
unit
,
pos
=
offset
)
header
close
(
unit
=
99
)
close
(
f_
unit
)
n_basis
=
header
(
4
)
n_electron
=
real
(
header
(
5
),
kind
=
r8
)
...
...
@@ -1475,6 +1479,7 @@ subroutine elsi_read_mat_sp_real(rwh,f_name,mat)
integer
(
kind
=
i4
)
::
i
integer
(
kind
=
i4
)
::
j
integer
(
kind
=
i4
)
::
this_nnz
integer
(
kind
=
i4
)
::
f_unit
integer
(
kind
=
i8
)
::
offset
integer
(
kind
=
i8
)
::
ierr
character
(
len
=
200
)
::
msg
...
...
@@ -1486,7 +1491,9 @@ subroutine elsi_read_mat_sp_real(rwh,f_name,mat)
character
(
len
=*
),
parameter
::
caller
=
"elsi_read_mat_sp_real"
! Open file
open
(
99
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
status
=
"old"
,&
call
elsi_get_unit
(
f_unit
)
open
(
f_unit
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
status
=
"old"
,&
iostat
=
ierr
)
if
(
ierr
/
=
0
)
then
...
...
@@ -1497,7 +1504,7 @@ subroutine elsi_read_mat_sp_real(rwh,f_name,mat)
! Read header
offset
=
1
read
(
unit
=
99
,
pos
=
offset
)
header
read
(
f_
unit
,
pos
=
offset
)
header
rwh
%
bh
%
nnz_g
=
header
(
6
)
rwh
%
bh
%
nnz_l_sp
=
header
(
6
)
...
...
@@ -1508,7 +1515,7 @@ subroutine elsi_read_mat_sp_real(rwh,f_name,mat)
! Read column pointer
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
read
(
unit
=
99
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
bh
%
n_lcol_sp
)
read
(
f_
unit
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
bh
%
n_lcol_sp
)
col_ptr
(
rwh
%
bh
%
n_lcol_sp
+1
)
=
rwh
%
bh
%
nnz_g
+1
...
...
@@ -1517,17 +1524,17 @@ subroutine elsi_read_mat_sp_real(rwh,f_name,mat)
! Read row index
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
read
(
unit
=
99
,
pos
=
offset
)
row_ind
read
(
f_
unit
,
pos
=
offset
)
row_ind
! Read nonzero value
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
+
rwh
%
bh
%
nnz_g
*
4
call
elsi_allocate
(
rwh
%
bh
,
nnz_val
,
rwh
%
bh
%
nnz_l_sp
,
"nnz_val"
,
caller
)
read
(
unit
=
99
,
pos
=
offset
)
nnz_val
read
(
f_
unit
,
pos
=
offset
)
nnz_val
! Close file
close
(
unit
=
99
)
close
(
f_
unit
)
! Convert to dense
mat
(:,:)
=
0.0_r8
...
...
@@ -1565,6 +1572,7 @@ subroutine elsi_read_mat_sp_cmplx(rwh,f_name,mat)
integer
(
kind
=
i4
)
::
i
integer
(
kind
=
i4
)
::
j
integer
(
kind
=
i4
)
::
this_nnz
integer
(
kind
=
i4
)
::
f_unit
integer
(
kind
=
i8
)
::
offset
integer
(
kind
=
i8
)
::
ierr
character
(
len
=
200
)
::
msg
...
...
@@ -1576,7 +1584,9 @@ subroutine elsi_read_mat_sp_cmplx(rwh,f_name,mat)
character
(
len
=*
),
parameter
::
caller
=
"elsi_read_mat_sp_cmplx"
! Open file
open
(
99
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
status
=
"old"
,&
call
elsi_get_unit
(
f_unit
)
open
(
f_unit
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
status
=
"old"
,&
iostat
=
ierr
)
if
(
ierr
/
=
0
)
then
...
...
@@ -1587,7 +1597,7 @@ subroutine elsi_read_mat_sp_cmplx(rwh,f_name,mat)
! Read header
offset
=
1
read
(
unit
=
99
,
pos
=
offset
)
header
read
(
f_
unit
,
pos
=
offset
)
header
rwh
%
bh
%
nnz_g
=
header
(
6
)
rwh
%
bh
%
nnz_l_sp
=
header
(
6
)
...
...
@@ -1598,7 +1608,7 @@ subroutine elsi_read_mat_sp_cmplx(rwh,f_name,mat)
! Read column pointer
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
read
(
unit
=
99
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
bh
%
n_lcol_sp
)
read
(
f_
unit
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
bh
%
n_lcol_sp
)
col_ptr
(
rwh
%
bh
%
n_lcol_sp
+1
)
=
rwh
%
bh
%
nnz_g
+1
...
...
@@ -1607,17 +1617,17 @@ subroutine elsi_read_mat_sp_cmplx(rwh,f_name,mat)
! Read row index
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
read
(
unit
=
99
,
pos
=
offset
)
row_ind
read
(
f_
unit
,
pos
=
offset
)
row_ind
! Read nonzero value
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
+
rwh
%
bh
%
nnz_g
*
4
call
elsi_allocate
(
rwh
%
bh
,
nnz_val
,
rwh
%
bh
%
nnz_l_sp
,
"nnz_val"
,
caller
)
read
(
unit
=
99
,
pos
=
offset
)
nnz_val
read
(
f_
unit
,
pos
=
offset
)
nnz_val
! Close file
close
(
unit
=
99
)
close
(
f_
unit
)
! Convert to dense
mat
(:,:)
=
(
0.0_r8
,
0.0_r8
)
...
...
@@ -1656,6 +1666,7 @@ subroutine elsi_write_mat_sp_real(rwh,f_name,mat)
integer
(
kind
=
i4
)
::
j
integer
(
kind
=
i4
)
::
this_nnz
integer
(
kind
=
i4
)
::
nnz_g
integer
(
kind
=
i4
)
::
f_unit
integer
(
kind
=
i8
)
::
offset
integer
(
kind
=
i8
)
::
ierr
character
(
len
=
200
)
::
msg
...
...
@@ -1693,7 +1704,9 @@ subroutine elsi_write_mat_sp_real(rwh,f_name,mat)
end
do
! Open file
open
(
99
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
iostat
=
ierr
)
call
elsi_get_unit
(
f_unit
)
open
(
f_unit
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
iostat
=
ierr
)
if
(
ierr
/
=
0
)
then
write
(
msg
,
"(2A)"
)
"Failed to open file "
,
trim
(
f_name
)
...
...
@@ -1711,25 +1724,25 @@ subroutine elsi_write_mat_sp_real(rwh,f_name,mat)
header
(
9
:
16
)
=
rwh
%
header_user
offset
=
1
write
(
unit
=
99
,
pos
=
offset
)
header
write
(
f_
unit
,
pos
=
offset
)
header
! Write column pointer
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
write
(
unit
=
99
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
n_basis
)
write
(
f_
unit
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
n_basis
)
! Write row index
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
write
(
unit
=
99
,
pos
=
offset
)
row_ind
write
(
f_
unit
,
pos
=
offset
)
row_ind
! Write nonzero value
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
+
nnz_g
*
4
write
(
unit
=
99
,
pos
=
offset
)
nnz_val
write
(
f_
unit
,
pos
=
offset
)
nnz_val
! Close file
close
(
unit
=
99
)
close
(
f_
unit
)
call
elsi_deallocate
(
rwh
%
bh
,
col_ptr
,
"col_ptr"
)
call
elsi_deallocate
(
rwh
%
bh
,
row_ind
,
"row_ind"
)
...
...
@@ -1754,6 +1767,7 @@ subroutine elsi_write_mat_sp_cmplx(rwh,f_name,mat)
integer
(
kind
=
i4
)
::
j
integer
(
kind
=
i4
)
::
this_nnz
integer
(
kind
=
i4
)
::
nnz_g
integer
(
kind
=
i4
)
::
f_unit
integer
(
kind
=
i8
)
::
offset
integer
(
kind
=
i8
)
::
ierr
character
(
len
=
200
)
::
msg
...
...
@@ -1791,7 +1805,9 @@ subroutine elsi_write_mat_sp_cmplx(rwh,f_name,mat)
end
do
! Open file
open
(
99
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
iostat
=
ierr
)
call
elsi_get_unit
(
f_unit
)
open
(
f_unit
,
file
=
f_name
,
access
=
"stream"
,
form
=
"unformatted"
,
iostat
=
ierr
)
if
(
ierr
/
=
0
)
then
write
(
msg
,
"(2A)"
)
"Failed to open file "
,
trim
(
f_name
)
...
...
@@ -1809,25 +1825,25 @@ subroutine elsi_write_mat_sp_cmplx(rwh,f_name,mat)
header
(
9
:
16
)
=
rwh
%
header_user
offset
=
1
write
(
unit
=
99
,
pos
=
offset
)
header
write
(
f_
unit
,
pos
=
offset
)
header
! Write column pointer
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
write
(
unit
=
99
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
n_basis
)
write
(
f_
unit
,
pos
=
offset
)
col_ptr
(
1
:
rwh
%
n_basis
)
! Write row index
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
write
(
unit
=
99
,
pos
=
offset
)
row_ind
write
(
f_
unit
,
pos
=
offset
)
row_ind
! Write nonzero value
offset
=
int
(
1
,
kind
=
i8
)
+
HEADER_SIZE
*
4
+
rwh
%
n_basis
*
4
+
nnz_g
*
4
write
(
unit
=
99
,
pos
=
offset
)
nnz_val
write
(
f_
unit
,
pos
=
offset
)
nnz_val
! Close file
close
(
unit
=
99
)
close
(
f_
unit
)
call
elsi_deallocate
(
rwh
%
bh
,
col_ptr
,
"col_ptr"
)
call
elsi_deallocate
(
rwh
%
bh
,
row_ind
,
"row_ind"
)
...
...
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