Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
f2782a95
Commit
f2782a95
authored
9 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Add option to switch uuid generation on/off.
parent
bf584c07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tests/deco2d_model.c
+2
-0
2 additions, 0 deletions
tests/deco2d_model.c
tests/pio_write.c
+14
-4
14 additions, 4 deletions
tests/pio_write.c
tests/pio_write.h
+1
-1
1 addition, 1 deletion
tests/pio_write.h
tests/simple_model.c
+2
-0
2 additions, 0 deletions
tests/simple_model.c
with
19 additions
and
5 deletions
tests/deco2d_model.c
+
2
−
0
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
)
...
...
This diff is collapsed.
Click to expand it.
tests/pio_write.c
+
14
−
4
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'
:
{
...
...
This diff is collapsed.
Click to expand it.
tests/pio_write.h
+
1
−
1
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
;
};
...
...
This diff is collapsed.
Click to expand it.
tests/simple_model.c
+
2
−
0
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment