(git:9111030)
Loading...
Searching...
No Matches
pexsi_interface.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Interface to the PEXSI library, providing wrappers for all PEXSI
10!> routines that are called inside CP2K. Requires PEXSI version 0.10.x.
11!> \par History
12!> 2014.12 created [Patrick Seewald]
13!> \author Patrick Seewald
14! **************************************************************************************************
16
17#if defined(__PEXSI)
18 USE f_ppexsi_interface, ONLY: f_ppexsi_dft_driver, &
19 f_ppexsi_load_real_hs_matrix, &
20 f_ppexsi_options, &
21 f_ppexsi_plan_finalize, &
22 f_ppexsi_plan_initialize, &
23 f_ppexsi_retrieve_real_dft_matrix, &
24 f_ppexsi_set_default_options
25#endif
26#if defined(__HAS_IEEE_EXCEPTIONS)
27 USE ieee_exceptions, ONLY: ieee_get_halting_mode, &
28 ieee_set_halting_mode, &
29 ieee_all
30#endif
31 USE kinds, ONLY: int_8, &
32 real_8
33 USE iso_c_binding, ONLY: c_intptr_t
35#include "./base/base_uses.f90"
36
37 IMPLICIT NONE
38
39 PRIVATE
40
41 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'pexsi_interface'
42
47
49 PRIVATE
50#if defined(__PEXSI)
51 TYPE(f_ppexsi_options) :: options
52#else
53 INTEGER :: unused = -1
54#endif
55 END TYPE cp_pexsi_options
56
57CONTAINS
58
59! **************************************************************************************************
60!> \brief Set PEXSI internal options
61!> \param pexsi_options ...
62!> \param temperature ...
63!> \param gap ...
64!> \param deltaE ...
65!> \param numPole ...
66!> \param isInertiaCount ...
67!> \param maxPEXSIIter ...
68!> \param muMin0 ...
69!> \param muMax0 ...
70!> \param mu0 ...
71!> \param muInertiaTolerance ...
72!> \param muInertiaExpansion ...
73!> \param muPEXSISafeGuard ...
74!> \param numElectronPEXSITolerance ...
75!> \param matrixType ...
76!> \param isSymbolicFactorize ...
77!> \param ordering ...
78!> \param rowOrdering ...
79!> \param npSymbFact ...
80!> \param verbosity ...
81! **************************************************************************************************
82 SUBROUTINE cp_pexsi_set_options(pexsi_options, temperature, gap, deltaE, numPole, &
83 isInertiaCount, maxPEXSIIter, muMin0, muMax0, mu0, &
84 muInertiaTolerance, muInertiaExpansion, &
85 muPEXSISafeGuard, numElectronPEXSITolerance, &
86 matrixType, isSymbolicFactorize, ordering, rowOrdering, &
87 npSymbFact, verbosity)
88
89 TYPE(cp_pexsi_options), INTENT(INOUT) :: pexsi_options
90 REAL(kind=real_8), INTENT(IN), OPTIONAL :: temperature, gap, deltae
91 INTEGER, INTENT(IN), OPTIONAL :: numpole, isinertiacount, &
92 maxpexsiiter
93 REAL(kind=real_8), INTENT(IN), OPTIONAL :: mumin0, mumax0, mu0, &
94 muinertiatolerance, muinertiaexpansion, mupexsisafeguard, &
95 numelectronpexsitolerance
96 INTEGER, INTENT(IN), OPTIONAL :: matrixtype, &
97 issymbolicfactorize, &
98 ordering, rowordering, npsymbfact, &
99 verbosity
100
101#if defined(__PEXSI)
102 IF (PRESENT(temperature)) pexsi_options%options%temperature = temperature
103 IF (PRESENT(gap)) pexsi_options%options%gap = gap
104 IF (PRESENT(deltae)) pexsi_options%options%deltaE = deltae
105 IF (PRESENT(numpole)) pexsi_options%options%numPole = numpole
106 IF (PRESENT(isinertiacount)) pexsi_options%options%isInertiaCount = isinertiacount
107 IF (PRESENT(maxpexsiiter)) pexsi_options%options%maxPEXSIIter = maxpexsiiter
108 IF (PRESENT(mumin0)) pexsi_options%options%muMin0 = mumin0
109 IF (PRESENT(mumax0)) pexsi_options%options%muMax0 = mumax0
110 IF (PRESENT(mu0)) pexsi_options%options%mu0 = mu0
111 IF (PRESENT(muinertiatolerance)) THEN
112 pexsi_options%options%muInertiaTolerance = muinertiatolerance
113 END IF
114 IF (PRESENT(muinertiaexpansion)) THEN
115 pexsi_options%options%muInertiaExpansion = muinertiaexpansion
116 END IF
117 IF (PRESENT(mupexsisafeguard)) THEN
118 pexsi_options%options%muPEXSISafeGuard = mupexsisafeguard
119 END IF
120 IF (PRESENT(numelectronpexsitolerance)) THEN
121 pexsi_options%options%numElectronPEXSITolerance = numelectronpexsitolerance
122 END IF
123 IF (PRESENT(matrixtype)) pexsi_options%options%matrixType = matrixtype
124 IF (PRESENT(issymbolicfactorize)) THEN
125 pexsi_options%options%isSymbolicFactorize = issymbolicfactorize
126 END IF
127 IF (PRESENT(ordering)) pexsi_options%options%ordering = ordering
128 IF (PRESENT(rowordering)) pexsi_options%options%rowOrdering = rowordering
129 IF (PRESENT(npsymbfact)) pexsi_options%options%npSymbFact = npsymbfact
130 IF (PRESENT(verbosity)) pexsi_options%options%verbosity = verbosity
131#else
132 mark_used(pexsi_options)
133 mark_used(temperature)
134 mark_used(gap)
135 mark_used(deltae)
136 mark_used(numpole)
137 mark_used(isinertiacount)
138 mark_used(maxpexsiiter)
139 mark_used(mumin0)
140 mark_used(mumax0)
141 mark_used(mu0)
142 mark_used(muinertiatolerance)
143 mark_used(muinertiaexpansion)
144 mark_used(mupexsisafeguard)
145 mark_used(numelectronpexsitolerance)
146 mark_used(matrixtype)
147 mark_used(issymbolicfactorize)
148 mark_used(ordering)
149 mark_used(rowordering)
150 mark_used(npsymbfact)
151 mark_used(verbosity)
152 cpabort("Requires linking to the PEXSI library.")
153#endif
154
155 ! Additional PEXSI parameters and their defaults not made available here
156 ! because CP2K should always use PEXSI's defaults:
157 ! isConstructCommPattern (=?, pexsi does not even use it)
158 ! symmetric (=1)
159 ! transpose (=0)
160 END SUBROUTINE cp_pexsi_set_options
161
162! **************************************************************************************************
163!> \brief Access PEXSI internal options
164!> \param pexsi_options ...
165!> \param temperature ...
166!> \param gap ...
167!> \param deltaE ...
168!> \param numPole ...
169!> \param isInertiaCount ...
170!> \param maxPEXSIIter ...
171!> \param muMin0 ...
172!> \param muMax0 ...
173!> \param mu0 ...
174!> \param muInertiaTolerance ...
175!> \param muInertiaExpansion ...
176!> \param muPEXSISafeGuard ...
177!> \param numElectronPEXSITolerance ...
178!> \param matrixType ...
179!> \param isSymbolicFactorize ...
180!> \param ordering ...
181!> \param rowOrdering ...
182!> \param npSymbFact ...
183!> \param verbosity ...
184! **************************************************************************************************
185 SUBROUTINE cp_pexsi_get_options(pexsi_options, temperature, gap, deltaE, numPole, &
186 isInertiaCount, maxPEXSIIter, muMin0, muMax0, mu0, &
187 muInertiaTolerance, muInertiaExpansion, &
188 muPEXSISafeGuard, numElectronPEXSITolerance, &
189 matrixType, isSymbolicFactorize, ordering, rowOrdering, &
190 npSymbFact, verbosity)
191 TYPE(cp_pexsi_options), INTENT(IN) :: pexsi_options
192 REAL(kind=real_8), INTENT(OUT), OPTIONAL :: temperature, gap, deltae
193 INTEGER, INTENT(OUT), OPTIONAL :: numpole, isinertiacount, &
194 maxpexsiiter
195 REAL(kind=real_8), INTENT(OUT), OPTIONAL :: mumin0, mumax0, mu0, &
196 muinertiatolerance, muinertiaexpansion, mupexsisafeguard, &
197 numelectronpexsitolerance
198 INTEGER, INTENT(OUT), OPTIONAL :: matrixtype, &
199 issymbolicfactorize, &
200 ordering, rowordering, npsymbfact, &
201 verbosity
202
203#if defined(__PEXSI)
204 IF (PRESENT(temperature)) temperature = pexsi_options%options%temperature
205 IF (PRESENT(gap)) gap = pexsi_options%options%gap
206 IF (PRESENT(deltae)) deltae = pexsi_options%options%deltaE
207 IF (PRESENT(numpole)) numpole = pexsi_options%options%numPole
208 IF (PRESENT(isinertiacount)) isinertiacount = pexsi_options%options%isInertiaCount
209 IF (PRESENT(maxpexsiiter)) maxpexsiiter = pexsi_options%options%maxPEXSIIter
210 IF (PRESENT(mumin0)) mumin0 = pexsi_options%options%muMin0
211 IF (PRESENT(mumax0)) mumax0 = pexsi_options%options%muMax0
212 IF (PRESENT(mu0)) mu0 = pexsi_options%options%mu0
213 IF (PRESENT(muinertiatolerance)) THEN
214 muinertiatolerance = pexsi_options%options%muInertiaTolerance
215 END IF
216 IF (PRESENT(muinertiaexpansion)) THEN
217 muinertiaexpansion = pexsi_options%options%muInertiaExpansion
218 END IF
219 IF (PRESENT(mupexsisafeguard)) THEN
220 mupexsisafeguard = pexsi_options%options%muPEXSISafeGuard
221 END IF
222 IF (PRESENT(numelectronpexsitolerance)) THEN
223 numelectronpexsitolerance = pexsi_options%options%numElectronPEXSITolerance
224 END IF
225 IF (PRESENT(matrixtype)) matrixtype = pexsi_options%options%matrixType
226 IF (PRESENT(issymbolicfactorize)) THEN
227 issymbolicfactorize = pexsi_options%options%isSymbolicFactorize
228 END IF
229 IF (PRESENT(ordering)) ordering = pexsi_options%options%ordering
230 IF (PRESENT(rowordering)) rowordering = pexsi_options%options%rowOrdering
231 IF (PRESENT(npsymbfact)) npsymbfact = pexsi_options%options%npSymbFact
232 IF (PRESENT(verbosity)) verbosity = pexsi_options%options%verbosity
233#else
234 mark_used(pexsi_options)
235 ! assign intent-out arguments to silence compiler warnings
236 IF (PRESENT(temperature)) temperature = 0.0_real_8
237 IF (PRESENT(gap)) gap = 0.0_real_8
238 IF (PRESENT(deltae)) deltae = 0.0_real_8
239 IF (PRESENT(numpole)) numpole = -1
240 IF (PRESENT(isinertiacount)) isinertiacount = -1
241 IF (PRESENT(maxpexsiiter)) maxpexsiiter = -1
242 IF (PRESENT(mumin0)) mumin0 = 0.0_real_8
243 IF (PRESENT(mumax0)) mumax0 = 0.0_real_8
244 IF (PRESENT(mu0)) mu0 = 0.0_real_8
245 IF (PRESENT(muinertiatolerance)) muinertiatolerance = 0.0_real_8
246 IF (PRESENT(muinertiaexpansion)) muinertiaexpansion = 0.0_real_8
247 IF (PRESENT(mupexsisafeguard)) mupexsisafeguard = 0.0_real_8
248 IF (PRESENT(numelectronpexsitolerance)) numelectronpexsitolerance = 0.0_real_8
249 IF (PRESENT(matrixtype)) matrixtype = -1
250 IF (PRESENT(issymbolicfactorize)) issymbolicfactorize = -1
251 IF (PRESENT(ordering)) ordering = -1
252 IF (PRESENT(rowordering)) rowordering = -1
253 IF (PRESENT(npsymbfact)) npsymbfact = -1
254 IF (PRESENT(verbosity)) verbosity = -1
255 cpabort("Requires linking to the PEXSI library.")
256#endif
257 END SUBROUTINE cp_pexsi_get_options
258
259! **************************************************************************************************
260!> \brief ...
261!> \param pexsi_options ...
262! **************************************************************************************************
263 SUBROUTINE cp_pexsi_set_default_options(pexsi_options)
264 TYPE(cp_pexsi_options), INTENT(OUT) :: pexsi_options
265
266#if defined(__PEXSI)
267 CALL f_ppexsi_set_default_options(pexsi_options%options)
268#else
269 cpabort("Requires linking to the PEXSI library.")
270#endif
271 END SUBROUTINE cp_pexsi_set_default_options
272
273! **************************************************************************************************
274!> \brief ...
275!> \param comm ...
276!> \param numProcRow ...
277!> \param numProcCol ...
278!> \param outputFileIndex ...
279!> \return ...
280! **************************************************************************************************
281 FUNCTION cp_pexsi_plan_initialize(comm, numProcRow, numProcCol, outputFileIndex)
282 TYPE(mp_comm_type), INTENT(IN) :: comm
283 INTEGER, INTENT(IN) :: numprocrow, numproccol, &
284 outputfileindex
285 INTEGER(KIND=C_INTPTR_T) :: cp_pexsi_plan_initialize
286
287#if defined(__PEXSI)
288 CHARACTER(LEN=*), PARAMETER :: routinen = 'cp_pexsi_plan_initialize'
289 INTEGER :: info, handle
290
291 CALL timeset(routinen, handle)
292 cp_pexsi_plan_initialize = f_ppexsi_plan_initialize(comm%get_handle(), numprocrow, &
293 numproccol, outputfileindex, info)
294 IF (info /= 0) THEN
295 cpabort("Pexsi returned an error. Consider logPEXSI0 for details.")
296 END IF
297 CALL timestop(handle)
298#else
299 mark_used(comm)
300 mark_used(numprocrow)
301 mark_used(numproccol)
302 mark_used(outputfileindex)
304 cpabort("Requires linking to the PEXSI library.")
305#endif
306 END FUNCTION cp_pexsi_plan_initialize
307
308! **************************************************************************************************
309!> \brief ...
310!> \param plan ...
311!> \param pexsi_options ...
312!> \param nrows ...
313!> \param nnz ...
314!> \param nnzLocal ...
315!> \param numColLocal ...
316!> \param colptrLocal ...
317!> \param rowindLocal ...
318!> \param HnzvalLocal ...
319!> \param isSIdentity ...
320!> \param SnzvalLocal ...
321! **************************************************************************************************
322 SUBROUTINE cp_pexsi_load_real_hs_matrix(plan, pexsi_options, nrows, nnz, &
323 nnzLocal, numColLocal, colptrLocal, &
324 rowindLocal, HnzvalLocal, isSIdentity, &
325 SnzvalLocal)
326 INTEGER(KIND=C_INTPTR_T), INTENT(IN) :: plan
327 TYPE(cp_pexsi_options), INTENT(IN) :: pexsi_options
328 INTEGER, INTENT(IN) :: nrows, nnz, nnzlocal, &
329 numcollocal, colptrlocal(*), &
330 rowindlocal(*)
331 REAL(kind=real_8), INTENT(IN) :: hnzvallocal(*)
332 INTEGER, INTENT(IN) :: issidentity
333 REAL(kind=real_8), INTENT(IN) :: snzvallocal(*)
334
335#if defined(__PEXSI)
336 CHARACTER(LEN=*), PARAMETER :: routinen = 'cp_pexsi_load_real_symmetric_hs_matrix'
337 INTEGER :: handle, info
338
339 CALL timeset(routinen, handle)
340 CALL f_ppexsi_load_real_hs_matrix(plan, pexsi_options%options, nrows, nnz, nnzlocal, &
341 numcollocal, colptrlocal, rowindlocal, &
342 hnzvallocal, issidentity, snzvallocal, info)
343 IF (info /= 0) THEN
344 cpabort("Pexsi returned an error. Consider logPEXSI0 for details.")
345 END IF
346 CALL timestop(handle)
347#else
348 mark_used(plan)
349 mark_used(pexsi_options)
350 mark_used(nrows)
351 mark_used(nnz)
352 mark_used(nnzlocal)
353 mark_used(numcollocal)
354 mark_used(issidentity)
355 cpabort("Requires linking to the PEXSI library.")
356
357 ! MARK_USED macro does not work on assumed shape variables
358 IF (.false.) THEN
359 DO
360 IF (colptrlocal(1) > rowindlocal(1) .OR. hnzvallocal(1) > snzvallocal(1)) EXIT
361 END DO
362 END IF
363#endif
364 END SUBROUTINE cp_pexsi_load_real_hs_matrix
365
366! **************************************************************************************************
367!> \brief ...
368!> \param plan ...
369!> \param pexsi_options ...
370!> \param numElectronExact ...
371!> \param muPEXSI ...
372!> \param numElectronPEXSI ...
373!> \param muMinInertia ...
374!> \param muMaxInertia ...
375!> \param numTotalInertiaIter ...
376!> \param numTotalPEXSIIter ...
377! **************************************************************************************************
378 SUBROUTINE cp_pexsi_dft_driver(plan, pexsi_options, numElectronExact, muPEXSI, &
379 numElectronPEXSI, muMinInertia, muMaxInertia, &
380 numTotalInertiaIter, numTotalPEXSIIter)
381 INTEGER(KIND=C_INTPTR_T), INTENT(IN) :: plan
382 TYPE(cp_pexsi_options), INTENT(IN) :: pexsi_options
383 REAL(kind=real_8), INTENT(IN) :: numelectronexact
384 REAL(kind=real_8), INTENT(out) :: mupexsi, numelectronpexsi, &
385 mumininertia, mumaxinertia
386 INTEGER, INTENT(out) :: numtotalinertiaiter, &
387 numtotalpexsiiter
388
389#if defined(__PEXSI)
390 CHARACTER(LEN=*), PARAMETER :: routinen = 'cp_pexsi_dft_driver'
391 INTEGER :: handle, info
392#if defined(__HAS_IEEE_EXCEPTIONS)
393 LOGICAL, DIMENSION(5) :: halt
394#endif
395
396 CALL timeset(routinen, handle)
397
398 ! Unfortuntatelly, some PEXSI kernels raise IEEE754 exceptions.
399 ! Therefore, we disable floating point traps temporarily.
400#if defined(__HAS_IEEE_EXCEPTIONS)
401 CALL ieee_get_halting_mode(ieee_all, halt)
402 CALL ieee_set_halting_mode(ieee_all, .false.)
403#endif
404
405 CALL f_ppexsi_dft_driver(plan, pexsi_options%options, numelectronexact, mupexsi, &
406 numelectronpexsi, mumininertia, mumaxinertia, &
407 numtotalinertiaiter, numtotalpexsiiter, info)
408
409#if defined(__HAS_IEEE_EXCEPTIONS)
410 CALL ieee_set_halting_mode(ieee_all, halt)
411#endif
412
413 IF (info /= 0) THEN
414 cpabort("Pexsi returned an error. Consider logPEXSI0 for details.")
415 END IF
416 CALL timestop(handle)
417#else
418 mark_used(plan)
419 mark_used(numelectronexact)
420 mark_used(pexsi_options)
421 ! assign intent-out arguments to silence compiler warnings
422 mupexsi = 0.0_real_8
423 numelectronpexsi = 0.0_real_8
424 mumininertia = 0.0_real_8
425 mumaxinertia = 0.0_real_8
426 numtotalinertiaiter = -1
427 numtotalpexsiiter = -1
428 cpabort("Requires linking to the PEXSI library.")
429#endif
430 END SUBROUTINE cp_pexsi_dft_driver
431
432! **************************************************************************************************
433!> \brief ...
434!> \param plan ...
435!> \param DMnzvalLocal ...
436!> \param EDMnzvalLocal ...
437!> \param FDMnzvalLocal ...
438!> \param totalEnergyH ...
439!> \param totalEnergyS ...
440!> \param totalFreeEnergy ...
441! **************************************************************************************************
442 SUBROUTINE cp_pexsi_retrieve_real_dft_matrix(plan, DMnzvalLocal, EDMnzvalLocal, &
443 FDMnzvalLocal, totalEnergyH, &
444 totalEnergyS, totalFreeEnergy)
445 INTEGER(KIND=C_INTPTR_T), INTENT(IN) :: plan
446 REAL(kind=real_8), INTENT(out) :: dmnzvallocal(*), edmnzvallocal(*), &
447 fdmnzvallocal(*), totalenergyh, totalenergys, &
448 totalfreeenergy
449
450#if defined(__PEXSI)
451 CHARACTER(LEN=*), PARAMETER :: routinen = 'cp_pexsi_retrieve_real_symmetric_dft_matrix'
452 INTEGER :: handle, info
453
454 CALL timeset(routinen, handle)
455 CALL f_ppexsi_retrieve_real_dft_matrix(plan, dmnzvallocal, edmnzvallocal, &
456 fdmnzvallocal, totalenergyh, &
457 totalenergys, totalfreeenergy, info)
458 IF (info /= 0) THEN
459 cpabort("Pexsi returned an error. Consider logPEXSI0 for details.")
460 END IF
461 CALL timestop(handle)
462#else
463 mark_used(plan)
464 ! assign intent-out arguments to silence compiler warnings
465 dmnzvallocal(1) = 0.0_real_8
466 edmnzvallocal(1) = 0.0_real_8
467 fdmnzvallocal(1) = 0.0_real_8
468 totalenergyh = 0.0_real_8
469 totalenergys = 0.0_real_8
470 totalfreeenergy = 0.0_real_8
471
472 cpabort("Requires linking to the PEXSI library.")
473#endif
475
476! **************************************************************************************************
477!> \brief ...
478!> \param plan ...
479! **************************************************************************************************
480 SUBROUTINE cp_pexsi_plan_finalize(plan)
481 INTEGER(KIND=C_INTPTR_T), INTENT(IN) :: plan
482
483#if defined(__PEXSI)
484 CHARACTER(LEN=*), PARAMETER :: routinen = 'cp_pexsi_plan_finalize'
485 INTEGER :: info, handle
486
487 CALL timeset(routinen, handle)
488 CALL f_ppexsi_plan_finalize(plan, info)
489 IF (info /= 0) THEN
490 cpabort("Pexsi returned an error. Consider logPEXSI0 for details.")
491 END IF
492 CALL timestop(handle)
493#else
494 mark_used(plan)
495 cpabort("Requires linking to the PEXSI library.")
496#endif
497 END SUBROUTINE cp_pexsi_plan_finalize
498
499END MODULE pexsi_interface
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public int_8
Definition kinds.F:54
integer, parameter, public real_8
Definition kinds.F:41
Interface to the message passing library MPI.
Interface to the PEXSI library, providing wrappers for all PEXSI routines that are called inside CP2K...
subroutine, public cp_pexsi_set_options(pexsi_options, temperature, gap, deltae, numpole, isinertiacount, maxpexsiiter, mumin0, mumax0, mu0, muinertiatolerance, muinertiaexpansion, mupexsisafeguard, numelectronpexsitolerance, matrixtype, issymbolicfactorize, ordering, rowordering, npsymbfact, verbosity)
Set PEXSI internal options.
subroutine, public cp_pexsi_retrieve_real_dft_matrix(plan, dmnzvallocal, edmnzvallocal, fdmnzvallocal, totalenergyh, totalenergys, totalfreeenergy)
...
subroutine, public cp_pexsi_get_options(pexsi_options, temperature, gap, deltae, numpole, isinertiacount, maxpexsiiter, mumin0, mumax0, mu0, muinertiatolerance, muinertiaexpansion, mupexsisafeguard, numelectronpexsitolerance, matrixtype, issymbolicfactorize, ordering, rowordering, npsymbfact, verbosity)
Access PEXSI internal options.
subroutine, public cp_pexsi_plan_finalize(plan)
...
subroutine, public cp_pexsi_load_real_hs_matrix(plan, pexsi_options, nrows, nnz, nnzlocal, numcollocal, colptrlocal, rowindlocal, hnzvallocal, issidentity, snzvallocal)
...
subroutine, public cp_pexsi_set_default_options(pexsi_options)
...
integer(kind=c_intptr_t) function, public cp_pexsi_plan_initialize(comm, numprocrow, numproccol, outputfileindex)
...
subroutine, public cp_pexsi_dft_driver(plan, pexsi_options, numelectronexact, mupexsi, numelectronpexsi, mumininertia, mumaxinertia, numtotalinertiaiter, numtotalpexsiiter)
...