File: bm_utils.h

package info (click to toggle)
netcdf-parallel 1%3A4.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 113,164 kB
  • sloc: ansic: 267,893; sh: 12,869; cpp: 5,822; yacc: 2,613; makefile: 1,813; lex: 1,216; xml: 173; awk: 2
file content (99 lines) | stat: -rw-r--r-- 2,438 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
/*********************************************************************
 *   Copyright 2018, UCAR/Unidata
 *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
 *********************************************************************/

#ifndef BM_UTILS_H
#define BM_UTILS_H

#include "config.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include "zincludes.h"

#undef DEBUG

/* Define the getopt tags */
#define OPT_UNKNOWN 0
#define OPT_TREEDEPTH 1
#define OPT_NGROUPS 2
#define OPT_NGROUPATTRS 3
#define OPT_NDIMS 4
#define OPT_NTYPES 5
#define OPT_NVARS 6
#define OPT_VARRANK 7
#define OPT_NVARATTRS 8
#define OPT_FORMAT 9
#define OPT_PATH 10
#define OPT_FILE 11
#define OPT_X 12
#define OPT_DEBUG 13
#define OPT_DIMS 14
#define OPT_CHUNKS 15
#define OPT_CACHEFACTOR 16
#define OPT_CACHESIZE 17
#define OPT_DEFLATELEVEL 18
#define OPT_WDEBUG 19
#define OPT_URL 20
#define OPT_READONLY 21
#define OPT_WRITEONLY 22

#define X_OPT_MATCH 1

extern struct BMOptions {
    int format;
    char* filename;
    char* url;
    char* path; /* as sent to e.g. nc_create() */
    char* pathtemplate;
    int xvalue;
    NCZM_IMPL impl;
    int debug;
    int wdebug;
    int readonly;
    int writeonly;
    struct BMMeta {
	int treedepth;
	int ngroups;
	int ngroupattrs;
	int ndims;
	int ntypes;
	int nvars;
	int varrank;
	int nvarattrs;
	size_t cachefactor;
	size_t cachesize;
	struct IntList {
	    int count;
   	    size_t* list;
	} dims;
	struct IntList chunks;
	int deflatelevel;
    } meta;
    struct X {
	int sync;
    } x;
} bmoptions;

#define NCCHECK(expr) nccheck((expr),__LINE__)

EXTERNL int bm_buildpath(struct BMOptions*);
EXTERNL int bm_getoptions(int* argcp, char*** argvp, struct BMOptions*);
EXTERNL void bm_clearoptions(struct BMOptions*);
EXTERNL const char* formatname(const struct BMOptions*);
EXTERNL void bm_reportoptions(struct BMOptions* o);
EXTERNL void bm_reportmetaoptions(struct BMMeta* o);
EXTERNL const char* bm_printvector(int rank, const size_t* vec);
EXTERNL const char* bm_printvectorp(int rank, const ptrdiff_t* vec);
EXTERNL const char* bm_varasprint(int rank, const size_t* start, const size_t* edges, const ptrdiff_t* stride);
EXTERNL int nc4_buildpath(struct BMOptions* o, char** pathp);
EXTERNL void reportoptions(struct BMOptions* o);
EXTERNL void reportmetaoptions(struct BMMeta* o);
EXTERNL void clearoptions(struct BMOptions*);

#include "ut_test.h"

#endif /*BM_UTILS_H*/