Skip to content

Commit fb94e02

Browse files
committed
Merge branch 'integration3' into smpath_int3
Signed-off-by: Changcheng Liu <[email protected]>
2 parents 262c034 + feea247 commit fb94e02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1855
-416
lines changed

.clang-format

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# C
2+
BasedOnStyle: LLVM
3+
AlignEscapedNewlines: Indent
4+
AlignConsecutiveAssignments: true
5+
AlignConsecutiveDeclarations: false
6+
AlignConsecutiveStructMembers: true
7+
AlignConsecutiveMacros: true
8+
AlignDeclarationByPointer: true
9+
AlignAfterOpenBracket: true
10+
AlignOperands: true
11+
PointerAlignment: Right
12+
DerivePointerAlignment: false
13+
AlignTrailingComments: false
14+
AllowAllArgumentsOnNextLine: false
15+
AllowAllParametersOfDeclarationOnNextLine: false
16+
AllowShortBlocksOnASingleLine: false
17+
AllowShortCaseLabelsOnASingleLine: false
18+
AllowShortFunctionsOnASingleLine: false
19+
AllowShortIfStatementsOnASingleLine: false
20+
AllowShortLoopsOnASingleLine: false
21+
AllowShortEnumsOnASingleLine: false
22+
AllowDesignatedInitializersOnASingleLine: false
23+
AlwaysBreakAfterReturnType: None
24+
PenaltyReturnTypeOnItsOwnLine: 20
25+
PenaltyBreakAssignment: 100
26+
PenaltyExcessCharacter: 100
27+
PenaltyBreakBeforeFirstCallParameter: 100
28+
PenaltyBreakMemberAccess: 250
29+
PenaltyBreakLastMemberAccess: 300
30+
PenaltyIndentedWhitespace: 0
31+
ColumnLimit: 80
32+
AlwaysBreakBeforeMultilineStrings: false
33+
BinPackArguments: true
34+
BinPackParameters: true
35+
BreakBeforeBraces: Custom
36+
BraceWrapping:
37+
AfterClass: false
38+
AfterControlStatement: false
39+
AfterEnum: false
40+
AfterFunction: true
41+
AfterNamespace: false
42+
AfterObjCDeclaration: false
43+
AfterStruct: false
44+
AfterUnion: false
45+
AfterExternBlock: false
46+
BeforeCatch: false
47+
BeforeElse: false
48+
IndentBraces: false
49+
SplitEmptyFunction: true
50+
SplitEmptyRecord: true
51+
SplitEmptyNamespace: true
52+
BreakBeforeBinaryOperators: false
53+
BreakBeforeTernaryOperators: false
54+
BreakStringLiterals: true
55+
ContinuationIndentWidth: 8
56+
IncludeBlocks: Regroup
57+
IndentCaseLabels: false
58+
IndentWidth: 4
59+
KeepEmptyLinesAtTheStartOfBlocks: false
60+
IndentPPDirectives: None
61+
MaxEmptyLinesToKeep: 2
62+
SpacesInCStyleCastParentheses: false
63+
SpacesInParentheses: false
64+
SpacesInSquareBrackets: false
65+
SpaceInEmptyParentheses: false
66+
SpaceBeforeParens: ControlStatementsExceptForEachMacros
67+
SpaceBeforeAssignmentOperators: true
68+
SpaceAfterCStyleCast: false
69+
SortIncludes: false
70+
ForEachMacros: ['_UCS_BITMAP_FOR_EACH_WORD',
71+
'FOR_EACH_ENTITY',
72+
'ucs_carray_for_each',
73+
'kh_foreach',
74+
'kh_foreach_key',
75+
'kh_foreach_value',
76+
'ucp_unpacked_address_for_each',
77+
'ucs_array_for_each',
78+
'UCS_BITMAP_FOR_EACH_BIT',
79+
'ucs_for_each_bit',
80+
'ucs_for_each_submask',
81+
'ucs_hlist_for_each',
82+
'ucs_hlist_for_each_extract',
83+
'ucs_hlist_for_each_extract_if',
84+
'ucs_list_for_each',
85+
'ucs_list_for_each_safe',
86+
'ucs_memory_type_for_each',
87+
'UCS_PP_FOREACH',
88+
'UCS_PP_FOREACH_SEP',
89+
'ucs_profile_for_each_location',
90+
'ucs_ptr_array_for_each',
91+
'ucs_ptr_array_locked_for_each',
92+
'ucs_queue_for_each',
93+
'ucs_queue_for_each_extract',
94+
'ucs_queue_for_each_safe',
95+
'ucs_timerq_for_each_expired',
96+
'ucs_string_buffer_for_each_token',
97+
'UCT_IB_IFACE_VERBS_FOREACH_RXWQE',
98+
'UCT_RC_VERBS_IFACE_FOREACH_TXWQE',
99+
'UCS_INIT_ONCE',
100+
'UCS_TEST_F',
101+
'UCX_PERF_TEST_FOREACH']
102+
StatementMacros : []
103+
TypenameMacros: ['khash_t', 'ucs_array_t']
104+
WhitespaceSensitiveMacros: []
105+
106+
# CPP
107+
Standard: Cpp11
108+
AccessModifierOffset: -4
109+
AlwaysBreakTemplateDeclarations: false
110+
BreakBeforeInheritanceComma: false
111+
BreakInheritanceList: AfterColon
112+
BreakConstructorInitializers: AfterColon
113+
CompactNamespaces: false
114+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
115+
ConstructorInitializerIndentWidth: 4
116+
Cpp11BracedListStyle: true
117+
Cpp11BracedListLineBreak: true
118+
FixNamespaceComments: true
119+
NamespaceIndentation: None
120+
UseTab: Never
121+
ReflowComments: false
122+
SortIncludes: false
123+
IncludeCategories:
124+
- Regex: '^"'
125+
Priority: 1
126+
- Regex: '^<'
127+
Priority: 2
128+
SortUsingDeclarations: true
129+
TabWidth: 4
130+
SpacesInAngles: false
131+
SpacesBeforeTrailingComments: 1
132+
SpaceAfterTemplateKeyword: false
133+
SpacesInContainerLiterals: false
134+
---
135+
# Java
136+
Language: Java
137+
DisableFormat: true

buildlib/az-helpers.sh

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
#!/bin/bash -eE
2+
3+
# The following functions uses Azure logging commands to report test
4+
# details or errors. If the process is not running in Azure environment,
5+
# no special output is generated.
6+
7+
# Logging commands documentation: https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands
8+
9+
10+
RUNNING_IN_AZURE="yes"
11+
if [ -z "$AGENT_ID" ]; then
12+
RUNNING_IN_AZURE="no"
13+
fi
14+
15+
# Report error and exit
16+
function error() {
17+
msg=$1
18+
azure_log_issue "${msg}"
19+
echo "ERROR: ${msg}"
20+
exit 1
21+
}
22+
23+
# Define Azure pipeline variable
24+
function azure_set_variable() {
25+
test "x$RUNNING_IN_AZURE" = "xno" && return
26+
name=$1
27+
value=$2
28+
set +x
29+
echo "##vso[task.setvariable variable=${name}]${value}"
30+
}
31+
32+
# Report an issue to Azure pipeline and stop step execution
33+
function azure_log_issue() {
34+
test "x$RUNNING_IN_AZURE" = "xno" && return
35+
msg=$1
36+
set +x
37+
echo "##vso[task.logissue type=error]${msg}"
38+
echo "##vso[task.complete result=Failed;]"
39+
}
40+
41+
# Report an error message to Azure pipeline
42+
function azure_log_error() {
43+
test "x$RUNNING_IN_AZURE" = "xno" && return
44+
msg=$1
45+
set +x
46+
echo "##vso[task.logissue type=error]${msg}"
47+
}
48+
49+
# Report an warning message to Azure pipeline
50+
function azure_log_warning() {
51+
test "x$RUNNING_IN_AZURE" = "xno" && return
52+
msg=$1
53+
set +x
54+
echo "##vso[task.logissue type=warning]${msg}"
55+
}
56+
57+
# Complete the task as "succeeeded with issues"
58+
function azure_complete_with_issues() {
59+
test "x$RUNNING_IN_AZURE" = "xno" && return
60+
msg=$1
61+
set +x
62+
echo "##vso[task.complete result=SucceededWithIssues;]DONE${msg}"
63+
}
64+
65+
# Get IPv4 address of an interface
66+
function get_ip() {
67+
iface=$1
68+
ip=$(ip addr show "$iface" | awk '/inet / {print $2}' | awk -F/ '{print $1}')
69+
echo "$ip"
70+
}
71+
72+
# Get active RDMA interfaces
73+
function get_rdma_interfaces() {
74+
echo `ibdev2netdev | grep Up | awk '{print $5}'`
75+
}
76+
77+
# Prepend each line with a timestamp
78+
function add_timestamp() {
79+
set +x
80+
while IFS= read -r line; do
81+
echo "$(date -u +"%Y-%m-%dT%T.%NZ") $line"
82+
done
83+
}
84+
85+
function az_init_modules() {
86+
. /etc/profile.d/modules.sh
87+
export MODULEPATH="/hpc/local/etc/modulefiles:$MODULEPATH"
88+
}
89+
90+
#
91+
# Test if an environment module exists and load it if yes.
92+
# Otherwise, return error code.
93+
#
94+
function az_module_load() {
95+
module=$1
96+
97+
if module avail -t 2>&1 | grep -q "^$module\$"
98+
then
99+
module load $module
100+
return 0
101+
else
102+
echo "MODULEPATH='${MODULEPATH}'"
103+
module avail || true
104+
azure_log_warning "Module $module cannot be loaded"
105+
return 1
106+
fi
107+
}
108+
109+
#
110+
# Safe unload for env modules (even if it doesn't exist)
111+
#
112+
function az_module_unload() {
113+
module=$1
114+
module unload "${module}" || true
115+
}
116+
117+
118+
#
119+
# try load cuda modules if nvidia driver is installed
120+
#
121+
try_load_cuda_env() {
122+
num_gpus=0
123+
have_cuda=no
124+
have_gdrcopy=no
125+
if [ -f "/proc/driver/nvidia/version" ]; then
126+
have_cuda=yes
127+
have_gdrcopy=yes
128+
az_module_load dev/cuda11.4 || have_cuda=no
129+
az_module_load dev/gdrcopy2.3_cuda11.4 || have_gdrcopy=no
130+
nvidia-smi -a
131+
ls -l /dev/nvidia*
132+
num_gpus=$(nvidia-smi -L | wc -l)
133+
if [ "$num_gpus" -gt 0 ] && ! [ -f /sys/kernel/mm/memory_peers/nv_mem/version ]
134+
then
135+
lsmod
136+
azure_log_error "GPU direct driver not loaded"
137+
fi
138+
fi
139+
}
140+
141+
142+
check_release_build() {
143+
build_reason=$1
144+
build_sourceversion=$2
145+
title_mask=$3
146+
147+
148+
if [ "${build_reason}" == "IndividualCI" ] || \
149+
[ "${build_reason}" == "ResourceTrigger" ]
150+
then
151+
launch=True
152+
elif [ "${build_reason}" == "PullRequest" ]
153+
then
154+
launch=False
155+
# In case of pull request, HEAD^ is the branch commit we merge with
156+
range="$(git rev-parse HEAD^)..${build_sourceversion}"
157+
for sha1 in `git log $range --format="%h"`
158+
do
159+
title=`git log -1 --format="%s" $sha1`
160+
[[ "$title" == "${title_mask}"* ]] && launch=True;
161+
done
162+
fi
163+
164+
echo "##vso[task.setvariable variable=Launch;isOutput=true]${launch}"
165+
}

buildlib/az-network-corrupter.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash -eE
2+
3+
echo "Running $0 $*..."
4+
eval "$*"
5+
initial_delay=${initial_delay:=10}
6+
interface=${interface:=bond0}
7+
cycles=${cycles:=1000}
8+
downtime=${downtime:=5}
9+
uptime=${uptime:=20}
10+
reset=${reset:="no"}
11+
12+
13+
manager_script_dir=/hpc/noarch/git_projects/hpc-mtt-conf/scripts
14+
manager_script=${manager_script_dir}/switch_port_on_off.py
15+
16+
if [ "x$reset" = "xyes" ]; then
17+
echo "Resetting interface ${interface} on $(hostname) interface ..."
18+
${manager_script} -d ${manager_script_dir}/hosts --host $(hostname) -a on -i ${interface}
19+
sleep "$uptime"
20+
exit $?
21+
fi
22+
23+
echo "Initial delay ${initial_delay} sec"
24+
sleep ${initial_delay}
25+
26+
for i in $(seq 1 ${cycles}); do
27+
echo "#$i Put it down! And sleep ${downtime}"
28+
${manager_script} --one -d ${manager_script_dir}/hosts --host $(hostname) -a off -i ${interface}
29+
sleep "$downtime"
30+
31+
echo "#$i Put it up! And sleep ${uptime}"
32+
${manager_script} -d ${manager_script_dir}/hosts --host $(hostname) -a on -i ${interface}
33+
sleep "$uptime"
34+
done

0 commit comments

Comments
 (0)