Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e6eeee7
the AD_LOGFS work
drieskimpe Dec 10, 2008
3ba85d3
Update LogFS to match modern romio, fix bugs
roblatham00 Apr 11, 2016
edd6d74
better memory management; address valgrind messages
roblatham00 Apr 27, 2016
510dd02
bug: clever fs-detection struct missed a few fs
roblatham00 Jun 1, 2016
fea903a
bug fix: large requests were only being partially processed
roblatham00 Jun 8, 2016
c81065b
tunable for log replay buffer
roblatham00 Jun 8, 2016
b7cf4ec
actually set file view in prefix (logfs:) case
roblatham00 Jun 28, 2016
b8babbe
rewrite typehelper_calcrange
roblatham00 Jun 28, 2016
d0aecf4
omit seek-to-byte for logfs
roblatham00 Jun 29, 2016
b0e96f4
logfs: atomiticy: return error instead of abort
roblatham00 Jul 1, 2016
56d9557
simplify non-blocking read
roblatham00 Jul 1, 2016
c72acf8
correct offset handling
roblatham00 Jul 1, 2016
16d46b4
do something reasonable with null values
roblatham00 Jul 12, 2016
22acf97
honor user-provided permissions
roblatham00 Jul 12, 2016
8e435c5
logfs delete: actually delete the file
roblatham00 Jul 13, 2016
46e1aa4
logfs: more helpful error handling
roblatham00 Jul 13, 2016
25975b6
shared file pointers won't work yet
roblatham00 Jul 13, 2016
22e602e
relax permissions on logfs files
roblatham00 Jul 13, 2016
9680f94
logfs: coll_test uncovered a case where indep needed
roblatham00 Jul 13, 2016
60a4efc
a standalone log file reader
roblatham00 Jul 14, 2016
75e8639
bug fix for types with non-zero lower bound
roblatham00 Jul 20, 2016
cb840f4
fix bug in logfs file view
roblatham00 Jul 21, 2016
3a4c042
move range tree into common code
roblatham00 Jul 22, 2016
415004a
whooops: move that outside of an include guard
roblatham00 Nov 3, 2016
9b7e205
use ADIOI_Type_create_hindexed_x in place of MPI_Type_indexed in case…
khou2020 Apr 26, 2018
492d9c3
change error code init form -1 to -2 in src/mpi/romio/adio/ad_lustre/…
khou2020 Dec 29, 2017
94fffa8
fix rtree sorting the wrong node at rtree.c:720; The problem caused r…
khou2020 May 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mpi/romio/adio/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ include $(top_srcdir)/adio/ad_pvfs2/Makefile.mk
include $(top_srcdir)/adio/ad_testfs/Makefile.mk
include $(top_srcdir)/adio/ad_ufs/Makefile.mk
include $(top_srcdir)/adio/ad_xfs/Makefile.mk
include $(top_srcdir)/adio/ad_logfs/Makefile.mk
include $(top_srcdir)/adio/common/Makefile.mk

45 changes: 45 additions & 0 deletions src/mpi/romio/adio/ad_logfs/ADIO_DESIGN
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
* Independent vs collective open

LogFS cannot reuse the existing file handle, since it is unable to set the view
in a reliable way from an independent call. (Which could be needed for example, if an
independent replay is needed)

For now this would work, since ADIO_Set_view only modifies some AD_File variables;
However, for the new two phase, if I'm not mistaken, their was some communication on
set_view to precalculate some data.

The real questions:
1° Is ADIOI_Set_view collective or not? (in ALL ADIO drivers?)
2° What about independent open? What about a replay on a CPU that didn't yet open the
file?


* Difficult (for the layering):
ADIO_Open doesn't have the MPI_Info even though MPI_File_open has it;
-> at open time the info is not available; only afterwards set_info
is called

* Strange:
-> ADIOI_xxx_SetInfo is called BEFORE ADIOI_xxxx_Open is called!
annoying, because ADIOI_xxx_Open can allocate the
fs_ptr structure (which might be used to store the hints)
however, it is only allocated on ADIOI_xxx_Open!

As a consequence, FS-specific data has to be in the general
ADIO_Fd structure (See union in ADIOI_Hints_strict );

Also, not calling ADIOI_Gen_SetInfo makes open crash
(because hints->cb_config_list remains 0 and ADIOI_cb_config_list_parse
assumes it is not 0 )

* Uses_generic_read | write

-> should use properties / flags / ... instead of function addrs



* data sieving:
For example, adio_open ("shared" function)
plays with access_mode (lies about it) just to be able to do data sieving
-> means that PVFS2 files in wr-only mode are also always openend in rdwr
mode, even though not needed
45 changes: 45 additions & 0 deletions src/mpi/romio/adio/ad_logfs/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## -*- Mode: Makefile; -*-
## vim: set ft=automake :
##
## (C) 2011 by Argonne National Laboratory.
## See COPYRIGHT in top-level directory.
##

if BUILD_AD_LOGFS

AM_CPPFLAGS += -I$(top_srcdir)/adio/ad_logfs

noinst_HEADERS += adio/ad_logfs/ad_logfs_common.h\
adio/ad_logfs/ad_logfs.h\
adio/ad_logfs/logfs_file.h\
adio/ad_logfs/logfs.h\
adio/ad_logfs/logfs_info.h\
adio/ad_logfs/logfs_rtree.h\
adio/ad_logfs/logfs_user.h\
adio/ad_logfs/rtree_config.h

romio_other_sources += adio/ad_logfs/ad_logfs.c \
adio/ad_logfs/ad_logfs_close.c \
adio/ad_logfs/ad_logfs_common.c\
adio/ad_logfs/ad_logfs_delete.c \
adio/ad_logfs/ad_logfs_done.c\
adio/ad_logfs/ad_logfs_fcntl.c\
adio/ad_logfs/ad_logfs_flush.c\
adio/ad_logfs/ad_logfs_getsh.c\
adio/ad_logfs/ad_logfs_hints.c\
adio/ad_logfs/ad_logfs_iread.c\
adio/ad_logfs/ad_logfs_iwrite.c\
adio/ad_logfs/ad_logfs_open.c\
adio/ad_logfs/ad_logfs_rdcoll.c \
adio/ad_logfs/ad_logfs_read.c\
adio/ad_logfs/ad_logfs_resize.c\
adio/ad_logfs/ad_logfs_seek.c\
adio/ad_logfs/ad_logfs_setsh.c\
adio/ad_logfs/ad_logfs_wait.c\
adio/ad_logfs/ad_logfs_wrcoll.c\
adio/ad_logfs/ad_logfs_write.c\
adio/ad_logfs/logfs.c\
adio/ad_logfs/logfs_file.c\
adio/ad_logfs/logfs_rtree.c\
adio/ad_logfs/ad_logfs_features.c
endif BUILD_AD_LOGFS
9 changes: 9 additions & 0 deletions src/mpi/romio/adio/ad_logfs/PROBLEMS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* how to deal with delete? file is not open, so no view can be set, so we
cannot override the delete function to delete the logfiles too...


* multiple opens
-> share logfiles?



42 changes: 42 additions & 0 deletions src/mpi/romio/adio/ad_logfs/ad_logfs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* $Id: ad_logfs.c,v 1.2 2002/10/24 17:01:03 gropp Exp $
*
* Copyright (C) 2001 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/

#include "ad_logfs.h"

/* adioi.h has the ADIOI_Fns_struct define */
#include "adioi.h"

struct ADIOI_Fns_struct ADIO_LOGFS_operations = {
ADIOI_LOGFS_Open, /* Open */
ADIOI_GEN_OpenColl, /* OpenColl */
ADIOI_LOGFS_ReadContig, /* ReadContig */
ADIOI_LOGFS_WriteContig, /* WriteContig */
ADIOI_LOGFS_ReadStridedColl, /* ReadStridedColl */
ADIOI_LOGFS_WriteStridedColl, /* WriteStridedColl */
ADIOI_LOGFS_SeekIndividual, /* SeekIndividual */
ADIOI_LOGFS_Fcntl, /* Fcntl */
ADIOI_LOGFS_SetInfo, /* SetInfo */
ADIOI_LOGFS_ReadStrided, /* ReadStrided */
ADIOI_LOGFS_WriteStrided, /* WriteStrided */
ADIOI_LOGFS_Close, /* Close */
ADIOI_LOGFS_IreadContig, /* IreadContig */
ADIOI_LOGFS_IwriteContig, /* IwriteContig */
ADIOI_GEN_IODone, /* ReadDone */
ADIOI_GEN_IODone, /* WriteDone */
ADIOI_GEN_IOComplete, /* ReadComplete */
ADIOI_GEN_IOComplete, /* WriteComplete */
ADIOI_LOGFS_IreadStrided, /* IreadStrided */
ADIOI_LOGFS_IwriteStrided, /* IwriteStrided */
ADIOI_LOGFS_Flush, /* Flush */
ADIOI_LOGFS_Resize, /* Resize */
ADIOI_LOGFS_Delete, /* Delete */
ADIOI_LOGFS_Feature, /* Features */
"LOGFS: logging layer for ROMIO drivers",
ADIOI_GEN_IreadStridedColl, /* IreadStridedColl */
ADIOI_GEN_IwriteStridedColl /* IwriteStridedColl */
};
82 changes: 82 additions & 0 deletions src/mpi/romio/adio/ad_logfs/ad_logfs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* $Id: ad_testfs.h,v 1.2 2002/10/24 17:01:03 gropp Exp $
*
* Copyright (C) 2001 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/

#ifndef AD_LOGFS_INCLUDE
#define AD_LOGFS_INCLUDE

#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <fcntl.h>
#include "adio.h"

void ADIOI_LOGFS_Open(ADIO_File fd, int *error_code);
void ADIOI_LOGFS_Close(ADIO_File fd, int *error_code);
void ADIOI_LOGFS_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_LOGFS_WriteContig(ADIO_File fd, const void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status * status, int
*error_code);
void ADIOI_LOGFS_IwriteContig(ADIO_File fd, const void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request * request, int
*error_code);
void ADIOI_LOGFS_IreadContig(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request * request, int
*error_code);
int ADIOI_LOGFS_ReadDone(ADIO_Request * request, ADIO_Status * status, int
*error_code);
int ADIOI_LOGFS_WriteDone(ADIO_Request * request, ADIO_Status * status, int
*error_code);
void ADIOI_LOGFS_ReadComplete(ADIO_Request * request, ADIO_Status * status, int
*error_code);
void ADIOI_LOGFS_WriteComplete(ADIO_Request * request, ADIO_Status * status, int *error_code);
void ADIOI_LOGFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t * fcntl_struct, int *error_code);
void ADIOI_LOGFS_WriteStrided(ADIO_File fd, const void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status * status, int *error_code);
void ADIOI_LOGFS_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_LOGFS_WriteStridedColl(ADIO_File fd, const void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status * status, int
*error_code);
void ADIOI_LOGFS_ReadStridedColl(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_LOGFS_IreadStrided(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request * request, int
*error_code);
void ADIOI_LOGFS_IwriteStrided(ADIO_File fd, const void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request * request, int
*error_code);
void ADIOI_LOGFS_Flush(ADIO_File fd, int *error_code);
void ADIOI_LOGFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
ADIO_Offset ADIOI_LOGFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
int whence, int *error_code);
void ADIOI_LOGFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
void ADIOI_LOGFS_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset * shared_fp, int *error_code);
void ADIOI_LOGFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code);
void ADIOI_LOGFS_Delete(const char *filename, int *error_code);


void ADIOI_LOGFS_Set_slave(ADIO_File fd, ADIOI_Fns * slaveops);

int ADIOI_LOGFS_Feature(ADIO_File fd, int flag);


#endif
32 changes: 32 additions & 0 deletions src/mpi/romio/adio/ad_logfs/ad_logfs_close.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* $Id: ad_testfs_close.c,v 1.2 2002/10/24 17:01:03 gropp Exp $
*
* Copyright (C) 2001 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*/

#include "ad_logfs.h"
#include "adioi.h"
#include "layered.h"
#include "logfs.h"



void ADIOI_LOGFS_Close(ADIO_File fd, int *error_code)
{
int standalone;

standalone = logfs_standalone(fd);

/* deactivate logfs ;
* If replay_on_close is set, there will first be a replay */
logfs_deactivate(fd);

*error_code = MPI_SUCCESS;

/* layering (if any) is disabled in logfs_deactivate
* so we just need to call the close function of the slave */
if (!standalone)
fd->fns->ADIOI_xxx_Close(fd, error_code);
}
94 changes: 94 additions & 0 deletions src/mpi/romio/adio/ad_logfs/ad_logfs_common.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#include <string.h>
#include <assert.h>
#include "adio.h"
#include "adioi.h"
#include "ad_logfs_common.h"

int ad_logfs_checkbool(const char *buf)
{
if (!buf || !buf[0])
return 0;
ADIOI_Strlower((char *) buf);

if (!strcmp(buf, "1"))
return 1;
if (!strcmp(buf, "true"))
return 1;

return 0;
}


int ad_logfs_hint_bool(MPI_Info info, const char *key, int *val)
{
int flag;
char buf[255];

if (info == MPI_INFO_NULL)
return 0;

MPI_Info_get(info, (char *) key, sizeof(buf) - 1, &buf[0], &flag);
if (!flag)
return 0;

*val = ad_logfs_checkbool(buf);
return 1;
}

int ad_logfs_hint_int(MPI_Info info, const char *key, int *val)
{
int flag;
char buf[255];

if (info == MPI_INFO_NULL)
return 0;

MPI_Info_get(info, (char *) key, sizeof(buf) - 1, &buf[0], &flag);
if (!flag)
return 0;

*val = atoi(buf);
return 1;
}

int ad_logfs_hint_str(MPI_Info info, const char *key, char **str)
{
int flag;
char buf[255];

if (info == MPI_INFO_NULL)
return 0;

MPI_Info_get(info, (char *) key, sizeof(buf) - 1, &buf[0], &flag);
if (!flag)
return 0;

if (*str)
ADIOI_Free(*str);

*str = ADIOI_Strdup(buf);

return 1;
}

void ad_logfs_hint_set_bool(MPI_Info info, const char *key, int val)
{
assert(info != MPI_INFO_NULL);
MPI_Info_set(info, (char *) key, (val ? "true" : "false"));
}

void ad_logfs_hint_set_int(MPI_Info info, const char *key, int val)
{
assert(info != MPI_INFO_NULL);
char buf[255];
snprintf(buf, sizeof(buf) - 1, "%i", val);
MPI_Info_set(info, (char *) key, buf);
}

/* if 'str' is NULL, info won't be set and key will not exist in info object */
void ad_logfs_hint_set_str(MPI_Info info, const char *key, const char *str)
{
assert(info != MPI_INFO_NULL);
if (str != NULL)
MPI_Info_set(info, (char *) key, (char *) str);
}
22 changes: 22 additions & 0 deletions src/mpi/romio/adio/ad_logfs/ad_logfs_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef AD_LOGFS_COMMON_H
#define AD_LOGFS_COMMON_H

/* Check str for TRUE, true, 1, ... ; Return the bool value of the string
* contents */
int ad_logfs_checkbool(const char *str);


/* return true if the hint was set; if so, adjust val */
int ad_logfs_hint_bool(MPI_Info info, const char *key, int *val);

int ad_logfs_hint_int(MPI_Info info, const char *key, int *val);

int ad_logfs_hint_str(MPI_Info info, const char *key, char **str);


/* Setting hints */
void ad_logfs_hint_set_bool(MPI_Info info, const char *key, int val);
void ad_logfs_hint_set_int(MPI_Info info, const char *key, int val);
void ad_logfs_hint_set_str(MPI_Info info, const char *key, const char *str);

#endif
Loading