Debian Codegraph @

modules/libfabric/prov/gni/test/run_gnitest

raw
1 #!/bin/bash
2 #
3 # Copyright (c) 2015 Cray Inc. All rights reserved.
4 # Copyright (c) 2019 Triad National Security, LLC.
5 # All rights reserved.
6 #
7 # This software is available to you under a choice of one of two
8 # licenses. You may choose to be licensed under the terms of the GNU
9 # General Public License (GPL) Version 2, available from the file
10 # COPYING in the main directory of this source tree, or the
11 # BSD license below:
12 #
13 # Redistribution and use in source and binary forms, with or
14 # without modification, are permitted provided that the following
15 # conditions are met:
16 #
17 # - Redistributions of source code must retain the above
18 # copyright notice, this list of conditions and the following
19 # disclaimer.
20 #
21 # - Redistributions in binary form must reproduce the above
22 # copyright notice, this list of conditions and the following
23 # disclaimer in the documentation and/or other materials
24 # provided with the distribution.
25 #
26 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
29 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
30 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
31 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 # SOFTWARE.
34 #
35
36 #
37 # disable use of xpmem bypass for criterion tests
38 #
39 export GNIX_DISABLE_XPMEM=1
40
41 #
42 # disable fma sharing for criterion tests
43 #
44 export UGNI_FMA_SHARED=0
45
46 #
47 # Check for srun or aprun
48 #
49 srun=`command -v srun`
50 if [ $? == 0 ]; then
51 launcher="srun"
52 else
53 aprun=`command -v aprun`
54 if [ $? == 0 ]; then
55 launcher="aprun"
56 else
57 echo "Cannot find a supported job launcher (srun, aprun). Please load the appropriate module"
58 exit -1
59 fi
60 fi
61
62 gnitest_bin="$(cd "$(dirname "$0")" && pwd)/gnitest"
63 if [ ! -f "$gnitest_bin" ]; then
64 echo "Could not find gnitest executable"
65 exit -1
66 fi
67
68 #
69 # for srun need to have multiple cores per task to insure we get enough
70 # GNI resources assiged for tests to pass
71 #
72 if [ $launcher = "srun" ]; then
73 args="-N1 --exclusive --cpu_bind=none -t00:20:00 --ntasks=1 --cpus-per-task=12"
74 else
75 args="-n1 -N1 -j0 -cc none -t1200"
76 fi
77
78 # As of Criterion 2.3, it seems that the PRE_ALL hook is being run
79 # more than once. These two environment variables insure we never
80 # fork and never initialize more than once.
81 export PMI_NO_PREINITIALIZE=1
82 export PMI_NO_FORK=1
83
84 # pass all command line args to gnitest
85 $launcher $args $gnitest_bin -j1 "$@"