next up previous contents
Next: MCHF Up: ATSP2K manual Previous: The MCDHF/MCHF Data Collection   Contents

Subsections


NONH

Introduction

The function of nonh is to produce data needed by mchf for deriving the multiconfigurational Hartree-Fock equations, and for generating the interaction matrix [#!book!#]. The wave function expansion are expressed as:


\begin{displaymath}
\Psi(\gamma LS) = \sum_i^M c_i \Phi(\gamma_i, LS), {\mbox{where}}
\sum_i^M c_i^2 =1.
\end{displaymath} (1)

Then, by definition, the interaction matrix ${\bf H} = (H_{ij})$, can be computed as (see  [#!book!#], page 74):


\begin{displaymath}
H_{ij} = \sum_{ab}w_{ab}^{ij} I(a,b) +
\sum_{abcd;k} v_{abcd;k}^{ij}R^k(ab,cd).
\end{displaymath} (2)

Where, sum on $ab$ or $abcd$ is a sum over occupied orbitals in either the initial or final states ( $\Phi(\gamma_j LS)$), ${\cal H}$ is the non-relativistic Hamiltonian, $I(a,b)$ are integrals arising from the kinetic energy operator of the Hamiltonian and $R^k(ab,cd)$ are Slater integrals

Program Structure

The main program nonh(), Fig.  4.6 starts with inita(), a library routine which initializes some of the basic constants of the program, including those which define the average energy of a configuration.

Figure 4.6: nonh() program structure. Program parameters are initialized in inita(), analy_blk(), orbitals(), genint(), cfgblk(). Then, a loop over configurations from the configuration file cfg.inp applying shellsjb(), angmomg() computes the angular data for the interaction matrix.
\begin{figure}\begin{center}
\centerline{\psfig{figure=tex/fig/nonh_main.epsi}}\end{center}\end{figure}

Then, nonh determines the set of all orbitals, and generates a list of all possible integrals of both types (Slater and $I(a,b)$). analy_blk reads the configuration list, cfg.inp and analyzes the format of the configuration input data for the different blocks, determines the number of blocks, the size of each block, and consistent ordering of the electrons. orbitals processes additionally the configuration list and determines the parameters of common closed shells, allocates memory for the list of orbitals. After allocating memory for the pointer and coefficient data (cn, inptr, nijptr, jan, jbn, ico are arrays for buffering output data with size genint first determines the number of integrals and then allocates memory for the integrals.

Figure 4.7: cfgblk() and cfgtest() check the coupling and the consistency of orbitals for each block.
\begin{figure}\begin{center}
\centerline{\psfig{figure=tex/fig/nonh_cfgblk.epsi}}\end{center}\end{figure}

After initializing the main parameters nonh continues with the main loop for each block, and computes and stores on disk the data for the interaction matrix. For each block cfgblk initializes pointer data, verifies the consistency of the configurations in the list, (type of coupling, number of electrons for each shell).

Then, nonh proceeds with each LS term in the cfg.inp file. The output data consists of a one-dimensional list of coefficients, $w_{ab}^{ij}$ or $v_{abcd;k}^{ij}$ (denoted by cn(j) in nonh, and coeff in mchf) and with each such coefficient there is associated an integral. The latter is specified by an integer, inptr(j) that indicates the position of the integral within the list of all possible integrals. In the generation of a matrix element, we then need to know where the data for a matrix element terminates. This is achieved by specifying the end position of a matrix element without the necessity of specifying the first, since it follows the last coefficient of the previous. This is the role of the array ico(i) which indicates the last position of the i'th non-zero matrix elements. Since only non-zero matrix elements are stored, another integer is needed to specify the value of the row index: jan(i) (ih(i) in mchf is the array containing this information. The data is collected and written to disk after LSDIM=30000 have been collected to memory. The last record for a given LS term will always contain less than LSDIM elements, possibly zero, if necessary. The value of LSDIM can be changed by changing four parameter statements.

Figure 4.8: The main loop of nonh() processes each block by columns. The inner loop is over the list of configurations.
\begin{figure}\begin{center}
\centerline{\psfig{figure=tex/fig/nonh_main_2.epsi}}\end{center}\end{figure}

The main loop of the program consists from shellsjb, angmomg which process the configuration lists by column. The interaction matrix is symmetric and only the lower or upper part needs to be evaluated. Respectively, the data for matrix elements are generated by column. Thus the computational process is:

 For column = 1 to ncfg
    For row = column to ncfg
        compute matrix element

Only non-zero matrix elements are stored. This particular structure for the information was determined by conditions desired for mchf. This "large-scale" version of nonh was designed to compute matrix elements sequentially to facilitate sparse matrix representation of the interaction matrix and the use of Davidson's algorithm based on repeated matrix-vector multiplies.

nonh can process a list of configurations comprised by up to 20 terms. By default the list of configurations is kept in the file cfg.inp.

nonh requires an input file cfg.inp, and on successful run, it creates the following files (the configuration list, cfg.inpi, in the example below contains 3 blocks, 2P, 2D, 4P, therefore the number of generated ih.nn files is 3, one per block):

-rw-r--r--    1 georgio  georgio       252 Sep 20 00:35 cfg.h
-rw-r--r--    1 georgio  georgio    114019 Sep 20 00:34 cfg.inp
-rw-r--r--    1 georgio  georgio   6619380 Sep 20 00:35 c.lst
-rw-r--r--    1 georgio  georgio    863484 Sep 20 00:35 ico.lst
-rw-r--r--    1 georgio  georgio    393736 Sep 20 00:35 ih.01.lst
-rw-r--r--    1 georgio  georgio    425988 Sep 20 00:35 ih.02.lst
-rw-r--r--    1 georgio  georgio     43760 Sep 20 00:35 ih.03.lst
-rw-r--r--    1 georgio  georgio     16760 Sep 20 00:35 yint.lst
The format of each file is described in  13.16. In general, the files can grow very large depending on the type of the electronic system, the number of configurations and type of angular data which is computed.

MPI version

Each node computes and stores angular data on disk independently from the other nodes, no communications are required. The program structure of the parallel version has not changed compared to the serial version. Only some of the routines have been modified and they mainly differ from their serial counterparts in included additional statements for I/O output. For all MPI modified files an mpi_ prefix has been added. Except for the presence of initializing and finalizing MPI communications, each MPI node independently processes the configuration list by columns, using interleaved mode with a step equal to the number of processors.

I/O Files

The files which are used or created by mpi_nonh and mpi_mchf can be divided into:
  1. Common files for all nodes, with a single copy cfg.inp stores the configuration lists. Node 0 creates and writes on a cfg.inp file general information about the problem, it is similar to the serial version.
    -rw-r--r--    1 georgio  georgio       252 Sep 20 00:35 cfg.h
    -rw-r--r--    1 georgio  georgio    114019 Sep 20 00:34 cfg.inp
    

  2. Node dependent files, with a copy per node Each node creates a file with a basename which is the same as in the serial version, with an additional suffix. The suffix is a string which shows the node ID. All files are written into a temporary directory and the processor ID is the most convenient way for referring to each file. Note, that this method ensures that both applications, nonh_mpi and mchf_mpi refer to precisely the same file as the node ID. This is important for using parallel environments which do not explicitly specify the processor nodes.
    -rw-r--r--    1 georgio  georgio   6619380 Sep 20 00:35 c.lst.000
    -rw-r--r--    1 georgio  georgio    863484 Sep 20 00:35 ico.lst.000
    -rw-r--r--    1 georgio  georgio    393736 Sep 20 00:35 ih.lst.000
    -rw-r--r--    1 georgio  georgio     16760 Sep 20 00:35 yint.lst.000
    

Parallel routines

nonh was modified to its parallel version, mpi_nonh by converting the main loop to parallel, and a section of the code shows how this was accomplished: goal:
         do jb = myid+1,ncfg,nprocs
           if (mod(jb,1000) .eq. 0) write(0,*) '   jb =',jb

           CALL SHELLSJB(jb)
           CALL ANGMOMG(NEW,NZERO,IFIRST)

           mycol = mycol + 1
           jptr(mycol) = nij
         end do

The variable jb refers to the current column, and each node will process only the myid+1 + jb*nprocs column, where nprocs is the total number of processors, myid is the processor id (0,1,2... to.. nprocs-1).

mpi_orbitals() is virtually the same, but with added common /MPI/ myid, nprocs, ierr, istat(MPI_STATUS_SIZE). Only the node with myid=0 writes data to UNIT=25, (which is the file cfg.h) and the common was used to convey the myid value. mpi_angmom() has been modified to allow for correct increments of the variables lij, ja, jb, ntot.

The nonh program implements parallel output for the largest data files, Figure  5.20.

Figure 4.9: The angular data are stored in files, which are written in parallel. Files with negligible IO requirements are read/written by node 0.
\begin{figure}\centerline{ \psfig{file=tex/fig/mpi_io_nonh.eps}}\end{figure}


next up previous contents
Next: MCHF Up: ATSP2K manual Previous: The MCDHF/MCHF Data Collection   Contents
2001-10-11