Commit c0677770 authored by Philip Carns's avatar Philip Carns
Browse files

Merge branch 'carns/clang-format' into 'master'

clang format

See merge request !18
parents 0cb6f9fc bbe020b1
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(margo)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentExternBlock: AfterExternBlock
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- MARGO_REGISTER
- MARGO_REGISTER_PROVIDER
- DEFINE_MARGO_RPC_HANDLER
- DECLARE_MARGO_RPC_HANDLER
- MERCURY_GEN_PROC
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- MERCURY_GEN_PROC
...
/*
* (C) 2016 The University of Chicago
*
*
* See COPYRIGHT in top-level directory.
*/
......@@ -15,10 +15,10 @@
extern "C" {
#endif
#define BAKE_CLIENT_NULL ((bake_client_t)NULL)
#define BAKE_CLIENT_NULL ((bake_client_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_provider_handle* bake_provider_handle_t;
/**
......@@ -56,11 +56,10 @@ int bake_client_finalize(bake_client_t client);
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_provider_handle_create(
bake_client_t client,
hg_addr_t addr,
uint16_t provider_id,
bake_provider_handle_t* handle);
int bake_provider_handle_create(bake_client_t client,
hg_addr_t addr,
uint16_t provider_id,
bake_provider_handle_t* handle);
/**
* Increment the reference counter of the provider handle
......@@ -81,23 +80,24 @@ int bake_provider_handle_ref_incr(bake_provider_handle_t handle);
* @param addr Returned address (ignored if NULL)
* @param provider_id Returned provider id (ignored if NULL)
*
* @return BAKE_SUCCESS or corresponding error code.
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_provider_handle_get_info(bake_provider_handle_t handle,
bake_client_t *client,
hg_addr_t *addr,
uint16_t *provider_id);
bake_client_t* client,
hg_addr_t* addr,
uint16_t* provider_id);
/**
* Get the limit (in bytes) bellow which this provider handle will use
* eager mode (i.e. packing data into the RPC instead of using RDMA).
* eager mode (i.e. packing data into the RPC instead of using RDMA).
*
* @param[in] handle provider handle
* @param[out] limit limit
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_provider_handle_get_eager_limit(bake_provider_handle_t handle, uint64_t* limit);
int bake_provider_handle_get_eager_limit(bake_provider_handle_t handle,
uint64_t* limit);
/**
* Set the limit (in bytes) bellow which this provider handle will use
......@@ -108,7 +108,8 @@ int bake_provider_handle_get_eager_limit(bake_provider_handle_t handle, uint64_t
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_provider_handle_set_eager_limit(bake_provider_handle_t handle, uint64_t limit);
int bake_provider_handle_set_eager_limit(bake_provider_handle_t handle,
uint64_t limit);
/**
* Decrement the reference counter of the provider handle,
......@@ -128,16 +129,16 @@ int bake_provider_handle_release(bake_provider_handle_t handle);
*
* @param [in] provider provider handle
* @param [in] max_targets maximum number of targets to retrieve
* @param [out] bti array of BAKE target identifiers with enough space for max_targets
* @param [out] bti array of BAKE target identifiers with enough space for
* max_targets
* @param [out] num_targets number of targets returned (at most max_targets)
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_probe(
bake_provider_handle_t provider,
uint64_t max_targets,
bake_target_id_t* bti,
uint64_t* num_targets);
int bake_probe(bake_provider_handle_t provider,
uint64_t max_targets,
bake_target_id_t* bti,
uint64_t* num_targets);
/**
* Creates a bounded-size BAKE data region. The resulting region can be
* written using BAKE write operations, and can be persisted (once writes
......@@ -150,12 +151,11 @@ int bake_probe(
* @param [out] rid identifier for new region
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_create(
bake_provider_handle_t provider,
bake_target_id_t bti,
uint64_t region_size,
bake_region_id_t *rid);
int bake_create(bake_provider_handle_t provider,
bake_target_id_t bti,
uint64_t region_size,
bake_region_id_t* rid);
/**
* Writes into a BAKE region that was previously created with bake_create().
* Result is not guaranteed to be persistent until explicit
......@@ -171,13 +171,12 @@ int bake_create(
* @param [in] buf_size size of local memory buffer to write
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_write(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
void const *buf,
uint64_t buf_size);
int bake_write(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
void const* buf,
uint64_t buf_size);
/**
* Writes data into a previously created BAKE region like bake_write(),
......@@ -197,18 +196,17 @@ int bake_write(
* @param [in] size size to write from remote bulk handle
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_proxy_write(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
hg_bulk_t remote_bulk,
uint64_t remote_offset,
const char* remote_addr,
uint64_t size);
int bake_proxy_write(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
hg_bulk_t remote_bulk,
uint64_t remote_offset,
const char* remote_addr,
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
* and reads may be performed on the region.
*
* @param [in] provider provider handle
......@@ -217,12 +215,11 @@ int bake_proxy_write(
* @param [in] size of the region
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_persist(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
size_t offset,
size_t size);
int bake_persist(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
size_t offset,
size_t size);
/**
* Creates a bounded-size BAKE region, writes data into it, and persists
......@@ -235,12 +232,11 @@ int bake_persist(
* @param [out] rid identifier for new region
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_create_write_persist(
bake_provider_handle_t provider,
bake_target_id_t bti,
void const *buf,
uint64_t buf_size,
bake_region_id_t *rid);
int bake_create_write_persist(bake_provider_handle_t provider,
bake_target_id_t bti,
void const* buf,
uint64_t buf_size,
bake_region_id_t* rid);
/**
* Issues a bake_create_write_persist on behalf of a remote entity (remote_addr)
......@@ -260,14 +256,13 @@ int bake_create_write_persist(
* @param [out] rid identifier for new region
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_create_write_persist_proxy(
bake_provider_handle_t provider,
bake_target_id_t bti,
hg_bulk_t remote_bulk,
uint64_t remote_offset,
const char* remote_addr,
uint64_t size,
bake_region_id_t *rid);
int bake_create_write_persist_proxy(bake_provider_handle_t provider,
bake_target_id_t bti,
hg_bulk_t remote_bulk,
uint64_t remote_offset,
const char* remote_addr,
uint64_t size,
bake_region_id_t* rid);
/**
* Checks the size of an existing BAKE region.
......@@ -280,11 +275,10 @@ int bake_create_write_persist_proxy(
* @param [out] size size of region
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_get_size(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t *size);
int bake_get_size(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t* size);
/**
* Gets the raw pointer of an existing BAKE region.
......@@ -306,11 +300,10 @@ int bake_get_size(
* @param [out] ptr pointer to the address of the data
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_get_data(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
void** ptr);
int bake_get_data(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
void** ptr);
/**
* Reads from a BAKE region that was previously persisted with bake_persist().
......@@ -326,14 +319,13 @@ int bake_get_data(
* @param [out] bytes_read number of bytes effectively read into the buffer
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_read(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
void *buf,
uint64_t buf_size,
uint64_t* bytes_read);
int bake_read(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
void* buf,
uint64_t buf_size,
uint64_t* bytes_read);
/**
* Reads data from a previously persisted BAKE region like bake_read(),
......@@ -354,16 +346,15 @@ int bake_read(
* @param [out] bytes_read number of bytes effectively read
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_proxy_read(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
hg_bulk_t remote_bulk,
uint64_t remote_offset,
const char* remote_addr,
uint64_t size,
uint64_t* bytes_read);
int bake_proxy_read(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid,
uint64_t region_offset,
hg_bulk_t remote_bulk,
uint64_t remote_offset,
const char* remote_addr,
uint64_t size,
uint64_t* bytes_read);
/**
* @brief Requests the source provider to migrate a particular
......@@ -383,16 +374,15 @@ int bake_proxy_read(
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_migrate_region(
bake_provider_handle_t source,
bake_target_id_t source_bti,
bake_region_id_t source_rid,
size_t region_size,
int remove_source,
const char* dest_addr,
uint16_t dest_provider_id,
bake_target_id_t dest_target_id,
bake_region_id_t* dest_rid);
int bake_migrate_region(bake_provider_handle_t source,
bake_target_id_t source_bti,
bake_region_id_t source_rid,
size_t region_size,
int remove_source,
const char* dest_addr,
uint16_t dest_provider_id,
bake_target_id_t dest_target_id,
bake_region_id_t* dest_rid);
/**
* @brief Migrates a full target from a provider to another.
......@@ -405,25 +395,22 @@ int bake_migrate_region(
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_migrate_target(
bake_provider_handle_t source,
bake_target_id_t src_target_id,
int remove_source,
const char* dest_addr,
uint16_t dest_provider_id,
const char* dest_root);
int bake_migrate_target(bake_provider_handle_t source,
bake_target_id_t src_target_id,
int remove_source,
const char* dest_addr,
uint16_t dest_provider_id,
const char* dest_root);
/**
* Shuts down a remote BAKE service (given an address).
* This will shutdown all the providers on the target address.
*
*
* @param [in] client BAKE client
* @param [in] addr address of the server
* @param [in] addr address of the server
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_shutdown_service(
bake_client_t client,
hg_addr_t addr);
int bake_shutdown_service(bake_client_t client, hg_addr_t addr);
/**
* Issues a BAKE no-op operation.
......@@ -435,16 +422,15 @@ int bake_noop(bake_provider_handle_t provider);
/**
* Removes a previously persisted BAKE region and frees its associated memory.
*
*
* @param provider Provider in which to remove the region.
* @param rid Region to remove.
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_remove(
bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid);
int bake_remove(bake_provider_handle_t provider,
bake_target_id_t bti,
bake_region_id_t rid);
#ifdef __cplusplus
}
......
/*
* (C) 2016 The University of Chicago
*
*
* See COPYRIGHT in top-level directory.
*/
......@@ -15,15 +15,15 @@
extern "C" {
#endif
#define BAKE_ABT_POOL_DEFAULT ABT_POOL_NULL
#define BAKE_ABT_POOL_DEFAULT ABT_POOL_NULL
#define BAKE_PROVIDER_ID_DEFAULT 0
#define BAKE_PROVIDER_IGNORE NULL
#define BAKE_PROVIDER_IGNORE NULL
typedef struct bake_provider* bake_provider_t;
/**
* 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_provider_register'.
*
......@@ -32,10 +32,7 @@ typedef struct bake_provider* bake_provider_t;
* @param[in] pool_mode mode of the created pool
* @returns 0 on success, -1 otherwise
*/
int bake_makepool(
const char *pool_name,
size_t pool_size,
mode_t pool_mode);
int bake_makepool(const char* pool_name, size_t pool_size, mode_t pool_mode);
/**
* Initializes a BAKE provider.
......@@ -47,11 +44,10 @@ int bake_makepool(
* @param[out] provider resulting provider
* @returns 0 on success, -1 otherwise
*/
int bake_provider_register(
margo_instance_id mid,
uint16_t provider_id,
ABT_pool pool,
bake_provider_t* provider);
int bake_provider_register(margo_instance_id mid,
uint16_t provider_id,
ABT_pool pool,
bake_provider_t* provider);
/**
* @brief Deregisters and destroys the provider.
......@@ -60,8 +56,7 @@ int bake_provider_register(
*
* @return 0 on success, -1 otherwise.
*/
int bake_provider_destroy(
bake_provider_t provider);
int bake_provider_destroy(bake_provider_t provider);
/**
* Makes the provider start managing a target.
......@@ -75,10 +70,9 @@ int bake_provider_destroy(
*
* @return 0 on success, -1 on failure
*/
int bake_provider_add_storage_target(
bake_provider_t provider,
const char *target_name,
bake_target_id_t* target_id);
int bake_provider_add_storage_target(bake_provider_t provider,
const char* target_name,
bake_target_id_t* target_id);
/**
* Makes the provider stop managing a target.
......@@ -88,9 +82,8 @@ int bake_provider_add_storage_target(
*
* @return 0 on success, -1 on failure
*/
int bake_provider_remove_storage_target(
bake_provider_t provider,
bake_target_id_t target_id);
int bake_provider_remove_storage_target(bake_provider_t provider,
bake_target_id_t target_id);
/**
* Removes all the targets associated with a provider.
......@@ -99,8 +92,7 @@ int bake_provider_remove_storage_target(
*
* @return 0 on success, -1 on failure
*/
int bake_provider_remove_all_storage_targets(
bake_provider_t provider);
int bake_provider_remove_all_storage_targets(bake_provider_t provider);
/**
* Returns the number of targets that this provider manages.
......@@ -110,9 +102,8 @@ int bake_provider_remove_all_storage_targets(
*
* @return 0 on success, -1 on failure
*/
int bake_provider_count_storage_targets(
bake_provider_t provider,
uint64_t* num_targets);
int bake_provider_count_storage_targets(bake_provider_t provider,
uint64_t* num_targets);
/**
* List the target ids of the targets managed by this provider.
......@@ -125,9 +116,8 @@ int bake_provider_count_storage_targets(
*
* @return 0 on success, -1 on failure
*/
int bake_provider_list_storage_targets(
bake_provider_t provider,
bake_target_id_t* targets);
int bake_provider_list_storage_targets(bake_provider_t provider,
bake_target_id_t* targets);