Deepen supercomputer category with shared base and expanded APIs.
Adds supercomputer-base helpers, richer job/shard/steal/thermal modules, priority jobs, claimMatching, and bumps all 14 modules to 0.3.1. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -2,6 +2,7 @@ require('bare-process/global')
|
||||
const EventEmitter = require('bare-events')
|
||||
const b4a = require('b4a')
|
||||
const { initModuleSwarm, gossipSend } = require('../../_shared/p2p-bare.js')
|
||||
const { clusterStats } = require('../../_shared/supercomputer-base.js')
|
||||
|
||||
const PROTOCOL = 'gpu-slot/v1'
|
||||
|
||||
@@ -81,6 +82,10 @@ class HyperP2PGpuSlot extends EventEmitter {
|
||||
return { total: this._slots.size, free: this.freeSlots().length, reserved: this._slots.size - this.freeSlots().length }
|
||||
}
|
||||
|
||||
slotsByTag (tag) {
|
||||
return this.listSlots().filter((s) => (s.tags || []).includes(tag))
|
||||
}
|
||||
|
||||
async ready () {
|
||||
if (this.swarm || !this.topic) return this
|
||||
await initModuleSwarm(this, {
|
||||
@@ -100,12 +105,10 @@ class HyperP2PGpuSlot extends EventEmitter {
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return {
|
||||
...this._stats,
|
||||
return clusterStats(this._stats, PROTOCOL, {
|
||||
slots: this._slots.size,
|
||||
free: this.freeSlots().length,
|
||||
protocol: PROTOCOL
|
||||
}
|
||||
free: this.freeSlots().length
|
||||
})
|
||||
}
|
||||
|
||||
async close () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hyper-p2p-gpu-slot",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "GPU slot registration and reservation for Bare/Pear P2P supercomputer mesh.",
|
||||
"main": "index.js",
|
||||
"type": "commonjs",
|
||||
|
||||
Reference in New Issue
Block a user