Skip to content

new fbtl using direct I/O #1290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 50 additions & 0 deletions ompi/mca/fbtl/directio/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008-2011 University of Houston. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).

if MCA_BUILD_ompi_fbtl_directio_DSO
component_noinst =
component_install = mca_fbtl_directio.la
else
component_noinst = libmca_fbtl_directio.la
component_install =
endif

mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_fbtl_directio_la_SOURCES = $(sources)
mca_fbtl_directio_la_LDFLAGS = -module -avoid-version

noinst_LTLIBRARIES = $(component_noinst)
libmca_fbtl_directio_la_SOURCES = $(sources)
libmca_fbtl_directio_la_LDFLAGS = -module -avoid-version

# Source files

sources = \
fbtl_directio.h \
fbtl_directio.c \
fbtl_directio_component.c \
fbtl_directio_preadv.c \
fbtl_directio_ipreadv.c \
fbtl_directio_pwritev.c \
fbtl_directio_ipwritev.c
94 changes: 94 additions & 0 deletions ompi/mca/fbtl/directio/fbtl_directio.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* These symbols are in a file by themselves to provide nice linker
* semantics. Since linkers generally pull in symbols by object fules,
* keeping these symbols as the only symbols in this file prevents
* utility programs such as "ompi_info" from having to import entire
* modules just to query their version and parameters
*/

#include "ompi_config.h"
#include "mpi.h"

#include <unistd.h>
#include <sys/uio.h>

#include "ompi/mca/fbtl/fbtl.h"
#include "ompi/mca/fbtl/directio/fbtl_directio.h"

/*
* *******************************************************************
* ************************ actions structure ************************
* *******************************************************************
*/
static mca_fbtl_base_module_1_0_0_t directio = {
mca_fbtl_directio_module_init, /* initalise after being selected */
mca_fbtl_directio_module_finalize, /* close a module on a communicator */
mca_fbtl_directio_preadv, /* blocking read */
NULL, /* non-blocking read */
mca_fbtl_directio_pwritev, /* blocking write */
NULL, /* non-blocking write */
NULL, /* module specific progress */
NULL /* free module specific data items on the request */
};
/*
* *******************************************************************
* ************************* structure ends **************************
* *******************************************************************
*/

int mca_fbtl_directio_component_init_query(bool enable_progress_threads,
bool enable_mpi_threads) {
/* Nothing to do */

return OMPI_SUCCESS;
}

struct mca_fbtl_base_module_1_0_0_t *
mca_fbtl_directio_component_file_query (mca_io_ompio_file_t *fh, int *priority) {
int fd_direct;
*priority = mca_fbtl_directio_priority;

memcpy (&fd_direct, &fh->f_fs_ptr, sizeof(int) );
if ( 0 < fd_direct &&
PVFS2 != fh->f_fstype) {
*priority = 100;
}

return &directio;
}

int mca_fbtl_directio_component_file_unquery (mca_io_ompio_file_t *file) {
/* This function might be needed for some purposes later. for now it
* does not have anything to do since there are no steps which need
* to be undone if this module is not selected */

return OMPI_SUCCESS;
}

int mca_fbtl_directio_module_init (mca_io_ompio_file_t *file) {

return OMPI_SUCCESS;
}


int mca_fbtl_directio_module_finalize (mca_io_ompio_file_t *file) {
return OMPI_SUCCESS;
}

69 changes: 69 additions & 0 deletions ompi/mca/fbtl/directio/fbtl_directio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/

#ifndef MCA_FBTL_DIRECTIO_H
#define MCA_FBTL_DIRECTIO_H

#include "ompi_config.h"
#include "ompi/mca/mca.h"
#include "ompi/mca/fbtl/fbtl.h"
#include "ompi/mca/io/ompio/io_ompio.h"
#include "ompi/mca/io/ompio/io_ompio_request.h"

extern int mca_fbtl_directio_priority;
#define FBTL_DIRECTIO_BLOCK_SIZE 4096
#define FBTL_DIRECTIO_MEMALIGN_SIZE 4096

BEGIN_C_DECLS

int mca_fbtl_directio_component_init_query(bool enable_progress_threads,
bool enable_mpi_threads);
struct mca_fbtl_base_module_1_0_0_t *
mca_fbtl_directio_component_file_query (mca_io_ompio_file_t *file, int *priority);
int mca_fbtl_directio_component_file_unquery (mca_io_ompio_file_t *file);

int mca_fbtl_directio_module_init (mca_io_ompio_file_t *file);
int mca_fbtl_directio_module_finalize (mca_io_ompio_file_t *file);

OMPI_MODULE_DECLSPEC extern mca_fbtl_base_component_2_0_0_t mca_fbtl_directio_component;
/*
* ******************************************************************
* ********* functions which are implemented in this module *********
* ******************************************************************
*/

ssize_t mca_fbtl_directio_preadv (mca_io_ompio_file_t *file );
ssize_t mca_fbtl_directio_pwritev (mca_io_ompio_file_t *file );
ssize_t mca_fbtl_directio_ipreadv (mca_io_ompio_file_t *file,
ompi_request_t *request);
ssize_t mca_fbtl_directio_ipwritev (mca_io_ompio_file_t *file,
ompi_request_t *request);

bool mca_fbtl_directio_progress ( mca_ompio_request_t *req);
void mca_fbtl_directio_request_free ( mca_ompio_request_t *req);

/*
* ******************************************************************
* ************ functions implemented in this module end ************
* ******************************************************************
*/

END_C_DECLS

#endif /* MCA_FBTL_DIRECTIO_H */
65 changes: 65 additions & 0 deletions ompi/mca/fbtl/directio/fbtl_directio_component.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2011 University of Houston. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* These symbols are in a file by themselves to provide nice linker
* semantics. Since linkers generally pull in symbols by object
* files, keeping these symbols as the only symbols in this file
* prevents utility programs such as "ompi_info" from having to import
* entire components just to query their version and parameters.
*/

#include "ompi_config.h"
#include "fbtl_directio.h"
#include "mpi.h"

/*
* Public string showing the fbtl directio component version number
*/
const char *mca_fbtl_directio_component_version_string =
"OMPI/MPI directio FBTL MCA component version " OMPI_VERSION;

int mca_fbtl_directio_priority = 10;

/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
mca_fbtl_base_component_2_0_0_t mca_fbtl_directio_component = {

/* First, the mca_component_t struct containing meta information
about the component itself */

.fbtlm_version = {
MCA_FBTL_BASE_VERSION_2_0_0,

/* Component name and version */
.mca_component_name = "directio",
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
OMPI_RELEASE_VERSION),
},
.fbtlm_data = {
/* This component is checkpointable */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
.fbtlm_init_query = mca_fbtl_directio_component_init_query, /* get thread level */
.fbtlm_file_query = mca_fbtl_directio_component_file_query, /* get priority and actions */
.fbtlm_file_unquery = mca_fbtl_directio_component_file_unquery, /* undo what was done by previous function */
};
36 changes: 36 additions & 0 deletions ompi/mca/fbtl/directio/fbtl_directio_ipreadv.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/


#include "ompi_config.h"
#include "fbtl_directio.h"

#include <unistd.h>

#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/fbtl/fbtl.h"

ssize_t mca_fbtl_directio_ipreadv (mca_io_ompio_file_t *fh,
ompi_request_t *request)
{
return OMPI_SUCCESS;
}
35 changes: 35 additions & 0 deletions ompi/mca/fbtl/directio/fbtl_directio_ipwritev.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/

#include "ompi_config.h"
#include "fbtl_directio.h"

#include <unistd.h>

#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/fbtl/fbtl.h"

ssize_t mca_fbtl_directio_ipwritev (mca_io_ompio_file_t *fh,
ompi_request_t *request)
{
return OMPI_SUCCESS;
}
Loading