|
|
|
@@ -1,34 +1,18 @@ |
|
|
|
package main |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/cgo/src/slurm" |
|
|
|
node_info "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/cgo/src/slurm/nodeinfo" |
|
|
|
"fmt" |
|
|
|
"os" |
|
|
|
) |
|
|
|
|
|
|
|
func main() { |
|
|
|
if len(os.Args) < 2 { |
|
|
|
fmt.Printf("Please specify node name\n") |
|
|
|
return |
|
|
|
} |
|
|
|
name := os.Args[1] |
|
|
|
|
|
|
|
node_list := node_info.Get_node_info(name) |
|
|
|
if node_list.Error_code != 0 { |
|
|
|
msg := slurm.GetErrorString(node_list.Error_code) |
|
|
|
fmt.Printf("Error: %s\n", msg) |
|
|
|
return |
|
|
|
} |
|
|
|
fmt.Printf("Found %d nodes \n", node_list.Record_count) |
|
|
|
|
|
|
|
/* a little bit nicer*/ |
|
|
|
fmt.Printf("name\t State\t\t\t Reason\t\t Tres\n") |
|
|
|
fmt.Printf("________________________________________\n") |
|
|
|
/* name := os.Args[1] |
|
|
|
fmt.Println(string(name))*/ |
|
|
|
node_list := node_info.Get_node_info("localhost") |
|
|
|
fmt.Println(string(node_list.Record_count)) |
|
|
|
for i := range node_list.Node_list { |
|
|
|
node := node_list.Node_list[i] |
|
|
|
fmt.Printf("%s\t %s\t %s\n", node.Node_hostname, node_info.State_to_string(node.Node_state), node.Reason) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |