Class LocalDistributedContext
java.lang.Object
org.episteme.core.distributed.LocalDistributedContext
- All Implemented Interfaces:
DistributedContext
Local implementation of DistributedContext using ForkJoinPool.
This serves as the default "distributed" context, running tasks in parallel on the local machine.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested classes/interfaces inherited from interface DistributedContext
DistributedContext.Priority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallGather(ByteBuffer sendBuffer, ByteBuffer recvBuffer) Gathers data from all tasks using ByteBuffer.voidallGather(DoubleBuffer sendBuffer, DoubleBuffer recvBuffer) Gathers data from all tasks and distributes the combined data to all tasks.voidbarrier()Synchronizes all processes.voidbroadcast(ByteBuffer buffer, int root) Broadcasts data from a root node using ByteBuffer.voidbroadcast(DoubleBuffer buffer, int root) Broadcasts data from a root node to all other nodes.voidfence()Synchronizes RDMA operations.voidget(ByteBuffer target, int sourceRank, long offset) Initiates a one-sided data transfer from a remote node (RDMA Get) using ByteBuffer.voidget(DoubleBuffer target, int sourceRank, long offset) Initiates a one-sided data transfer from a remote node (RDMA Get).intReturns the number of available processing nodes or cores.<T extends Serializable>
List<Future<T>> Submits a collection of tasks for execution.voidput(ByteBuffer source, int targetRank, long offset) Initiates a one-sided data transfer to a remote node (RDMA Put) using ByteBuffer.voidput(DoubleBuffer source, int targetRank, long offset) Initiates a one-sided data transfer to a remote node (RDMA Put).voidshutdown()Shuts down the context.<T extends Serializable>
Future<T> Submits a task for execution with NORMAL priority.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DistributedContext
submit
-
Constructor Details
-
LocalDistributedContext
public LocalDistributedContext() -
LocalDistributedContext
public LocalDistributedContext(int parallelism)
-
-
Method Details
-
submit
Description copied from interface:DistributedContextSubmits a task for execution with NORMAL priority.- Specified by:
submitin interfaceDistributedContext- Type Parameters:
T- Result type- Parameters:
task- Task to execute- Returns:
- Future representing the result
-
invokeAll
Description copied from interface:DistributedContextSubmits a collection of tasks for execution.- Specified by:
invokeAllin interfaceDistributedContext- Type Parameters:
T- Result type- Parameters:
tasks- List of tasks- Returns:
- List of Futures
-
getParallelism
public int getParallelism()Description copied from interface:DistributedContextReturns the number of available processing nodes or cores.- Specified by:
getParallelismin interfaceDistributedContext
-
shutdown
public void shutdown()Description copied from interface:DistributedContextShuts down the context.- Specified by:
shutdownin interfaceDistributedContext
-
put
Description copied from interface:DistributedContextInitiates a one-sided data transfer to a remote node (RDMA Put).- Specified by:
putin interfaceDistributedContext- Parameters:
source- Data to sendtargetRank- Target node IDoffset- Remote offset
-
get
Description copied from interface:DistributedContextInitiates a one-sided data transfer from a remote node (RDMA Get).- Specified by:
getin interfaceDistributedContext- Parameters:
target- Buffer to receive datasourceRank- Source node IDoffset- Remote offset
-
put
Description copied from interface:DistributedContextInitiates a one-sided data transfer to a remote node (RDMA Put) using ByteBuffer.- Specified by:
putin interfaceDistributedContext
-
get
Description copied from interface:DistributedContextInitiates a one-sided data transfer from a remote node (RDMA Get) using ByteBuffer.- Specified by:
getin interfaceDistributedContext
-
fence
public void fence()Description copied from interface:DistributedContextSynchronizes RDMA operations.- Specified by:
fencein interfaceDistributedContext
-
broadcast
Description copied from interface:DistributedContextBroadcasts data from a root node to all other nodes.- Specified by:
broadcastin interfaceDistributedContext- Parameters:
buffer- The buffer containing data to broadcast. On root, this contains the source data. On other nodes, this buffer will be filled with the received data.root- The rank of the root node broadcasting the data.
-
broadcast
Description copied from interface:DistributedContextBroadcasts data from a root node using ByteBuffer.- Specified by:
broadcastin interfaceDistributedContext
-
allGather
Description copied from interface:DistributedContextGathers data from all tasks and distributes the combined data to all tasks.- Specified by:
allGatherin interfaceDistributedContext- Parameters:
sendBuffer- The buffer containing the data to be sent by this task.recvBuffer- The buffer where the gathered data from all tasks will be stored.
-
allGather
Description copied from interface:DistributedContextGathers data from all tasks using ByteBuffer.- Specified by:
allGatherin interfaceDistributedContext
-
barrier
public void barrier()Description copied from interface:DistributedContextSynchronizes all processes. A process waits at this call until all processes have reached this barrier.- Specified by:
barrierin interfaceDistributedContext
-