Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A key-value model for HPC resources in CEMC

License

NotificationsYou must be signed in to change notification settings

cemc-oper/hpc-model-go

Repository files navigation

A key-value model for HPC resources in CEMC/CMA.Including models for:

  • Slurm

Installation

Usego get to install the latest version.

go get github.com/cemc-oper/hpc-model-go

Getting Started

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.

Test

Usego test to run all tests.

License

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp