OP2/OP2-Common — pull request #52 by gihanmudalige (2012-11-22 09:46:49+00:00)
Title: Rebased/output dat to file

This pull request implements a number of routines supporting the querying of an op_dat (usually for checking the solution of an application).

1. void op_print_dat_to_txtfile(op_dat dat, const char *file_name) - write the op_dat dat to an ASCI file
2. void op_print_dat_to_binfile(op_dat dat, const char *file_name) - writes the op_dat dat to a binary file

3. void op_fetch_data ( op_dat dat, T* usr_ptr) - copies the op_dat dat's data in OP2 space to a user defined memory block. Under MPI (without hdf5) this will copy the blocks of data held by each mpi process from OP2 space to user space.

3. op_fetch_data_hdf5(op_dat, T* usr_ptr, int low, int high) - to be used with hdf5 file I/O only, copies op_dat dat's data within the given number of elements, from low to high (inclusive) from OP2 space to a user defined memory block. Under MPI (with hdf5) all the processes will hold the same data block(i.e. after an all_gather)

4. op_fetch_data_hdf52(op_dat dat , const char *file_name) - to be used with hdf5 file I/O only, writes the op_dat dat to an hdf5 file given by file_name. If file does not exists, it is created. If file exists, searches for the an hdf5 data space defining this op_dat in the file. If op_dat data space is not found, it creates an hdf5 data space for dat and writes the dat to file. Else, the existing op_dat in hdf5 file is updated.