Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
7cd4c204
Commit
7cd4c204
authored
Oct 23, 2015
by
Thomas Jahns
🤸
Browse files
Remove stream member vlistIDorig no longer used.
parent
11934e31
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
7cd4c204
...
...
@@ -317,8 +317,6 @@ void streamDefVlist(int streamID, int vlistID);
/* streamInqVlist: Get the Vlist of a stream */
int
streamInqVlist
(
int
streamID
);
/* PIO: */
int
streamInqVlistIDorig
(
int
streamID
);
/* streamInqFiletype: Get the filetype */
int
streamInqFiletype
(
int
streamID
);
...
...
src/cdi.inc
View file @
7cd4c204
...
...
@@ -539,13 +539,6 @@
!
(
INTEGER
streamID
)
EXTERNAL
streamInqVlist
!
!
PIO
:
!
INTEGER
streamInqVlistIDorig
!
(
INTEGER
streamID
)
EXTERNAL
streamInqVlistIDorig
INTEGER
streamInqFiletype
!
(
INTEGER
streamID
)
EXTERNAL
streamInqFiletype
...
...
src/cdiFortran.c
View file @
7cd4c204
...
...
@@ -119,10 +119,6 @@ FCALLSCSUB1 (streamClose, STREAMCLOSE, streamclose, INT)
FCALLSCSUB1
(
streamSync
,
STREAMSYNC
,
streamsync
,
INT
)
FCALLSCSUB2
(
streamDefVlist
,
STREAMDEFVLIST
,
streamdefvlist
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
streamInqVlist
,
STREAMINQVLIST
,
streaminqvlist
,
INT
)
/* PIO: */
FCALLSCFUN1
(
INT
,
streamInqVlistIDorig
,
STREAMINQVLISTIDORIG
,
streaminqvlistidorig
,
INT
)
FCALLSCFUN1
(
INT
,
streamInqFiletype
,
STREAMINQFILETYPE
,
streaminqfiletype
,
INT
)
FCALLSCSUB2
(
streamDefByteorder
,
STREAMDEFBYTEORDER
,
streamdefbyteorder
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
streamInqByteorder
,
STREAMINQBYTEORDER
,
streaminqbyteorder
,
INT
)
...
...
src/cdi_int.h
View file @
7cd4c204
...
...
@@ -254,7 +254,6 @@ typedef struct {
#else
void
*
gribContainers
;
#endif
int
vlistIDorig
;
/* only used by MPI-parallelized version of library */
int
ownerRank
;
// MPI rank of owner process
...
...
@@ -346,7 +345,7 @@ void streamDefineTaxis(int streamID);
int
streamsNewEntry
(
int
filetype
);
void
streamsInitEntry
(
int
streamID
);
void
cdiStreamSetupVlist
(
stream_t
*
streamptr
,
int
vlistID
,
int
vlistIDorig
);
void
cdiStreamSetupVlist
(
stream_t
*
streamptr
,
int
vlistID
);
int
stream_new_var
(
stream_t
*
streamptr
,
int
gridID
,
int
zaxisID
,
int
tilesetID
);
int
tstepsNewEntry
(
stream_t
*
streamptr
);
...
...
@@ -403,7 +402,7 @@ char *cdiUnescapeSpaces(const char *string, const char **outStringEnd);
struct
streamAssoc
{
int
streamID
,
vlistID
,
vlistIDorig
;
int
streamID
,
vlistID
;
};
struct
streamAssoc
...
...
src/mo_cdi.f90
View file @
7cd4c204
...
...
@@ -231,7 +231,6 @@ module mo_cdi
public
::
streamSync
public
::
streamDefVlist
public
::
streamInqVlist
public
::
streamInqVlistIDorig
public
::
streamInqFiletype
public
::
streamDefByteorder
public
::
streamInqByteorder
...
...
@@ -753,13 +752,6 @@ module mo_cdi
integer
(
c_int
)
::
f_result
end
function
streamInqVlist
function
streamInqVlistIDorig
(
streamID_dummy
)
bind
(
c
,
name
=
&
&
'streamInqVlistIDorig'
)
result
(
f_result
)
import
c_int
integer
(
c_int
),
value
::
streamID_dummy
integer
(
c_int
)
::
f_result
end
function
streamInqVlistIDorig
function
streamInqFiletype
(
streamID_dummy
)
bind
(
c
,
name
=
&
&
'streamInqFiletype'
)
result
(
f_result
)
import
c_int
...
...
src/resource_handle.c
View file @
7cd4c204
...
...
@@ -428,31 +428,6 @@ void *reshGetValue(const char * caller, const char* expressionString, cdiResH re
return
reshGetElem
(
caller
,
expressionString
,
resH
,
ops
)
->
res
.
v
.
val
;
}
int
reshEntryExists
(
cdiResH
resH
,
const
resOps
*
ops
)
{
int
nsp
;
namespaceTuple_t
nspT
;
listElem_t
*
listElem
=
NULL
;
xassert
(
ops
);
LIST_INIT
(
1
);
LIST_LOCK
();
nsp
=
namespaceGetActive
();
nspT
=
namespaceResHDecode
(
resH
);
LIST_UNLOCK
();
int
found
=
0
;
if
(
nspT
.
nsp
==
nsp
&&
nspT
.
idx
<
resHList
[
nsp
].
size
)
listElem
=
resHList
[
nsp
].
resources
+
nspT
.
idx
;
LIST_UNLOCK
();
if
(
listElem
&&
(
listElem
->
res
.
v
.
ops
==
ops
)
)
found
=
1
;
return
found
;
}
/**************************************************************/
void
reshGetResHListOfType
(
unsigned
numIDs
,
int
resHs
[],
const
resOps
*
ops
)
...
...
src/resource_handle.h
View file @
7cd4c204
...
...
@@ -62,9 +62,6 @@ unsigned reshCountType(const resOps *resTypeOps);
void
*
reshGetValue
(
const
char
*
caller
,
const
char
*
expressionString
,
cdiResH
id
,
const
resOps
*
ops
);
#define reshGetVal(resH, ops) reshGetValue(__func__, #resH, resH, ops)
int
reshEntryExists
(
cdiResH
id
,
const
resOps
*
ops
);
#define reshExists(resH, ops) reshEntryExists(resH, ops)
void
reshGetResHListOfType
(
unsigned
numIDs
,
int
IDs
[],
const
resOps
*
ops
);
enum
cdiApplyRet
{
...
...
src/resource_unpack.c
View file @
7cd4c204
...
...
@@ -92,8 +92,6 @@ int reshUnpackResources(char * unpackBuffer, int unpackBufferSize,
{
cdiStreamSetupVlist
(
stream_to_pointer
(
associations
[
i
].
streamID
),
namespaceAdaptKey
(
associations
[
i
].
vlistID
,
originNamespace
),
namespaceAdaptKey
(
associations
[
i
].
vlistIDorig
,
originNamespace
));
}
Free
(
associations
);
...
...
src/stream.c
View file @
7cd4c204
...
...
@@ -868,7 +868,6 @@ void streamDefaultValue ( stream_t * streamptr )
for
(
i
=
0
;
i
<
MAX_GRIDS_PS
;
i
++
)
streamptr
->
ncavarID
[
i
]
=
CDI_UNDEFID
;
streamptr
->
gribContainers
=
NULL
;
streamptr
->
vlistIDorig
=
CDI_UNDEFID
;
}
...
...
@@ -1047,15 +1046,6 @@ void streamClose(int streamID)
vlistDestroy
(
vlistID
);
/* decrease lock counter of the original vlist by 1 */
if
(
streamptr
->
vlistIDorig
!=
CDI_UNDEFID
)
{
/* Note: Here we have to check if the original vlist still
* exists. If, for example, the garbage collection routine
* reshListDestruct takes care of the destruction of objects,
* then the original vlist might have been destroyed
* beforehand. */
if
(
reshExists
(
streamptr
->
vlistIDorig
,
&
vlistOps
)
!=
0
)
vlist_unlock
(
streamptr
->
vlistIDorig
);
}
}
stream_delete_entry
(
streamptr
);
...
...
@@ -2035,7 +2025,7 @@ cdiStreamDefVlist_(int streamID, int vlistID)
stream_check_ptr
(
__func__
,
streamptr
);
if
(
streamptr
->
vlistID
==
CDI_UNDEFID
)
cdiStreamSetupVlist
(
streamptr
,
vlistDuplicate
(
vlistID
)
,
vlistID
);
cdiStreamSetupVlist
(
streamptr
,
vlistDuplicate
(
vlistID
));
else
Warning
(
"vlist already defined for %s!"
,
streamptr
->
filename
);
}
...
...
@@ -2066,16 +2056,6 @@ int streamInqVlist(int streamID)
}
int
streamInqVlistIDorig
(
int
streamID
)
{
stream_t
*
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
return
(
streamptr
->
vlistIDorig
);
}
void
streamDefCompType
(
int
streamID
,
int
comptype
)
{
stream_t
*
streamptr
=
stream_to_pointer
(
streamID
);
...
...
@@ -2161,19 +2141,11 @@ int streamTxCode(void)
}
void
cdiStreamSetupVlist
(
stream_t
*
streamptr
,
int
vlistID
,
int
vlistIDorig
)
void
cdiStreamSetupVlist
(
stream_t
*
streamptr
,
int
vlistID
)
{
int
nvars
=
vlistNvars
(
vlistID
);
streamptr
->
vlistID
=
vlistID
;
streamptr
->
vlistIDorig
=
vlistIDorig
;
/* increase lock counter of the original vlist by 1 */
if
(
CDI_Debug
)
Message
(
"attach vlist=%d to stream, stream vlist=%d"
,
vlistIDorig
,
vlistID
);
vlist_lock
(
vlistIDorig
);
vlist_unlock
(
vlistID
);
// why is this vlistID sometimes locked?
// without this line "cdo splitmon" gives
// Destroying of a locked object (vlistID=xx) failed
for
(
int
varID
=
0
;
varID
<
nvars
;
varID
++
)
{
int
gridID
=
vlistInqVarGrid
(
vlistID
,
varID
);
...
...
@@ -2234,8 +2206,6 @@ static int streamCompareP(void * streamptr1, void * streamptr2)
xassert
(
s2
);
if
(
s1
->
filetype
!=
s2
->
filetype
)
return
differ
;
if
(
namespaceAdaptKey2
(
s1
->
vlistIDorig
)
!=
namespaceAdaptKey2
(
s2
->
vlistIDorig
))
return
differ
;
if
(
s1
->
byteorder
!=
s2
->
byteorder
)
return
differ
;
if
(
s1
->
comptype
!=
s2
->
comptype
)
return
differ
;
if
(
s1
->
complevel
!=
s2
->
complevel
)
return
differ
;
...
...
@@ -2311,11 +2281,10 @@ void streamPrintP ( void * streamptr, FILE * fp )
fprintf
(
fp
,
"ztype = %d
\n
"
,
sp
->
comptype
);
fprintf
(
fp
,
"zlevel = %d
\n
"
,
sp
->
complevel
);
fprintf
(
fp
,
"// void **gribContainers;
\n
"
);
fprintf
(
fp
,
"vlistIDorig = %d
\n
"
,
sp
->
vlistIDorig
);
}
enum
{
streamNint
=
1
1
,
streamNint
=
1
0
,
};
static
int
...
...
@@ -2339,17 +2308,16 @@ streamPack(void * streamptr, void * packBuffer, int packBufferSize,
stream_t
*
streamP
=
(
stream_t
*
)
streamptr
;
int
intBuffer
[
streamNint
];
intBuffer
[
0
]
=
streamP
->
self
;
intBuffer
[
1
]
=
streamP
->
filetype
;
intBuffer
[
2
]
=
(
int
)
strlen
(
streamP
->
filename
)
+
1
;
intBuffer
[
3
]
=
streamP
->
vlistID
;
intBuffer
[
4
]
=
streamP
->
vlistIDorig
;
intBuffer
[
5
]
=
streamP
->
byteorder
;
intBuffer
[
6
]
=
streamP
->
comptype
;
intBuffer
[
7
]
=
streamP
->
complevel
;
intBuffer
[
8
]
=
streamP
->
unreduced
;
intBuffer
[
9
]
=
streamP
->
sortname
;
intBuffer
[
10
]
=
streamP
->
have_missval
;
intBuffer
[
0
]
=
streamP
->
self
;
intBuffer
[
1
]
=
streamP
->
filetype
;
intBuffer
[
2
]
=
(
int
)
strlen
(
streamP
->
filename
)
+
1
;
intBuffer
[
3
]
=
streamP
->
vlistID
;
intBuffer
[
4
]
=
streamP
->
byteorder
;
intBuffer
[
5
]
=
streamP
->
comptype
;
intBuffer
[
6
]
=
streamP
->
complevel
;
intBuffer
[
7
]
=
streamP
->
unreduced
;
intBuffer
[
8
]
=
streamP
->
sortname
;
intBuffer
[
9
]
=
streamP
->
have_missval
;
serializePack
(
intBuffer
,
streamNint
,
DATATYPE_INT
,
packBuffer
,
packBufferSize
,
packBufferPos
,
context
);
uint32_t
d
=
cdiCheckSum
(
DATATYPE_INT
,
streamNint
,
intBuffer
);
...
...
@@ -2385,14 +2353,14 @@ streamUnpack(char * unpackBuffer, int unpackBufferSize,
int
targetStreamID
=
namespaceAdaptKey
(
intBuffer
[
0
],
originNamespace
),
streamID
=
streamOpenID
(
filename
,
'w'
,
intBuffer
[
1
],
targetStreamID
);
xassert
(
streamID
>=
0
&&
targetStreamID
==
streamID
);
streamDefByteorder
(
streamID
,
intBuffer
[
5
]);
streamDefCompType
(
streamID
,
intBuffer
[
6
]);
streamDefCompLevel
(
streamID
,
intBuffer
[
7
]);
streamDefByteorder
(
streamID
,
intBuffer
[
4
]);
streamDefCompType
(
streamID
,
intBuffer
[
5
]);
streamDefCompLevel
(
streamID
,
intBuffer
[
6
]);
stream_t
*
streamptr
=
stream_to_pointer
(
streamID
);
streamptr
->
unreduced
=
intBuffer
[
8
];
streamptr
->
sortname
=
intBuffer
[
9
];
streamptr
->
have_missval
=
intBuffer
[
10
];
struct
streamAssoc
retval
=
{
streamID
,
intBuffer
[
3
]
,
intBuffer
[
4
]
};
streamptr
->
unreduced
=
intBuffer
[
7
];
streamptr
->
sortname
=
intBuffer
[
8
];
streamptr
->
have_missval
=
intBuffer
[
9
];
struct
streamAssoc
retval
=
{
streamID
,
intBuffer
[
3
]
};
return
retval
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment