You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a wrapper for a generic runtime backed by an opaque implementation of a parallel computation model, like MPI (multi-process), Tokio (async), or Rayon (multi-thread).
The internals of the Runtime can be implemented with Tokio. That is, a Tokio runtime will be encapsulated in a custom Runtime type, and the Tokio runtime will be the coordinator of the parallel implementation's workers. All Runtime calls should be synchronous and blocking, but internally, the Tokio runtime might make asynchronous / non-blocking calls to the underlying model.
In this sense, this is the first part of four things:
Synchronous runtime wrapper
Asynchronous generic coordinator
Bindings to parallel impls. (OpenMPI, rayon, more Tokio, etc.)
Thread-safe database implementation
Example
/// Available types of runtime. All of these assume a shared file system.enumRuntime{ThreadPool{threads:u32},Async{tasks:u32},MPI{nodes:u32},}/// Arguments to job functions.structArgs<G,D>{game:&G,db:&mutD,}/// Solve the game.fnsolve<G: ...,D: ...>(game:&G,db:&mutD) -> Result<()>{let rt = Runtime::initialize(Runtime::MPI(30))?;
rt.dashboard(Interface::Web)?;
rt.route_logs(LOG_FILE)?;letmut graph = Graph::<JobID>::new();// Partition solving jobs (JobID = Partition #)letmut set = Vec::<JobID>::new();// Exploration jobs (JobID = State)
starts = stochastic_exploration(game, db);
graph = rt.independent(ExploreArgs{ game, db },explore_job::<G,D>,
jobs: set,)?;
rt.dependent(SolveArgs{ game, db },solve_job::<G,D>,
jobs: graph,)?;}/// Explore the game tree.fnexplore_job<G: ...,D: ...>(args:Args<G,D>,target:JobID) -> Result<()>{ ...}/// Solve a single partition.fnsolve_job<G: ...,D: ...>(args:Args<G,D>,target:JobID) -> Result<()>{ ...}/// Sample random states in the game tree.fnstochastic_exploration<G: ...,D: ...>(args:Args<G,D>) -> Result<()>{ ...}
Recommended Courses (UC Berkeley)
If you can't tell whether this is out of your scope, we recommend the following experience:
CS 61B (minimum)
CS 61C (minimum)
CS 162
CS 267
The text was updated successfully, but these errors were encountered:
Create a wrapper for a generic runtime backed by an opaque implementation of a parallel computation model, like MPI (multi-process), Tokio (async), or Rayon (multi-thread).
The internals of the
Runtime
can be implemented with Tokio. That is, a Tokio runtime will be encapsulated in a customRuntime
type, and the Tokio runtime will be the coordinator of the parallel implementation's workers. AllRuntime
calls should be synchronous and blocking, but internally, the Tokio runtime might make asynchronous / non-blocking calls to the underlying model.In this sense, this is the first part of four things:
Example
Recommended Courses (UC Berkeley)
If you can't tell whether this is out of your scope, we recommend the following experience:
The text was updated successfully, but these errors were encountered: