22# Licensed under the MIT License. See LICENCE in the project root.
33# ------------------------------------------------------------------
44
5- function readDB (filename)
6-
7- d = Vector ()
8- i= 0
9- for ls in readlines (filename)
10- if i> 0
11- l = split (ls,' ,' )
12- ks = split (l[1 ],' ;' )
13- d2 = d
14- for k in ks
15- next_d = nothing
16- for (key,value) in d
17- if (k == key)
18- next_d = value
19- end
20- end
21- if (isnothing (next_d))
22- next_d = Vector ()
23- push! (d,(k,next_d))
24- end
25- d = next_d
26- end
27- push! (d,(l[2 ],tuple (l[2 : length (l)]. .. )))
28- d = d2
29- end
30- i = i + 1
31- end
325
33- return d
34- end
35-
36- function lookupDB (db, key)
37-
38- d = db
39-
40- while typeof (d) <: Vector
41-
42- ks = d
43-
44- found = false
45- for (k,v) in ks
46- if (occursin (k,key))
47- d = v; found = true
48- break
49- end
50- end
51- if ! found return nothing end
52- end
53-
54- return d
55-
56- end
576
587const processor_dict = Ref {Vector} ()
598const accelerator_dict = Ref {Vector} ()
@@ -777,13 +726,8 @@ function identityInterconnection()
777726 return interconnection_features
778727end
779728
780- # TODO
781729function identifyNode ()
782730
783- println (stderr , " fail." )
784- println (stderr , " => Note: detection of node features (cluster and cloud computing) not yet implemented. Using default features." )
785- println (stderr , " You can setup node features manually." )
786-
787731 node_features = Dict ()
788732
789733 node_features[" node_count" ] = 1
@@ -793,7 +737,13 @@ function identifyNode()
793737 node_features[" node_machinefamily" ] = " unset"
794738 node_features[" node_machinetype" ] = " unset"
795739 node_features[" node_vcpus_count" ] = " unset"
796-
740+
741+ for p in subtypes (CloudProvider)
742+ print (stderr , string (p) * " ?" )
743+ ok = getNodeFeatures (p, node_features)
744+ if (isnothing (ok)) print (stderr , " No" ) else print (stderr , " Yes" ) end ; print (stderr , " , " )
745+ end
746+ print (stderr , " ... ok" )
797747 return node_features
798748end
799749
0 commit comments