-
Notifications
You must be signed in to change notification settings - Fork 29
209 lines (207 loc) · 8.38 KB
/
darshan_ldms_test_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#
#Test overview:
# Test the Darshan LDMS Integrated code (e.g. darshanConnector).
# Build and Compile lastest LDMS release
# Build and Compile Darshan against the latest LDMS library
# Run an MPI-IO Test from Darshan's test suites
# Check that the test completes normally and LDMS is collecting runtime timeseries data
# Check that the test completes with Darshan when LDMS variables are not set
#
#
name: Darshan-LDMS Integration Test - Latest
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest]
python-version: ["3.10"]
runs-on: ${{ matrix.platform }}
steps:
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install hdf5-tools libhdf5-openmpi-dev openmpi-bin
python -m pip install --upgrade pip
python -m pip install --upgrade pytest mpi4py
export HDF5_MPI="ON"
CC=mpicc python -m pip install --no-cache-dir h5py
- name: Clone LDMS
uses: actions/checkout@v3
with:
repository: ovis-hpc/ovis
path: ovis
ref: OVIS-4
- name: Clone Darshan Repo
uses: actions/checkout@v3
with:
repository: darshan-hpc/darshan
path: darshan
ref: main
- name: Install LDMS
run: |
cd ovis
sh autogen.sh
set -e
mkdir -p build
pushd build
export CFLAGS="-O1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -march=native"
../configure --prefix=/opt/ovis-latest
make
make install
- name: Install darshan-runtime
run: |
cd darshan
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/include/hdf5/openmpi/
export DARSHAN_INSTALL_PATH=/opt/darshan-latest
git submodule update --init
./prepare.sh
cd darshan-runtime
mkdir build
cd build
# build darshan against LDMS library
CC=mpicc ../configure --prefix=$DARSHAN_INSTALL_PATH --with-log-path-by-env=DARSHAN_LOGPATH --enable-ldms-mod --with-ldms=/opt/ovis-latest --with-jobid-env=NONE --enable-hdf5-mod
make
make install
- name: Install darshan-util
run: |
export DARSHAN_INSTALL_PATH=/opt/darshan-latest
cd darshan/darshan-util
mkdir build
cd build
../configure --prefix=$DARSHAN_INSTALL_PATH --enable-apxc-mod --enable-apmpi-mod
make
make install
- name: Test Preparation and Run
run : |
echo "---setting Darshan environment---"
export DARSHAN_INSTALL_PATH=/opt/darshan-latest
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/include/hdf5/openmpi
export LD_PRELOAD=$DARSHAN_INSTALL_PATH/lib/libdarshan.so
export HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/openmpi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DARSHAN_INSTALL_PATH/lib
export DXT_ENABLE_IO_TRACE=1
echo "---setting LDMS environment---"
export LDMS_INSTALL_PATH=/opt/ovis-latest
export LD_LIBRARY_PATH=$LDMS_INSTALL_PATH/lib/:$LD_LIBRARY_PATH
export LDMSD_PLUGIN_LIBPATH=$LDMS_INSTALL_PATH/lib/ovis-ldms
export ZAP_LIBPATH=$LDMS_INSTALL_PATH/lib/ovis-ldms
export PATH=$LDMS_INSTALL_PATH/sbin:$LDMS_INSTALL_PATH/bin:$PATH
export PYTHONPATH=$LDMS_INSTALL_PATH/lib/python3.6/site-packages
echo "---setting Darshan-LDMS environment---"
export DARSHAN_LDMS_STREAM=darshanConnector
export DARSHAN_LDMS_PORT=10444
export DARSHAN_LDMS_HOST=localhost
export DARSHAN_LDMS_XPRT=sock
export DARSHAN_LDMS_AUTH=none
export POSIX_ENABLE_LDMS=
export MPIIO_ENABLE_LDMS=
export STDIO_ENABLE_LDMS=
export HDF5_ENABLE_LDMS=
echo "---setting Test Case Variables---"
export PROG=mpi-io-test
export DARSHAN_TMP=/tmp/darshan-ldms-test
export DARSHAN_PLATFORM=cray-module-stria
export DARSHAN_TESTDIR=$PWD/darshan/darshan-test/regression
export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan
echo "---checking TMP Path---"
if [ ! -d $DARSHAN_TMP ]; then
mkdir -p $DARSHAN_TMP
fi
if [ ! -d $DARSHAN_TMP ]; then
echo "Error: unable to find or create $DARSHAN_TMP" 1>&2
exit 1
fi
if [ ! -w $DARSHAN_TMP ]; then
echo "Error: unable to write to $DARSHAN_TMP" 1>&2
exit 1
fi
echo "---generating ldmsd configuration file---"
cat > stream-samp-4.3.3.conf << EOF
load name=hello_sampler
config name=hello_sampler producer=host1 instance=host1/hello_sampler stream=darshanConnector component_id=1
start name=hello_sampler interval=1000000 offset=0
load name=stream_csv_store
config name=stream_csv_store path=./streams/store container=csv stream=darshanConnector rolltype=3 rollover=500000
EOF
echo "---starting ldmsd---"
ldmsd -x sock:10444 -c stream-samp-4.3.3.conf -l /tmp/stream-samp-4.3.3.log -v DEBUG
# check it is running
STREAM_SAMP_433_PID=$(pgrep -f stream-samp-4.3.3.conf)
pgrep -a ldmsd
[[ -n "${STREAM_SAMP_433_PID}" ]] || error "stream-samp-4.3.3.log is not running"
echo "---Running Test Case---"
mpicc $DARSHAN_TESTDIR/test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG}
cd $DARSHAN_TMP
./${PROG} -f $DARSHAN_TMP/${PROG}.tmp.dat
echo "---Running Test Case Wihout Darshan-LDMS Env Set---"
unset DARSHAN_LDMS_STREAM
unset DARSHAN_LDMS_PORT
unset DARSHAN_LDMS_HOST
unset DARSHAN_LDMS_XPRT
unset DARSHAN_LDMS_AUTH
# Collect both MPIIO and POSIX
unset DXT_ENABLE_LDMS
unset STDIO_ENABLE_LDMS
unset HDF5_ENABLE_LDMS
export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}-no-ldms-env.darshan
mpicc $DARSHAN_TESTDIR/test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG}
./${PROG} -f $DARSHAN_TMP/${PROG}.tmp.dat
echo "---Running Test Case Without LDMS Streams daemon---"
export DARSHAN_LDMS_STREAM=darshanConnector
export DARSHAN_LDMS_PORT=10444
export DARSHAN_LDMS_HOST=localhost
export DARSHAN_LDMS_XPRT=sock
export DARSHAN_LDMS_AUTH=none
export DXT_ENABLE_LDMS=
export STDIO_ENABLE_LDMS=
export HDF5_ENABLE_LDMS=
export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}-no-ldms-daemon.darshan
echo "killing the daemon"
kill ${STREAM_SAMP_433_PID}
mpicc $DARSHAN_TESTDIR/test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG}
./${PROG} -f $DARSHAN_TMP/${PROG}.tmp.dat
echo "---Parse Darshan log file from darshanConnector Run---"
export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan
if [ ! -x $DARSHAN_INSTALL_PATH/bin/darshan-dxt-parser ]; then
echo "Error: $DARSHAN_PATH doesn't contain a valid Darshan install." 1>&2
exit 1
fi
$DARSHAN_INSTALL_PATH/bin/darshan-parser --all $DARSHAN_LOGFILE > $DARSHAN_TMP/${PROG}.darshan.txt
if [ $? -ne 0 ]; then
echo "Error: failed to parse ${DARSHAN_LOGFILE}" 1>&2
exit 1
fi
$DARSHAN_INSTALL_PATH/bin/darshan-dxt-parser --show-incomplete $DARSHAN_LOGFILE > $DARSHAN_TMP/${PROG}-dxt.darshan.txt
if [ $? -ne 0 ]; then
echo "Error: failed to parse ${DARSHAN_LOGFILE} for dxt tracing" 1>&2
exit 1
fi
- name: Check Results
run: |
export DARSHAN_TMP=/tmp/darshan-ldms-test
export PROG=mpi-io-test
ls -ltr $DARSHAN_TMP
if [[ ! -f "$DARSHAN_TMP/${PROG}.darshan" || ! -f "$DARSHAN_TMP/${PROG}-no-ldms-env.darshan" || ! -f "$DARSHAN_TMP/${PROG}-no-ldms-daemon.darshan" ]]; then
echo "One of the darshan log files do not exist."
exit 1
fi
if ! compgen -G "streams/store/csv/darshanConnector.*" > /dev/null; then
echo "CSV file does not exist."
cat /tmp/stream-samp-4.3.3.log
exit 1
else
ls -ltr streams/store/csv/
cat streams/store/csv/darshanConnector.*
fi
echo "DONE!"