1# Copyright (C) 2015-2021 Regents of the University of California
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16def gridengine_batch_system_factory():
17    from toil.batchSystems.gridengine import GridEngineBatchSystem
18    return GridEngineBatchSystem
19
20
21def parasol_batch_system_factory():
22    from toil.batchSystems.parasol import ParasolBatchSystem
23    return ParasolBatchSystem
24
25
26def lsf_batch_system_factory():
27    from toil.batchSystems.lsf import LSFBatchSystem
28    return LSFBatchSystem
29
30
31def single_machine_batch_system_factory():
32    from toil.batchSystems.singleMachine import SingleMachineBatchSystem
33    return SingleMachineBatchSystem
34
35
36def mesos_batch_system_factory():
37    from toil.batchSystems.mesos.batchSystem import MesosBatchSystem
38    return MesosBatchSystem
39
40
41def slurm_batch_system_factory():
42    from toil.batchSystems.slurm import SlurmBatchSystem
43    return SlurmBatchSystem
44
45
46def torque_batch_system_factory():
47    from toil.batchSystems.torque import TorqueBatchSystem
48    return TorqueBatchSystem
49
50
51def htcondor_batch_system_factory():
52    from toil.batchSystems.htcondor import HTCondorBatchSystem
53    return HTCondorBatchSystem
54
55
56def kubernetes_batch_system_factory():
57    from toil.batchSystems.kubernetes import KubernetesBatchSystem
58    return KubernetesBatchSystem
59
60
61BATCH_SYSTEM_FACTORY_REGISTRY = {
62    'parasol'        : parasol_batch_system_factory,
63    'single_machine' : single_machine_batch_system_factory,
64    'grid_engine'    : gridengine_batch_system_factory,
65    'lsf'            : lsf_batch_system_factory,
66    'mesos'          : mesos_batch_system_factory,
67    'slurm'          : slurm_batch_system_factory,
68    'torque'         : torque_batch_system_factory,
69    'htcondor'       : htcondor_batch_system_factory,
70    'kubernetes'     : kubernetes_batch_system_factory
71}
72BATCH_SYSTEMS = list(BATCH_SYSTEM_FACTORY_REGISTRY.keys())
73DEFAULT_BATCH_SYSTEM = 'single_machine'
74