~ubuntu-branches/ubuntu/vivid/adios/vivid-proposed

« back to all changes in this revision

Viewing changes to utils/bp2ascii/bp2ascii.c

  • Committer: Package Import Robot
  • Author(s): Alastair McKinstry
  • Date: 2014-06-16 23:06:38 UTC
  • mfrom: (15.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20140616230638-cxryhot6b8ge32l6
Tags: 1.7.0-1
* New upstream release.
* Add adios.pc pkgconfig file. adios_config now uses this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#include <stdio.h>
9
9
#include <stdlib.h>
10
10
#include <sys/types.h>
11
 
//#include "adios_types.h"
 
11
#include "adios_internals.h"
12
12
#include "adios_bp_v1.h"
13
13
#include "adios_read.h"
14
14
 
35
35
int main (int argc, char ** argv)
36
36
{
37
37
    char * filename;
38
 
    char * var;
39
38
    char newfilename [256];
40
39
    int i = 0;
41
40
    int rc = 0;
42
 
    uint64_t element_num = 0, element_count;
43
 
    struct adios_bp_element_struct * element = NULL;
44
41
    struct dump_struct dump;
45
42
 
46
43
    if (argv [1][0] && argv [1][0] == '-' && argc > 3)
94
91
    adios_parse_version (b, &version);
95
92
 
96
93
    struct adios_index_process_group_struct_v1 * pg_root = 0;
97
 
    struct adios_index_process_group_struct_v1 * pg = 0;
98
94
    struct adios_index_var_struct_v1 * vars_root = 0;
99
 
    struct adios_index_attribute_struct_v1 * attrs_root = 0;
 
95
    //struct adios_index_attribute_struct_v1 * attrs_root = 0;
100
96
 
101
97
    adios_posix_read_index_offsets (b);
102
98
    adios_parse_index_offsets_v1 (b);
118
114
    }
119
115
 
120
116
    uint64_t element_counts = vars_root->characteristics_count;
121
 
    struct adios_process_group_header_struct_v1 pg_header;
 
117
    //struct adios_process_group_header_struct_v1 pg_header;
122
118
    struct adios_var_header_struct_v1 var_header;
123
119
    struct adios_var_payload_struct_v1 var_payload;
124
120
    uint64_t offset, var_len;
163
159
        switch (var_header.type) {
164
160
            case adios_long_double:
165
161
                for (j=0; j<var_header.payload_size/16;j++) 
166
 
                    fprintf(outf, "%f ", *((long double*)var_payload.payload+j));
 
162
                    fprintf(outf, "%Lf ", *((long double*)var_payload.payload+j));
167
163
                    break;
168
164
            case adios_double:
169
165
                for (j=0; j<var_header.payload_size/8;j++) 
206
202
                    fprintf(outf, "%c ", *((char *)var_payload.payload+j));
207
203
                    break;
208
204
            case adios_string:
209
 
                    fprintf(outf, "%s ", var_payload.payload);
 
205
                    fprintf(outf, "%s ", (char *)var_payload.payload);
210
206
                    break;
211
207
            case adios_complex:
212
208
                for (j=0; j<(var_header.payload_size)/8;j++) 
216
212
                for (j=0; j<(var_header.payload_size)/16;j++) 
217
213
                    fprintf(outf, "%f + %fi", *((double *)var_payload.payload+2*j),*((double *)var_payload.payload+j*2+1));
218
214
                    break;
 
215
            case adios_unknown:
 
216
                    break;
219
217
         }        
220
218
         fprintf(outf,"\n");
221
219
    }
228
226
                      ,struct adios_process_group_header_struct_v1 * pg_header
229
227
                      )
230
228
{
231
 
    int i;
232
229
    struct adios_method_info_struct_v1 * m;
233
230
 
234
231
    printf ("Process Group: %llu\n", num);
267
264
}
268
265
void print_var_header (struct adios_var_header_struct_v1 * var_header)
269
266
{
270
 
    int i = 0;
271
267
    printf ("\t\tVar Name (ID): %s (%d)\n", var_header->name, var_header->id);
272
268
    printf ("\t\tVar Path: %s\n", var_header->path);
273
269
    printf ("\t\tDatatype: %s\n", adios_type_to_string_int (var_header->type));