File: adios_list_methods.c

package info (click to toggle)
adios 1.13.1-16
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,248 kB
  • sloc: ansic: 133,236; f90: 8,791; sh: 7,806; python: 7,480; xml: 3,793; makefile: 3,002; cpp: 2,340; java: 626; sed: 16; perl: 8
file content (107 lines) | stat: -rw-r--r-- 3,041 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
 * in the COPYING file in the top level directory of this source distribution.
 *
 * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
 */

/* ADIOS list_methods utility
 *  list available 
 *    write methods
 *    read methods
 *    transform methods
 *
 * This is a sequential program but compiled with MPI to use libadios.a
 */

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <getopt.h>
#include <errno.h>

#include <math.h>     // NAN
#include <libgen.h>   // basename
#include <regex.h>    // regular expression matching
#include <fnmatch.h>  // shell pattern matching

#ifdef WRITE
#include "public/adios.h"
#endif
#include "public/adios_read.h"
#include "public/adios_transform_methods.h"
#include "public/adios_query.h"


int main (int argc, char ** argv) {
    int  rank = 0, i;
#ifndef _NOMPI  // added only to enable compiling with Score-P and other libs substituting MPI 
    MPI_Comm comm = MPI_COMM_WORLD;
    MPI_Init(&argc,&argv);
    MPI_Comm_rank(comm,&rank);
#endif


#ifdef WRITE
    adios_init_noxml(MPI_COMM_WORLD);
#endif

#ifndef _NOMPI
    adios_read_init_method(ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, "");
#else
    adios_read_init_method(ADIOS_READ_METHOD_BP, 1, "");
#endif

    if(rank==0) {

#ifdef WRITE
    	printf ("Available write methods (in XML <method> element or in adios_select_method()):\n");
    	ADIOS_AVAILABLE_WRITE_METHODS * wm = adios_available_write_methods();
    	if (wm) {
    		for (i = 0; i < wm->nmethods; i++) {
    			printf("    \"%s\"\n", wm->name[i]);
    		}
    		adios_available_write_methods_free(wm);
    	}
#endif

        printf ("Available read methods (constants after #include \"adios_read.h\"):\n");
        ADIOS_AVAILABLE_READ_METHODS * rm = adios_available_read_methods();
        if (rm) {
        	for (i = 0; i < rm->nmethods; i++) {
        		printf("    %s (=%d)\n", rm->name[i], rm->methodID[i]);
        	}
        	adios_available_read_methods_free(rm);
        }

        printf ("Available data transformation methods (in XML transform tags in <var> elements):\n");
        ADIOS_AVAILABLE_TRANSFORM_METHODS * t = adios_available_transform_methods();
        if (t) {
            for (i=0; i<t->ntransforms; i++)
            {
                printf("    \"%s\"\t: %s\n",  t->name[i], t->description[i]);
            }
            adios_available_transform_methods_free(t);
        }


        printf ("Available query methods (in adios_query_set_method()):\n");
        ADIOS_AVAILABLE_QUERY_METHODS * qm = adios_available_query_methods();
        if (qm) {
        	for (i = 0; i < qm->nmethods; i++) {
        		printf("    %s (=%d)\n", qm->name[i], qm->methodID[i]);
        	}
        	adios_available_query_methods_free(qm);
        }
    }

#ifndef _NOMPI  // added only to enable compiling with Score-P and other libs substituting MPI 
    MPI_Barrier(comm);
    MPI_Finalize();
#endif
    return(0);
}