npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@totemorg/atomic

v2.18.0

Published

Cloud compute for python, js, cv, matlab, R, etc engines

Downloads

18

Readme

ATOMIC

ATOMIC provides cloud computing for python, js, cv, matlab, R, ... engines via the following web endpoints:

POST advance/step/insert a stateful engine
PUT	compile/init/update a stateful engine
DELETE deallocate/kill/delete a stateful engine
GET execute/read/select a stateless engines

Stateless engines are supported at the read (GET) endpoint, and are provided the following parameters:

TAU.i = {tau} = input event sinked to an engine
TAU.o = {tau} = output event sourced from an engine
TAU.p = {sql: {...}, query: {...} }

where the query hash will contain the supplied url parameters.

Stateful engines implement the step-init-kill (POST-PUT-DELETE) endpoints, and are supplied event tokens (tau):

TAU.i = [{tau}, ...] = events arriving to engine's input port
TAU.o = [{tau}, ...] = events departing from engine's output port
TAU.p = {port1: {...}, ... port2: {...}, ... sql: {...} }
TAU.port = engine's in/out port to step
TAU.thread = engine's 0-base thread counter

where input/output ports and engine code are defined by the engine context || COE || SBU.

An event token typically contain the following default fields (they can be freely interpretted and extended by the engine):

job = "" 	= Current job thread N.N...
work = 0 	= Anticipated/delivered data volume (dims bits etc)
disem = "" 	= Disemination channel for this event
classif = ""	= Classification of this event
cost = ""	= Billing center
policy = ""	= Data retention policy
status = 0	= Status code
value = 0	= Flow calculation

Manage

npm install @totemorg/atomic	# install
npm run start [ ? | $ | ...]	# Unit test
npm run verminor				# Roll minor version
npm run vermajor				# Roll major version
npm run redoc					# Regen documentation

Usage

Acquire and optionally configure ATOMIC like this:

var ATOMIC = require("atomic").config({
	key: value, 						// set key
	"key.key": value, 					// indexed set
	"key.key.": value					// indexed append
});

where configuration keys follow ENUMS deep copy conventions.

Program Reference

Constants

ATOMIC

Provides cloud computing on python, js, cv, matlab, R, ... engines via web endpoints. This module documented in accordance with jsdoc.

Requires: module:enums, module:child_process, module:fs, module:vm, module:pythonIF, module:opencvIF, module:RIF
Author: ACMESDS

### Env Dependencies

	HASGPU = 1|0
	HASCAFFE = 1|0
	ODBC_USER
	ODBC_PASS
	URL_MASTER  

ATOMIC.macs

Number of worker cores (aka threads) to provide in the cluster. 0 cores provides only the master.

Kind: static property of ATOMIC

ATOMIC.db

Next available core

Kind: static property of ATOMIC

ATOMIC.lib

Modules to share accross all I-engines

Kind: static property of ATOMIC

ATOMIC.init

Engine initializers.

Kind: static property of ATOMIC

ATOMIC.step

Engine steppers.

Kind: static property of ATOMIC

ATOMIC.config()

Configure the engine interface and estblish workers.

Kind: static method of ATOMIC

ATOMIC.run()

Run an engine.

Allocate the supplied callback cb(core) with the engine core that is/was allocated to a Client.Engine.Type.Instance
thread as defined by this request (in the req.body and req.log).  If a workflow Instance is
provided, then the engine is assumed to be in a workflow (thus the returned core will remain
on the same compile-step thread); otherwise, the engine is assumed to be standalone (thus forcing
the engine to re-compile each time it is stepped).

As used here (and elsewhere) the terms "process", "engine core", "safety core", and "worker" are 
equivalent, and should not be confused with a physical "cpu core".  Because heavyweight 
(spawned) workers run in their own V8 instance, these workers can tollerate all faults (even 
core-dump exceptions). The lightweight (cluster) workers used here, however, share the same V8 
instance.  Heavyweight workers thus provide greater safety for bound executables (like opencv and 
python) at the expense of greater cpu overhead.  

The goal of hyperthreading is to balance threads across cpu cores.  The workerless (master only)
configuration will intrinsically utilize only one of its underlying cpu cores (the OS remains, 
however, free to bounce between cpu cores via SMP).  A worker cluster, however, tends to 
balance threads across all cpu cores, especially when the number of allocated workers exceeds
the number of physical cpu cores.

Only the cluster master can see its workers; thus workers can not send work to other workers, only
the master can send work to workers.   

This method will callback cb(core) with the requested engine core; null if the core could not
be located or allocated.

Kind: static method of ATOMIC

ATOMIC.save()

Save context tau tokens into job files.

Kind: static method of ATOMIC

ATOMIC.insert(req, res)

Provides engine CRUD interface: step/insert/POST, compile/update/PUT, run/select/GET, and free/delete/DELETE.

Kind: static method of ATOMIC

| Param | Type | Description | | --- | --- | --- | | req | Object | Totem request | | res | function | Totem response |

ATOMIC.delete(req, res)

Provides engine CRUD interface: step/insert/POST, compile/update/PUT, run/select/GET, and free/delete/DELETE.

Kind: static method of ATOMIC

| Param | Type | Description | | --- | --- | --- | | req | Object | Totem request | | res | function | Totem response |

ATOMIC.select(req, res)

Provides engine CRUD interface: step/insert/POST, compile/update/PUT, run/select/GET, and free/delete/DELETE.

Kind: static method of ATOMIC

| Param | Type | Description | | --- | --- | --- | | req | Object | Totem request | | res | function | Totem response |

ATOMIC.update(req, res)

Provides engine CRUD interface: step/insert/POST, compile/update/PUT, run/select/GET, and free/delete/DELETE.

Kind: static method of ATOMIC

| Param | Type | Description | | --- | --- | --- | | req | Object | Totem request | | res | function | Totem response |

ATOMIC.mixContext()

Callback engine cb(ctx) with its state ctx primed with state from its ctx.Entry, then export its ctx state specified by its ctx.Exit. The ctx.sqls = {var:"query...", ...} || "query..." enumerates the engine's ctx.Entry (to import state into its ctx before the engine is run), and enumerates the engine's ctx.Exit (to export state from its ctx after the engine is run). If an sqls entry/exit exists, this will cause the ctx.req = [var, ...] list to be built to synchronously import/export the state into/from the engine's context.

Kind: static method of ATOMIC

paths

Paths to various things.

Kind: global constant

Contacting, Contributing, Following

Feel free to


© 2012 ACMESDS