Skip to main content

A simple shell command manager. Used for running parallel simulations.

Project description

parallel_manager

Python test

A simple shell command manager. Used for running parallel simulations.

Structure

Separate coroutine from init methods

  1. Worker
    1. Receive request from queue and process it
    2. Could have FunctionWorker or ShellWorker?
  2. WorkerGroup
    1. Manage workers of same class
    2. Collect basic stats from workers
  3. Manager?
    1. Might host various workergroups with different worker type

    2. Support various ways to add tasks

    3. Also to get current status/monitoring

    4. Control workergroups/workers

    5. Various middleware/plugin to the BaseManager to implement other features like http web monitoring and task submission

    6. Has a dedicated async.Runner to host the event loop in this Manager?

    7. non-blocking mode (make this a subclass of BaseManager)

      1. I would like to init the manager with asyncio.run
      2. then could add request to it in synchronous code
      3. Something like
      # Async part
      asyncio.run(simpleShellManager.init(), debug=True)
      
      # Sync part
      for i in range(10):
      print(i)
      simpleShellManager.add_shell_request(f"echoing loop2-{i}", f"echo {i}")
      
      1. Update, this is impossible with single threaded program as when .run() finishes, the loop is closed.
      2. Need two threads for this, one for managing the workers, one to submit
    8. BaseManager

      1. Need to have a event loop attribute
      2. BaseManager will need to be wrapped in a coroutine.

TODO

  1. Request and Response queue for worker

  2. Request and Response class design

  3. [] Dump failed cmd to a file

  4. [] Slurm rerun task

  5. [] Task complete statistics? Worker timed the run time for each cmd executed and plot it at the end or when killed?

  6. [] atexit function, dump remaining tasks currently in the queue

  7. [] Progress indicator for each task when logging?

  8. [] Interactive control for status monitoring and changing configuration dynamically, treat worker as a server that can submit task to, like a local slurm control

  9. [] decouple worker and job pushing

  10. [] support launching together in a script or subscribe to the worker server

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parallel_manager-0.0.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

parallel_manager-0.0.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file parallel_manager-0.0.2.tar.gz.

File metadata

  • Download URL: parallel_manager-0.0.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for parallel_manager-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1b8379d66b851438d52ad6a6e137dc5c43865f556d68222fef4b9cb1b2d9e2f8
MD5 f3a365a4917900d5c7581cccb06a9daf
BLAKE2b-256 1c0f96cb3a8446563fd0b6ffffed9405be5a3810c603f8e428580daf845aa387

See more details on using hashes here.

File details

Details for the file parallel_manager-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for parallel_manager-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5ce6fb286dcdc59bc522057e3adf5595f51db2b9e89c24286605dd24cf7e355
MD5 eb3e0fd4426712a5816f83b65ffcf037
BLAKE2b-256 8213415284315dc6d06d534cab228348c7df12b47865b1a2fde2e675139bd2a0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page