PEXSI
 All Classes Namespaces Files Functions Variables Typedefs Pages
c_pexsi_interface_old.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012 The Regents of the University of California,
3  through Lawrence Berkeley National Laboratory.
4 
5  Author: Lin Lin
6 
7  This file is part of PEXSI. All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions are met:
11 
12  (1) Redistributions of source code must retain the above copyright notice, this
13  list of conditions and the following disclaimer.
14  (2) Redistributions in binary form must reproduce the above copyright notice,
15  this list of conditions and the following disclaimer in the documentation
16  and/or other materials provided with the distribution.
17  (3) Neither the name of the University of California, Lawrence Berkeley
18  National Laboratory, U.S. Dept. of Energy nor the names of its contributors may
19  be used to endorse or promote products derived from this software without
20  specific prior written permission.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33  You are under no obligation whatsoever to provide any bug fixes, patches, or
34  upgrades to the features, functionality or performance of the source code
35  ("Enhancements") to anyone; however, if you choose to make your Enhancements
36  available either publicly, or directly to Lawrence Berkeley National
37  Laboratory, without imposing a separate written license agreement for such
38  Enhancements, then you hereby grant the following license: a non-exclusive,
39  royalty-free perpetual license to install, use, modify, prepare derivative
40  works, incorporate into other computer software, distribute, and sublicense
41  such enhancements or derivative works thereof, in binary and source code form.
42 */
53 #ifndef _PEXSI_C_PEXSI_INTERFACE_H_
54 #define _PEXSI_C_PEXSI_INTERFACE_H_
55 #include "mpi.h"
56 
57 #ifdef __cplusplus
58 extern "C"{
59 #endif
60 
61 
74  char* filename,
75  int* size,
76  int* nnz,
77  int* nnzLocal,
78  int* numColLocal,
79  MPI_Comm comm );
80 
101  char* filename,
102  int size,
103  int nnz,
104  int nnzLocal,
105  int numColLocal,
106  int* colptrLocal,
107  int* rowindLocal,
108  double* nzvalLocal,
109  MPI_Comm comm );
110 
111 
124  char* filename,
125  int* size,
126  int* nnz,
127  int* nnzLocal,
128  int* numColLocal,
129  MPI_Comm comm );
130 
154  char* filename,
155  int size,
156  int nnz,
157  int nnzLocal,
158  int numColLocal,
159  int* colptrLocal,
160  int* rowindLocal,
161  double* nzvalLocal,
162  MPI_Comm comm );
163 
164 
165 
217 void PPEXSISelInvInterface (
218  int nrows,
219  int nnz,
220  int nnzLocal,
221  int numColLocal,
222  int* colptrLocal,
223  int* rowindLocal,
224  double* HnzvalLocal,
225  int isSIdentity,
226  double* SnzvalLocal,
227  double* zShift,
228  int ordering,
229  int npSymbFact,
230  MPI_Comm comm,
231  double* AinvnzvalLocal,
232  int* info
233  );
234 
344  int nrows,
345  int nnz,
346  int nnzLocal,
347  int numColLocal,
348  int* colptrLocal,
349  int* rowindLocal,
350  double* HnzvalLocal,
351  int isSIdentity,
352  double* SnzvalLocal,
353  double temperature,
354  double numElectronExact,
355  double muMin0,
356  double muMax0,
357  int numPole,
358  int maxIter,
359  double numElectronTolerance,
360  int ordering,
361  int npPerPole,
362  int npSymbFact,
363  MPI_Comm comm,
364  double* muMinInertia,
365  double* muMaxInertia,
366  double* muLowerEdge,
367  double* muUpperEdge,
368  int* numIter,
369  double* muList,
370  double* numElectronList,
371  int* info
372  );
373 
374 
388  // Input parameters
389  int nrows,
390  int nnz,
391  int nnzLocal,
392  int numColLocal,
393  int* colptrLocal,
394  int* rowindLocal,
395  double* HnzvalLocal,
396  int isSIdentity,
397  double* SnzvalLocal,
398  double muMin0,
399  double muMax0,
400  int numPole,
401  int ordering,
402  int npPerPole,
403  int npSymbFact,
404  MPI_Comm comm,
405  double* muList,
406  int * numElectronList,
407  int* info
408  );
409 
410 
509  int nrows,
510  int nnz,
511  int nnzLocal,
512  int numColLocal,
513  int* colptrLocal,
514  int* rowindLocal,
515  double* HnzvalLocal,
516  int isSIdentity,
517  double* SnzvalLocal,
518  double temperature,
519  double numElectronExact,
520  double mu0,
521  double muMin0,
522  double muMax0,
523  double gap,
524  double deltaE,
525  int numPole,
526  int maxIter,
527  double numElectronTolerance,
528  int ordering,
529  int npPerPole,
530  int npSymbFact,
531  MPI_Comm comm,
532  double* DMnzvalLocal,
533  double* EDMnzvalLocal,
534  double* FDMnzvalLocal,
535  double* muPEXSI,
536  double* numElectronPEXSI,
537  double* muMinPEXSI,
538  double* muMaxPEXSI,
539  int* numIter,
540  double* muList,
541  double* numElectronList,
542  double* numElectronDrvList,
543  int* info
544  );
545 
546 
603  int nrows,
604  int nnz,
605  int nnzLocal,
606  int numColLocal,
607  int* colptrLocal,
608  int* rowindLocal,
609  double* HnzvalLocal,
610  int isSIdentity,
611  double* SnzvalLocal,
612  double Energy,
613  double eta,
614  int ordering,
615  int npSymbFact,
616  MPI_Comm comm,
617  double* localDOSnzvalLocal,
618  int* info
619  );
620 
621 
656  int nrows,
657  int nnz,
658  int nnzLocal,
659  int numColLocal,
660  int* colptrLocal,
661  int* rowindLocal,
662  double* AnzvalLocal,
663  int ordering,
664  int npSymbFact,
665  MPI_Comm comm,
666  int nprow,
667  int npcol,
668  double* AinvnzvalLocal,
669  int* info
670  );
671 
672 
712  int nrows,
713  int nnz,
714  int nnzLocal,
715  int numColLocal,
716  int* colptrLocal,
717  int* rowindLocal,
718  double* AnzvalLocal,
719  int ordering,
720  int npSymbFact,
721  MPI_Comm comm,
722  int nprow,
723  int npcol,
724  double* AinvnzvalLocal,
725  int* info
726  );
727 
728 
729 #ifdef __cplusplus
730 }// extern "C"
731 #endif
732 
733 #endif // _PEXSI_C_PEXSI_INTERFACE_H_
734 
void ReadDistSparseMatrixFormattedInterface(char *filename, int size, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *nzvalLocal, MPI_Comm comm)
Reading the data of a formatted DistSparseMatrix.
Definition: interface.cpp:120
Real Energy(const NumMat< F > &M)
Energy computes the L2 norm of a matrix (treated as a vector).
Definition: NumMat_impl.hpp:142
void PPEXSISolveInterface(int nrows, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *HnzvalLocal, int isSIdentity, double *SnzvalLocal, double temperature, double numElectronExact, double mu0, double muMin0, double muMax0, double gap, double deltaE, int numPole, int maxIter, double numElectronTolerance, int ordering, int npPerPole, int npSymbFact, MPI_Comm comm, double *DMnzvalLocal, double *EDMnzvalLocal, double *FDMnzvalLocal, double *muPEXSI, double *numElectronPEXSI, double *muMinPEXSI, double *muMaxPEXSI, int *numIter, double *muList, double *numElectronList, double *numElectronDrvList, int *info)
Main driver routine for solving Kohn-Sham density functional theory using PEXSI.
Definition: interface_old.cpp:927
void PSelInvRealSymmetricInterface(int nrows, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *AnzvalLocal, int ordering, int npSymbFact, MPI_Comm comm, int nprow, int npcol, double *AinvnzvalLocal, int *info)
Simplified driver interface for computing the selected elements of a real symmetric symmetric...
void PPEXSIRawInertiaCountInterface(int nrows, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *HnzvalLocal, int isSIdentity, double *SnzvalLocal, double muMin0, double muMax0, int numPole, int ordering, int npPerPole, int npSymbFact, MPI_Comm comm, double *muList, int *numElectronList, int *info)
Directly compute the negative inertia at a set of shifts.
Definition: interface_old.cpp:711
void ReadDistSparseMatrixFormattedHeadInterface(char *filename, int *size, int *nnz, int *nnzLocal, int *numColLocal, MPI_Comm comm)
Read the sizes of a DistSparseMatrix in formatted form (txt) for allocating memory in C...
Definition: interface.cpp:63
void ReadDistSparseMatrixHeadInterface(char *filename, int *size, int *nnz, int *nnzLocal, int *numColLocal, MPI_Comm comm)
Read the sizes of a DistSparseMatrix in unformatted form (csc) for allocating memory in C...
Definition: interface.cpp:153
void PPEXSILocalDOSInterface(int nrows, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *HnzvalLocal, int isSIdentity, double *SnzvalLocal, double Energy, double eta, int ordering, int npSymbFact, MPI_Comm comm, double *localDOSnzvalLocal, int *info)
Driver interface for computing the local density of states.
Definition: interface_old.cpp:1463
void ParaReadDistSparseMatrixInterface(char *filename, int size, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *nzvalLocal, MPI_Comm comm)
Actual reading the data of a DistSparseMatrix using MPI-IO, assuming that the arrays have been alloca...
Definition: interface.cpp:214
void PPEXSISelInvInterface(int nrows, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *HnzvalLocal, int isSIdentity, double *SnzvalLocal, double *zShift, int ordering, int npSymbFact, MPI_Comm comm, double *AinvnzvalLocal, int *info)
Driver interface for computing the selected elements of a matrix (in complex arithmietic).
Definition: interface_old.cpp:1217
void PPEXSIInertiaCountInterface(int nrows, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *HnzvalLocal, int isSIdentity, double *SnzvalLocal, double temperature, double numElectronExact, double muMin0, double muMax0, int numPole, int maxIter, double numElectronTolerance, int ordering, int npPerPole, int npSymbFact, MPI_Comm comm, double *muMinInertia, double *muMaxInertia, double *muLowerEdge, double *muUpperEdge, int *numIter, double *muList, double *numElectronList, int *info)
Driver interface for estimating the chemical potential using inertia counting procedure.
Definition: interface_old.cpp:281
void PSelInvComplexSymmetricInterface(int nrows, int nnz, int nnzLocal, int numColLocal, int *colptrLocal, int *rowindLocal, double *AnzvalLocal, int ordering, int npSymbFact, MPI_Comm comm, int nprow, int npcol, double *AinvnzvalLocal, int *info)
Simplified driver interface for computing the selected elements of a complex symmetric symmetric...
Definition: interface_old.cpp:1557