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:
Raven Scott
2026-05-21 01:40:29 -04:00
co-authored by Cursor
parent cacab441af
commit d89b56d782
32 changed files with 446 additions and 74 deletions
+8 -5
View File
@@ -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",