18 #include "wrapperMPI.hpp" 28 double dHam_re, dHam_im;
29 char ctmp[256], ctmp2[256];
32 char sdt[D_FileNameMax];
40 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
42 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
43 sscanf(ctmp,
"%ld %ld %ld\n", &itmp, &itmp, &ihermite);
45 fprintf(
stdoutMPI,
"Error: The dimension of input Hamiltonian is wrong: input=%ld, idim=%ld.\n", itmp, imax);
48 for(i=1; i<= ihermite; i++){
49 fgetsMPI(ctmp2,
sizeof(ctmp2) /
sizeof(
char), fp);
50 sscanf(ctmp2,
"%ld %ld %lf %lf\n",
51 &ham_i, &ham_j, &dHam_re, &dHam_im);
52 v0[ham_i][ham_j]=dHam_re+
I*dHam_im;
53 v0[ham_j][ham_i]=conj(
v0[ham_i][ham_j]);
struct DefineList Def
Definision of system (Hamiltonian) etc.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
std::complex< double > ** v0
std::complex< double > I(0.0, 1.0)
char * fgetsMPI(char *InputString, int maxcount, FILE *fp)
MPI file I/O (get a line, fgets) wrapper. Only the root node (myrank = 0) reads and broadcast string...
struct CheckList Check
Size of the Hilbert space.
char * CDataFileHead
Read from Calcmod in readdef.h. Header of output file such as Green's function.
long int idim_max
The dimension of the Hilbert space of this process.
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.