Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
f2782a95
Commit
f2782a95
authored
Oct 27, 2015
by
Thomas Jahns
🤸
Browse files
Add option to switch uuid generation on/off.
parent
bf584c07
Changes
4
Hide whitespace changes
Inline
Side-by-side
tests/deco2d_model.c
View file @
f2782a95
...
...
@@ -148,6 +148,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
lats
[
i
]
=
((
double
)(
i
*
180
))
/
nlat
-
90
.
0
;
gridDefXvals
(
gridID
,
lons
);
gridDefYvals
(
gridID
,
lats
);
if
(
setup
.
create_uuid
)
{
unsigned
char
uuid
[
CDI_UUID_SIZE
];
if
(
rank
==
0
)
...
...
@@ -197,6 +198,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
=
zaxisCreate
(
ZAXIS_PRESSURE
,
varDesc
[
varIdx
].
nlev
);
zaxisDefLevels
(
varDesc
[
varIdx
].
zaxisID
,
levs
);
}
if
(
setup
.
create_uuid
)
{
unsigned
char
uuid
[
16
];
if
(
rank
==
0
)
...
...
tests/pio_write.c
View file @
f2782a95
...
...
@@ -34,7 +34,7 @@ static const struct model_config default_setup
#else
=
{
.
nlon
=
12
,
.
nts
=
3
,
.
nlat
=
6
,
.
nvars
=
5
,
.
filetype
=
FILETYPE_GRB
,
.
datatype
=
DATATYPE_PACK24
,
.
compute_checksum
=
1
,
.
compute_checksum
=
1
,
.
create_uuid
=
0
,
.
suffix
=
"grb"
,
.
max_nlev
=
5
,
};
...
...
@@ -96,11 +96,13 @@ parse_unsignedarg(const char msg[])
typedef
int
(
*
pioRoleFunc
)(
MPI_Comm
commSuper
,
int
IOMode
,
int
nProcsIO
);
static
void
parse_long_option
(
int
pioConfHandle
,
pioRoleFunc
*
pioRoleAssign
,
parse_long_option
(
struct
model_config
*
restrict
setup
,
int
pioConfHandle
,
pioRoleFunc
*
pioRoleAssign
,
const
char
*
str
)
{
static
const
char
cacheRedistStr
[]
=
"cache-redists"
,
pioRoleSchemeOptionStr
[]
=
"pio-role-scheme"
;
pioRoleSchemeOptionStr
[]
=
"pio-role-scheme"
,
uuidCreateOptionStr
[]
=
"no-create-uuid"
;
if
(
!
strncmp
(
str
,
cacheRedistStr
,
sizeof
(
cacheRedistStr
)
-
1
))
{
#ifdef USE_MPI
...
...
@@ -144,6 +146,14 @@ parse_long_option(int pioConfHandle, pioRoleFunc *pioRoleAssign,
pioRoleSchemeOptionStr
);
#endif
}
else
if
(
!
strcmp
(
str
,
uuidCreateOptionStr
+
3
))
{
setup
->
create_uuid
=
true
;
}
else
if
(
!
strcmp
(
str
,
uuidCreateOptionStr
))
{
setup
->
create_uuid
=
false
;
}
else
invalidOptionDie
(
"unknown long option: %s
\n
"
,
str
);
}
...
...
@@ -222,7 +232,7 @@ int main(int argc, char *argv[])
break
;
#endif
case
'q'
:
parse_long_option
(
pioConfHandle
,
&
pioRoleAssign
,
optarg
);
parse_long_option
(
&
setup
,
pioConfHandle
,
&
pioRoleAssign
,
optarg
);
break
;
case
'f'
:
{
...
...
tests/pio_write.h
View file @
f2782a95
...
...
@@ -11,7 +11,7 @@ struct model_config
{
int
nlon
,
nlat
,
nts
,
max_nlev
,
nvars
;
int
filetype
,
datatype
;
bool
compute_checksum
;
bool
compute_checksum
,
create_uuid
;
const
char
*
suffix
;
};
...
...
tests/simple_model.c
View file @
f2782a95
...
...
@@ -116,6 +116,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
lats
[
i
]
=
((
double
)(
i
*
180
))
/
nlat
-
90
.
0
;
gridDefXvals
(
gridID
,
lons
);
gridDefYvals
(
gridID
,
lats
);
if
(
setup
.
create_uuid
)
{
unsigned
char
uuid
[
CDI_UUID_SIZE
];
if
(
rank
==
0
)
...
...
@@ -165,6 +166,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
=
zaxisCreate
(
ZAXIS_PRESSURE
,
varDesc
[
varIdx
].
nlev
);
zaxisDefLevels
(
varDesc
[
varIdx
].
zaxisID
,
levs
);
}
if
(
setup
.
create_uuid
)
{
unsigned
char
uuid
[
16
];
if
(
rank
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment