File: prte_check_slurm.m4

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (90 lines) | stat: -rw-r--r-- 3,515 bytes parent folder | download
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
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
#                         University Research and Technology
#                         Corporation.  All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
#                         of Tennessee Research Foundation.  All rights
#                         reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
#                         University of Stuttgart.  All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
#                         All rights reserved.
# Copyright (c) 2009-2020 Cisco Systems, Inc.  All rights reserved
# Copyright (c) 2016      Los Alamos National Security, LLC. All rights
#                         reserved.
# Copyright (c) 2017-2019 Intel, Inc.  All rights reserved.
# Copyright (c) 2021      Nanook Consulting.  All rights reserved.
# Copyright (c) 2022      Amazon.com, Inc. or its affiliates.
#                         All Rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# PRTE_CHECK_SLURM(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([PRTE_CHECK_SLURM],[
    if test -z "$prte_check_slurm_happy" ; then
	AC_ARG_WITH([slurm],
           [AS_HELP_STRING([--with-slurm],
                           [Build SLURM scheduler component (default: yes)])])

	if test "$with_slurm" = "no" ; then
            prte_check_slurm_happy="no"
	elif test "$with_slurm" = "" ; then
            # unless user asked, only build slurm component on linux, AIX,
            # and OS X systems (these are the platforms that SLURM
            # supports)
            case $host in
		*-linux*|*-aix*|*-apple-darwin*)
                    prte_check_slurm_happy="yes"
                    ;;
		*)
                    AC_MSG_CHECKING([for SLURM srun in PATH])
		    PRTE_WHICH([srun], [PRTE_CHECK_SLURM_SRUN])
                    if test "$PRTE_CHECK_SLURM_SRUN" = ""; then
			prte_check_slurm_happy="no"
                    else
			prte_check_slurm_happy="yes"
                    fi
                    AC_MSG_RESULT([$prte_check_slurm_happy])
                    ;;
            esac
        else
            prte_check_slurm_happy="yes"
        fi

        AS_IF([test "$prte_check_slurm_happy" = "yes"],
              [AC_CHECK_FUNC([fork],
                             [prte_check_slurm_happy="yes"],
                             [prte_check_slurm_happy="no"])])

        AS_IF([test "$prte_check_slurm_happy" = "yes"],
              [AC_CHECK_FUNC([execve],
                             [prte_check_slurm_happy="yes"],
                             [prte_check_slurm_happy="no"])])

        AS_IF([test "$prte_check_slurm_happy" = "yes"],
              [AC_CHECK_FUNC([setpgid],
                             [prte_check_slurm_happy="yes"],
                             [prte_check_slurm_happy="no"])])

        # check to see if this is a Cray nativized slurm env.

        slurm_cray_env=0
        PRTE_CHECK_ALPS([prte_slurm_cray],
                        [slurm_cray_env=1])

        AC_DEFINE_UNQUOTED([SLURM_CRAY_ENV],[$slurm_cray_env],
                           [defined to 1 if slurm cray env, 0 otherwise])

        PRTE_SUMMARY_ADD([Resource Managers], [Slurm], [], [$prte_check_slurm_happy])
    fi

    AS_IF([test "$prte_check_slurm_happy" = "yes"],
          [$2],
          [$3])
])