Commit e0bd79d7 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

added a pass of clang-format

parent 30ec7725
---
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) 2020 The University of Chicago
*
*
* See COPYRIGHT in top-level directory.
*/
#ifndef __MONA_COLL_H
......@@ -12,7 +12,7 @@
extern "C" {
#endif
#define MONA_IN_PLACE ((void *) -1)
#define MONA_IN_PLACE ((void*)-1)
/**
* @brief Handle for a group of processes. Contrary to MPI, messages
......@@ -49,11 +49,10 @@ typedef void (*mona_op_t)(const void*, void*, na_size_t, na_size_t, void*);
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_create(
mona_instance_t mona,
na_size_t count,
const na_addr_t* peers,
mona_comm_t* comm);
na_return_t mona_comm_create(mona_instance_t mona,
na_size_t count,
const na_addr_t* peers,
mona_comm_t* comm);
/**
* @brief Free a communicator.
......@@ -99,11 +98,8 @@ na_return_t mona_comm_rank(mona_comm_t comm, int* rank);
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_addr(
mona_comm_t comm,
int rank,
na_addr_t* addr,
na_bool_t copy);
na_return_t
mona_comm_addr(mona_comm_t comm, int rank, na_addr_t* addr, na_bool_t copy);
/**
* @brief Duplicate the communicator.
......@@ -113,9 +109,7 @@ na_return_t mona_comm_addr(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_dup(
mona_comm_t comm,
mona_comm_t* new_comm);
na_return_t mona_comm_dup(mona_comm_t comm, mona_comm_t* new_comm);
/**
* @brief Build a new communicator from a subset of the
......@@ -128,11 +122,10 @@ na_return_t mona_comm_dup(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_subset(
mona_comm_t comm,
const int* ranks,
na_size_t size,
mona_comm_t* new_comm);
na_return_t mona_comm_subset(mona_comm_t comm,
const int* ranks,
na_size_t size,
mona_comm_t* new_comm);
/**
* @brief Send data to a destination process. Contrary to
......@@ -148,29 +141,24 @@ na_return_t mona_comm_subset(
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_send(
mona_comm_t comm,
const void *buf,
na_size_t size,
int dest,
na_tag_t tag);
mona_comm_t comm, const void* buf, na_size_t size, int dest, na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_send.
* @see Non-blocking version of mona_comm_send.
*/
na_return_t mona_comm_isend(
mona_comm_t comm,
const void *buf,
na_size_t size,
int dest,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_isend(mona_comm_t comm,
const void* buf,
na_size_t size,
int dest,
na_tag_t tag,
mona_request_t* req);
/**
* @brief Receive a message from a source rank.
*
* MONA_ANY_SOURCE and MONA_ANY_TAG may be used
* to receive from any process or with any tag.
*
*
* actual_size, actual_src, actual_tag may be
* ignored by passing NULL.
*
......@@ -185,29 +173,27 @@ na_return_t mona_comm_isend(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_recv(
mona_comm_t comm,
void* buf,
na_size_t size,
int src,
na_tag_t tag,
na_size_t* actual_size,
int* actual_src,
na_tag_t* actual_tag);
na_return_t mona_comm_recv(mona_comm_t comm,
void* buf,
na_size_t size,
int src,
na_tag_t tag,
na_size_t* actual_size,
int* actual_src,
na_tag_t* actual_tag);
/**
* @see Non-blocking version of mona_comm_recv.
* @see Non-blocking version of mona_comm_recv.
*/
na_return_t mona_comm_irecv(
mona_comm_t comm,
void* buf,
na_size_t size,
int src,
na_tag_t tag,
na_size_t* actual_size,
int* actual_src,
na_tag_t* actual_tag,
mona_request_t* req);
na_return_t mona_comm_irecv(mona_comm_t comm,
void* buf,
na_size_t size,
int src,
na_tag_t tag,
na_size_t* actual_size,
int* actual_src,
na_tag_t* actual_tag,
mona_request_t* req);
/**
* @brief Issue a send and a receive in parallel.
......@@ -227,19 +213,18 @@ na_return_t mona_comm_irecv(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_sendrecv(
mona_comm_t comm,
const void *sendbuf,
na_size_t sendsize,
int dest,
na_tag_t sendtag,
void *recvbuf,
na_size_t recvsize,
int source,
na_tag_t recvtag,
na_size_t* actual_recvsize,
int* actual_recv_src,
na_tag_t* actual_recv_tag);
na_return_t mona_comm_sendrecv(mona_comm_t comm,
const void* sendbuf,
na_size_t sendsize,
int dest,
na_tag_t sendtag,
void* recvbuf,
na_size_t recvsize,
int source,
na_tag_t recvtag,
na_size_t* actual_recvsize,
int* actual_recv_src,
na_tag_t* actual_recv_tag);
/**
* @brief Perform a barrier across the processes of the communicator.
......@@ -249,17 +234,13 @@ na_return_t mona_comm_sendrecv(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_barrier(
mona_comm_t comm,
na_tag_t tag);
na_return_t mona_comm_barrier(mona_comm_t comm, na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_barrier.
*/
na_return_t mona_comm_ibarrier(
mona_comm_t comm,
na_tag_t tag,
mona_request_t* req);
na_return_t
mona_comm_ibarrier(mona_comm_t comm, na_tag_t tag, mona_request_t* req);
/**
* @brief Broadcast data from the specified root process to
......@@ -274,22 +255,17 @@ na_return_t mona_comm_ibarrier(
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_bcast(
mona_comm_t comm,
void *buf,
na_size_t size,
int root,
na_tag_t tag);
mona_comm_t comm, void* buf, na_size_t size, int root, na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_bcast.
*/
na_return_t mona_comm_ibcast(
mona_comm_t comm,
void *buf,
na_size_t size,
int root,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_ibcast(mona_comm_t comm,
void* buf,
na_size_t size,
int root,
na_tag_t tag,
mona_request_t* req);
/**
* @brief Gather data from processes to the root.
......@@ -303,25 +279,23 @@ na_return_t mona_comm_ibcast(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_gather(
mona_comm_t comm,
const void *sendbuf,
na_size_t size,
void *recvbuf,
int root,
na_tag_t tag);
na_return_t mona_comm_gather(mona_comm_t comm,
const void* sendbuf,
na_size_t size,
void* recvbuf,
int root,
na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_gather.
*/
na_return_t mona_comm_igather(
mona_comm_t comm,
const void *sendbuf,
na_size_t size,
void *recvbuf,
int root,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_igather(mona_comm_t comm,
const void* sendbuf,
na_size_t size,
void* recvbuf,
int root,
na_tag_t tag,
mona_request_t* req);
/**
* @brief Version of mona_comm_gather where each process
......@@ -332,35 +306,34 @@ na_return_t mona_comm_igather(
* @param sendsize [IN] Size of data to send from this process
* @param recvbuf [OUT] Receiving buffer (relevant only at root)
* @param recvsizes [IN] recvsizes[r] represents the size to receive from rank r
* @param displ [IN] displ[r] represents the offset at which to place data from rank r in recvbuf
* @param displ [IN] displ[r] represents the offset at which to place data from
* rank r in recvbuf
* @param root [IN] Root process
* @param tag [IN] Tag to use for messages
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_gatherv(
mona_comm_t comm,
const void *sendbuf,
na_size_t sendsize,
void *recvbuf,
const na_size_t* recvsizes,
const na_size_t* displ,
int root,
na_tag_t tag);
na_return_t mona_comm_gatherv(mona_comm_t comm,
const void* sendbuf,
na_size_t sendsize,
void* recvbuf,
const na_size_t* recvsizes,
const na_size_t* displ,
int root,
na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_gatherv.
*/
na_return_t mona_comm_igatherv(
mona_comm_t comm,
const void *sendbuf,
na_size_t sendsize,
void *recvbuf,
const na_size_t* recvsizes,
const na_size_t* displ,
int root,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_igatherv(mona_comm_t comm,
const void* sendbuf,
na_size_t sendsize,
void* recvbuf,
const na_size_t* recvsizes,
const na_size_t* displ,
int root,
na_tag_t tag,
mona_request_t* req);
/**
* @brief Scatter data from the root process to the rest of the processes.
......@@ -374,25 +347,23 @@ na_return_t mona_comm_igatherv(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_scatter(
mona_comm_t comm,
const void *sendbuf,
na_size_t size,
void *recvbuf,
int root,
na_tag_t tag);
na_return_t mona_comm_scatter(mona_comm_t comm,
const void* sendbuf,
na_size_t size,
void* recvbuf,
int root,
na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_scatter.
*/
na_return_t mona_comm_iscatter(
mona_comm_t comm,
const void *sendbuf,
na_size_t size,
void *recvbuf,
int root,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_iscatter(mona_comm_t comm,
const void* sendbuf,
na_size_t size,
void* recvbuf,
int root,
na_tag_t tag,
mona_request_t* req);
/**
* @brief Version of mona_comm_scatter allowing to send
......@@ -409,29 +380,27 @@ na_return_t mona_comm_iscatter(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_scatterv(
mona_comm_t comm,
const void *sendbuf,
const na_size_t *sendsizes,
const na_size_t *displs,
void *recvbuf,
na_size_t recvsize,
int root,
na_tag_t tag);
na_return_t mona_comm_scatterv(mona_comm_t comm,
const void* sendbuf,
const na_size_t* sendsizes,
const na_size_t* displs,
void* recvbuf,
na_size_t recvsize,
int root,
na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_scatterv.
*/
na_return_t mona_comm_iscatterv(
mona_comm_t comm,
const void *sendbuf,
const na_size_t *sendsizes,
const na_size_t *displs,
void *recvbuf,
na_size_t recvsize,
int root,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_iscatterv(mona_comm_t comm,
const void* sendbuf,
const na_size_t* sendsizes,
const na_size_t* displs,
void* recvbuf,
na_size_t recvsize,
int root,
na_tag_t tag,
mona_request_t* req);
/**
* @brief Gather data from all processes to all processes.
......@@ -444,23 +413,21 @@ na_return_t mona_comm_iscatterv(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_allgather(
mona_comm_t comm,
const void *sendbuf,
na_size_t size,
void *recvbuf,
na_tag_t tag);
na_return_t mona_comm_allgather(mona_comm_t comm,
const void* sendbuf,
na_size_t size,
void* recvbuf,
na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_allgather.
*/
na_return_t mona_comm_iallgather(
mona_comm_t comm,
const void *sendbuf,
na_size_t size,
void *recvbuf,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_iallgather(mona_comm_t comm,
const void* sendbuf,
na_size_t size,
void* recvbuf,
na_tag_t tag,
mona_request_t* req);
/**
* @brief Reduce data down to the root process using
......@@ -479,31 +446,29 @@ na_return_t mona_comm_iallgather(
*
* @return NA_SUCCESS or corresponding error code (see na.h)
*/
na_return_t mona_comm_reduce(
mona_comm_t comm,
const void *sendbuf,
void *recvbuf,
na_size_t typesize,
na_size_t count,
mona_op_t op,
void* uargs,
int root,
na_tag_t tag);
na_return_t mona_comm_reduce(mona_comm_t comm,
const void* sendbuf,
void* recvbuf,
na_size_t typesize,
na_size_t count,
mona_op_t op,
void* uargs,
int root,
na_tag_t tag);
/**
* @see Non-blocking version of mona_comm_reduce.
*/
na_return_t mona_comm_ireduce(
mona_comm_t comm,
const void *sendbuf,
void *recvbuf,
na_size_t typesize,
na_size_t count,
mona_op_t op,
void* uargs,
int root,
na_tag_t tag,
mona_request_t* req);
na_return_t mona_comm_ireduce(mona_comm_t comm,
const void* sendbuf,
void* recvbuf,
na_size_t typesize,
na_size_t count,
mona_op_t op,
void* uargs,