08/07/2008 by zf2:
Changes made:
1. Migrate to new BP format.
2. -c option is removed. host-language information is extracted from header.
3. Known issue: cannot handle attribute whose value is a var.

06/11/2008 by zf2:

Changes made: 
1. Replace br_get_next_element_general() with br_get_next_element_specific() 
   for parsing bp files. br_get_next_element_general() uses a fix-sized buffer
   for reading dataset and scalar data values. br_get_next_element_specific() 
   has a pre_element_fetch callback to allocate read buffer on demand before 
   reading. 

2. Add a set of config flags to customize the converter:
   - array_dim_order_fortran: 
      transpose array dimension order if using Fortran convention; otherwise 
      keep order unchanged.
   - attr_str_ds_fortran: convert string-typed dataset attribute to HDF5 type
      H5T_FORTRAN_S1 if using Fortran convention; otherwise convert to 
      HDF5 type H5T_C_S1_g.
   - attr_str_gp_fortran: 
      convert string-typed group attribute to HDF5 type H5T_FORTRAN_S1 if using
      Fortran convention; otherwise convert to HDF5 type H5T_C_S1_g.
   - scalar_dataspace: 
      write scalar variable/attribute in a scalar dataspace or in a single 
      element array.

3. Add two command line options to set above-mentioned config flag
   -c config_file, --config=config_file:  
   If the host-language parameter in config file is "Fortran", then set 
   array_dim_order_fortran, attr_str_ds_fortran and attr_str_gp_fortran to use
   Fortran convention; otherwise set them to use C convention
   --scalar_as_array: 
   If this option is specified, then set scalar_dataspace to write scalar 
   variable/attribute in a single element array. If not specified, a scalar 
   variable/attribute is written in a scalar dataspace. 

4. Fix a bug in hw_dset(): check dims [0].global_bound to decide if a dataset
   has global bounds, instead of dims [i].global_bound (line: 141)       

5. Add install target in Makefile. 

Known Issues:
1. Although br_get_next_element_specific() can re-allocate read buffer when 
   needed, it still requires to read in all bytes at once. This may be 
   impossible for very large datasets. The root cause of this is that the 
   br_read_buffer() function in br-utils.c in ADIOS makes a single read() call. 

2. bp2h5 assumes that when writing an attribute, the dataset/group to which 
   this attribute is attached is already creaded in h5 file. If this is not 
   the case, bp2h5 would create a single-element-array dataset and attach the 
   attribute to it. This is a bug. However, since currently all bp file writing
   routines (including those in adios_posix, adios_mpi, and adios_mpi_cio) 
   write all vars before writing attributes, this bug is never touched. 


TODO:
1. Since HDF5 provides a rich set of data types, the mapping of ADIOS data 
   types to HDF5 data types is not deterministic. Currently the mapping is 
   hard-coded, but it may need to be more flexible. 

2. More careful error checking and handling.

Usage:

bp2h5:
    Convert a bp file to h5 file.

USAGE: bp2h5 [OPTION] bp_file [h5_file]

    bp2h5 converts an bp file nameed by bp_file to a h5 file named by h5_file.
    If h5_file is not specified, the generated h5 file is named by the basename
    of bp_file suffixed by ".h5".

OPTION:
    -c config_file, --config=config_file
        (Optional) Specify the XML config file which defines ADIOS groups in bp
         file. If not specified, the default is "./config.xml"
    --scalar_as_array
        (Optional) Write a scalar variable or attribute in a single-element
        array. If not specified, a scalar variable/attribute is written in a
        scalar dataspace.
    -V, --verbose
        (Optional) Print detailed information during conversion.
    -h, --help
        (Optional) Print usage information and exit.



