generate_gitlab_ci_tests.py 37.1 KB
Newer Older
Wenzhe Yu's avatar
Wenzhe Yu committed
1
#!/usr/bin/env python3
2
3
from itertools import product

4

5
6
7
8
9
10
11
12
13
14
15
def set_number_of_cores(mpi_tasks, o):
    cores = 1
    cores = 1 * mpi_tasks

    if (o == "openmp"):
        cores = cores * 2
    return cores

def set_requested_memory(na):
    memory="None"
    if (na == "150"):
16
            memory="2Gb"
17
    elif (na > "150" and na <= "1500"):
18
        memory="12Gb"
19
    elif (na > "1500" and na < "5000"):
20
        memory="12Gb"
21
    else:
22
        memory="16Gb"
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
    return memory

def set_compiler_wrappers(mpi, fc, cc, instr, fortran_compiler, c_compiler):
    fortran_compiler_wrapper="undefined"
    c_compiler_wrapper = "undefined"
    if (instr != "power8"):
        if (m == "mpi" and fc == "intel"):
            fortran_compiler_wrapper="mpiifort"
        if (m == "mpi" and fc == "gnu"):
            fortran_compiler_wrapper="mpif90"
        if (m == "mpi" and cc == "intel"):
            c_compiler_wrapper="mpiicc"
        if (m == "mpi" and cc == "gnu"):
            c_compiler_wrapper="mpicc"

        if (m == "nompi" and fc == "intel"):
            fortran_compiler_wrapper=fortran_compiler[fc]
        if (m == "nompi" and fc == "gnu"):
            fortran_compiler_wrapper=fortran_compiler[fc]
        if (m == "nompi" and cc == "intel"):
            c_compiler_wrapper=c_compiler[cc]
        if (m == "nompi" and cc == "gnu"):
            c_compiler_wrapper=c_compiler[cc]
    else:
        if (m == "mpi" and fc == "pgi"):
            fortran_compiler_wrapper="mpifort"
        if (m == "mpi" and fc == "gnu"):
           fortran_compiler_wrapper="mpifort"
        if (m == "mpi" and cc == "gnu"):
            c_compiler_wrapper="mpicc"
        if (m == "mpi" and cc == "gnu"):
            c_compiler_wrapper="mpicc"

    return (fortran_compiler_wrapper, c_compiler_wrapper)

def set_scalapack_flags(instr, fc, g, m, o):
    scalapackldflags="undefined"
    scalapackfcflags="undefined"
    libs="undefined"
    ldflags="undefined"

    if (instr != "power8"):
        if (fc == "intel"):
            if (m == "mpi"):
                if (o == "openmp"):
                    scalapackldflags="$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_OMP "
                    scalapackfcflags="$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_OMP "
                else:
                    scalapackldflags="$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP "
                    scalapackfcflags="$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP "
            else:
                if (o == "openmp"):
                    scalapackldflags="$MKL_INTEL_SCALAPACK_LDFLAGS_NO_MPI_OMP "
                    scalapackfcflags="$MKL_INTEL_SCALAPACK_FCFLAGS_NO_MPI_OMP "
                else:
                    scalapackldflags="$MKL_INTEL_SCALAPACK_LDFLAGS_NO_MPI_NO_OMP "
                    scalapackfcflags="$MKL_INTEL_SCALAPACK_FCFLAGS_NO_MPI_NO_OMP "

        if (fc == "gnu"):
            if (m == "mpi"):
                if (o == "openmp"):
                    scalapackldflags="$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_OMP "
                    scalapackfcflags="$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_OMP "
                else:
                    scalapackldflags="$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_NO_OMP "
                    scalapackfcflags="$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_NO_OMP "
            else:
                if (o == "openmp"):
                    scalapackldflags="$MKL_GFORTRAN_SCALAPACK_LDFLAGS_NO_MPI_OMP "
                    scalapackfcflags="$MKL_GFORTRAN_SCALAPACK_FCFLAGS_NO_MPI_OMP "
                else:
                    scalapackldflags="$MKL_GFORTRAN_SCALAPACK_LDFLAGS_NO_MPI_NO_OMP "
                    scalapackfcflags="$MKL_GFORTRAN_SCALAPACK_FCFLAGS_NO_MPI_NO_OMP "

        if (g == "with-gpu"):
            scalapackldflags += " -L\\$CUDA_HOME/lib64 -lcublas -I\\$CUDA_HOME/include"
            scalapackfcflags += " -I\\$CUDA_HOME/include"

        if (instr == "sse" or (instr == "avx" and g != "with-gpu")):
Andreas Marek's avatar
Andreas Marek committed
102
103
            scalapackldflags = " SCALAPACK_LDFLAGS=\\\""+scalapackldflags+"\\\""
            scalapackfcflags = " SCALAPACK_FCFLAGS=\\\""+scalapackfcflags+"\\\""
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

        if ( instr == "avx2" or instr == "avx512" or instr == "knl" or g == "with-gpu"):
            scalapackldflags = " SCALAPACK_LDFLAGS=\\\""+"\\"+scalapackldflags+"\\\""
            scalapackfcflags = " SCALAPACK_FCFLAGS=\\\""+"\\"+scalapackfcflags+"\\\""

        libs=""
        ldflags=""
    else:
        # on power 8
        scalapackldflags = ""
        scalapackfcflags = ""
        libs = " LIBS=\\\" -lessl -lreflapack -lessl -lcublas -lgfortran \\\""
        ldflags = " LDFLAGS=\\\" -L/home/elpa/libs/scalapack/lib -L\\$CUDA_HOME/lib64 \\\""


    return (scalapackldflags,scalapackfcflags,libs,ldflags)

def set_cflags_fcflags(instr, cc, fc, instruction_set):
    CFLAGS=""
    FCFLAGS=""
    INSTRUCTION_OPTIONS=""

    if (instr == "avx512"):
        INSTRUCTION_OPTIONS = " --enable-avx512"
        if (cc == "gnu"):
            CFLAGS += "-O3 -march=skylake-avx512"
        else:
            CFLAGS += "-O3 -xCORE-AVX512"
        if (fc == "gnu"):
            FCFLAGS += "-O3 -march=skylake-avx512"
        else:
            FCFLAGS += "-O3 -xCORE-AVX512"

    if (instr == "knl"):
        INSTRUCTION_OPTIONS = " --enable-avx512"
        if (cc == "gnu"):
            CFLAGS += "-O3 -march=native"
        else:
            CFLAGS += "-O3 -xMIC-AVX512"
        if (fc == "gnu"):
            FCFLAGS += "-O3 -march=native"
        else:
            FCFLAGS += "-O3 -xMIC-AVX512"

    if (instr == "avx2"):
149
        INSTRUCTION_OPTIONS = instruction_set[instr] + " --disable-avx512"
150
151
152
153
154
155
156
157
158
159
        if (cc == "gnu"):
            CFLAGS += "-O3 -mavx2 -mfma"
        else:
            CFLAGS += "-O3 -xAVX2"
        if (fc == "gnu"):
            FCFLAGS += "-O3 -mavx2 -mfma"
        else:
            FCFLAGS += "-O3 -xAVX2"

    if (instr == "avx"):
160
        INSTRUCTION_OPTIONS = instruction_set[instr] + " --disable-avx2 --disable-avx512"
161
162
163
164
165
166
167
168
        if (cc == "gnu"):
           CFLAGS  += "-O3 -mavx"
           FCFLAGS += "-O3 -mavx"
        else:
           CFLAGS  += "-O3 -xAVX"
           FCFLAGS += "-O3 -xAVX"

    if (instr == "sse"):
169
        INSTRUCTION_OPTIONS = instruction_set[instr] + " --disable-avx --disable-avx2 --disable-avx512"
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
        if (cc == "gnu"):
            CFLAGS  +="-O3 -msse4.2"
            FCFLAGS +="-O3 -msse4.2"
        else:
            CFLAGS  +="-O3 -xSSE4.2"
            FCFLAGS +="-O3 -xSSE4.2"

    if (instr == "power8"):
       INSTRUCTION_OPTIONS = instruction_set[instr]
       CFLAGS +="-O2 -I\$CUDA_HOME/include"
       FCFLAGS +="-O2"

    return (CFLAGS, FCFLAGS, INSTRUCTION_OPTIONS)


#define the stages
print("stages:")
print("  - test")
188
189
#print("  - coverage")
#print("  - deploy")
190
191
192
193
print("\n\n")

#define before test actions
print("before_script:")
194
print("  - git clean -f")
195
196
197
198
print("  - export LANG=C")
print("  - ulimit -s unlimited")
print("  - ulimit -v unlimited")
print("  - echo \"HOST \" $(hostname)")
Andreas Marek's avatar
Andreas Marek committed
199
print("  - echo $CI_RUNNER_DESCRIPTION")
Andreas Marek's avatar
Andreas Marek committed
200
print("  - echo $CI_RUNNER_TAGS")
Andreas Marek's avatar
Andreas Marek committed
201
202
203
204
205
206
print("  - export SLURM=yes")
print("  - export INTERACTIVE_RUN=yes")
print("  - if [ \"$(hostname)\" = \"amarek-elpa-gitlab-runner-1\" ]; then module purge && module load git && module list && export INTERACTIVE_RUN=yes && export SLURM=no && source ./ci_test_scripts/.ci-env-vars; fi")
print("  - if [ \"$(hostname)\" = \"amarek-elpa-gitlab-runner-2\" ]; then module purge && module load git && module list && export INTERACTIVE_RUN=yes && export SLURM=no && source ./ci_test_scripts/.ci-env-vars; fi")
print("  - if [ \"$(hostname)\" = \"amarek-elpa-gitlab-runner-3\" ]; then module purge && module load git && module list && export INTERACTIVE_RUN=yes && export SLURM=no && source ./ci_test_scripts/.ci-env-vars; fi")
print("  - if [ \"$(hostname)\" = \"amarek-elpa-gitlab-runner-4\" ]; then module purge && module load git && module list && export INTERACTIVE_RUN=yes && export SLURM=no && source ./ci_test_scripts/.ci-env-vars; fi")
Andreas Marek's avatar
Andreas Marek committed
207
208
print("  - module list")
print("  - source ./ci_test_scripts/.ci-env-vars")
Andreas Marek's avatar
Andreas Marek committed
209
210
211
212

print("  - if [ \"$CI_RUNNER_DESCRIPTION\" = \"freya01-interactive\" ]; then export INTERACTIVE_RUN=yes && export SLURM=no; fi")
print("  - if [ \"$CI_RUNNER_DESCRIPTION\" = \"freya01-interactive-2\" ]; then export INTERACTIVE_RUN=yes && export SLURM=no; fi")

Andreas Marek's avatar
Andreas Marek committed
213
print("\n")
214
215
216
print("  - export MATRIX_SIZE=150")
print("  - export NUMBER_OF_EIGENVECTORS=150")
print("  - export BLOCK_SIZE=16")
Andreas Marek's avatar
Andreas Marek committed
217
218
219
print("  - if [ \"$MEDIUM_MATRIX\" = \"yes\" ]; then export MATRIX_SIZE=1500 && export NUMBER_OF_EIGENVECTORS=750; fi")
print("  - if [ \"$LARGE_MATRIX\" = \"yes\" ]; then export MATRIX_SIZE=5000 && export NUMBER_OF_EIGENVECTORS=500; fi")
print("  - if [ \"$GPU_BLOCKSIZE\" = \"yes\" ]; then export BLOCK_SIZE=128 ; fi")
Andreas Marek's avatar
Andreas Marek committed
220
print("  - if [ -z \"$PIPELINE_MPI_TASKS\" ]; then export MPI_TASKS=2; else export MPI_TASKS=$PIPELINE_MPI_TASKS; fi")
221

Andreas Marek's avatar
Andreas Marek committed
222
print("  - echo \"This test will run with matrix size na = $MATRIX_SIZE, nev= $NUMBER_OF_EIGENVECTORS, on a blacs grid with blocksize nblk= $BLOCK_SIZE \" ")
Andreas Marek's avatar
Andreas Marek committed
223
print("  - export SKIP_STEP=0")
224
print("  - ./autogen.sh")
Andreas Marek's avatar
Andreas Marek committed
225
print("  - export SKIP_STEP=0")
Andreas Marek's avatar
Andreas Marek committed
226
print("  - if [ -f /etc/profile.d/modules.sh ]; then source /etc/profile.d/modules.sh ; else source /etc/profile.d/mpcdf_modules.sh; fi  && . ./ci_test_scripts/.ci-env-vars")
Andreas Marek's avatar
Andreas Marek committed
227

228
229
230
231
232
233
234
print("\n\n")

#define after script
print("# For some reason sometimes not-writable files remain, which cause trouble the")
print("# next time a runner tries to clean-up")
print("after_script:")
print("  - chmod u+w -R .")
Andreas Marek's avatar
Andreas Marek committed
235
print("  - if [ ! -f ./debug.keep ]; then find . -exec chmod a+rxw {} \; && rm -rf * ; fi")
Andreas Marek's avatar
Andreas Marek committed
236
237
#print("  - chmod u+w -R /tmp/elpa")
#print("  - find /tmp/elpa -exec chmod a+rxw {} \; && rm -rf /tmp/elpa ;")
238
239
240
print("\n\n")


241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
##define the total coverage phase
#print("# print coverage results")
#print("total_coverage:")
#print("  only:")
#print("    - /.*master.*/")
#print("  stage: coverage")
#print("  tags:")
#print("    - coverage")
#print("  script:")
#print("    - echo \"Generating coverage report\"")
#print("    - ./ci_test_scripts/ci_coverage_summary")
#print("  artifacts:")
#print("    paths:")
#print("      - public")
#print("\n\n")
#
#print("pages:")
#print("  stage: deploy")
#print("  tags:")
#print("    - coverage")
#print("  script:")
#print("    - echo \"Publishing pages\"")
#print("  artifacts:")
#print("    paths:")
#print("      - public")
#print("  only:")
#print("    - master")
#print("\n\n")
269
270
271
272
273

print("static-build:")
print("  tags:")
print("    - avx")
print("  script:")
274
print("    - ./ci_test_scripts/run_ci_tests.sh -c \" CFLAGS=\\\"-O3 -mavx\\\" FCFLAGS=\\\"-O3 -axAVX\\\" SCALAPACK_LDFLAGS=\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_NO_MPI_NO_OMP\\\"  \
275
        SCALAPACK_FCFLAGS=\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_NO_MPI_NO_OMP\\\" --with-mpi=no FC=ifort --enable-shared=no --enable-static=yes --disable-avx2  --disable-avx512 --enable-optional-argument-in-C-API || { cat config.log; exit 1; } \" -j 8 \
276
        -t $MPI_TASKS -m 150 -n 50 -b 16 -s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM ")
277
278
279
280
281
print("\n\n")

print("# test distcheck")
print("distcheck:")
print("  tags:")
282
print("    - distcheck")
283
print("  script:")
Andreas Marek's avatar
Andreas Marek committed
284
285
#print("    - ./ci_test_scripts/run_ci_tests.sh -c \" CC=gcc FC=gfortran SCALAPACK_LDFLAGS=\\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_NO_MPI_NO_OMP\\\"  \
#        SCALAPACK_FCFLAGS=\\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_NO_MPI_NO_OMP\\\" --enable-option-checking=fatal --with-mpi=no --disable-sse-assembly \
286
#        --disable-sse --disable-avx --disable-avx2 --disable-avx512 || { cat config.log; exit 1; } \" -t $MPI_TASKS -m 150 -n 50 -b 16 -s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM ")
Andreas Marek's avatar
Andreas Marek committed
287
288
print("    - ./ci_test_scripts/run_distcheck_tests.sh  -c \"  CC=gcc FC=gfortran SCALAPACK_LDFLAGS=\\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_NO_MPI_NO_OMP\\\"  \
        SCALAPACK_FCFLAGS=\\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_NO_MPI_NO_OMP\\\" --enable-option-checking=fatal --with-mpi=no --disable-sse-assembly \
289
        --disable-sse --disable-avx --disable-avx2 --disable-avx512 \" -d \"  CC=gcc FC=gfortran SCALAPACK_LDFLAGS=\\\\\\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_NO_MPI_NO_OMP\\\\\\\"  \
290
        SCALAPACK_FCFLAGS=\\\\\\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_NO_MPI_NO_OMP\\\\\\\" --enable-option-checking=fatal --with-mpi=no --disable-sse-assembly \
291
        --disable-sse --disable-avx --disable-avx2 --disable-avx512 \" -t $MPI_TASKS -m 150 -n 50 -b 16 -S$SLURM ")
292
print("\n\n")
293

294
295
print("distcheck-mpi:")
print("  tags:")
296
print("    - distcheck")
297
print("  script:")
Andreas Marek's avatar
Andreas Marek committed
298
299
300
301
#print("    - ./ci_test_scripts/run_ci_tests.sh -c \" FC=mpiifort FCFLAGS=\\\"-xHost\\\" CFLAGS=\\\"-march=native\\\" \
#  SCALAPACK_LDFLAGS=\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\" \
#  SCALAPACK_FCFLAGS=\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\" \
#  --enable-option-checking=fatal --with-mpi=yes \
302
# --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 --disable-avx512 || { cat config.log; exit 1; } \" -t $MPI_TASKS -m 150 \
Andreas Marek's avatar
Andreas Marek committed
303
# -n 50 -b 16 -s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM ")
Andreas Marek's avatar
Andreas Marek committed
304
305
306
print("    - ./ci_test_scripts/run_distcheck_tests.sh  -c \" FC=mpiifort FCFLAGS=\\\"-xHost\\\" \
 CFLAGS=\\\"-march=native\\\" SCALAPACK_LDFLAGS=\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\"  \
 SCALAPACK_FCFLAGS=\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\" --enable-option-checking=fatal \
307
 --with-mpi=yes --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 --disable-avx512 \" -d \" FC=mpiifort FCFLAGS=\\\\\\\"-xHost\\\\\\\" \
308
309
 CFLAGS=\\\\\\\"-march=native\\\\\\\" SCALAPACK_LDFLAGS=\\\\\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\\\\\"  \
 SCALAPACK_FCFLAGS=\\\\\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\\\\\" --enable-option-checking=fatal \
310
 --with-mpi=yes --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 --disable-avx512 \" -t $MPI_TASKS -m 150 -n 50 -b 16 -S$SLURM ")
311
312
print("\n\n")

313
314
print("distcheck-no-autotune:")
print("  tags:")
315
print("    - distcheck")
316
print("  script:")
Andreas Marek's avatar
Andreas Marek committed
317
318
319
320
#print("    - ./ci_test_scripts/run_ci_tests.sh -c \" FC=mpiifort FCFLAGS=\\\"-xHost\\\" CFLAGS=\\\"-march=native\\\" \
#  SCALAPACK_LDFLAGS=\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\" \
#  SCALAPACK_FCFLAGS=\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\" \
#  --enable-option-checking=fatal --with-mpi=yes \
321
#  --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 --disable-avx512 --disable-autotuning || { cat config.log; exit 1; } \" -t $MPI_TASKS -m 150 \
Andreas Marek's avatar
Andreas Marek committed
322
#  -n 50 -b 16 -s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM ")
Andreas Marek's avatar
Andreas Marek committed
323
324
325
print("    - ./ci_test_scripts/run_distcheck_tests.sh  -c \" FC=mpiifort FCFLAGS=\\\"-xHost\\\" \
 CFLAGS=\\\"-march=native\\\" SCALAPACK_LDFLAGS=\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\"  \
 SCALAPACK_FCFLAGS=\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\" --enable-option-checking=fatal \
326
 --with-mpi=yes --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 --disable-avx512 --disable-autotuning \" -d \" FC=mpiifort FCFLAGS=\\\\\\\"-xHost\\\\\\\" \
327
328
 CFLAGS=\\\\\\\"-march=native\\\\\\\" SCALAPACK_LDFLAGS=\\\\\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\\\\\"  \
 SCALAPACK_FCFLAGS=\\\\\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\\\\\" --enable-option-checking=fatal \
329
 --with-mpi=yes --disable-sse-assembly --disable-sse --disable-avx --disable-avx2 --disable-avx512 --disable-autotuning \" -t $MPI_TASKS -m 150 -n 50 -b 16 -S$SLURM ")
330
331
332
print("\n\n")


Andreas Marek's avatar
Andreas Marek committed
333
334
335
336
337
338
339
340
341
342
343
#add two tests for ilp64 mkl interface
ilp64_no_omp_tests = [
    "# gnu-gnu-ilp64-nompi-noomp",
    "gnu-gnu-nompi-noopenmp-ilp64:",
    "  tags:",
    "    - avx",
    "  artifacts:",
    "    when: on_success",
    "    expire_in: 2 month",
    "  script:",
    '   - ./ci_test_scripts/run_ci_tests.sh -c "'
344
345
    'CC=\\"gcc\\" CFLAGS=\\"-O3 -mavx\\" '
    'FC=\\"gfortran\\" FCFLAGS=\\"-O3 -mavx\\" '
Andreas Marek's avatar
Andreas Marek committed
346
    'SCALAPACK_LDFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_NOMPI_NOOMP_ILP64 \\" '
347
    'SCALAPACK_FCFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_NOMPI_NOOMP_ILP64 \\" '
Andreas Marek's avatar
Andreas Marek committed
348
    '--enable-option-checking=fatal --with-mpi=no --disable-openmp '
349
    '--disable-nvidia-gpu --enable-avx --disable-avx2 --disable-avx512 --enable-64bit-integer-math-support || { cat config.log; exit 1; }'
Andreas Marek's avatar
Andreas Marek committed
350
351
352
353
354
355
356
357
358
359
360
361
    '" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE '
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
    "\n",
    "# gnu-gnu-ilp64-nompi-openmp",
    "gnu-gnu-nompi-openmp-ilp64:",
    "  tags:",
    "    - avx",
    "  artifacts:",
    "    when: on_success",
    "    expire_in: 2 month",
    "  script:",
    '   - ./ci_test_scripts/run_ci_tests.sh -c "'
362
363
    'CC=\\"gcc\\" CFLAGS=\\"-O3 -mavx\\" '
    'FC=\\"gfortran\\" FCFLAGS=\\"-O3 -mavx\\" '
Andreas Marek's avatar
Andreas Marek committed
364
    'SCALAPACK_LDFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_NOMPI_OMP_ILP64 \\" '
365
    'SCALAPACK_FCFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_NOMPI_OMP_ILP64 \\" '
Andreas Marek's avatar
Andreas Marek committed
366
    '--enable-option-checking=fatal --with-mpi=no --enable-openmp '
367
    '--disable-nvidia-gpu --enable-avx --disable-avx2 --disable-avx512 --enable-64bit-integer-math-support || { cat config.log; exit 1; }'
Andreas Marek's avatar
Andreas Marek committed
368
369
370
371
372
373
    '" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE '
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
    "\n",
]

print("\n".join(ilp64_no_omp_tests))
374

375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
#two test for ilp64 mkl interface with 32bit intel MPI
ilp64_no_omp_mpi_tests = [
    "# gnu-gnu-ilp64-mpi-noomp",
    "gnu-gnu-mpi-noopenmp-ilp64:",
    "  tags:",
    "    - avx",
    "  artifacts:",
    "    when: on_success",
    "    expire_in: 2 month",
    "  script:",
    '   - ./ci_test_scripts/run_ci_tests.sh -c "'
    'CC=\\"mpicc\\" CFLAGS=\\"-O3 -mavx\\" '
    'FC=\\"mpif90\\" FCFLAGS=\\"-O3 -mavx\\" '
    'SCALAPACK_LDFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_NOOMP_ILP64 \\" '
    'SCALAPACK_FCFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_NOOMP_ILP64 \\" '
    '--enable-option-checking=fatal --with-mpi=yes --disable-openmp '
391
    '--disable-nvidia-gpu --enable-avx --disable-avx2 --disable-avx512 --enable-64bit-integer-math-support || { cat config.log; exit 1; }'
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
    '" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE '
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
    "\n",
    "# gnu-gnu-ilp64-mpi-openmp",
    "gnu-gnu-mpi-openmp-ilp64:",
    "  tags:",
    "    - avx",
    "  artifacts:",
    "    when: on_success",
    "    expire_in: 2 month",
    "  script:",
    '   - ./ci_test_scripts/run_ci_tests.sh -c "'
    'CC=\\"mpicc\\" CFLAGS=\\"-O3 -mavx\\" '
    'FC=\\"mpif90\\" FCFLAGS=\\"-O3 -mavx\\" '
    'SCALAPACK_LDFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_OMP_ILP64 \\" '
    'SCALAPACK_FCFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_OMP_ILP64 \\" '
    '--enable-option-checking=fatal --with-mpi=yes --enable-openmp '
409
    '--disable-nvidia-gpu --enable-avx --disable-avx2 --disable-avx512 --enable-64bit-integer-math-support || { cat config.log; exit 1; }'
410
411
412
413
414
415
416
    '" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE '
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
    "\n",
]

print("\n".join(ilp64_no_omp_mpi_tests))

Andreas Marek's avatar
Andreas Marek committed
417
418
419
420
421
422
423
424
425
426
427
428
429
#two test for matrix-redistribute
matrix_redistribute_mpi_tests = [
    "# gnu-gnu-matrix-redistribute-mpi-noomp",
    "gnu-gnu-mpi-noopenmp-matrix-redistribute:",
    "  tags:",
    "    - avx",
    "  artifacts:",
    "    when: on_success",
    "    expire_in: 2 month",
    "  script:",
    '   - ./ci_test_scripts/run_ci_tests.sh -c "'
    'CC=\\"mpicc\\" CFLAGS=\\"-O3 -mavx\\" '
    'FC=\\"mpif90\\" FCFLAGS=\\"-O3 -mavx\\" '
Andreas Marek's avatar
Andreas Marek committed
430
431
    'SCALAPACK_LDFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_NO_OMP \\" '
    'SCALAPACK_FCFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_NO_OMP \\" '
Andreas Marek's avatar
Andreas Marek committed
432
    '--enable-option-checking=fatal --with-mpi=yes --disable-openmp '
433
    '--disable-nvidia-gpu --enable-avx --disable-avx2 --disable-avx512 --enable-scalapack-tests --enable-autotune-redistribute-matrix || { cat config.log; exit 1; }'
Andreas Marek's avatar
Andreas Marek committed
434
435
436
437
438
439
440
441
442
443
444
445
446
447
    '" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE '
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
    "\n",
    "# gnu-gnu-matrix-redistribute-mpi-openmp",
    "gnu-gnu-mpi-openmp-matrix-redistribute:",
    "  tags:",
    "    - avx",
    "  artifacts:",
    "    when: on_success",
    "    expire_in: 2 month",
    "  script:",
    '   - ./ci_test_scripts/run_ci_tests.sh -c "'
    'CC=\\"mpicc\\" CFLAGS=\\"-O3 -mavx\\" '
    'FC=\\"mpif90\\" FCFLAGS=\\"-O3 -mavx\\" '
Andreas Marek's avatar
Andreas Marek committed
448
449
    'SCALAPACK_LDFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_OMP \\" '
    'SCALAPACK_FCFLAGS=\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_OMP \\" '
Andreas Marek's avatar
Andreas Marek committed
450
    '--enable-option-checking=fatal --with-mpi=yes --enable-openmp '
451
    '--disable-nvidia-gpu --enable-avx --disable-avx2 --disable-avx512 --enable-scalapack-tests --enable-autotune-redistribute-matrix || { cat config.log; exit 1; }'
Andreas Marek's avatar
Andreas Marek committed
452
453
454
455
456
457
458
    '" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE '
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
    "\n",
]

print("\n".join(matrix_redistribute_mpi_tests))

459
# add python tests
Sebastian Ohlmann's avatar
Sebastian Ohlmann committed
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
python_ci_tests = [
    "# python tests",
    "python-intel-intel-mpi-openmp:",
    "  tags:",
    "    - python",
    "  artifacts:",
    "    when: on_success",
    "    expire_in: 2 month",
    "  script:",
    '   - ./ci_test_scripts/run_ci_tests.sh -c "'
    'CC=\\"mpiicc\\" CFLAGS=\\"-O3 -xAVX\\" '
    'FC=\\"mpiifort\\" FCFLAGS=\\"-O3 -xAVX\\" '
    'SCALAPACK_LDFLAGS=\\"$MKL_ANACONDA_INTEL_SCALAPACK_LDFLAGS_MPI_OMP \\" '
    'SCALAPACK_FCFLAGS=\\"$MKL_ANACONDA_INTEL_SCALAPACK_FCFLAGS_MPI_OMP \\" '
    '--enable-option-checking=fatal --with-mpi=yes --enable-openmp '
475
    '--disable-nvidia-gpu --enable-avx --enable-python --enable-python-tests || { cat config.log; exit 1; }'
476
    '" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE '
Andreas Marek's avatar
Andreas Marek committed
477
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
Sebastian Ohlmann's avatar
Sebastian Ohlmann committed
478
479
480
    "\n",
    "python-distcheck:",
    "  tags:",
Andreas Marek's avatar
Andreas Marek committed
481
    "    - python-distcheck",
Sebastian Ohlmann's avatar
Sebastian Ohlmann committed
482
    "  script:",
Andreas Marek's avatar
Andreas Marek committed
483
    '#    - ./ci_test_scripts/run_ci_tests.sh -c "'
Andreas Marek's avatar
Andreas Marek committed
484
485
486
487
    'CC=\\\"mpiicc\\\" CFLAGS=\\\"-O3 -xAVX\\\" '
    'FC="mpiifort" FCFLAGS=\\\"-O3 -xAVX\\\" '
    'SCALAPACK_LDFLAGS=\\\"$MKL_ANACONDA_INTEL_SCALAPACK_LDFLAGS_MPI_OMP\\\" '
    'SCALAPACK_FCFLAGS=\\\"$MKL_ANACONDA_INTEL_SCALAPACK_FCFLAGS_MPI_OMP\\\" '
Sebastian Ohlmann's avatar
Sebastian Ohlmann committed
488
    '--enable-option-checking=fatal --with-mpi=yes --enable-openmp '
489
    '--disable-nvidia-gpu --enable-avx --enable-python --enable-python-tests || { cat config.log; exit 1; }'
490
    '" -j 8 -t $MPI_TASKS -m 150 -n 50 -b 16 '
Andreas Marek's avatar
Andreas Marek committed
491
492
493
    '-s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM',
    "\n",
    '    - ./ci_test_scripts/run_distcheck_tests.sh -c "'
Andreas Marek's avatar
Andreas Marek committed
494
495
496
497
    'CC=\\\"mpiicc\\\" CFLAGS=\\\"-O3 -xAVX\\\" '
    'FC=\\\"mpiifort\\\" FCFLAGS=\\\"-O3 -xAVX\\\" '
    'SCALAPACK_LDFLAGS=\\\"$MKL_ANACONDA_INTEL_SCALAPACK_LDFLAGS_MPI_OMP \\\" '
    'SCALAPACK_FCFLAGS=\\\"$MKL_ANACONDA_INTEL_SCALAPACK_FCFLAGS_MPI_OMP \\\" '
Sebastian Ohlmann's avatar
Sebastian Ohlmann committed
498
    '--enable-option-checking=fatal --with-mpi=yes --enable-openmp '
499
    '--disable-nvidia-gpu --enable-avx --enable-python --enable-python-tests "'
500
501
502
503
504
    '-d " CC=\\\\\\\"mpiicc\\\\\\\" CFLAGS=\\\\\\\"-O3 -xAVX\\\\\\\" '
    'FC=\\\\\\\"mpiifort\\\\\\\" FCFLAGS=\\\\\\\"-O3 -xAVX\\\\\\\" '
    'SCALAPACK_LDFLAGS=\\\"$MKL_ANACONDA_INTEL_SCALAPACK_LDFLAGS_MPI_OMP \\\" '
    'SCALAPACK_FCFLAGS=\\\"$MKL_ANACONDA_INTEL_SCALAPACK_FCFLAGS_MPI_OMP \\\" '
    '--enable-option-checking=fatal --with-mpi=yes --enable-openmp '
505
    '--disable-nvidia-gpu --enable-avx --enable-python --enable-python-tests'
506
    '" -t $MPI_TASKS -m 150 -n 50 -b 16 -S $SLURM  || { chmod u+rwX -R . ; exit 1 ; }',
Sebastian Ohlmann's avatar
Sebastian Ohlmann committed
507
508
509
510
    "\n",
]
print("\n".join(python_ci_tests))

511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526

# construct the builds of the "test_projects"

stage = {
          "1stage" : "1stage",
          "2stage" : "2stage",
}

api = {
        "new_api" : "",
}

compiler = {
             "gnu" : "gnu",
             "intel" : "intel"
}
Andreas Marek's avatar
Andreas Marek committed
527
528
529
530
531
532
533
534
for comp, s, a in product(
                             sorted(compiler.keys()),
                             sorted(stage.keys()),
                             sorted(api.keys())):

    print("# test_project_"+stage[s]+api[a]+"_"+compiler[comp])
    print("test_project_"+stage[s]+api[a]+"_"+compiler[comp]+":")
    print("  tags:")
535
    print("    - project_test")
Andreas Marek's avatar
Andreas Marek committed
536
537
    print("  script:")
    if ( s == "1stage"):
538
        projectBinary="test_real"
Andreas Marek's avatar
Andreas Marek committed
539
    else:
540
541
542
        projectBinary="test_real2"

    if (comp == "intel"):
543
544
545
546
        if (a == "new_api"):
            print("    - ./ci_test_scripts/run_project_tests.sh -c \" FC=mpiifort FCFLAGS=\\\"-march=native \\\" CFLAGS=\\\"-march=native\\\" \
                    SCALAPACK_LDFLAGS=\\\"$MKL_INTEL_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\" \
                    SCALAPACK_FCFLAGS=\\\"$MKL_INTEL_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\" \
547
                    --enable-option-checking=fatal  --disable-avx2  --disable-avx512 --prefix=$PWD/installdest --disable-avx2 --disable-avx512 || { cat config.log; exit 1; } \" \
548
                    -t $MPI_TASKS -m 150 -n 50 -b 16 -S $SLURM -p test_project_"+stage[s]+api[a]+" -e "+projectBinary+" \
Andreas Marek's avatar
Andreas Marek committed
549
                    -C \" FC=mpiifort PKG_CONFIG_PATH=$PWD/installdest/lib/pkgconfig  \
550
551
                     --enable-option-checking=fatal || { cat config.log; exit 1; } \" ")

552
    if (comp == "gnu"):
553
554
555
556
        if (a == "new_api"):
            print("    - ./ci_test_scripts/run_project_tests.sh -c \" FC=mpif90 FCFLAGS=\\\"-march=native \\\" CFLAGS=\\\"-march=native\\\" \
                    SCALAPACK_LDFLAGS=\\\"$MKL_GFORTRAN_SCALAPACK_LDFLAGS_MPI_NO_OMP\\\" \
                    SCALAPACK_FCFLAGS=\\\"$MKL_GFORTRAN_SCALAPACK_FCFLAGS_MPI_NO_OMP\\\" \
557
                    --enable-option-checking=fatal  --disable-avx2 --disable-avx512 --prefix=$PWD/installdest --disable-avx2 --disable-avx512 || { cat config.log; exit 1; } \" \
558
                    -t $MPI_TASKS -m 150 -n 50 -b 16 -S $SLURM -p test_project_"+stage[s]+api[a]+" -e "+projectBinary+" \
Andreas Marek's avatar
Andreas Marek committed
559
                    -C \" FC=mpif90 PKG_CONFIG_PATH=$PWD/installdest/lib/pkgconfig \
560
                     --enable-option-checking=fatal || { cat config.log; exit 1; } \" ")
Andreas Marek's avatar
Andreas Marek committed
561
    print("\n\n")
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599

print("#The tests follow here")

c_compiler = {
        "gnu"   : "gcc",
        "intel" : "icc",
}
fortran_compiler = {
        "gnu" : "gfortran",
        "intel" : "ifort",
        "pgi"   : "pgfortran",
}
mpi = {
        "mpi"   : "--with-mpi=yes",
        "nompi" : "--with-mpi=no --disable-mpi-module",
}

openmp = {
        "openmp"   : "--enable-openmp",
        "noopenmp" : "--disable-openmp",
}

precision = {
        "double-precision" : "--disable-single-precision",
        "single-precision" : "--enable-single-precision",
}

assumed_size = {
        "assumed-size" : "--enable-assumed-size",
        "no-assumed-size" : "--disable-assumed-size",
}

band_to_full_blocking = {
        "band-to-full-blocking" : "--enable-band-to-full-blocking",
        "no-band-to-full-blocking" : "--disable-band-to-full-blocking",
}

gpu = {
600
601
        "no-gpu" : "--disable-nvidia-gpu",
        "with-gpu" : "--enable-nvidia-gpu --with-cuda-path=\\$CUDA_HOME/",
602
603
}

604

605
606
607
608
609
coverage = {
        "coverage" : "coverage",
        "no-coverage": "no-coverage",
}

610
        #"knl" : "--enable-avx512",
611
        #"power8" : " --enable-vsx --disable-sse --disable-sse-assembly --disable-avx --disable-avx2 --disable-avx512 --disable-mpi-module --with-GPU-compute-capability=sm_60 ",
Andreas Marek's avatar
Andreas Marek committed
612

613
614
615
616
617
618
619
#instruction_set = {
#        "sse" : " --enable-sse --enable-sse-assembly",
#        "avx" : " --enable-avx",
#        "avx2" : " --enable-avx2",
#        "avx512" : "--enable-avx512",
#}

620
instruction_set = {
Andreas Marek's avatar
Andreas Marek committed
621
        "avx2" : " --enable-avx2",
622
        "avx512" : "--enable-avx512",
623
624
625
626
627
628
629
}

address_sanitize_flag = {
        "address-sanitize" : "address-sanitize",
        "no-address-sanitize" : "no-address-sanitize",
}

630

631
632
633
634
635
636
637
638
639
640
#matrix_size = {
#        "small"   : "150",
#        "medium"  : "1500",
#        "large"   : "5000",
#}

matrix_size = {
        "small"   : "150",
}

641
642
#MPI_TASKS=2

643
644
#                             sorted(coverage.keys()),     
for cc, fc, m, o, p, a, b, g, instr, addr, na in product(
645
646
647
648
649
650
651
                             sorted(c_compiler.keys()),
                             sorted(fortran_compiler.keys()),
                             sorted(mpi.keys()),
                             sorted(openmp.keys()),
                             sorted(precision.keys()),
                             sorted(assumed_size.keys()),
                             sorted(band_to_full_blocking.keys()),
Andreas Marek's avatar
Andreas Marek committed
652
                             sorted(gpu.keys()),
653
654
655
656
                             sorted(instruction_set.keys()),
                             sorted(address_sanitize_flag.keys()),
                             sorted(matrix_size.keys())):

657

658
    cov = "no-coverage"
659
660
661

    nev = 150
    nblk = 16
Andreas Marek's avatar
Andreas Marek committed
662

663
664
665
666
667
    # do not all combinations with all compilers
    # especially - use pgi only on minskys for now
    #            - do not allow to use FC=gfortran but CC=intel
    #            - if pgfortran => use always GPUs
    #            - if gfortran disable MPI module
Andreas Marek's avatar
Andreas Marek committed
668
    #            - on KNL only use intel, do not test openmp
669
670
    if (instr == "power8" and (fc !="pgi" and fc !="gnu")):
        continue
671
672
    if (instr == "knl" and (fc !="intel" and cc !="intel")):
        continue
Andreas Marek's avatar
Andreas Marek committed
673
674
    if (instr == "knl" and o == "openmp"):
        continue
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
    if (fc == "pgi" and instr !="power8"):
        continue
    if ( cc == "intel" and fc == "gnu"):
        continue
    if (fc == "pgi" and g !="with-gpu"):
        continue
    mpi_configure_flag = mpi[m]
    if (fc == "gnu" and  m == "mpi"):
        mpi_configure_flag += " --disable-mpi-module"

    # on power8 only test with mpi and gpu
    if (instr == "power8" and (m == "nompi" or g == "no-gpu")):
        continue

    # set C and FCFLAGS according to instruction set
    (CFLAGS, FCFLAGS, INSTRUCTION_OPTIONS) = set_cflags_fcflags(instr, cc, fc, instruction_set)


    #coverage need O0 and only with gnu and no coverage in combination with address-sanitize
    if (cov == "coverage" and addr == "address-sanitize"):
        continue
    if (cov == "coverage" and (cc != "gnu" or fc != "gnu")):
        continue
    if (cov == "coverage" and instr == "sse"):
        continue
    if (cov == "coverage" and instr == "knl"):
        continue
    if (cov == "coverage" and g == "with-gpu"):
        continue
    if (cov == "coverage"):
        CFLAGS +=" --coverage -O0"
        FCFLAGS +=" --coverage -O0"

708
709
    # add tests for scalapack for some specific test cases
    runScalapackTest = False
Andreas Marek's avatar
Andreas Marek committed
710
711
712
    #if (instr == "avx2" and cov == "coverage" and m == "mpi"):
    #if (instr == "avx2" and m == "mpi"):
    #    runScalapackTest = True
713

714
715
716
717
718
719
720
721

    # address-sanitize only with gnu compiler
    if (addr == "address-sanitize" and (cc != "gnu" and fc != "gnu")):
        continue
    if (instr == "power8" and addr == "address-sanitize"):
        continue
    if (g == "with-gpu" and addr == "address-sanitize"):
        continue
722
723
    if (instr == "knl" and addr == "address-sanitize"):
        continue
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742

    if (addr == "address-sanitize" and (cc == "gnu" and fc == "gnu")):
        CFLAGS += " -fsanitize=address"
        FCFLAGS += " -fsanitize=address"

    # make sure that CFLAGS and FCFLAGS are not empty
    if (CFLAGS == ""):
        CFLAGS = "-O3"
    if (FCFLAGS == ""):
        FCFLAGS = "-O3"

    #KNL is slow: only run single-precision (which includes double-precision)
    if (p == "double-precision" and instr == "knl"):
        continue

    #no gpu testing with openmp
    if (g == "with-gpu" and o == "openmp"):
        continue

Andreas Marek's avatar
Andreas Marek committed
743
    #no gpu testing with intel C compiler (gcc needed)
744
745
746
747
    if (g == "with-gpu" and cc == "intel"):
        continue

    #at the moment gpu testing only on AVX machines or minskys
748
    if (g == "with-gpu" and (instr !="avx512" and instr !="power8")):
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
        continue

#    #on KNL do only intel tests
#    if (instr == "knl" and (cc == "gnu" or fc == "gnu")):
#        continue


    # do to the number of tests, do some only on branchens master and master-pre-stage
    # default is: always test
    # - knl is really slow in building => turn-arround time is aweful
    # - coverage only on masters
    # - double precision only masters (is tested anyway with single precision)
    # - sanitize-address always for sse and avx, else only on master
    MasterOnly=False
    if ( instr == "knl"):
        MasterOnly=True
    if (cov == "coverage"):
        MasterOnly=True
    if (p == "double-precision"):
        MasterOnly=True
    if (instr != "avx" and instr != "sse" and addr == "address-sanitize"):
        MasterOnly=True
771
772
773
774

    # make non-master tests even faster
    # kicking out gpu is not good, but at the momemt we have a real problem with gpu runners
    # should be returned when solved
775
776
777
778
    if (g == "with-gpu"):
        MasterOnly=True
    if (a == "no-assumed-size"):
        MasterOnly=True
779
780
    if (instr == "avx2" or instr == "avx512"):
        MasterOnly=True
781
782
783

    print("# " + cc + "-" + fc + "-" + m + "-" + o + "-" + p + "-" + a + "-" + b + "-" +g + "-" + cov + "-" + instr + "-" + addr)
    print(cc + "-" + fc + "-" + m + "-" + o + "-" + p + "-" +a + "-" +b + "-" +g + "-" + cov + "-" + instr + "-" + addr + "-jobs:")
784
785
786
    if (MasterOnly):
        print("  only:")
        print("    - /.*master.*/")
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
    if (instr == "power8"):
        print("  allow_failure: true")
    print("  tags:")
    if (cov == "coverage"):
        if (instr == "avx"):
            print("    - coverage")
        if (instr == "avx2"):
            print("    - avx2-coverage")
        if (g == "with-gpu"):
            print("    - gpu-coverage")
        if (instr == "avx512"):
            print("    - avx512-coverage")
    else:
        if (g == "with-gpu"):
            if (instr == "power8"):
               print("    - minsky")
            else:
               print("    - gpu")
        else:
            print("    - " + instr)
807
808
809
    print("  artifacts:")
    print("    when: on_success")
    print("    expire_in: 2 month")
810
811
812
813
814
815
    print("  script:")

    (fortran_compiler_wrapper, c_compiler_wrapper) = set_compiler_wrappers(mpi, fc, cc, instr, fortran_compiler, c_compiler)

    (scalapackldflags,scalapackfcflags,libs,ldflags) = set_scalapack_flags(instr, fc, g, m, o)

816
817
    memory = set_requested_memory(matrix_size[na])

Andreas Marek's avatar
Andreas Marek committed
818
819
820
821
822
    if (g != "with-gpu"):
        gpuJob="no"
    else:
        gpuJob="yes"

823
824
    # do the configure
    if ( instr == "sse" or (instr == "avx" and g != "with-gpu")):
825
        if ( instr == "sse"):
826
827
            print("   - if [ $MATRIX_SIZE -gt 150 ]; then export SKIP_STEP=1 ; fi # our SSE test machines do not have a lot of memory")
        print("   - ./ci_test_scripts/run_ci_tests.sh -c \" CC=\\\""+c_compiler_wrapper+"\\\"" + " CFLAGS=\\\""+CFLAGS+"\\\"" + " FC=\\\""+fortran_compiler_wrapper+"\\\"" + " FCFLAGS=\\\""+FCFLAGS+"\\\"" \
Andreas Marek's avatar
Andreas Marek committed
828
829
830
                + libs + " " + ldflags + " " + " "+ scalapackldflags +" " + scalapackfcflags \
                + " --enable-option-checking=fatal" + " " + mpi_configure_flag + " " + openmp[o] \
+ " " + precision[p] + " " + assumed_size[a] + " " + band_to_full_blocking[b] \
Andreas Marek's avatar
Andreas Marek committed
831
+ " " +gpu[g] + INSTRUCTION_OPTIONS + "\" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE -s $SKIP_STEP -i $INTERACTIVE_RUN -S $SLURM -g " +gpuJob)
832

833
    if ( instr == "avx2" or instr == "avx512" or instr == "knl" or g == "with-gpu"):
Andreas Marek's avatar
Andreas Marek committed
834
        print("    - export REQUESTED_MEMORY="+memory)    
835
        print("\n")
836
837

        if (runScalapackTest):
Andreas Marek's avatar
Andreas Marek committed
838
839
            print("    - ./ci_test_scripts/run_ci_tests.sh -c \" CC=\\\""+c_compiler_wrapper+"\\\"" + " CFLAGS=\\\""+CFLAGS+"\\\"" + " FC=\\\""+fortran_compiler_wrapper+"\\\"" + " FCFLAGS=\\\""+FCFLAGS+"\\\"" \
                + libs + " " + ldflags + " " + " "+ scalapackldflags +" " + scalapackfcflags \
Andreas Marek's avatar
Andreas Marek committed
840
                + " --enable-option-checking=fatal --enable-scalapack-tests --enable-autotune-redistribute-matrix" + " " + mpi_configure_flag + " " + openmp[o] \
841
                + " " + precision[p] + " " + assumed_size[a] + " " + band_to_full_blocking[b] \
Andreas Marek's avatar
Andreas Marek committed
842
                + " " +gpu[g] + INSTRUCTION_OPTIONS + "\" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE -s $SKIP_STEP -q \"srun\" -S $SLURM -g " +gpuJob)
Andreas Marek's avatar
Andreas Marek committed
843
844
            

845
        else:
846
            print("    - ./ci_test_scripts/run_ci_tests.sh -c \" CC=\\\""+c_compiler_wrapper+"\\\"" + " CFLAGS=\\\""+CFLAGS+"\\\"" + " FC=\\\""+fortran_compiler_wrapper+"\\\"" + " FCFLAGS=\\\""+FCFLAGS+"\\\"" \
Andreas Marek's avatar
Andreas Marek committed
847
848
                + libs + " " + ldflags + " " + " "+ scalapackldflags +" " + scalapackfcflags \
                + " --enable-option-checking=fatal" + " " + mpi_configure_flag + " " + openmp[o] \
849
                + " " + precision[p] + " " + assumed_size[a] + " " + band_to_full_blocking[b] \
Andreas Marek's avatar
Andreas Marek committed
850
                + " " +gpu[g] + INSTRUCTION_OPTIONS + "\" -j 8 -t $MPI_TASKS -m $MATRIX_SIZE -n $NUMBER_OF_EIGENVECTORS -b $BLOCK_SIZE -s $SKIP_STEP -q \"srun\" -i $INTERACTIVE_RUN -S $SLURM -g " +gpuJob)
851
852
853
854
855
856
857
858
859
860
861

    # do the test

    if ( instr == "avx2" or instr == "avx512" or instr == "knl"  or g == "with-gpu"):
        if (o == "openmp"):
            if (cov == "no-coverage"):
                openmp_threads=" 2 "
            else:
                openmp_threads=" 1 "
        else:
            openmp_threads=" 1 "
862
863
864
865
866
867
        #for na in sorted(matrix_size.keys(),reverse=True):
        #    cores = set_number_of_cores(MPI_TASKS, o)
        #    #print("    - echo \" srun  --ntasks=1 --cpus-per-task="+str(cores)+" $SRUN_COMMANDLINE_RUN\" ")
        #    print("    -  echo \"na= $MATRIX_SIZE, nev= $NUMBER_OF_EIGENVECTORS nblock= $BLOCK_SIZE\" ")
        #    #print("    - srun --ntasks-per-core=1 --ntasks=1 --cpus-per-task="+str(cores)+" $SRUN_COMMANDLINE_RUN \
        #    #                             /scratch/elpa/bin/run_elpa.sh "+str(MPI_TASKS) + openmp_threads +" \" TEST_FLAGS=\\\" $MATRIX_SIZE $NUMBER_OF_EIGENVECTORS $BLOCK_SIZE " +"\\\"  || { cat test-suite.log; exit 1; }\"")
868
869

        if (cov == "coverage"):
870
            print("    - ./ci_test_scripts/ci_coverage_collect")
871
872
873
874
            print("  artifacts:")
            print("    paths:")
            print("      - coverage_data")
    print("\n\n")