Skip to content
GitLab
Menu
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
6fb6e054
Commit
6fb6e054
authored
Jul 15, 2013
by
Thomas Jahns
🤸
Browse files
Move client-side streamOpen to pio_client.c.
parent
7cc363cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/pio.c
View file @
6fb6e054
...
...
@@ -142,35 +142,6 @@ int pioFileOpen(const char *filename, const char *mode)
/***************************************************************/
int
cdiPioStreamOpen
(
const
char
*
filename
,
const
char
*
filemode
,
int
filetype
,
stream_t
*
streamptr
,
int
recordBufIsToBeCreated
)
{
if
(
tolower
(
*
filemode
)
==
'w'
)
{
statusCode
nspStatus
=
namespaceInqResStatus
();
switch
(
nspStatus
)
{
case
STAGE_DEFINITION
:
break
;
case
STAGE_TIMELOOP
:
pioBufferFuncCall
(
STREAMOPEN
,
2
,
filename
,
filetype
);
break
;
case
STAGE_CLEANUP
:
xabort
(
"TRANSITION TO IO PROCESSES ALREADY FINISHED."
);
break
;
default:
xabort
(
"INTERNAL ERROR"
);
}
}
else
Error
(
"cdiPIO read support not implemented"
);
return
1
;
}
/***************************************************************/
void
backendInit
(
void
)
{
int
IOMode
=
commInqIOMode
();
...
...
src/pio.h
View file @
6fb6e054
...
...
@@ -18,9 +18,6 @@ int pioFileOpen(const char *filename, const char *mode);
int
pioFileClose
(
int
);
size_t
cdiPioFileWrite
(
int
fileID
,
const
void
*
restrict
buffer
,
size_t
len
,
int
tsID
);
int
cdiPioStreamOpen
(
const
char
*
filename
,
const
char
*
filemode
,
int
filetype
,
stream_t
*
streamptr
,
int
recordBufIsToBeCreated
);
#else
typedef
int
MPI_Comm
;
#endif
...
...
src/pio_client.c
View file @
6fb6e054
...
...
@@ -3,6 +3,8 @@
#endif
#ifdef USE_MPI
#include
<ctype.h>
#include
<yaxt.h>
#include
"namespace.h"
...
...
@@ -13,6 +15,33 @@
#include
"pio_rpc.h"
#include
"pio_util.h"
static
int
cdiPioClientStreamOpen
(
const
char
*
filename
,
const
char
*
filemode
,
int
filetype
,
stream_t
*
streamptr
,
int
recordBufIsToBeCreated
)
{
if
(
tolower
(
*
filemode
)
==
'w'
)
{
statusCode
nspStatus
=
namespaceInqResStatus
();
switch
(
nspStatus
)
{
case
STAGE_DEFINITION
:
break
;
case
STAGE_TIMELOOP
:
pioBufferFuncCall
(
STREAMOPEN
,
2
,
filename
,
filetype
);
break
;
case
STAGE_CLEANUP
:
xabort
(
"TRANSITION TO IO PROCESSES ALREADY FINISHED."
);
break
;
default:
xabort
(
"INTERNAL ERROR"
);
}
}
else
Error
(
"cdiPIO read support not implemented"
);
return
1
;
}
static
void
cdiPioClientStreamDefVlist_
(
int
streamID
,
int
vlistID
)
{
...
...
@@ -99,7 +128,7 @@ cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
int
callerCDINamespace
=
namespaceGetActive
();
pioNamespaceSetActive
(
*
pioNamespace_
);
serializeSetMPI
();
namespaceSwitchSet
(
NSSWITCH_STREAM_OPEN_BACKEND
,
cdiPioStreamOpen
);
namespaceSwitchSet
(
NSSWITCH_STREAM_OPEN_BACKEND
,
cdiPio
Client
StreamOpen
);
namespaceSwitchSet
(
NSSWITCH_STREAM_DEF_VLIST_
,
cdiPioClientStreamDefVlist_
);
namespaceSwitchSet
(
NSSWITCH_STREAM_WRITE_VAR_
,
cdiPioClientStreamWriteVar_
);
namespaceSwitchSet
(
NSSWITCH_STREAM_WRITE_VAR_CHUNK_
,
...
...
Write
Preview
Supports
Markdown
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