[Bio] / FigCommon / env.linux-fc4.pl Repository:
ViewVC logotype

Annotation of /FigCommon/env.linux-fc4.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : overbeek 1.1 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 :     #
19 :     # Linux-postgres-specific configuration.
20 :     #
21 :    
22 :     #
23 :     # Invoke the postgres-specific configuration.
24 :     #
25 :     # We'll find it in the FigCommon directory.
26 :     #
27 :    
28 :     #$ cat /proc/meminfo
29 :     # total: used: free: shared: buffers: cached:
30 :     # Mem: 526127104 519618560 6508544 0 117166080 330891264
31 :     # Swap: 263200768 93118464 170082304
32 :     #
33 :    
34 :    
35 :     my $fh;
36 :     if (open($fh, "</proc/meminfo"))
37 :     {
38 :     while (<$fh>)
39 :     {
40 :     print;
41 :     if (/^Mem:\s+(\d+)/)
42 :     {
43 :     $OtherConfig->{memory} = $1;
44 :     last;
45 :     }
46 :     elsif (/^MemTotal:\s+(\d+)\s+(\S+)/)
47 :     {
48 :     my $mem = $1;
49 :     my $units = lc($2);
50 :     if ($units eq "kb")
51 :     {
52 :     $mem *= 1024;
53 :     }
54 :     elsif ($units eq "mb")
55 :     {
56 :     $mem *= 1024 * 1024;
57 :     }
58 :     elsif ($units eq "gb")
59 :     {
60 :     $mem *= 1024 * 1024 * 1024;
61 :     }
62 :    
63 :     $OtherConfig->{memory} = $mem;
64 :     last;
65 :     }
66 :     }
67 :    
68 :     close($fh);
69 :     }
70 :    
71 :     if (open($fh, "</proc/sys/kernel/shmmax"))
72 :     {
73 :     $_ = <$fh>;
74 :     if (/^(\d+)$/)
75 :     {
76 :     $OtherConfig->{shmmax} = $1;
77 :     }
78 :     }
79 :    
80 :     $pg_script = "$ENV{FIGCONFIG_RELEASE_DIR}/FigCommon/envsub.postgres.pl";
81 :    
82 :     run_script($pg_script);
83 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3