- Notifications
You must be signed in to change notification settings - Fork2
A key-value model for HPC resources in CEMC
License
NotificationsYou must be signed in to change notification settings
cemc-oper/hpc-model-go
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A key-value model for HPC resources in CEMC/CMA.Including models for:
- Slurm
Usego get
to install the latest version.
go get github.com/cemc-oper/hpc-model-go
The following example useshpc-model-go
to extract job id and job owner from asqueue -o %all
query.
Create category list:
categoryList:= slurm.QueryCategoryList{QueryCategoryList: hpcmodel.QueryCategoryList{CategoryList: []*hpcmodel.QueryCategory{ {ID:"sinfo.partition",DisplayName:"Partition",Label:"PARTITION",PropertyClass:"StringProperty",PropertyCreateArguments: []string{},RecordParserClass:"TokenRecordParser", }, {ID:"sinfo.avail",DisplayName:"Avail",Label:"AVAIL",PropertyClass:"StringProperty",PropertyCreateArguments: []string{},RecordParserClass:"TokenRecordParser", }, {ID:"sinfo.nodes",DisplayName:"Nodes(A/I/O/T)",Label:"NODES(A/I/O/T)",PropertyClass:"StringProperty",PropertyCreateArguments: []string{},RecordParserClass:"TokenRecordParser", }, {ID:"sinfo.cpus",DisplayName:"CPUs(A/I/O/T)",Label:"CPUS(A/I/O/T)",PropertyClass:"StringProperty",PropertyCreateArguments: []string{},RecordParserClass:"TokenRecordParser", }, }, },}
Getsqueue -o %all
output.
cmd:=exec.Command("sinfo",params...)//fmt.Println(cmd.Args)varout bytes.Buffercmd.Stdout=&outerr:=cmd.Run()iferr!=nil {returnnil,fmt.Errorf("command ran error: %v",err)}s:=out.String()lines:=strings.Split(s,"\n")
Build model from category list.
model,err:=slurm.BuildModel(lines,categoryList," ")
model
contains data of all categories.
Usego test
to run all tests.
Copyright © 2019-2023, developers at cemc-oper.
hpc-model-go
is licensed underThe MIT License.
About
A key-value model for HPC resources in CEMC
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.