PROGRESS  master
prg_graphsp2parser_mod.F90
Go to the documentation of this file.
1 
13 
16  use bml
17 
18  implicit none
19 
20  private
21 
22  integer, parameter :: dp = kind(1.0d0)
23 
26  type, public :: gsp2data_type
27  character(20) :: jobname
28  character(50) :: hamfile
29  integer :: verbose
30  integer :: minsp2iter
31  integer :: maxsp2iter
32  integer :: nodesperpart
33  integer :: natoms
34  integer :: partition_count
35  real(dp) :: sp2tol
36  real(dp) :: threshold
37  real(dp) :: bndfil
38  real(dp) :: gthreshold
39  real(dp) :: errlimit
40  integer :: mdim
41  integer :: ndim
42  character :: sdim(3)
43  real(dp) :: pdim(3)
44  character(20) :: bml_type
45  character(10) :: sp2conv
46  character(10) :: graph_element
47  character(10) :: partition_type
48  character(10) :: partition_refinement
49  logical :: double_jump
50  real(dp) :: covgfact !Factor for tuning the extension of the covalency
51  real(dp) :: nlgcut !Radius cutoff for the hmiltonian (distance) based graph
52  integer :: parteach !Do the partition each PartEach mdsteps
53  end type gsp2data_type
54 
55  public :: prg_parse_gsp2
56 
57 contains
58 
61  subroutine prg_parse_gsp2(gsp2data,filename)
62 
63  implicit none
64  type(gsp2data_type), intent(inout) :: gsp2data
65  integer, parameter :: nkey_char = 7, nkey_int = 8, nkey_re = 7, nkey_log = 2
66  character(len=*) :: filename
67 
68  !Library of keywords with the respective defaults.
69  character(len=50), parameter :: keyvector_char(nkey_char) = [character(len=100) :: &
70  'JobName=', 'BMLType=','SP2Conv=', 'HamFile=', 'GraphElement=', &
71  'PartitionType=', 'PartitionRefinement=']
72  character(len=100) :: valvector_char(nkey_char) = [character(len=100) :: &
73  'MyJob', 'Dense','REL', 'text.mtx', 'Atom', 'Block', 'None']
74 
75  character(len=50), parameter :: keyvector_int(nkey_int) = [character(len=50) :: &
76  'Mdim=', 'MinSP2Iter=', 'MaxSP2Iter=','Ndim=', 'NodesPerPart=', 'NAtoms=', &
77  'PartitionCount=', 'PartEach=']
78  integer :: valvector_int(nkey_int) = (/ &
79  -1, 10, 100, 1, 16, 1, 1,1 /)
80 
81  character(len=50), parameter :: keyvector_re(nkey_re) = [character(len=50) :: &
82  'MatrixThreshold=','SP2Tol=','BndFil=', 'GraphThreshold=', 'ErrLimit=', 'CovGraphFact=', 'NLGraphCut=' ]
83  real(dp) :: valvector_re(nkey_re) = (/&
84  0.00001, 0.00000001, 0.0, 0.00000000001, 0.0, 2.5, 2.5 /)
85 
86  character(len=50), parameter :: keyvector_log(nkey_log) = [character(len=100) :: &
87  'DoubleJump=', 'Log2=']
88  logical :: valvector_log(nkey_log) = (/&
89  .true., .false./)
90 
91  !Start and stop characters
92  character(len=50), parameter :: startstop(2) = [character(len=50) :: &
93  'GSP2{', '}']
94 
95  call prg_parsing_kernel(keyvector_char,valvector_char&
96  ,keyvector_int,valvector_int,keyvector_re,valvector_re,&
97  keyvector_log,valvector_log,trim(filename),startstop)
98 
99  !Characters
100  gsp2data%JobName = valvector_char(1)
101 
102  if(valvector_char(2) == "Dense")then
103  gsp2data%bml_type = bml_matrix_dense
104  elseif(valvector_char(2) == "Ellpack")then
105  gsp2data%bml_type = bml_matrix_ellpack
106  elseif(valvector_char(2) == "Ellblock")then
107  gsp2data%bml_type = bml_matrix_ellblock
108  endif
109  gsp2data%sp2conv = valvector_char(3)
110  gsp2data%hamfile = valvector_char(4)
111  gsp2data%graph_element = valvector_char(5)
112 
113  gsp2data%partition_type = valvector_char(6)
114  gsp2data%partition_refinement = valvector_char(7)
115 
116  !Reals
117  gsp2data%threshold = valvector_re(1)
118  gsp2data%sp2tol = valvector_re(2)
119  gsp2data%bndFil = valvector_re(3)
120  gsp2data%gthreshold = valvector_re(4)
121  gsp2data%errlimit = valvector_re(5)
122  gsp2data%covgfact = valvector_re(6)
123  gsp2data%nlgcut = valvector_re(7)
124 
125  !Logicals
126  gsp2data%double_jump = valvector_log(1)
127 
128  !Integers
129  gsp2data%mdim = valvector_int(1)
130  gsp2data%minsp2iter = valvector_int(2)
131  gsp2data%maxsp2iter = valvector_int(3)
132  gsp2data%ndim = valvector_int(4)
133  gsp2data%nodesPerPart = valvector_int(5)
134  gsp2data%natoms = valvector_int(6)
135  gsp2data%partition_count= valvector_int(7)
136  gsp2data%parteach= valvector_int(8)
137 
138  end subroutine prg_parse_gsp2
139 
140 end module prg_graphsp2parser_mod
Graph partitioning SP2 parser.
subroutine, public prg_parse_gsp2(gsp2data, filename)
The parser for SP2 solver.
Some general parsing functions.
subroutine, public prg_parsing_kernel(keyvector_char, valvector_char, keyvector_int, valvector_int, keyvector_re, valvector_re, keyvector_log, valvector_log, filename, startstop)
The general parsing function. It is used to vectorize a set of "keywords" "value" pairs as included i...
Module to handle input output files for the PROGRESS lib.