File: prte_check_slurm.m4

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (81 lines) | stat: -rw-r--r-- 3,200 bytes parent folder | download | duplicates (4)
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
# -*- 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-2025 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"])])

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

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