Commit 48d42533 authored by Shane Snyder's avatar Shane Snyder

massive changes to switch from bake-bulk => bake

parent 3109dd62
...@@ -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/bake-bulk-client.h include/bake-bulk-server.h include_HEADERS = include/bake.h include/bake-client.h include/bake-server.h
TESTS_ENVIRONMENT = TESTS_ENVIRONMENT =
EXTRA_DIST += \ EXTRA_DIST += \
...@@ -27,15 +27,16 @@ AM_LIBS = ...@@ -27,15 +27,16 @@ AM_LIBS =
AM_CXXFLAGS = $(AM_CFLAGS) AM_CXXFLAGS = $(AM_CFLAGS)
lib_LTLIBRARIES = src/libbake-bulk-client.la src/libbake-bulk-server.la lib_LTLIBRARIES = src/libbake-client.la src/libbake-server.la
src_libbake_bulk_client_la_SOURCES = src_libbake_client_la_SOURCES =
src_libbake_bulk_server_la_SOURCES = src_libbake_server_la_SOURCES =
LDADD = src/libbake-bulk-client.la LDADD = src/libbake-client.la
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = maint/bake-bulk-client.pc \ pkgconfig_DATA = \
maint/bake-bulk-server.pc maint/bake-client.pc \
maint/bake-server.pc
include Make.rules include Make.rules
......
...@@ -80,6 +80,6 @@ LIBS="$UUID_LIBS $LIBS" ...@@ -80,6 +80,6 @@ LIBS="$UUID_LIBS $LIBS"
CPPFLAGS="$UUID_CFLAGS $CPPFLAGS" CPPFLAGS="$UUID_CFLAGS $CPPFLAGS"
CFLAGS="$UUID_CFLAGS $CFLAGS" CFLAGS="$UUID_CFLAGS $CFLAGS"
AC_CONFIG_FILES([Makefile maint/bake-bulk-client.pc maint/bake-bulk-server.pc]) AC_CONFIG_FILES([Makefile maint/bake-client.pc maint/bake-server.pc])
AC_OUTPUT AC_OUTPUT
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
* See COPYRIGHT in top-level directory. * See COPYRIGHT in top-level directory.
*/ */
#ifndef __BAKE_BULK_CLIENT_H #ifndef __BAKE_CLIENT_H
#define __BAKE_BULK_CLIENT_H #define __BAKE_CLIENT_H
#include <stdint.h> #include <stdint.h>
#include "margo.h" #include "margo.h"
#include "bake-bulk.h" #include "bake.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Obtain identifying information for a bake target through the provided * Obtains identifying information for a BAKE target through the provided
* remote mercury address. * remote mercury address.
* *
* @param [in] mid margo instance * @param [in] mid margo instance
...@@ -30,25 +30,25 @@ int bake_probe_instance( ...@@ -30,25 +30,25 @@ int bake_probe_instance(
bake_target_id_t *bti); bake_target_id_t *bti);
/** /**
* Create a bounded-size bulk data region. The resulting region can be * Creates a bounded-size BAKE data region. The resulting region can be
* written using bulk write operations, and can be persisted (once writes are * written using BAKE write operations, and can be persisted (once writes
* complete) with a a bulk persist operation. The region is not valid for * are complete) with a a BAKE persist operation. The region is not valid
* read access until persisted. * for read access until persisted.
* *
* @param [in] bti BAKE target identifier * @param [in] bti BAKE target identifier
* @param [in] region_size size of region to be created * @param [in] region_size size of region to be created
* @param [out] rid identifier for new region * @param [out] rid identifier for new region
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_bulk_create( int bake_create(
bake_target_id_t bti, bake_target_id_t bti,
uint64_t region_size, uint64_t region_size,
bake_bulk_region_id_t *rid); bake_region_id_t *rid);
/** /**
* Writes into a region that was previously created with bake_bulk_create(). * Writes into a BAKE region that was previously created with bake_create().
* Result is not guaranteed to be persistent until explicit * Result is not guaranteed to be persistent until explicit
* bake_bulk_persist() call. * bake_persist() call.
* *
* Results are undefined if multiple writers (from same process or different * Results are undefined if multiple writers (from same process or different
* processes) perform overlapping writes. * processes) perform overlapping writes.
...@@ -60,15 +60,15 @@ int bake_bulk_create( ...@@ -60,15 +60,15 @@ int bake_bulk_create(
* @param [in] buf_size size of local memory buffer to write * @param [in] buf_size size of local memory buffer to write
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_bulk_write( int bake_write(
bake_target_id_t bti, bake_target_id_t bti,
bake_bulk_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);
/** /**
* Write data into a previously created BAKE region like bake_bulk_write(), * Writes data into a previously created BAKE region like bake_write(),
* except the write is performed on behalf of some remote entity. * except the write is performed on behalf of some remote entity.
* *
* @param [in] bti BAKE target identifier * @param [in] bti BAKE target identifier
...@@ -80,9 +80,9 @@ int bake_bulk_write( ...@@ -80,9 +80,9 @@ int bake_bulk_write(
* @param [in] size size to write from remote bulk handle * @param [in] size size to write from remote bulk handle
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_bulk_proxy_write( int bake_proxy_write(
bake_target_id_t bti, bake_target_id_t bti,
bake_bulk_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,
...@@ -90,32 +90,32 @@ int bake_bulk_proxy_write( ...@@ -90,32 +90,32 @@ int bake_bulk_proxy_write(
uint64_t size); uint64_t size);
/** /**
* Persist a bulk region. The region is considered immutable at this point * Persists a BAKE region. The region is considered immutable at this point
* and reads may be performed on the region. * and reads may be performed on the region.
* *
* @param [in] bti BAKE target identifier * @param [in] bti BAKE target identifier
* @param [in] rid identifier for region * @param [in] rid identifier for region
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_bulk_persist( int bake_persist(
bake_target_id_t bti, bake_target_id_t bti,
bake_bulk_region_id_t rid); bake_region_id_t rid);
/** /**
* Check the size of an existing region. * Checks the size of an existing BAKE region.
* *
* @param [in] bti BAKE target identifier * @param [in] bti BAKE target identifier
* @param [in] rid identifier for region * @param [in] rid identifier for region
* @param [out] size sizes of region * @param [out] size size of region
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_bulk_get_size( int bake_get_size(
bake_target_id_t bti, bake_target_id_t bti,
bake_bulk_region_id_t rid, bake_region_id_t rid,
uint64_t *region_size); uint64_t *size);
/** /**
* Reads from a region that was previously persisted with bake_bulk_persist(). * Reads from a BAKE region that was previously persisted with bake_persist().
* *
* NOTE: for now at least, this call does not support "short" reads. It * NOTE: for now at least, this call does not support "short" reads. It
* either succeeds in reading the requested size or not. * either succeeds in reading the requested size or not.
...@@ -127,15 +127,15 @@ int bake_bulk_get_size( ...@@ -127,15 +127,15 @@ int bake_bulk_get_size(
* @param [in] buf_size size of local memory buffer to read into * @param [in] buf_size size of local memory buffer to read into
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_bulk_read( int bake_read(
bake_target_id_t bti, bake_target_id_t bti,
bake_bulk_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);
/** /**
* Read data from a previously persisted BAKE region like bake_bulk_read(), * Reads data from a previously persisted BAKE region like bake_read(),
* except the read is performed on behalf of some remote entity. * except the read is performed on behalf of some remote entity.
* *
* @param [in] bti BAKE target identifier * @param [in] bti BAKE target identifier
...@@ -147,9 +147,9 @@ int bake_bulk_read( ...@@ -147,9 +147,9 @@ int bake_bulk_read(
* @param [in] size size to read to remote bulk handle * @param [in] size size to read to remote bulk handle
* @returns 0 on success, -1 on failure * @returns 0 on success, -1 on failure
*/ */
int bake_bulk_proxy_read( int bake_proxy_read(
bake_target_id_t bti, bake_target_id_t bti,
bake_bulk_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,
...@@ -157,8 +157,8 @@ int bake_bulk_proxy_read( ...@@ -157,8 +157,8 @@ int bake_bulk_proxy_read(
uint64_t size); uint64_t size);
/** /**
* Release local resources associated with access to a target; does not * Releases local resources associated with access to a BAKE target;
* modify the target in any way. * does not modify the target in any way.
* *
* @param [in] bti BAKE target_identifier * @param [in] bti BAKE target_identifier
*/ */
...@@ -166,28 +166,25 @@ void bake_release_instance( ...@@ -166,28 +166,25 @@ void bake_release_instance(
bake_target_id_t bti); bake_target_id_t bti);
/** /**
* Utility function to shut down a remote service * Shuts down a remote BAKE service (given a target ID).
* *
* @param [in] bti Bake target identifier * @param [in] bti BAKE target identifier
* @returns 0 on success, -1 on fialure * @returns 0 on success, -1 on fialure
*/ */
int bake_shutdown_service(bake_target_id_t bti); 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 * Issues a BAKE no-op operation.
* *
* @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_bulk_noop( int bake_noop(
bake_target_id_t bti); bake_target_id_t bti);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __BAKE_BULK__CLIENT_H */ #endif /* __BAKE_CLIENT_H */
...@@ -4,23 +4,24 @@ ...@@ -4,23 +4,24 @@
* See COPYRIGHT in top-level directory. * See COPYRIGHT in top-level directory.
*/ */
#ifndef __BAKE_BULK_SERVER_H #ifndef __BAKE_SERVER_H
#define __BAKE_BULK_SERVER_H #define __BAKE_SERVER_H
#include <margo.h> #include <margo.h>
#include <libpmemobj.h> #include <libpmemobj.h>
#include "bake-bulk.h" #include "bake.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Creates a bake-bulk pool to use for backend PMEM storage. * Creates a BAKE pool to use for backend PMEM storage.
* NOTE: this function must be called on a pool before the pool *
* can be passed to 'bake_server_init' * NOTE: This function must be called on a pool before the pool
* can be passed to 'bake_server_init'.
* *
* @param[in] pool_name path to pmem backend file * @param[in] pool_name path to PMEM backend file
* @param[in] pool_size size of the created pool * @param[in] pool_size size of the created pool
* @param[in] pool_mode mode of the created pool * @param[in] pool_mode mode of the created pool
* @returns 0 on success, -1 otherwise * @returns 0 on success, -1 otherwise
...@@ -31,10 +32,10 @@ int bake_server_makepool( ...@@ -31,10 +32,10 @@ int bake_server_makepool(
mode_t pool_mode); mode_t pool_mode);
/** /**
* Register a bake server instance for a given Margo instance. * Initializes a BAKE server instance.
* *
* @param[in] mid Margo instance identifier * @param[in] mid Margo instance identifier
* @param[in] pool_name path to pmem backend file * @param[in] pool_name path to PMEM backend file
* @returns 0 on success, -1 otherwise * @returns 0 on success, -1 otherwise
*/ */
int bake_server_init( int bake_server_init(
...@@ -42,16 +43,20 @@ int bake_server_init( ...@@ -42,16 +43,20 @@ int bake_server_init(
const char *pool_name); const char *pool_name);
/** /**
* Shuts down a bake server and frees all associated resources. * Shuts down a BAKE server and frees all associated resources.
*/ */
void bake_server_shutdown(void); void bake_server_shutdown(
void);
/** /**
* Suspends the server process until some other entity calls bake_server_shutdown. * Suspends a BAKE server process until some other entity calls
* bake_server_shutdown().
*/ */
void bake_server_wait_for_shutdown(void); void bake_server_wait_for_shutdown(
void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __BAKE_BULK_SERVER_H */
#endif /* __BAKE_SERVER_H */
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* See COPYRIGHT in top-level directory. * See COPYRIGHT in top-level directory.
*/ */
#ifndef __BAKE_BULK_H #ifndef __BAKE_H
#define __BAKE_BULK_H #define __BAKE_H
#include <uuid/uuid.h> #include <uuid/uuid.h>
#include <stdint.h> #include <stdint.h>
...@@ -23,16 +23,16 @@ typedef struct { ...@@ -23,16 +23,16 @@ typedef struct {
} bake_target_id_t; } bake_target_id_t;
/** /**
* Persistent, opaque identifier for a bulk region within a BAKE target. * Persistent, opaque identifier for a region within a BAKE target.
*/ */
#define BAKE_BULK_REGION_ID_DATA_SIZE 24 #define BAKE_REGION_ID_DATA_SIZE 24
typedef struct { typedef struct {
uint32_t type; uint32_t type;
char data[BAKE_BULK_REGION_ID_DATA_SIZE]; char data[BAKE_REGION_ID_DATA_SIZE];
} bake_bulk_region_id_t; } bake_region_id_t;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __BAKE_BULK_H */ #endif /* __BAKE_H */
src_libbake_bulk_client_la_SOURCES += \ src_libbake_client_la_SOURCES += \
src/bake-bulk-client.c src/bake-client.c
src_libbake_bulk_server_la_SOURCES += \ src_libbake_server_la_SOURCES += \
src/bake-bulk-server.c src/bake-server.c
src_bake_bulk_server_daemon_LDADD = src/libbake-bulk-server.la src_bake_server_daemon_LDADD = src/libbake-server.la
src_bake_bulk_mkpool_LDADD = src/libbake-bulk-server.la src_bake_mkpool_LDADD = src/libbake-server.la
bin_PROGRAMS += \ bin_PROGRAMS += \
src/bake-bulk-server-daemon \ src/bake-server-daemon \
src/bake-bulk-mkpool \ src/bake-mkpool \
src/bb-shutdown \ src/bake-shutdown \
src/bb-copy-to \ src/bake-copy-to \
src/bb-copy-from \ src/bake-copy-from \
src/bb-latency-bench src/bake-latency-bench
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "bake-bulk-client.h" #include "bake-client.h"
/* client program that will copy a bake bulk region out to a POSIX file */ /* client program that will copy a BAKE region out to a POSIX file */
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
...@@ -27,7 +27,7 @@ int main(int argc, char **argv) ...@@ -27,7 +27,7 @@ int main(int argc, char **argv)
bake_target_id_t bti; bake_target_id_t bti;
hg_return_t hret; hg_return_t hret;
int ret; int ret;
bake_bulk_region_id_t rid; bake_region_id_t rid;
int fd; int fd;
char* local_region; char* local_region;
int region_fd; int region_fd;
...@@ -35,8 +35,8 @@ int main(int argc, char **argv) ...@@ -35,8 +35,8 @@ int main(int argc, char **argv)
if(argc != 4) if(argc != 4)
{ {
fprintf(stderr, "Usage: bb-copy-from <server addr> <identifier file> <output file>\n"); fprintf(stderr, "Usage: bake-copy-from <server addr> <identifier file> <output file>\n");
fprintf(stderr, " Example: ./bb-copy-from tcp://localhost:1234 /tmp/bb-copy-rid.0GjOlu /tmp/output.dat\n"); fprintf(stderr, " Example: ./bake-copy-from tcp://localhost:1234 /tmp/bb-copy-rid.0GjOlu /tmp/output.dat\n");
return(-1); return(-1);
} }
svr_addr_str = argv[1]; svr_addr_str = argv[1];
...@@ -93,10 +93,10 @@ int main(int argc, char **argv) ...@@ -93,10 +93,10 @@ int main(int argc, char **argv)
} }
close(region_fd); close(region_fd);
ret = bake_bulk_get_size(bti, rid, &check_size); ret = bake_get_size(bti, rid, &check_size);
if(ret != 0) if(ret != 0)
{ {
fprintf(stderr, "Error: bake_bulk_get_size()\n"); fprintf(stderr, "Error: bake_get_size()\n");
bake_release_instance(bti); bake_release_instance(bti);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
margo_finalize(mid); margo_finalize(mid);
...@@ -136,7 +136,7 @@ int main(int argc, char **argv) ...@@ -136,7 +136,7 @@ int main(int argc, char **argv)
} }
/* transfer data */ /* transfer data */
ret = bake_bulk_read( ret = bake_read(
bti, bti,
rid, rid,
0, 0,
...@@ -149,7 +149,7 @@ int main(int argc, char **argv) ...@@ -149,7 +149,7 @@ int main(int argc, char **argv)
bake_release_instance(bti); bake_release_instance(bti);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
margo_finalize(mid); margo_finalize(mid);
fprintf(stderr, "Error: bake_bulk_read()\n"); fprintf(stderr, "Error: bake_read()\n");
return(-1); return(-1);
} }
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "bake-bulk-client.h" #include "bake-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 region */
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
...@@ -27,7 +27,7 @@ int main(int argc, char **argv) ...@@ -27,7 +27,7 @@ int main(int argc, char **argv)
bake_target_id_t bti; bake_target_id_t bti;
hg_return_t hret; hg_return_t hret;
int ret; int ret;
bake_bulk_region_id_t rid; bake_region_id_t rid;
int fd; int fd;
struct stat statbuf; struct stat statbuf;
char* local_region; char* local_region;
...@@ -37,8 +37,8 @@ int main(int argc, char **argv) ...@@ -37,8 +37,8 @@ int main(int argc, char **argv)
if(argc != 3) if(argc != 3)
{ {
fprintf(stderr, "Usage: bb-copy-to <local file> <server addr>\n"); fprintf(stderr, "Usage: bake-copy-to <local file> <server addr>\n");
fprintf(stderr, " Example: ./bb-copy-to /tmp/foo.dat tcp://localhost:1234\n"); fprintf(stderr, " Example: ./bake-copy-to /tmp/foo.dat tcp://localhost:1234\n");
return(-1); return(-1);
} }
svr_addr_str = argv[2]; svr_addr_str = argv[2];
...@@ -102,7 +102,7 @@ int main(int argc, char **argv) ...@@ -102,7 +102,7 @@ int main(int argc, char **argv)
} }
/* create region */ /* create region */
ret = bake_bulk_create(bti, statbuf.st_size, &rid); ret = bake_create(bti, statbuf.st_size, &rid);
if(ret != 0) if(ret != 0)
{ {
bake_release_instance(bti); bake_release_instance(bti);
...@@ -110,12 +110,12 @@ int main(int argc, char **argv) ...@@ -110,12 +110,12 @@ int main(int argc, char **argv)
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_bulk_create()\n"); fprintf(stderr, "Error: bake_create()\n");
return(-1); return(-1);
} }
/* transfer data */ /* transfer data */
ret = bake_bulk_write( ret = bake_write(
bti, bti,
rid, rid,
0, 0,
...@@ -128,31 +128,31 @@ int main(int argc, char **argv) ...@@ -128,31 +128,31 @@ int main(int argc, char **argv)
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_bulk_write()\n"); fprintf(stderr, "Error: bake_write()\n");
return(-1); return(-1);
} }
munmap(local_region, statbuf.st_size); munmap(local_region, statbuf.st_size);
close(fd); close(fd);
ret = bake_bulk_persist(bti, rid); ret = bake_persist(bti, rid);
if(ret != 0) if(ret != 0)
{ {
bake_release_instance(bti); bake_release_instance(bti);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
margo_finalize(mid); margo_finalize(mid);
fprintf(stderr, "Error: bake_bulk_persist()\n"); fprintf(stderr, "Error: bake_persist()\n");
return(-1); return(-1);
} }
/* safety check size */ /* safety check size */
ret = bake_bulk_get_size(bti, rid, &check_size); ret = bake_get_size(bti, rid, &check_size);
if(ret != 0) if(ret != 0)
{ {
bake_release_instance(bti); bake_release_instance(bti);
margo_addr_free(mid, svr_addr); margo_addr_free(mid, svr_addr);
margo_finalize(mid); margo_finalize(mid);
fprintf(stderr, "Error: bake_bulk_get_size()\n"); fprintf(stderr, "Error: bake_get_size()\n");
return(-1); return(-1);
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "bake-bulk-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_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);
...@@ -22,7 +22,7 @@ static void bench_routine_print(const char* op, int size, int iterations, double ...@@ -22,7 +22,7 @@ static void bench_routine_print(const char* op, int size, int iterations, double
static int measurement_cmp(const void* a, const void *b); static int measurement_cmp(const void* a, const void *b);
static double *measurement_array = NULL; static double *measurement_array = NULL;
static bake_bulk_region_id_t rid; static bake_region_id_t rid;