-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_good_node_list
executable file
·124 lines (105 loc) · 4.03 KB
/
generate_good_node_list
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/perl -w
# The MIT License
#
# Copyright (c) 2014 Adrian Tan <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
use strict;
use warnings;
my $executablePath = __FILE__;
$executablePath =~ s/[^\/]+$//;
my $defaultUser = "atks";
my $configFile = $executablePath . ".config";
if (-e $configFile)
{
open(IN, $configFile) || die "Cannot open config file";
$defaultUser = <IN>;
chomp($defaultUser);
close(IN);
}
else
{
print STDERR "Please create a .config file containing your user name in the directory of cluster tools.\n";
exit(1);
}
my $acct = @ARGV==1 ? $ARGV[0] : $defaultUser;
my %LOG;
my @nodes = split(",", "10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171");
#my @nodes = split(",", "10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167");
my $host = `hostname`;
open(OUT, ">good_node_list.txt") || die "Cannot open good_node_list.txt";
for my $node (@nodes)
{
if ($host!~/fantasia|wonderland|snowwhite|dumbo/)
{
print STDERR "please run on fantasia, wonderland, snowwhite or dumbo";
}
my $cmd = "";
my $newNode = "";
$cmd = "mosctl whois $node";
$newNode = `$cmd`;
$newNode =~ /\(([^\)]+)\.csgstat\.sph\.umich\.edu\)/;
if (!defined($1))
{
print "$newNode\n";
next;
}
print OUT "$node\t$1\n";
}
for my $miniCluster ("1000g", "sardinia","esp", "amd", "psoriasis", "finnseq", "bipolar", "t2dgenes", "twins", "assembly", "got2d")
{
print OUT "$miniCluster\t$miniCluster\n";
for my $i (1,2,3,4)
{
print OUT "$miniCluster-1" . ($i-1) . "\t$miniCluster-mc0$i\n";
}
if ($miniCluster eq "bipolar")
{
for my $i (5,6,7,8)
{
print OUT "$miniCluster-1" . ($i-1) . "\t$miniCluster-mc0$i\n";
}
}
}
print OUT "1\tfantasia\n";
print OUT "2\tsnowhite\n";
print OUT "3\twonderland\n";
print OUT "4\tdumbo\n";
print OUT "rescheduling\trescheduling\n";
print OUT "topmed\ttopmed\n";
print OUT "(Priority)\t(Priority)\n";
print OUT "(QOSMaxCpusPerUserLimit)\t(QOSMaxCpusPerUserLimit)\n";
print OUT "(Resources)\t(Resources)\n";
print OUT "(None)\t(None)\n";
print OUT "Bwait\tBwait\n";
print OUT "r6306\tr6306\n";
print OUT "r6314\tr6314\n";
print OUT "r6312\tr6312\n";
print OUT "r6309\tr6309\n";
print OUT "r6310\tr6310\n";
print OUT "r6304\tr6304\n";
print OUT "r6303\tr6303\n";
print OUT "r6302\tr6302\n";
print OUT "r6311\tr6311\n";
print OUT "r6315\tr6315\n";
print OUT "r6308\tr6308\n";
print OUT "r6301\tr6301\n";
print OUT "r6313\tr6313\n";
print OUT "r6305\tr6305\n";
close(OUT);