Commit b753fa81 authored by Matthieu Dorier's avatar Matthieu Dorier

added provider handles and now bake_target_id_t is simply a uuid

parent 94b56161
...@@ -16,10 +16,10 @@ extern "C" { ...@@ -16,10 +16,10 @@ extern "C" {
#endif #endif
#define BAKE_CLIENT_NULL ((bake_client_t)NULL) #define BAKE_CLIENT_NULL ((bake_client_t)NULL)
#define BAKE_TARGET_ID_NULL ((bake_target_id_t)NULL) #define BAKE_PROVIDER_HANDLE_NULL ((bake_provider_handle_t)NULL)
typedef struct bake_client* bake_client_t; typedef struct bake_client* bake_client_t;
typedef struct bake_target* bake_target_id_t; typedef struct bake_provider_handle* bake_provider_handle_t;
/** /**
* Creates a BAKE client attached to the given margo instance. * Creates a BAKE client attached to the given margo instance.
...@@ -46,6 +46,16 @@ int bake_client_init(margo_instance_id mid, bake_client_t* client); ...@@ -46,6 +46,16 @@ int bake_client_init(margo_instance_id mid, bake_client_t* client);
*/ */
int bake_client_finalize(bake_client_t client); int bake_client_finalize(bake_client_t client);
int bake_provider_handle_create(
bake_client_t client,
hg_addr_t addr,
uint8_t mplex_id,
bake_provider_handle_t* handle);
int bake_provider_handle_ref_incr(bake_provider_handle_t handle);
int bake_provider_handle_release(bake_provider_handle_t handle);
/** /**
* Obtains identifying information for a BAKE target through the provided * Obtains identifying information for a BAKE target through the provided
* remote mercury address and multiplex id. * remote mercury address and multiplex id.
...@@ -56,11 +66,11 @@ int bake_client_finalize(bake_client_t client); ...@@ -56,11 +66,11 @@ int bake_client_finalize(bake_client_t client);
* @param [out] bti BAKE target identifier * @param [out] bti BAKE target identifier
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_probe_instance( int bake_probe(
bake_client_t client, bake_provider_handle_t provider,
hg_addr_t dest_addr, uint64_t max_targets,
uint8_t mplex_id, bake_target_id_t* bti,
bake_target_id_t *bti); uint64_t* num_targets);
/** /**
* Creates a bounded-size BAKE data region. The resulting region can be * Creates a bounded-size BAKE data region. The resulting region can be
...@@ -74,9 +84,10 @@ int bake_probe_instance( ...@@ -74,9 +84,10 @@ int bake_probe_instance(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_create( int bake_create(
bake_target_id_t bti, bake_provider_handle_t provider,
uint64_t region_size, bake_target_id_t bti,
bake_region_id_t *rid); uint64_t region_size,
bake_region_id_t *rid);
/** /**
* Writes into a BAKE region that was previously created with bake_create(). * Writes into a BAKE region that was previously created with bake_create().
...@@ -94,11 +105,11 @@ int bake_create( ...@@ -94,11 +105,11 @@ int bake_create(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_write( int bake_write(
bake_target_id_t bti, bake_provider_handle_t provider,
bake_region_id_t rid, bake_region_id_t rid,
uint64_t region_offset, uint64_t region_offset,
void const *buf, void const *buf,
uint64_t buf_size); uint64_t buf_size);
/** /**
* Writes data into a previously created BAKE region like bake_write(), * Writes data into a previously created BAKE region like bake_write(),
...@@ -114,13 +125,13 @@ int bake_write( ...@@ -114,13 +125,13 @@ int bake_write(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_proxy_write( int bake_proxy_write(
bake_target_id_t bti, bake_provider_handle_t provider,
bake_region_id_t rid, bake_region_id_t rid,
uint64_t region_offset, uint64_t region_offset,
hg_bulk_t remote_bulk, hg_bulk_t remote_bulk,
uint64_t remote_offset, uint64_t remote_offset,
const char* remote_addr, const char* remote_addr,
uint64_t size); uint64_t size);
/** /**
* Persists a BAKE region. The region is considered immutable at this point * Persists a BAKE region. The region is considered immutable at this point
...@@ -131,8 +142,8 @@ int bake_proxy_write( ...@@ -131,8 +142,8 @@ int bake_proxy_write(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_persist( int bake_persist(
bake_target_id_t bti, bake_provider_handle_t provider,
bake_region_id_t rid); bake_region_id_t rid);
/** /**
* Creates a bounded-size BAKE region, writes data into it, and persists * Creates a bounded-size BAKE region, writes data into it, and persists
...@@ -147,12 +158,13 @@ int bake_persist( ...@@ -147,12 +158,13 @@ int bake_persist(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_create_write_persist( int bake_create_write_persist(
bake_target_id_t bti, bake_provider_handle_t provider,
uint64_t region_size, bake_target_id_t bti,
uint64_t region_offset, uint64_t region_size,
void const *buf, uint64_t region_offset,
uint64_t buf_size, void const *buf,
bake_region_id_t *rid); uint64_t buf_size,
bake_region_id_t *rid);
/** /**
* *
...@@ -167,14 +179,15 @@ int bake_create_write_persist( ...@@ -167,14 +179,15 @@ int bake_create_write_persist(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_create_write_persist_proxy( int bake_create_write_persist_proxy(
bake_target_id_t bti, bake_provider_handle_t provider,
uint64_t region_size, bake_target_id_t bti,
uint64_t region_offset, uint64_t region_size,
hg_bulk_t remote_bulk, uint64_t region_offset,
uint64_t remote_offset, hg_bulk_t remote_bulk,
const char* remote_addr, uint64_t remote_offset,
uint64_t size, const char* remote_addr,
bake_region_id_t *rid); uint64_t size,
bake_region_id_t *rid);
/** /**
* Checks the size of an existing BAKE region. * Checks the size of an existing BAKE region.
...@@ -185,9 +198,9 @@ int bake_create_write_persist_proxy( ...@@ -185,9 +198,9 @@ int bake_create_write_persist_proxy(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_get_size( int bake_get_size(
bake_target_id_t bti, bake_provider_handle_t provider,
bake_region_id_t rid, bake_region_id_t rid,
uint64_t *size); uint64_t *size);
/** /**
* Reads from a BAKE region that was previously persisted with bake_persist(). * Reads from a BAKE region that was previously persisted with bake_persist().
...@@ -203,11 +216,11 @@ int bake_get_size( ...@@ -203,11 +216,11 @@ int bake_get_size(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_read( int bake_read(
bake_target_id_t bti, bake_provider_handle_t provider,
bake_region_id_t rid, bake_region_id_t rid,
uint64_t region_offset, uint64_t region_offset,
void *buf, void *buf,
uint64_t buf_size); uint64_t buf_size);
/** /**
* Reads data from a previously persisted BAKE region like bake_read(), * Reads data from a previously persisted BAKE region like bake_read(),
...@@ -223,22 +236,13 @@ int bake_read( ...@@ -223,22 +236,13 @@ int bake_read(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_proxy_read( int bake_proxy_read(
bake_target_id_t bti, bake_provider_handle_t provider,
bake_region_id_t rid, bake_region_id_t rid,
uint64_t region_offset, uint64_t region_offset,
hg_bulk_t remote_bulk, hg_bulk_t remote_bulk,
uint64_t remote_offset, uint64_t remote_offset,
const char* remote_addr, const char* remote_addr,
uint64_t size); uint64_t size);
/**
* Releases local resources associated with access to a BAKE target;
* does not modify the target in any way.
*
* @param [in] bti BAKE target_identifier
*/
void bake_target_id_release(
bake_target_id_t bti);
/** /**
* Shuts down a remote BAKE service (given an address). * Shuts down a remote BAKE service (given an address).
...@@ -249,7 +253,7 @@ void bake_target_id_release( ...@@ -249,7 +253,7 @@ void bake_target_id_release(
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_shutdown_service( int bake_shutdown_service(
bake_client_t client, hg_addr_t addr); bake_client_t client, hg_addr_t addr);
/** /**
* Issues a BAKE no-op operation. * Issues a BAKE no-op operation.
...@@ -257,8 +261,7 @@ int bake_shutdown_service( ...@@ -257,8 +261,7 @@ int bake_shutdown_service(
* @param [in] bti BAKE target identifier * @param [in] bti BAKE target identifier
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_noop( int bake_noop(bake_provider_handle_t provider);
bake_target_id_t bti);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -16,7 +16,7 @@ extern "C" { ...@@ -16,7 +16,7 @@ extern "C" {
typedef struct { typedef struct {
uuid_t id; uuid_t id;
} bake_uuid_t; } bake_target_id_t;
/** /**
* Persistent, opaque identifier for a region within a BAKE target. * Persistent, opaque identifier for a region within a BAKE target.
*/ */
......
This diff is collapsed.
...@@ -27,6 +27,8 @@ int main(int argc, char **argv) ...@@ -27,6 +27,8 @@ int main(int argc, char **argv)
hg_addr_t svr_addr; hg_addr_t svr_addr;
margo_instance_id mid; margo_instance_id mid;
bake_client_t bcl; bake_client_t bcl;
bake_provider_handle_t bph;
uint64_t num_targets;
bake_target_id_t bti; bake_target_id_t bti;
uint8_t mplex_id; uint8_t mplex_id;
hg_return_t hret; hg_return_t hret;
...@@ -75,10 +77,21 @@ int main(int argc, char **argv) ...@@ -75,10 +77,21 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
ret = bake_probe_instance(bcl, svr_addr, mplex_id, &bti); ret = bake_provider_handle_create(bcl, svr_addr, mplex_id, &bph);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, "Error: bake_probe_instance()\n"); fprintf(stderr, "Error: bake_provider_handle_create()\n");
margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl);
margo_finalize(mid);
return(-1);
}
ret = bake_probe(bph, 1, &bti, &num_targets);
if(ret < 0)
{
fprintf(stderr, "Error: bake_probe()\n");
bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -89,7 +102,7 @@ int main(int argc, char **argv) ...@@ -89,7 +102,7 @@ int main(int argc, char **argv)
if(region_fd < 0) if(region_fd < 0)
{ {
perror("open rid"); perror("open rid");
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -101,7 +114,7 @@ int main(int argc, char **argv) ...@@ -101,7 +114,7 @@ int main(int argc, char **argv)
{ {
perror("read"); perror("read");
close(region_fd); close(region_fd);
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -109,11 +122,11 @@ int main(int argc, char **argv) ...@@ -109,11 +122,11 @@ int main(int argc, char **argv)
} }
close(region_fd); close(region_fd);
ret = bake_get_size(bti, rid, &check_size); ret = bake_get_size(bph, rid, &check_size);
if(ret != 0) if(ret != 0)
{ {
fprintf(stderr, "Error: bake_get_size()\n"); fprintf(stderr, "Error: bake_get_size()\n");
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -124,7 +137,7 @@ int main(int argc, char **argv) ...@@ -124,7 +137,7 @@ int main(int argc, char **argv)
if(fd < 0) if(fd < 0)
{ {
perror("open output"); perror("open output");
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -136,7 +149,7 @@ int main(int argc, char **argv) ...@@ -136,7 +149,7 @@ int main(int argc, char **argv)
{ {
perror("ftruncate"); perror("ftruncate");
close(fd); close(fd);
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -148,7 +161,7 @@ int main(int argc, char **argv) ...@@ -148,7 +161,7 @@ int main(int argc, char **argv)
{ {
perror("mmap"); perror("mmap");
close(fd); close(fd);
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -157,7 +170,7 @@ int main(int argc, char **argv) ...@@ -157,7 +170,7 @@ int main(int argc, char **argv)
/* transfer data */ /* transfer data */
ret = bake_read( ret = bake_read(
bti, bph,
rid, rid,
0, 0,
local_region, local_region,
...@@ -166,7 +179,7 @@ int main(int argc, char **argv) ...@@ -166,7 +179,7 @@ int main(int argc, char **argv)
{ {
munmap(local_region, check_size); munmap(local_region, check_size);
close(fd); close(fd);
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -176,7 +189,7 @@ int main(int argc, char **argv) ...@@ -176,7 +189,7 @@ int main(int argc, char **argv)
munmap(local_region, check_size); munmap(local_region, check_size);
close(fd); close(fd);
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
......
...@@ -27,6 +27,8 @@ int main(int argc, char **argv) ...@@ -27,6 +27,8 @@ int main(int argc, char **argv)
hg_addr_t svr_addr; hg_addr_t svr_addr;
margo_instance_id mid; margo_instance_id mid;
bake_client_t bcl; bake_client_t bcl;
bake_provider_handle_t bph;
uint64_t num_targets;
bake_target_id_t bti; bake_target_id_t bti;
uint8_t mplex_id; uint8_t mplex_id;
hg_return_t hret; hg_return_t hret;
...@@ -106,23 +108,36 @@ int main(int argc, char **argv) ...@@ -106,23 +108,36 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
ret = bake_probe_instance(bcl, svr_addr, mplex_id, &bti); ret = bake_provider_handle_create(bcl, svr_addr, mplex_id, &bph);
if(ret != 0)
{
margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl);
margo_finalize(mid);
munmap(local_region, statbuf.st_size);
close(fd);
fprintf(stderr, "Error: bake_provider_handle_create()\n");
return(-1);
}
ret = bake_probe(bph, 1, &bti, &num_targets);
if(ret < 0) if(ret < 0)
{ {
bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
munmap(local_region, statbuf.st_size); munmap(local_region, statbuf.st_size);
close(fd); close(fd);
fprintf(stderr, "Error: bake_probe_instance()\n"); fprintf(stderr, "Error: bake_probe()\n");
return(-1); return(-1);
} }
/* create region */ /* create region */
ret = bake_create(bti, statbuf.st_size, &rid); ret = bake_create(bph, bti, statbuf.st_size, &rid);
if(ret != 0) if(ret != 0)
{ {
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -134,14 +149,14 @@ int main(int argc, char **argv) ...@@ -134,14 +149,14 @@ int main(int argc, char **argv)
/* transfer data */ /* transfer data */
ret = bake_write( ret = bake_write(
bti, bph,
rid, rid,
0, 0,
local_region, local_region,
statbuf.st_size); statbuf.st_size);
if(ret != 0) if(ret != 0)
{ {
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -154,10 +169,10 @@ int main(int argc, char **argv) ...@@ -154,10 +169,10 @@ int main(int argc, char **argv)
munmap(local_region, statbuf.st_size); munmap(local_region, statbuf.st_size);
close(fd); close(fd);
ret = bake_persist(bti, rid); ret = bake_persist(bph, rid);
if(ret != 0) if(ret != 0)
{ {
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -166,18 +181,18 @@ int main(int argc, char **argv) ...@@ -166,18 +181,18 @@ int main(int argc, char **argv)
} }
/* safety check size */ /* safety check size */
ret = bake_get_size(bti, rid, &check_size); ret = bake_get_size(bph, rid, &check_size);
if(ret != 0) if(ret != 0)
{ {
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
fprintf(stderr, "Error: bake_get_size()\n"); fprintf(stderr, "Error: bake_get_size()\n");
return(-1); return(-1);
} }
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#include "bake-client.h" #include "bake-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_provider_handle_t bph, 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_provider_handle_t bph, int iterations, double* measurement_array, int size);
static void bench_routine_noop(bake_target_id_t bti, int iterations, double* measurement_array); static void bench_routine_noop(bake_provider_handle_t bph, int iterations, double* measurement_array);
static void bench_routine_print(const char* op, int size, int iterations, double* measurement_array); static void bench_routine_print(const char* op, int size, int iterations, double* measurement_array);
static int measurement_cmp(const void* a, const void *b); static int measurement_cmp(const void* a, const void *b);
...@@ -34,6 +34,8 @@ int main(int argc, char **argv) ...@@ -34,6 +34,8 @@ int main(int argc, char **argv)
hg_addr_t svr_addr; hg_addr_t svr_addr;
margo_instance_id mid; margo_instance_id mid;
bake_client_t bcl; bake_client_t bcl;
bake_provider_handle_t bph;
uint64_t num_targets;
bake_target_id_t bti; bake_target_id_t bti;
uint8_t mplex_id; uint8_t mplex_id;
hg_return_t hret; hg_return_t hret;
...@@ -91,10 +93,11 @@ int main(int argc, char **argv) ...@@ -91,10 +93,11 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
ret = bake_probe_instance(bcl, svr_addr, mplex_id, &bti); ret = bake_probe(bph, 1, &bti, &num_targets);
if(ret < 0) if(ret < 0)
{ {
fprintf(stderr, "Error: bake_probe_instance()\n"); fprintf(stderr, "Error: bake_probe()\n");
bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -103,17 +106,17 @@ int main(int argc, char **argv) ...@@ -103,17 +106,17 @@ int main(int argc, char **argv)
printf("# <op> <iterations> <size> <min> <q1> <med> <avg> <q3> <max>\n"); printf("# <op> <iterations> <size> <min> <q1> <med> <avg> <q3> <max>\n");
bench_routine_noop(bti, iterations, measurement_array); bench_routine_noop(bph, iterations, measurement_array);
bench_routine_print("noop", 0, iterations, measurement_array); bench_routine_print("noop", 0, iterations, measurement_array);
for(cur_size=min_size; cur_size <= max_size; cur_size *= 2) for(cur_size=min_size; cur_size <= max_size; cur_size *= 2)
{ {
bench_routine_write(bti, iterations, measurement_array, cur_size); bench_routine_write(bph, bti, iterations, measurement_array, cur_size);
bench_routine_print("write", cur_size, iterations, measurement_array); bench_routine_print("write", cur_size, iterations, measurement_array);
bench_routine_read(bti, iterations, measurement_array, cur_size); bench_routine_read(bph, iterations, measurement_array, cur_size);
bench_routine_print("read", cur_size, iterations, measurement_array); bench_routine_print("read", cur_size, iterations, measurement_array);
} }
bake_target_id_release(bti); bake_provider_handle_release(bph);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
bake_client_finalize(bcl); bake_client_finalize(bcl);
margo_finalize(mid); margo_finalize(mid);
...@@ -130,7 +133,7 @@ static double Wtime(void) ...@@ -130,7 +133,7 @@ static double Wtime(void)
return((double)tp.tv_sec + (double)(tp.tv_nsec) / (double)1000000000.0); return((double)tp.tv_sec + (double)(tp.tv_nsec) / (double)1000000000.0);
} }
static void bench_routine_write(bake_target_id_t bti, int iterations, double *measurement_array, int size) static void bench_routine_write(bake_provider_handle_t bph, bake_target_id_t bti, int iterations, double *measurement_array, int size)
{ {
int ret; int ret;
double tm1, tm2; double tm1, tm2;
...@@ -142,7 +145,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me ...@@ -142,7 +145,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me
assert(buffer); assert(buffer);
/* create region */ /* create region */
ret = bake_create(bti, size*iterations, &rid); ret = bake_create(bph, bti, size*iterations, &rid);
assert(ret == 0); assert(ret == 0);
sleep(1); sleep(1);
...@@ -152,7 +155,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me ...@@ -152,7 +155,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me
tm1 = Wtime(); tm1 = Wtime();
/* transfer data (writes) */ /* transfer data (writes) */
ret = bake_write( ret = bake_write(
bti, bph,
rid, rid,
region_offset, region_offset,
buffer, buffer,
...@@ -164,7 +167,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me ...@@ -164,7 +167,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me
} }
/* persist */ /* persist */
ret = bake_persist(bti, rid); ret = bake_persist(bph, rid);
assert(ret == 0); assert(ret == 0);
free(buffer); free(buffer);
...@@ -172,7 +175,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me ...@@ -172,7 +175,7 @@ static void bench_routine_write(bake_target_id_t bti, int iterations, double *me
return; return;
} }
static void bench_routine_read(bake_target_id_t bti, int iterations, double *measurement_array, int size)