Revision 1adec4be
b/Makefile.am | ||
---|---|---|
324 | 324 |
HS_LIB_SRCS = \ |
325 | 325 |
htools/Ganeti/HTools/CLI.hs \ |
326 | 326 |
htools/Ganeti/HTools/Cluster.hs \ |
327 |
htools/Ganeti/HTools/Compat.hs \ |
|
327 | 328 |
htools/Ganeti/HTools/Container.hs \ |
328 | 329 |
htools/Ganeti/HTools/ExtLoader.hs \ |
329 | 330 |
htools/Ganeti/HTools/Group.hs \ |
... | ... | |
462 | 463 |
exit 1; \ |
463 | 464 |
fi |
464 | 465 |
BINARY=$(@:htools/%=%); $(GHC) --make \ |
465 |
$(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \ |
|
466 |
$(HFLAGS) $(HEXTRA) \ |
|
467 |
$(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \ |
|
466 | 468 |
-osuf $$BINARY.o -hisuf $$BINARY.hi $@ |
467 | 469 |
|
468 | 470 |
# for the htools/test binary, we need to enable profiling/coverage |
... | ... | |
1113 | 1115 |
then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \ |
1114 | 1116 |
else OPTGHC=""; \ |
1115 | 1117 |
fi; \ |
1118 |
if [ "$(HTOOLS_PARALLEL3)" ]; \ |
|
1119 |
then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \ |
|
1120 |
fi; \ |
|
1116 | 1121 |
RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(HS_BUILT_SRCS:htools/%=%)"; \ |
1117 | 1122 |
for file in $$RELSRCS; do \ |
1118 | 1123 |
hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \ |
b/configure.ac | ||
---|---|---|
360 | 360 |
AC_SUBST(HTOOLS_NOCURL) |
361 | 361 |
AC_MSG_CHECKING([parallel]) |
362 | 362 |
GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-3.*') |
363 |
if test -z "$GHC_PKG_PARALLEL"
|
|
363 |
if test -n "$GHC_PKG_PARALLEL"
|
|
364 | 364 |
then |
365 |
HTOOLS_PARALLEL3=-DPARALLEL3 |
|
366 |
else |
|
365 | 367 |
GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-2.*') |
366 | 368 |
fi |
367 | 369 |
if test -z "$GHC_PKG_PARALLEL" |
... | ... | |
369 | 371 |
GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-1.*') |
370 | 372 |
fi |
371 | 373 |
AC_SUBST(GHC_PKG_PARALLEL) |
374 |
AC_SUBST(HTOOLS_PARALLEL3) |
|
372 | 375 |
AC_MSG_RESULT($GHC_PKG_PARALLEL) |
373 | 376 |
AC_MSG_CHECKING([json]) |
374 | 377 |
GHC_PKG_JSON=$($GHC_PKG latest json) |
b/htools/Ganeti/HTools/Cluster.hs | ||
---|---|---|
82 | 82 |
import Data.Ord (comparing) |
83 | 83 |
import Text.Printf (printf) |
84 | 84 |
import Control.Monad |
85 |
import Control.Parallel.Strategies |
|
86 | 85 |
|
87 | 86 |
import qualified Ganeti.HTools.Container as Container |
88 | 87 |
import qualified Ganeti.HTools.Instance as Instance |
... | ... | |
90 | 89 |
import qualified Ganeti.HTools.Group as Group |
91 | 90 |
import Ganeti.HTools.Types |
92 | 91 |
import Ganeti.HTools.Utils |
92 |
import Ganeti.HTools.Compat |
|
93 | 93 |
import qualified Ganeti.OpCodes as OpCodes |
94 | 94 |
|
95 | 95 |
-- * Types |
b/htools/Ganeti/HTools/Compat.hs | ||
---|---|---|
1 |
{-# LANGUAGE CPP #-} |
|
2 |
|
|
3 |
{- | Compatibility helper module. |
|
4 |
|
|
5 |
This module holds definitions that help with supporting multiple library versions or transitions between versions. |
|
6 |
|
|
7 |
-} |
|
8 |
|
|
9 |
{- |
|
10 |
|
|
11 |
Copyright (C) 2011 Google Inc. |
|
12 |
|
|
13 |
This program is free software; you can redistribute it and/or modify |
|
14 |
it under the terms of the GNU General Public License as published by |
|
15 |
the Free Software Foundation; either version 2 of the License, or |
|
16 |
(at your option) any later version. |
|
17 |
|
|
18 |
This program is distributed in the hope that it will be useful, but |
|
19 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
21 |
General Public License for more details. |
|
22 |
|
|
23 |
You should have received a copy of the GNU General Public License |
|
24 |
along with this program; if not, write to the Free Software |
|
25 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
26 |
02110-1301, USA. |
|
27 |
|
|
28 |
-} |
|
29 |
|
|
30 |
module Ganeti.HTools.Compat |
|
31 |
( rwhnf |
|
32 |
, Control.Parallel.Strategies.parMap |
|
33 |
) where |
|
34 |
|
|
35 |
import qualified Control.Parallel.Strategies |
|
36 |
|
|
37 |
rwhnf :: Control.Parallel.Strategies.Strategy a |
|
38 |
#ifdef PARALLEL3 |
|
39 |
rwhnf = Control.Parallel.Strategies.rseq |
|
40 |
#else |
|
41 |
rwhnf = Control.Parallel.Strategies.rwhnf |
|
42 |
#endif |
Also available in: Unified diff