Commit 1e384fd4 authored by Rob Latham's avatar Rob Latham
Browse files

[svn-r2944] well here we go... after languishing for a year and a change of revision

control systems, dust off the old zoidfs branch and commit to trunk
- simple, unoptimized  ad_zoidfs driver
- initial cut of "file system features"
parent 0acce8c3
......@@ -823,6 +823,28 @@ EOF
fi
rm -f conftest mpitest.c
])dnl
define(PAC_TEST_MPIU_FUNCS,[
AC_MSG_CHECKING(support for MPICH2 memory macros)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
#include "stdio.h"
main(Int argc, char **argv)
{
MPIU_Free(NULL);
}
EOF
rm -f conftest
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPIU_FUNCS,1,[Define if MPICH2 memory tracing macros defined])
else
AC_MSG_RESULT(no)
fi
rm -f conftest mpitest.c
])dnl
dnl
define(PAC_TEST_MPI_GREQUEST,[
AC_MSG_CHECKING(support for generalized requests)
rm -f mpitest.c
......@@ -841,7 +863,8 @@ EOF
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPI_GREQUEST,,[Define if generalized requests avaliable])
AC_DEFINE(HAVE_MPI_GREQUEST,1,[Define if generalized requests avaliable])
DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1"
else
AC_MSG_RESULT(no)
fi
......
......@@ -12,6 +12,7 @@
struct ADIOI_Fns_struct ADIO_NFS_operations = {
ADIOI_NFS_Open, /* Open */
ADIOI_FAILSAFE_OpenColl, /* OpenColl */
ADIOI_NFS_ReadContig, /* ReadContig */
ADIOI_NFS_WriteContig, /* WriteContig */
ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
......
......@@ -33,4 +33,5 @@ struct ADIOI_Fns_struct ADIO_PIOFS_operations = {
ADIOI_GEN_Flush, /* Flush */
ADIOI_GEN_Resize, /* Resize */
ADIOI_GEN_Delete, /* Delete */
ADIOI_PIOFS_Feature,
};
......@@ -35,4 +35,6 @@ void ADIOI_PIOFS_WriteStrided(ADIO_File fd, void *buf, int count,
*error_code);
void ADIOI_PIOFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
void ADIOI_PIOFS_Feature(ADIO_File fd, int flag);
#endif
int ADIOI_PIOFS_Features(int flag)
{
switch(flag) {
case ADIO_LOCKS:
case ADIO_SHARED_FP:
case ADIO_ATOMIC_MODE:
case ADIO_DATA_SIEVING_WRITES:
case ADIO_SCALABLE_OPEN:
default:
return 0;
break;
}
}
......@@ -12,6 +12,7 @@
struct ADIOI_Fns_struct ADIO_PVFS2_operations = {
ADIOI_PVFS2_Open, /* Open */
ADIOI_SCALABLE_OpenColl, /* OpenColl */
ADIOI_PVFS2_ReadContig, /* ReadContig */
ADIOI_PVFS2_WriteContig, /* WriteContig */
ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
......@@ -33,6 +34,7 @@ struct ADIOI_Fns_struct ADIO_PVFS2_operations = {
ADIOI_PVFS2_Flush, /* Flush */
ADIOI_PVFS2_Resize, /* Resize */
ADIOI_PVFS2_Delete, /* Delete */
ADIOI_PVFS2_Feature,
};
/*
......
......@@ -37,6 +37,8 @@ void ADIOI_PVFS2_Flush(ADIO_File fd, int *error_code);
void ADIOI_PVFS2_Delete(char *filename, int *error_code);
void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
int ADIOI_PVFS2_Feature(ADIO_File fd, int flag);
void ADIOI_PVFS2_IReadContig(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, MPI_Request *request,
......
int ADIOI_PVFS2_Features(int flag)
{
switch(flag) {
case ADIOI_SHARED_FILE_PTR:
case ADIOI_NEEDS_LOCKING:
case ADIOI_SEQUENTIAL:
default:
return 0;
}
}
......@@ -12,6 +12,7 @@
struct ADIOI_Fns_struct ADIO_TESTFS_operations = {
ADIOI_TESTFS_Open, /* Open */
ADIOI_GEN_OpenColl, /* OpenColl */
ADIOI_TESTFS_ReadContig, /* ReadContig */
ADIOI_TESTFS_WriteContig, /* WriteContig */
ADIOI_TESTFS_ReadStridedColl, /* ReadStridedColl */
......
......@@ -12,6 +12,7 @@
struct ADIOI_Fns_struct ADIO_UFS_operations = {
ADIOI_UFS_Open, /* Open */
ADIOI_GEN_OpenColl, /* OpenColl */
ADIOI_GEN_ReadContig, /* ReadContig */
ADIOI_GEN_WriteContig, /* WriteContig */
ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
......@@ -38,4 +39,5 @@ struct ADIOI_Fns_struct ADIO_UFS_operations = {
ADIOI_GEN_Flush, /* Flush */
ADIOI_GEN_Resize, /* Resize */
ADIOI_GEN_Delete, /* Delete */
ADIOI_GEN_Feature, /* Features */
};
CC = @CC@
AR = @AR@
RANLIB = @RANLIB@
LIBNAME = @LIBNAME@
srcdir = @srcdir@
CC_SHL = @CC_SHL@
SHLIBNAME = @SHLIBNAME@
INCLUDE_DIR = -I@MPI_INCLUDE_DIR@ -I${srcdir}/../include -I../include -I../../include -I${srcdir}/../../../../include -I../../../../include
CFLAGS = @CPPFLAGS@ @CFLAGS@ $(INCLUDE_DIR)
top_builddir = @master_topbuild_dir@
LIBTOOL = @LIBTOOL@
C_COMPILE_SHL = $(CC_SHL)
@VPATH@
AD_ZOIDFS_OBJECTS = ad_zoidfs.o ad_zoidfs_close.o ad_zoidfs_common.o \
ad_zoidfs_delete.o ad_zoidfs_fcntl.o ad_zoidfs_flush.o \
ad_zoidfs_io.o ad_zoidfs_open.o ad_zoidfs_resize.o
default: $(LIBNAME)
@if [ "@ENABLE_SHLIB@" != "none" ] ; then \
$(MAKE) $(SHLIBNAME).la ;\
fi
.SUFFIXES: $(SUFFIXES) .p .lo
.c.o:
$(CC) $(CFLAGS) -c $<
.c.lo:
$(C_COMPILE_SHL) $(CFLAGS) -c $< -o _s$*.o
@mv -f _s$*.o $*.lo
$(LIBNAME): $(AD_ZOIDFS_OBJECTS)
$(AR) $(LIBNAME) $(AD_ZOIDFS_OBJECTS)
$(RANLIB) $(LIBNAME)
AD_ZOIDFS_LOOBJECTS=$(AD_ZOIDFS_OBJECTS:.o=.lo)
$(SHLIBNAME).la: $(AD_ZOIDFS_LOOBJECTS)
$(AR) $(SHLIBNAME).la $(AD_ZOIDFS_LOOBJECTS)
coverage:
-@for file in ${AD_ZOIDFS_OBJECTS:.o=.c} ; do \
gcov -b -f $$file ; done
clean:
@rm -f *.o *.lo *.gcno *.gcda *.bb *.bbg
@rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda
@rm -f ${srcdir}/*.bb ${srcdir}/*.bbg
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
* Copyright (C) 2003 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#include "ad_zoidfs.h"
/* adioi.h has the ADIOI_Fns_struct define */
#include "adioi.h"
struct ADIOI_Fns_struct ADIO_ZOIDFS_operations = {
ADIOI_ZOIDFS_Open, /* Open */
ADIOI_SCALABLE_OpenColl, /* OpenColl */
ADIOI_ZOIDFS_ReadContig, /* ReadContig */
ADIOI_ZOIDFS_WriteContig, /* WriteContig */
ADIOI_GEN_ReadStridedColl, /* ReadStridedColl */
ADIOI_GEN_WriteStridedColl, /* WriteStridedColl */
ADIOI_GEN_SeekIndividual, /* SeekIndividual */
ADIOI_ZOIDFS_Fcntl, /* Fcntl */
ADIOI_GEN_SetInfo, /* SetInfo */
ADIOI_GEN_ReadStrided, /* ReadStrided */
ADIOI_GEN_WriteStrided, /* WriteStrided */
ADIOI_ZOIDFS_Close, /* Close */
ADIOI_FAKE_IreadContig, /* IreadContig */
ADIOI_FAKE_IwriteContig, /* IwriteContig */
ADIOI_FAKE_IODone, /* ReadDone */
ADIOI_FAKE_IODone, /* WriteDone */
ADIOI_FAKE_IOComplete, /* ReadComplete */
ADIOI_FAKE_IOComplete, /* WriteComplete */
ADIOI_FAKE_IreadStrided, /* IreadStrided */
ADIOI_FAKE_IwriteStrided, /* IwriteStrided */
ADIOI_ZOIDFS_Flush, /* Flush */
ADIOI_ZOIDFS_Resize, /* Resize */
ADIOI_ZOIDFS_Delete, /* Delete */
ADIOI_ZOIDFS_Feature,
};
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
* Copyright (C) 1997 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#ifndef AD_ZOIDFS_INCLUDE
#define AD_ZOIDFS_INCLUDE
#include "adio.h"
#ifdef HAVE_ZOIDFS_H
#include "zoidfs.h"
#endif
typedef zoidfs_handle_t ADIOI_ZOIDFS_object;
void ADIOI_ZOIDFS_Open(ADIO_File fd, int *error_code);
void ADIOI_ZOIDFS_Close(ADIO_File fd, int *error_code);
void ADIOI_ZOIDFS_ReadContig(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
void ADIOI_ZOIDFS_WriteContig(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
void ADIOI_ZOIDFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct, int
*error_code);
void ADIOI_ZOIDFS_WriteStrided(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
void ADIOI_ZOIDFS_ReadStrided(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code);
void ADIOI_ZOIDFS_Delete(char *filename, int *error_code);
void ADIOI_ZOIDFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
void ADIOI_ZOIDFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
int ADIOI_ZOIDFS_Feature(ADIO_File fd, int flag);
#endif
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
* Copyright (C) 1997 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#include "ad_zoidfs.h"
void ADIOI_ZOIDFS_Close(ADIO_File fd, int *error_code)
{
ADIOI_Free(fd->fs_ptr);
fd->fs_ptr = NULL;
/* At some point or another it was decided that ROMIO would not
* explicitly flush (other than any local cache) on close, because
* there is no way to *avoid* that overhead if you implement it here
* and don't actually want it.
*/
*error_code = MPI_SUCCESS;
}
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (C) 2003 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#include "ad_zoidfs.h"
#include "ad_zoidfs_common.h"
#include <unistd.h>
#include <sys/types.h>
#include <time.h>
/* keyval hack to both tell us if we've already initialized zoidfs and also
* close it down when mpi exits */
int ADIOI_ZOIDFS_Initialized = MPI_KEYVAL_INVALID;
void ADIOI_ZOIDFS_End(int *error_code)
{
int ret;
static char myname[] = "ADIOI_ZOIDFS_END";
ret = zoidfs_finalize();
/* --BEGIN ERROR HANDLING-- */
if (ret != 0 ) {
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE,
myname, __LINE__,
ADIOI_zoidfs_error_convert(ret),
"Error in zoidfs_finalize", 0);
return;
}
/* --END ERROR HANDLING-- */
*error_code = MPI_SUCCESS;
}
int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval,
void *attribute_val, void *extra_state)
{
int error_code;
ADIOI_ZOIDFS_End(&error_code);
return error_code;
}
void ADIOI_ZOIDFS_Init(int rank, int *error_code )
{
int ret;
static char myname[] = "ADIOI_ZOIDFS_INIT";
/* do nothing if we've already fired up the zoidfs interface */
if (ADIOI_ZOIDFS_Initialized != MPI_KEYVAL_INVALID) {
*error_code = MPI_SUCCESS;
return;
}
ret = zoidfs_init();
if (ret < 0 ) {
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE,
myname, __LINE__,
ADIOI_ZOIDFS_error_convert(ret),
"Error in zoidfs_init",
0);
return;
}
MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_ZOIDFS_End_call,
&ADIOI_ZOIDFS_Initialized, (void *)0);
/* just like romio does, we make a dummy attribute so we
* get cleaned up */
MPI_Attr_put(MPI_COMM_WORLD, ADIOI_ZOIDFS_Initialized, (void *)0);
}
void ADIOI_ZOIDFS_makeattribs(zoidfs_sattr_t * attribs)
{
struct timeval now;
memset(attribs, 0, sizeof(zoidfs_sattr_t));
attribs->mask = ZOIDFS_ATTR_SETABLE;
attribs->mode = 0644;
attribs->uid = getuid();
attribs->gid = getgid();
gettimeofday(&now, NULL);
attribs->atime.seconds = now.tv_sec;
attribs->atime.useconds = now.tv_usec;
attribs->mtime.seconds = now.tv_sec;
attribs->mtime.useconds = now.tv_usec;
}
int ADIOI_ZOIDFS_error_convert(int error)
{
return MPI_UNDEFINED;
}
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/
/* -*- Mode: C; c-basic-offset:4 ; -*-
* vim: ts=8 sts=4 sw=4 noexpandtab
*
* Copyright (C) 1997 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#ifndef _AD_ZOIDFS_COMMON_H
#define _AD_ZOIDFS_COMMON_H
#include "ad_zoidfs.h"
void ADIOI_ZOIDFS_Init(int rank, int *error_code );
void ADIOI_ZOIDFS_makeattribs(zoidfs_sattr_t * attribs);
void ADIOI_ZOIDFS_End(int *error_code);
int ADIOI_ZOIDFS_End_call(MPI_Comm comm, int keyval,
void *attribute_val, void *extra_state);
int ADIOI_ZOIDFS_error_convert(int error);
#endif
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
* Copyright (C) 2003 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#include "ad_zoidfs.h"
#include "adio.h"
#include "ad_zoidfs_common.h"
void ADIOI_ZOIDFS_Delete(char *filename, int *error_code)
{
int ret;
static char myname[] = "ADIOI_ZOIDFS_DELETE";
ADIOI_ZOIDFS_Init(0, error_code);
/* --BEGIN ERROR HANDLING-- */
if (*error_code != MPI_SUCCESS)
{
/* ADIOI_ZOIDFS_INIT handles creating error codes itself */
return;
}
/* --END ERROR HANDLING-- */
ret = zoidfs_remove(NULL, NULL, filename, NULL);
/* --BEGIN ERROR HANDLING-- */
if (ret != ZFS_OK) {
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE,
myname, __LINE__,
ADIOI_ZOIDFS_error_convert(ret),
"Error in zoidfs_remove", 0);
return;
}
/* --END ERROR HANDLING-- */
*error_code = MPI_SUCCESS;
return;
}
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
* Copyright (C) 1997 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#include "ad_zoidfs.h"
#include "adio_extern.h"
#include "ad_zoidfs_common.h"
void ADIOI_ZOIDFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct,
int *error_code)
{
int ret;
zoidfs_attr_t attr;
ADIOI_ZOIDFS_object *zoidfs_obj_ptr;
static char myname[] = "ADIOI_ZOIDFS_FCNTL";
zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr;
switch(flag) {
case ADIO_FCNTL_GET_FSIZE:
ret = zoidfs_getattr(zoidfs_obj_ptr, &attr);
if ( !(attr.mask & ZOIDFS_ATTR_SIZE) || (ret != ZFS_OK ) ) {
/* --BEGIN ERROR HANDLING-- */
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE,
myname, __LINE__,
ADIOI_ZOIDFS_error_convert(ret),
"Error in zoidfs_getattr", 0);
/* --END ERROR HANDLING-- */
}
else {
*error_code = MPI_SUCCESS;
}
fcntl_struct->fsize = attr.size;
return;
case ADIO_FCNTL_SET_DISKSPACE:
ADIOI_GEN_Prealloc(fd, fcntl_struct->diskspace, error_code);
break;
/* --BEGIN ERROR HANDLING-- */
case ADIO_FCNTL_SET_ATOMICITY:
default:
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE,
myname, __LINE__,
MPI_ERR_ARG,
"**flag", "**flag %d", flag);
/* --END ERROR HANDLING-- */
}
}
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/
int ADIOI_ZOIDFS_Features(int flag)
{
case ADIOI_NEEDS_LOCKING:
case ADIOI_SHARED_FP:
case ADIOI_ATOMIC:
default:
return 0;
break;
}
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
* Copyright (C) 1997 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/
#include "ad_zoidfs.h"
#include "ad_zoidfs_common.h"
/* we want to be a bit clever here: at scale, if every client sends a
* flush request, it will stress the file system with redundant
* commit requests. Instead, one process should wait for
* everyone to catch up, do the sync, then broadcast the result.
*/
void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code)
{
int ret, rank, dummy=0, dummy_in=0;
ADIOI_ZOIDFS_object *zoidfs_obj_ptr;
static char myname[] = "ADIOI_ZOIDFS_FLUSH";
*error_code = MPI_SUCCESS;
zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr;
MPI_Comm_rank(fd->comm, &rank);
/* collective call to ensure no outstanding write requests. reduce is
* slightly less expensvie than barrier */
MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM,
fd->hints->ranklist[0], fd->comm);
if (rank == fd->hints->ranklist[0]) {
ret = zoidfs_commit(zoidfs_obj_ptr);
}
MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
/* --BEGIN ERROR HANDLING-- */
if (ret != 0) {
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE,
myname, __LINE__,
ADIOI_ZOIDFS_error_convert(ret),
"Error in zoidfs_commit", 0);
}
/* --END ERROR HANDLING-- */
}
/*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment