title: MPICH output not printing
body: <h3>Problem</h3>
  
  <p>I'm running an <strong>executable cp2k</strong> installed on HPC cluster using <strong>mpich-3.2</strong>. The output from the executable is printed in an <strong>out</strong> file. The problem is, that there is <strong>no output</strong> in the out file after <strong>some steps</strong> are printed, but when I see the status of my job on the cluster, it turns out that it is still running. Basically, the problem is that my job is still running, but the output is not getting printed.</p>
  
  <h3>Script</h3>
  
  <p>I'm using the following job script:</p>
  
  <pre><code>#!/bin/bash
  #PBS -N test
  #PBS -o test.log
  #PBS -j oe
  #PBS -l nodes=2:ppn=20
  #PBS -q mini
  #PBS -l walltime=2:00:00
  cd $PBS_O_WORKDIR
  echo Master process running on `hostname`
  echo Directory is `pwd`
  echo PBS has allocated the following nodes:
  echo `cat $PBS_NBODEFILE`
  NPROCS=`wc -l &lt; $PBS_NODEFILE`
  echo This job has allocated $NPROCS nodes
  export I_MPI_FABRICS=shm:dapl
  export I_MPI_PROVIDER=psm2
  export I_MPI_FALLBACK=0
  export KMP_AFFINITY=verbose,scatter
  export OMP_NUM_THREADS=1
  export I_MPI_IFACE=ib0
  echo Starting executation at `date`
  EXEC="/home/arshil/software/cp2k-5.1.0/exe/local/cp2k.popt"
  cp  $EXEC ./cp2k
  mpiexec -np $NPROCS --machinefile $PBS_NODEFILE ./cp2k -i test.inp &gt;&amp; out
  rm cp2k
  echo Finished at `date`
  </code></pre>
  
  <h3>Error</h3>
  
  <p>The <strong>ouput</strong> in the <strong>out</strong> file:</p>
  
  <pre><code>SCF WAVEFUNCTION OPTIMIZATION
  
    ----------------------------------- OT ---------------------------------------
    Minimizer      : DIIS                : direct inversion
                                           in the iterative subspace
                                           using   7 DIIS vectors
                                           safer DIIS on
    Preconditioner : FULL_SINGLE_INVERSE : inversion of 
                                           H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T
    Precond_solver : DEFAULT
    stepsize       :    0.08000000                  energy_gap     :    0.08000000
    eps_taylor     :   0.10000E-15                  max_taylor     :             4
    ----------------------------------- OT ---------------------------------------
  
    Step     Update method      Time    Convergence         Total energy    Change
    ------------------------------------------------------------------------------
       1 OT DIIS     0.80E-01   21.3     0.00002878     -8797.2068024142 -8.80E+03
       2 OT DIIS     0.80E-01   10.9     0.00007114     -8797.2061897209  6.13E-04
       3 OT DIIS     0.80E-01   10.8     0.00001688     -8797.2073257531 -1.14E-03
  </code></pre>
  
  <p>As it can be seen, there is <strong>no printing</strong> after <strong>step 3</strong> in the output file, but the job is <strong>still running</strong> in the background. Even after the walltime is over, the output file remains the same as above. Where is the output going? </p>
  
  <p>The <strong>executable cp2k</strong> is used to perform quantum chemical calculations and was installed on the cluster along with mpich-3.2. All <strong>CP2K</strong> needs is an input file with extension <code>.inp</code>. For my case, <code>test.inp</code> is the input file. </p>
  
  <pre><code>&amp;FORCE_EVAL
    METHOD Quickstep
    &amp;DFT
        BASIS_SET_FILE_NAME  GTH_BASIS_SETS
        POTENTIAL_FILE_NAME  GTH_POTENTIALS
      &amp;MGRID
        NGRIDS 4
        CUTOFF 380
        REL_CUTOFF 60
      &amp;END MGRID
      &amp;QS
        METHOD GPW
        MAP_CONSISTENT
        EXTRAPOLATION ASPC
        EXTRAPOLATION_ORDER 3
      &amp;END QS
  
      &amp;SCF
        MAX_SCF 1000
        EPS_SCF 1.0E-5
        SCF_GUESS ATOMIC
        &amp;OT
          PRECONDITIONER FULL_SINGLE_INVERSE
          MINIMIZER DIIS
          N_DIIS 7
        &amp;END OT
        &amp;PRINT
          &amp;RESTART OFF
          &amp;END RESTART
        &amp;END PRINT
       &amp;END SCF
  
       &amp;XC
          &amp;XC_FUNCTIONAL PBE
          &amp;END XC_FUNCTIONAL
          &amp;vdW_POTENTIAL
             DISPERSION_FUNCTIONAL PAIR_POTENTIAL
             &amp;PAIR_POTENTIAL
                PARAMETER_FILE_NAME dftd3.dat
                TYPE DFTD3
                REFERENCE_FUNCTIONAL PBE
                R_CUTOFF  [angstrom] 12.3
             &amp;END PAIR_POTENTIAL
          &amp;END vdW_POTENTIAL
       &amp;END XC
  
    &amp;END DFT
    &amp;SUBSYS
      &amp;CELL
        ABC 24.6904 24.6904 24.6904
        PERIODIC XYZ
      &amp;END CELL
  
      &amp;KIND C
        BASIS_SET TZV2P-GTH
        POTENTIAL GTH-PBE-q4
      &amp;END KIND
      &amp;KIND P
        BASIS_SET TZV2P-GTH
        POTENTIAL GTH-PBE-q5
      &amp;END KIND
      &amp;KIND H
        BASIS_SET TZV2P-GTH
        POTENTIAL GTH-PBE-q1
      &amp;END KIND
      &amp;KIND O
        BASIS_SET TZV2P-GTH
        POTENTIAL GTH-PBE-q6
      &amp;END KIND
      &amp;KIND N
        BASIS_SET TZV2P-GTH
        POTENTIAL GTH-PBE-q5
      &amp;END KIND
      &amp;KIND Mg
        BASIS_SET TZV2P-GTH
        POTENTIAL GTH-PBE-q10
      &amp;END KIND
  
      &amp;COLVAR
         &amp;COORDINATION
            ATOMS_FROM 41
            ATOMS_TO 38
            R_0 [bohr] 4.5
            NN  6
            ND  12
         &amp;END COORDINATION
      &amp;END COLVAR
  
      &amp;COLVAR
         &amp;COORDINATION
            ATOMS_FROM 41
            ATOMS_TO 42 44 47 50 53 56 59 62 65 68 71 74 77 80 83 86 89 92 95 98 101 104 107 110 113 116 119 122 125 128 131 134 137 140 143 146 149 152 155 158 161 164 167 170 173 176 179 182 185 188 191 194 197 200 203 206 209 212 215 218 221 224 227 230 233 236 239 242 245 248 251 254 257 260 263 266 269 272 275 278 281 284 287 290 293 296 299 302 305 308 311 314 317 320 323 326 329 332 335 338 341 344 347 350 353 356 359 362 365 368 371 374 377 380 383 386 389 392 395 398 401 404 407 410 413 416 419 422 425 428 431 434 437 440 443 446 449 452 455 458 461 464 467 470 473 476 479 482 485 488 491 494 497 500 503 506 509 512 515 518 521 524 527 530 533 536 539 542 545 548 551 554 557 560 563 566 569 572 575 578 581 584 587 590 593 596 599 602 605 608 611 614 617 620 623 626 629 632 635 638 641 644 647 650 653 656 659 662 665 668 671 674 677 680 683 686 689 692 695 698 701 704 707 710 713 716 719 722 725 728 731 734 737 740 743 746 749 752 755 758 761 764 767 770 773 776 779 782 785 788 791 794 797 800 803 806 809 812 815 818 821 824 827 830 833 836 839 842 845 848 851 854 857 860 863 866 869 872 875 878 881 884 887 890 893 896 899 902 905 908 911 914 917 920 923 926 929 932 935 938 941 944 947 950 953 956 959 962 965 968 971 974 977 980 983 986 989 992 995 998 1001 1004 1007 1010 1013 1016 1019 1022 1025 1028 1031 1034 1037 1040 1043 1046 1049 1052 1055 1058 1061 1064 1067 1070 1073 1076 1079 1082 1085 1088 1091 1094 1097 1100 1103 1106 1109 1112 1115 1118 1121 1124 1127 1130 1133 1136 1139 1142 1145 1148 1151 1154 1157 1160 1163 1166 1169 1172 1175 1178 1181 1184 1187 1190 1193 1196 1199 1202 1205 1208 1211 1214 1217 1220 1223 1226 1229 1232 1235 1238 1241 1244 1247 1250 1253 1256 1259 1262 1265 1268 1271 1274 1277 1280 1283 1286 1289 1292 1295 1298 1301 1304 1307 1310 1313 1316 1319 1322 1325 1328 1331 1334 1337 1340 1343 1346 1349 1352 1355 1358 1361 1364 1367 1370 1373 1376 1379 1382 1385 1388 1391 1394 1397 1400 1403 1406 1409 1412 1415 1418 1421 1424 1427 1430 1433 1436 1439 1442 1445 1448 1451 1454 1457 
            ATOMS_TO 1460 1463 1466 1469 1472 1475 1478 1481 1484 1487 1490 1493 1496 1499 1502 1505
            R_0 [bohr]  4.5
            NN  6
            ND  12
         &amp;END COORDINATION
      &amp;END COLVAR
    &amp;END SUBSYS
  &amp;END FORCE_EVAL
  
  &amp;GLOBAL
    PROJECT test
    RUN_TYPE MD
    PRINT_LEVEL LOW
  &amp;END GLOBAL
  
  &amp;MOTION
    &amp;MD
      ENSEMBLE NVT
      STEPS 100000
      TIMESTEP 0.5
      TEMPERATURE 310
      TEMP_TOL 100
      &amp;THERMOSTAT
        &amp;NOSE
          LENGTH 3
          YOSHIDA 3
          TIMECON 100.0
          MTS 2
        &amp;END NOSE
      &amp;END
      &amp;PRINT
        &amp;ENERGY
          &amp;EACH
             MD 10
          &amp;END
        &amp;END
        &amp;PROGRAM_RUN_INFO
          &amp;EACH
             MD 100
          &amp;END
        &amp;END
        FORCE_LAST
      &amp;END PRINT
    &amp;END MD
  
    &amp;FREE_ENERGY
      &amp;METADYN
        DO_HILLS 
        LAGRANGE .TRUE.
        NT_HILLS 40
        WW [kcalmol] 1
        TEMPERATURE 310
        TEMP_TOL 10
  
        &amp;METAVAR
          SCALE 0.05
          COLVAR 1
          MASS 50
          LAMBDA 2
          &amp;WALL
              POSITION 0.0
              TYPE QUARTIC
              &amp;QUARTIC
                 DIRECTION WALL_MINUS
                 K  10.0
              &amp;END
          &amp;END
        &amp;END METAVAR
  
        &amp;METAVAR
          SCALE 0.05
          COLVAR 2
          MASS 50
          LAMBDA 2
          &amp;WALL
              POSITION 0.0
              TYPE QUARTIC
              &amp;QUARTIC
                 DIRECTION WALL_MINUS
                 K  10.0
              &amp;END
          &amp;END
        &amp;END METAVAR
  
        &amp;PRINT
          &amp;COLVAR
             COMMON_ITERATION_LEVELS 3
             &amp;EACH
               MD 1
             &amp;END
          &amp;END
          &amp;HILLS
             COMMON_ITERATION_LEVELS 3
             &amp;EACH
               MD 1
             &amp;END
          &amp;END
        &amp;END
      &amp;END METADYN
    &amp;END
  
    &amp;PRINT
      &amp;TRAJECTORY
        &amp;EACH
          MD 1
        &amp;END
      &amp;END
      &amp;VELOCITIES OFF
      &amp;END
      &amp;RESTART
        &amp;EACH
           MD 20
        &amp;END
        ADD_LAST NUMERIC
      &amp;END
      &amp;RESTART_HISTORY 
        &amp;EACH
           MD 2000
        &amp;END
      &amp;END
    &amp;END
  &amp;END MOTION
  
  &amp;EXT_RESTART
    RESTART_FILE_NAME NVT-1.restart
    RESTART_COUNTERS .FALSE.
  &amp;END 
  </code></pre>
  
  <p>The problem in my opinion is not with the input file. It has got to do something with <strong>mpich-3.2</strong>. I would really appreciate some help. </p>