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
56dc93cf
Commit
56dc93cf
authored
Nov 17, 2010
by
Deike Kleberg
Browse files
No commit message
No commit message
parent
8fb51fc8
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
56dc93cf
...
...
@@ -179,8 +179,7 @@ extern "C" {
/* deike */
/* parallel io types, A: asynchronous, B: blocking */
/*#ifndef NOMPI*/
#define PIO_NONE 0
#define PIO_MPI_NONB 1
#define PIO_POSIX_NONB 2
...
...
@@ -191,7 +190,6 @@ extern "C" {
int
pioInit
(
int
,
int
,
int
*
,
int
*
,
int
*
);
void
pioFinalize
(
void
);
/*#endif*/
/* CDI control routines */
...
...
src/make_cdilib
View file @
56dc93cf
...
...
@@ -46,8 +46,9 @@ cat > ${PROG} << EOR
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#ifndef _SX
#include <aio.h>
#endif
#include <stdbool.h>
#ifndef NOMPI
#include "mpi.h"
...
...
src/pio.c
View file @
56dc93cf
...
...
@@ -93,12 +93,12 @@ void checkMPIstat ( int iret, const char *filename, int line, int rank,
{
switch
(
status
->
MPI_ERROR
)
{
fprintf
(
std
out
,
"------- checking error in request ----------
\n
"
);
fprintf
(
std
err
,
"------- checking error in request ----------
\n
"
);
case
MPI_SUCCESS
:
fprintf
(
std
out
,
"-------- mpi_success -----------
\n
"
);
fprintf
(
std
err
,
"-------- mpi_success -----------
\n
"
);
break
;
case
MPI_ERR_PENDING
:
fprintf
(
std
out
,
"-------- mpi_err_pending ----------
\n
"
);
fprintf
(
std
err
,
"-------- mpi_err_pending ----------
\n
"
);
break
;
default:
MPI_Error_string
(
status
->
MPI_ERROR
,
errorString
,
&
len
);
...
...
@@ -166,9 +166,11 @@ size_t pioFileWrite ( int id, int tsId, const void *buffer, size_t len )
case
PIO_MPI_NONB
:
iret
=
fwMPINONB
(
id
,
tsId
,
buffer
,
len
);
break
;
#ifndef _SX
case
PIO_POSIX_ASYNCH
:
iret
=
fwPOSIXASYNCH
(
id
,
tsId
,
buffer
,
len
);
break
;
#endif
case
PIO_POSIX_FPGUARD_SENDRECV
:
iret
=
fwPOSIXFPGUARDSENDRECV
(
id
,
tsId
,
buffer
,
len
);
break
;
...
...
@@ -197,9 +199,11 @@ int pioFileClose ( int id )
case
PIO_MPI_NONB
:
iret
=
fcMPINONB
(
id
);
break
;
#ifndef _SX
case
PIO_POSIX_ASYNCH
:
iret
=
fcPOSIXASYNCH
(
id
);
break
;
#endif
case
PIO_POSIX_FPGUARD_SENDRECV
:
iret
=
fcPOSIXFPGUARDSENDRECV
(
id
);
break
;
...
...
@@ -228,9 +232,11 @@ int pioFileOpenW ( const char *filename )
case
PIO_MPI_NONB
:
iret
=
fowMPINONB
(
filename
);
break
;
#ifndef _SX
case
PIO_POSIX_ASYNCH
:
iret
=
fowPOSIXASYNCH
(
filename
);
break
;
#endif
case
PIO_POSIX_FPGUARD_SENDRECV
:
iret
=
fowPOSIXFPGUARDSENDRECV
(
filename
);
break
;
...
...
@@ -276,15 +282,14 @@ void setPioCommunicator ( MPI_Comm *myComm, MPI_Comm commF2C, int *color,
if
(
myHost
[
0
]
==
'\0'
)
errorPIO
(
"did not succeed to set hostname"
,
__FILE__
,
__LINE__
,
rank
);
if
(
ddebug
)
{
strncpy
(
hostname
,
myHost
,
len
);
hostname
[
len
]
=
'\0'
;
fprintf
(
std
out
,
"pe%d: myHost = %s
\n
"
,
rank
,
hostname
);
fprintf
(
std
err
,
"pe%d: myHost = %s
\n
"
,
rank
,
hostname
);
}
allHosts
=
(
char
**
)
xmalloc
(
size
*
sizeof
(
char
*
));
allHosts
[
0
]
=
(
char
*
)
xmalloc
(
size
*
MPI_MAX_PROCESSOR_NAME
*
sizeof
(
char
));
...
...
@@ -329,7 +334,7 @@ void setPioCommunicator ( MPI_Comm *myComm, MPI_Comm commF2C, int *color,
free
(
myHost
);
if
(
ddebug
)
fprintf
(
std
out
,
fprintf
(
std
err
,
"pe%d in setPioCommunicator, color=%d, before return
\n
"
,
rank
,
*
color
);
...
...
@@ -342,32 +347,38 @@ void setPioCommunicator ( MPI_Comm *myComm, MPI_Comm commF2C, int *color,
int
pioInit
(
int
ptype
,
int
commF
,
int
*
color
,
int
*
nnodes
,
int
*
pioCollComm2F
)
{
#ifndef NOMPI
MPI_Comm
comm
;
int
size
,
rank
;
#endif
int
collectingData
=
1
;
*
nnodes
=
1
;
*
color
=
1
;
*
pioCollComm2F
=
0
;
#ifndef NOMPI
MPI_Comm
comm
;
int
size
,
rank
;
comm
=
MPI_COMM_NULL
;
if
((
comm
=
MPI_Comm_f2c
((
MPI_Fint
)
commF
))
==
NULL
)
errorPIO
(
"MPI_Comm_f2c didn't succeed"
,
__FILE__
,
__LINE__
,
-
1
);
MPI_Comm_set_errhandler
(
comm
,
MPI_ERRORS_RETURN
);
MPI_Comm_size
(
comm
,
&
size
);
MPI_Comm_rank
(
comm
,
&
rank
);
if
(
ptype
<
0
||
ptype
>
maxPtype
)
errorPIO
(
"PIOTYPE is no valid modus"
,
__FILE__
,
__LINE__
,
rank
);
#ifdef _SX
if
(
ptype
==
PIO_POSIX_ASYNCH
)
errorPIO
(
"PIO_POSIX_ASYNCH does not work on SX"
,
__FILE__
,
__LINE__
,
rank
);
#endif
pioinfo
=
(
pioInfo
*
)
xmalloc
(
sizeof
(
pioInfo
));
pioinfo
->
type
=
ptype
;
setPioCommunicator
(
&
(
pioinfo
->
comm
),
comm
,
color
,
nnodes
);
if
((
pioinfo
->
type
==
PIO_NONE
)
&&
(
*
nnodes
!=
size
))
...
...
@@ -378,13 +389,13 @@ int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F
MPI_Comm_size
(
pioinfo
->
comm
,
&
(
pioinfo
->
size
));
if
(
ddebug
&&
pioinfo
->
rank
==
0
)
fprintf
(
std
out
,
"pe%d in pio
DefPtype
(), ptype=%d, initial_buffersize=%ld: "
fprintf
(
std
err
,
"pe%d in pio
Init
(), ptype=%d, initial_buffersize=%ld: "
"after init pioinfo ...
\n
"
,
pioinfo
->
rank
,
pioinfo
->
type
,
initial_buffersize
);
pioinfo
->
collectorComm
=
MPI_COMM_NULL
;
switch
(
pioinfo
->
type
)
{
case
PIO_NONE
:
...
...
@@ -394,9 +405,11 @@ int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F
case
PIO_MPI_NONB
:
collectingData
=
initMPINONB
();
break
;
#ifndef _SX
case
PIO_POSIX_ASYNCH
:
collectingData
=
initPOSIXASYNCH
();
break
;
#endif
case
PIO_POSIX_FPGUARD_SENDRECV
:
collectingData
=
initPOSIXFPGUARDSENDRECV
();
break
;
...
...
@@ -406,19 +419,21 @@ int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F
case
PIO_POSIX_FPGUARD_THREAD_REFUSE
:
collectingData
=
initPOSIXFPGUARDTHREADREFUSE
();
break
;
case
PIO_POSIX_NONB
:
case
PIO_POSIX_NONB
:
collectingData
=
initPOSIXNONB
();
break
;
}
*
pioCollComm2F
=
0
;
if
((
*
pioCollComm2F
=
MPI_Comm_c2f
(
pioinfo
->
collectorComm
))
==
0
)
errorPIO
(
"MPI_Comm_c2f didn't succeed
\n
"
,
__FILE__
,
__LINE__
,
rank
);
/* ????? MPI_Comm_c2f hardwired to 0 ????
*pioCollComm2F = 0;
if (( *pioCollComm2F = MPI_Comm_c2f ( pioinfo->collectorComm ) == 0 )
errorPIO ( "MPI_Comm_c2f didn't succeed\n", __FILE__, __LINE__ , rank);
*/
*
pioCollComm2F
=
MPI_Comm_c2f
(
pioinfo
->
collectorComm
);
#endif
if
(
ddebug
)
fprintf
(
std
out
,
"pe in pioinit out
\n
"
);
fprintf
(
std
err
,
"pe in pioinit out
\n
"
);
return
collectingData
;
}
...
...
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