new engine(engine, workerLocation)
main engine driver for all the available modules in the hydrocompute library
Parameters:
Name | Type | Description |
---|---|---|
engine |
String | name of engine running the workers |
workerLocation |
String | location of the worker script running the data |
Properties:
Name | Type | Description |
---|---|---|
results |
array with results |
|
execTime |
execution time of the running tasks |
|
engineName |
name of the engine running (javascript, wasm, webgpu) |
|
workerLocation |
location of worker script per engine |
- Source:
Methods
(static) availableScripts() → {Object}
Returns all the available scripts for each of the engines
- Source:
Returns:
available functions for each script on an engine
- Type
- Object
(async, static) concurrentRun(args, step, dependencies) → {Promise}
Runs multiple tasks concurrently using worker threads and dependency graph.
Parameters:
Name | Type | Description |
---|---|---|
args |
object | The arguments for concurrent execution. |
step |
number | The step value. |
dependencies |
Array | The dependency graph. |
- Source:
Returns:
- A promise that resolves to the result of concurrent execution.
- Type
- Promise
(static) initialize(engine)
setter for the current engine name and worker location
Parameters:
Name | Type | Description |
---|---|---|
engine |
String | engine worker location to be fetched |
- Source:
(async, static) parallelRun(args, step) → {Promise.<Array>}
Runs multiple tasks in parallel using worker threads.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
object | The arguments for parallel execution. Properties
|
||||||||||||
step |
number | The step value. |
- Source:
Returns:
- A promise that resolves to an array of results.
- Type
- Promise.<Array>
(static) run(args)
interface method from the compute layer. it resets the values for each of the
Parameters:
Name | Type | Description |
---|---|---|
args |
Object | containing the values for each step of isSplit, data, length, functions, funcArgs, dependencies, linked. See documentation for the HydroCompute class for more details |
- Source:
(static) stepRun(args) → {Promise}
main method for running a simulation. It sets up the way of running the computational engine for each module
Parameters:
Name | Type | Description |
---|---|---|
args |
* |
- Source:
Returns:
Resolves the type of run to take.
- Type
- Promise
(async, static) taskRunner(args, stepCounter, dependencies) → {Promise}
Executes tasks based on the provided dependencies and step counter.
Parameters:
Name | Type | Description |
---|---|---|
args |
object | The arguments for task execution. |
stepCounter |
number | The step counter. |
dependencies |
Array | The dependency graph. |
- Source:
Returns:
- A promise that resolves to the result of task execution.
- Type
- Promise