18 #include "wrapperMPI.h"    25   long int imax = 
X->Check.idim_max;
    28   double dHam_re, dHam_im;
    29   char ctmp[256], ctmp2[256];
    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     Ham[ham_i][ham_j]=dHam_re+I*dHam_im;
    53     Ham[ham_j][ham_i]=conj(
Ham[ham_i][ham_j]);
 
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory. 
const char * cFileNamePhys_FullDiag_Ham
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...
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()