1
1

ROMIO 3.1.4 refresh: apply post romio-3.1.4 patches

Этот коммит содержится в:
Gilles Gouaillardet 2015-04-30 18:56:53 +09:00
родитель 6400bc75ab
Коммит 92f6c7c1e2
9 изменённых файлов: 60 добавлений и 22 удалений

Просмотреть файл

@ -8,11 +8,6 @@
* Copyright (C) 2008 Sun Microsystems, Lustre group
*/
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include <stdlib.h>

Просмотреть файл

@ -121,6 +121,7 @@ void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count,
}
/* --END ERROR HANDLING-- */
#ifdef HAVE_MPI_GREQUEST_EXTENSIONS
/* posted. defered completion */
if (ret == 0) {
if (ADIOI_PVFS2_greq_class == 0) {
@ -132,6 +133,15 @@ void ADIOI_PVFS2_AIO_contig(ADIO_File fd, void *buf, int count,
MPIX_Grequest_class_allocate(ADIOI_PVFS2_greq_class, aio_req, request);
memcpy(&(aio_req->req), request, sizeof(*request));
}
#else
/* if generalized request extensions not available, we will have to process
* this operation right here */
int error;
ret = PVFS_sys_wait(aio_req->op_id, "ADIOI_PVFS2_AIO_Contig", &error);
if (ret == 0) {
MPIO_Completed_request_create(&fd, len, error_code, request);
}
#endif
/* immediate completion */
if (ret == 1) {

Просмотреть файл

@ -8,11 +8,6 @@
#ifndef AD_XFS_INCLUDE
#define AD_XFS_INCLUDE
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>

Просмотреть файл

@ -6,11 +6,6 @@
*/
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include "adio.h"

Просмотреть файл

@ -6,11 +6,6 @@
*/
#ifdef _STDC_C99
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#include <unistd.h>
#include "adio.h"

Просмотреть файл

@ -8,7 +8,6 @@
#include <adio.h>
#include <limits.h>
/* utility function for creating large contiguous types: algorithim from BigMPI
* https://github.com/jeffhammond/BigMPI */
@ -105,6 +104,35 @@ int ADIOI_Type_create_hindexed_x(int count,
return ret;
}
/* some systems do not have pread/pwrite, or requrie XOPEN_SOURCE set higher
* than we would like. see #1973 */
#if (HAVE_DECL_PWRITE == 0)
#include <sys/types.h>
#include <unistd.h>
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
off_t lseek_ret;
lseek_ret = lseek(fd, offset, SEEK_SET);
if (lseek_ret == -1)
return lseek_ret;
return (read(fd, buf, count));
}
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) {
off_t lseek_ret;
lseek_ret = lseek(fd, offset, SEEK_SET);
if (lseek_ret == -1)
return lseek_ret;
return (write(fd, buf, count));
}
#endif
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/

Просмотреть файл

@ -916,3 +916,10 @@ void *ADIOI_IO_Thread_Func(void *vptr_args);
#endif
#if (HAVE_DECL_PWRITE == 0)
#include <sys/types.h>
#include <unistd.h>
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
#endif

Просмотреть файл

@ -1476,6 +1476,14 @@ if test "$ac_cv_header_unistd_h" = "yes" ; then
fi
fi
# pread and pwrite are useful to ROMIO: if implemented well, they help us avoid
# an extra system call. But --enable-strict or CFLAGS="--std=c99" does not
# expose this feature. If we define XOPEN_SOURCE in ROMIO, we cause headaches
# for some versions of lustre, quota.h, and caddr_t. see if we need to provide
# our own pread/pwrite
AC_CHECK_DECLS([pwrite])
####################################################################
# We're about to mess with CC etc. No more feature tests past here,

Просмотреть файл

@ -36,7 +36,12 @@
of correct programs */
#define MPIU_THREAD_CS_ENTER(x,y)
#define MPIU_THREAD_CS_EXIT(x,y)
#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) do {} while (0)
/* The MPI_DATATYPE_ISCOMMITTED macro now always sets err_=0.
This is an optimistic approach for Open MPI, but it is likely other
upper layers already checked the datatype was committed.
Not setting err_ is incorrect since it can lead to use of
uninitialized variable.*/
#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) do { err_ = 0; } while (0)
#ifdef HAVE_WINDOWS_H
#define MPIU_UNREFERENCED_ARG(a) a
#else