~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to config/cs_batch.m4

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl----------------------------------------------------------------------------
2
 
dnl   This file is part of the Code_Saturne Kernel, element of the
3
 
dnl   Code_Saturne CFD tool.
4
 
dnl
5
 
dnl   Copyright (C) 2011 EDF S.A., France
6
 
dnl
7
 
dnl   The Code_Saturne Kernel is free software; you can redistribute it
8
 
dnl   and/or modify it under the terms of the GNU General Public License
9
 
dnl   as published by the Free Software Foundation; either version 2 of
10
 
dnl   the License, or (at your option) any later version.
11
 
dnl
12
 
dnl   The Code_Saturne Kernel is distributed in the hope that it will be
13
 
dnl   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14
 
dnl   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
dnl   GNU General Public License for more details.
16
 
dnl
17
 
dnl   You should have received a copy of the GNU General Public Licence
18
 
dnl   along with the Code_Saturne Preprocessor; if not, write to the
19
 
dnl   Free Software Foundation, Inc.,
20
 
dnl   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21
 
dnl-----------------------------------------------------------------------------
22
 
 
23
 
# CS_AC_TEST_BATCH
24
 
#-----------------
25
 
# Tries to determine if a batch system is available
26
 
 
27
 
AC_DEFUN([CS_AC_TEST_BATCH], [
28
 
 
29
 
cs_batch_template=no
30
 
 
31
 
AC_ARG_WITH(batch,
32
 
            [AS_HELP_STRING([--with-batch=TYPE],
33
 
                            [specify batch type or template path])],
34
 
            [with_batch=$withval],
35
 
            [with_batch=check])
36
 
 
37
 
# Attempt at auto-detection
38
 
 
39
 
if test "x$with_batch" = "xcheck" ; then
40
 
 
41
 
  AC_MSG_CHECKING([for batch system])
42
 
 
43
 
  # Check for available batch types
44
 
 
45
 
  cmd_prev=no
46
 
 
47
 
  for cmd in qsub ccc_msub bsub llsubmit sbatch; do
48
 
 
49
 
    which $cmd > /dev/null 2>&1
50
 
    if test $? = 0 ; then
51
 
 
52
 
      if test "$cmd_prev" != "no" ; then
53
 
        AC_MSG_ERROR([
54
 
At least 2 batch submission commands found ($cmd_prev and $cmd);
55
 
use --with-batch=<value> to specify either batch type (PBS, CCC, LSF,
56
 
LOADL, SGE, or SLURM), absolute path to batch template file, or "no")])
57
 
      else
58
 
        cmd_prev=$cmd
59
 
      fi
60
 
    fi
61
 
 
62
 
  done
63
 
 
64
 
  case $cmd_prev in
65
 
    qsub)
66
 
      # qsub may be either PBS (PBS-PRO, TORQUE) or Sun Grid Engine
67
 
      # but Sun Grid Engine should have qmon command.
68
 
       which qmon > /dev/null 2>&1
69
 
       if test $? = 0 ; then
70
 
         cs_batch_template=SGE
71
 
       else
72
 
         cs_batch_template=PBS
73
 
       fi
74
 
       ;;
75
 
 
76
 
    ccc_msub) cs_batch_template=CCC ;; 
77
 
    bsub) cs_batch_template=LSF ;;
78
 
    llsubmit) cs_batch_template=LOADL ;;
79
 
    sbatch) cs_batch_template=SLURM ;;
80
 
    *) cs_batch_template=no ;;
81
 
  esac
82
 
 
83
 
  AC_MSG_RESULT($cs_batch_template)
84
 
 
85
 
elif test "x$with_batch" != "xno" ; then
86
 
  cs_batch_template=$with_batch
87
 
fi
88
 
 
89
 
AC_SUBST(cs_batch_template)
90
 
 
91
 
])dnl
92