Commit ec0a8846 authored by Shane Snyder's avatar Shane Snyder

rename/reorganize client-side libary/header

parent 1e31e3a7
...@@ -13,7 +13,7 @@ CLEANFILES = $(bin_SCRIPTS) ...@@ -13,7 +13,7 @@ CLEANFILES = $(bin_SCRIPTS)
MAINTAINERCLEANFILES = MAINTAINERCLEANFILES =
EXTRA_DIST = EXTRA_DIST =
BUILT_SOURCES = BUILT_SOURCES =
include_HEADERS = include/bake-bulk.h include_HEADERS = include/bake-bulk.h include/bake-bulk-client.h
EXTRA_DIST += \ EXTRA_DIST += \
prepare.sh prepare.sh
...@@ -26,10 +26,10 @@ AM_LIBS = ...@@ -26,10 +26,10 @@ AM_LIBS =
AM_CXXFLAGS = $(AM_CFLAGS) AM_CXXFLAGS = $(AM_CFLAGS)
lib_LTLIBRARIES = src/libbake-bulk.la lib_LTLIBRARIES = src/libbake-bulk-client.la
src_libbake_bulk_la_SOURCES = src_libbake_bulk_client_la_SOURCES =
LDADD = src/libbake-bulk.la LDADD = src/libbake-bulk-client.la
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = maint/bake-bulk.pc pkgconfig_DATA = maint/bake-bulk.pc
......
/*
* (C) 2016 The University of Chicago
*
* See COPYRIGHT in top-level directory.
*/
#ifndef __BAKE_BULK_CLIENT_H
#define __BAKE_BULK_CLIENT_H
#include <stdint.h>
#include "bake-bulk.h"
/**
* Obtain identifying information for a bake target through the provided
* remote mercury address.
*
* @param [in] mecury_dest Mercury address in string form
* @param [out] bti BAKE target identifier
* @returns 0 on success, -1 on failure
*/
int bake_probe_instance(
const char *mercury_dest,
bake_target_id_t *bti);
/**
* Create a bounded-size bulk data region. The resulting region can be
* written using bulk write operations, and can be persisted (once writes are
* complete) with a a bulk persist operation. The region is not valid for
* read access until persisted.
*
* @param [in] bti BAKE target identifier
* @param [in] region_size size of region to be created
* @param [out] rid identifier for new region
* @returns 0 on success, -1 on failure
*/
int bake_bulk_create(
bake_target_id_t bti,
uint64_t region_size,
bake_bulk_region_id_t *rid);
/**
* Writes into a region that was previously created with bake_bulk_create().
* Result is not guaranteed to be persistent until explicit
* bake_bulk_persist() call.
*
* Results are undefined if multiple writers (from same process or different
* processes) perform overlapping writes.
*
* @param [in] bti BAKE target identifier
* @param [in] rid identifier for region
* @param [in] region_offset offset into the target region to write
* @param [in] buf local memory buffer to write
* @param [in] buf_size size of local memory buffer to write
* @returns 0 on success, -1 on failure
*/
int bake_bulk_write(
bake_target_id_t bti,
bake_bulk_region_id_t rid,
uint64_t region_offset,
void const *buf,
uint64_t buf_size);
/**
* Persist a bulk region. The region is considered immutable at this point
* and reads may be performed on the region.
*
* @param [in] bti BAKE target identifier
* @param [in] rid identifier for region
* @returns 0 on success, -1 on failure
*/
int bake_bulk_persist(
bake_target_id_t bti,
bake_bulk_region_id_t rid);
/**
* Check the size of an existing region.
*
* @param [in] bti BAKE target identifier
* @param [in] rid identifier for region
* @param [out] size sizes of region
* @returns 0 on success, -1 on failure
*/
int bake_bulk_get_size(
bake_target_id_t bti,
bake_bulk_region_id_t rid,
uint64_t *region_size);
/**
* Reads from a region that was previously persisted with bake_bulk_persist().
*
* NOTE: for now at least, this call does not support "short" reads. It
* either succeeds in reading the requested size or not.
*
* @param [in] bti BAKE target identifier
* @param [in] rid region identifier
* @param [in] region_offset offset into the target region to read from
* @param [in] buf local memory buffer read into
* @param [in] buf_size size of local memory buffer to read into
* @returns 0 on success, -1 on failure
*/
int bake_bulk_read(
bake_target_id_t bti,
bake_bulk_region_id_t rid,
uint64_t region_offset,
void *buf,
uint64_t buf_size);
/**
* Release local resources associated with access to a target; does not
* modify the target in any way.
*
* @param [in] bti BAKE target_identifier
*/
void bake_release_instance(
bake_target_id_t bti);
/**
* Utility function to shut down a remote service
*
* @param [in] bti Bake target identifier
* @returns 0 on success, -1 on fialure
*/
int bake_shutdown_service(bake_target_id_t bti);
/* NOTE: code below is a copy of the bulk portion of the proposed BAKE API.
* Commented out for now but leaving it in place for reference
*/
/**
* Issue a no-op
*
* @param [in] bti BAKE target identifier
* @returns 0 on success, -1 on failure
*/
int bake_bulk_noop(
bake_target_id_t bti);
#endif /* __BAKE_BULK__CLIENT_H */
...@@ -27,131 +27,6 @@ typedef struct { ...@@ -27,131 +27,6 @@ typedef struct {
char data[BAKE_BULK_REGION_ID_DATA_SIZE]; char data[BAKE_BULK_REGION_ID_DATA_SIZE];
} bake_bulk_region_id_t; } bake_bulk_region_id_t;
/**
* Obtain identifying information for a bake target through the provided
* remote mercury address.
*
* @param [in] mecury_dest Mercury address in string form
* @param [out] bti BAKE target identifier
* @returns 0 on success, -1 on failure
*/
int bake_probe_instance(
const char *mercury_dest,
bake_target_id_t *bti);
/**
* Create a bounded-size bulk data region. The resulting region can be
* written using bulk write operations, and can be persisted (once writes are
* complete) with a a bulk persist operation. The region is not valid for
* read access until persisted.
*
* @param [in] bti BAKE target identifier
* @param [in] region_size size of region to be created
* @param [out] rid identifier for new region
* @returns 0 on success, -1 on failure
*/
int bake_bulk_create(
bake_target_id_t bti,
uint64_t region_size,
bake_bulk_region_id_t *rid);
/**
* Writes into a region that was previously created with bake_bulk_create().
* Result is not guaranteed to be persistent until explicit
* bake_bulk_persist() call.
*
* Results are undefined if multiple writers (from same process or different
* processes) perform overlapping writes.
*
* @param [in] bti BAKE target identifier
* @param [in] rid identifier for region
* @param [in] region_offset offset into the target region to write
* @param [in] buf local memory buffer to write
* @param [in] buf_size size of local memory buffer to write
* @returns 0 on success, -1 on failure
*/
int bake_bulk_write(
bake_target_id_t bti,
bake_bulk_region_id_t rid,
uint64_t region_offset,
void const *buf,
uint64_t buf_size);
/**
* Persist a bulk region. The region is considered immutable at this point
* and reads may be performed on the region.
*
* @param [in] bti BAKE target identifier
* @param [in] rid identifier for region
* @returns 0 on success, -1 on failure
*/
int bake_bulk_persist(
bake_target_id_t bti,
bake_bulk_region_id_t rid);
/**
* Check the size of an existing region.
*
* @param [in] bti BAKE target identifier
* @param [in] rid identifier for region
* @param [out] size sizes of region
* @returns 0 on success, -1 on failure
*/
int bake_bulk_get_size(
bake_target_id_t bti,
bake_bulk_region_id_t rid,
uint64_t *region_size);
/**
* Reads from a region that was previously persisted with bake_bulk_persist().
*
* NOTE: for now at least, this call does not support "short" reads. It
* either succeeds in reading the requested size or not.
*
* @param [in] bti BAKE target identifier
* @param [in] rid region identifier
* @param [in] region_offset offset into the target region to read from
* @param [in] buf local memory buffer read into
* @param [in] buf_size size of local memory buffer to read into
* @returns 0 on success, -1 on failure
*/
int bake_bulk_read(
bake_target_id_t bti,
bake_bulk_region_id_t rid,
uint64_t region_offset,
void *buf,
uint64_t buf_size);
/**
* Release local resources associated with access to a target; does not
* modify the target in any way.
*
* @param [in] bti BAKE target_identifier
*/
void bake_release_instance(
bake_target_id_t bti);
/**
* Utility function to shut down a remote service
*
* @param [in] bti Bake target identifier
* @returns 0 on success, -1 on fialure
*/
int bake_shutdown_service(bake_target_id_t bti);
/* NOTE: code below is a copy of the bulk portion of the proposed BAKE API.
* Commented out for now but leaving it in place for reference
*/
/**
* Issue a no-op
*
* @param [in] bti BAKE target identifier
* @returns 0 on success, -1 on failure
*/
int bake_bulk_noop(
bake_target_id_t bti);
#if 0 #if 0
/// ==== Some high-level goals ==== /// ==== Some high-level goals ====
......
src_libbake_bulk_la_SOURCES += \ src_libbake_bulk_client_la_SOURCES += \
src/bake-bulk.c src/bake-bulk-client.c
bin_PROGRAMS += \ bin_PROGRAMS += \
src/bake-bulk-server \ src/bake-bulk-server \
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "abt.h" #include "abt.h"
#include "abt-snoozer.h" #include "abt-snoozer.h"
#include "bake-bulk.h" #include "bake-bulk-client.h"
/* client program that will copy a bake bulk region out to a POSIX file */ /* client program that will copy a bake bulk region out to a POSIX file */
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "abt.h" #include "abt.h"
#include "abt-snoozer.h" #include "abt-snoozer.h"
#include "bake-bulk.h" #include "bake-bulk-client.h"
/* client program that will copy a POSIX file into a bake bulk region */ /* client program that will copy a POSIX file into a bake bulk region */
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "abt.h" #include "abt.h"
#include "abt-snoozer.h" #include "abt-snoozer.h"
#include "bake-bulk.h" #include "bake-bulk-client.h"
static void bench_routine_write(bake_target_id_t bti, int iterations, double* measurement_array, int size); static void bench_routine_write(bake_target_id_t bti, int iterations, double* measurement_array, int size);
static void bench_routine_read(bake_target_id_t bti, int iterations, double* measurement_array, int size); static void bench_routine_read(bake_target_id_t bti, int iterations, double* measurement_array, int size);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "abt.h" #include "abt.h"
#include "abt-snoozer.h" #include "abt-snoozer.h"
#include "bake-bulk.h" #include "bake-bulk-client.h"
/* client program that will shut down a BAKE bulk server. */ /* client program that will shut down a BAKE bulk server. */
......
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