Skip to content
Snippets Groups Projects
Commit 93da5c16 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix protection of asynch I/O feature.

* NEC SX might not be the only platform without asynchronous I/O facilities.
* Also fix problem where the feature is available at compile time but
  not enabled at run-time.
parent 14c87152
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ cat > ${PROG} << EOR
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#ifndef _SX
#ifdef _POSIX_ASYNCHRONOUS_IO
#include <aio.h>
#endif
#include <stdbool.h>
......
......@@ -61,7 +61,7 @@ cat > ${PROG} << EOR
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#ifndef _SX
#ifdef _POSIX_ASYNCHRONOUS_IO
#include <aio.h>
#endif
#include <stdbool.h>
......
......@@ -6,6 +6,7 @@
#endif
#include <stdbool.h>
#include <unistd.h>
#include <mpi.h>
......@@ -109,7 +110,7 @@ void pioSendInitialize(void);
/* pio_posixasynch.c */
#ifndef _SX
#ifdef _POSIX_ASYNCHRONOUS_IO
void pioWriterAIO(void);
#endif
......
......@@ -7,6 +7,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <mpi.h>
#include <yaxt.h>
......@@ -478,10 +479,12 @@ cdiPioInit(MPI_Comm commGlob, int confResH, int *pioNamespace)
if ( IOMode < PIO_MINIOMODE || IOMode > PIO_MAXIOMODE )
xabort ( "IOMODE IS NOT VALID." );
#ifdef _SX
if ( IOMode == PIO_ASYNCH )
xabort ( "PIO_ASYNCH DOES NOT WORK ON SX." );
if (
#ifdef _POSIX_ASYNCHRONOUS_IO
!sysconf(_SC_ASYNCHRONOUS_IO) &&
#endif
IOMode == PIO_ASYNCH )
xabort ( "CDI-PIO Output method PIO_ASYNCH is unsupported on this system!" );
if ((xtInitByCDI = (!xt_initialized() || xt_finalized())))
xt_initialize(commGlob);
......@@ -564,9 +567,7 @@ cdiPioFileWritingInit(const struct cdiPioConf *conf)
case PIO_MPI:
initMPINONB();
break;
#ifndef _SX
case PIO_ASYNCH:
#endif
case PIO_WRITER:
pioSendInitialize();
break;
......
......@@ -7,8 +7,10 @@
#endif
#ifndef _SX
#include <unistd.h>
#ifdef _POSIX_ASYNCHRONOUS_IO
#include <aio.h>
#include <errno.h>
#include <fcntl.h>
......@@ -17,7 +19,6 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <mpi.h>
......
......@@ -4,6 +4,7 @@
#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
#include "cdipio.h"
#include "dmemory.h"
......@@ -313,9 +314,11 @@ pioSendInitialize(void)
case PIO_WRITER:
pioWriterStdIO();
break;
#ifdef _POSIX_ASYNCHRONOUS_IO
case PIO_ASYNCH:
pioWriterAIO();
break;
#endif
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment