Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3315692
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:22:48+00:00 2026-05-17T22:22:48+00:00

Clarification : As per some of the comments, I should clarify that this is

  • 0

Clarification: As per some of the comments, I should clarify that this is intended as a simple framework to allow execution of programs that are naturally parallel (so-called embarrassingly parallel programs). It isn’t, and never will be, a solution for tasks which require communication or synchronisation between processes.

I’ve been looking for a simple process-based parallel programming environment in Python that can execute a function on multiple CPUs on a cluster, with the major criterion being that it needs to be able to execute unmodified Python code. The closest I found was Parallel Python, but pp does some pretty funky things, which can cause the code to not be executed in the correct context (with the appropriate modules imported etc).

I finally got tired of searching, so I decided to write my own. What I came up with is actually quite simple. The problem is, I’m not sure if what I’ve come up with is simple because I’ve failed to think of a lot of things. Here’s what my program does:

  • I have a job server which hands out jobs to nodes in the cluster.
  • The jobs are handed out to servers listening on nodes by passing a dictionary that looks like this:

    {
    'moduleName':'some_module', 
    'funcName':'someFunction', 
    'localVars': {'someVar':someVal,...}, 
    'globalVars':{'someOtherVar':someOtherVal,...}, 
    'modulePath':'/a/path/to/a/directory', 
    'customPathHasPriority':aBoolean, 
    'args':(arg1,arg2,...), 
    'kwargs':{'kw1':val1, 'kw2':val2,...}
    }
    
  • moduleName and funcName are mandatory, and the others are optional.

  • A node server takes this dictionary and does:

    sys.path.append(modulePath)
    globals()[moduleName]=__import__(moduleName, localVars, globalVars)
    returnVal = globals()[moduleName].__dict__[funcName](*args, **kwargs)
    
  • On getting the return value, the server then sends it back to the job server which puts it into a thread-safe queue.

  • When the last job returns, the job server writes the output to a file and quits.

I’m sure there are niggles that need to be worked out, but is there anything obvious wrong with this approach? On first glance, it seems robust, requiring only that the nodes have access to the filesystem(s) containing the .py file and the dependencies. Using __import__ has the advantage that the code in the module is automatically run, and so the function should execute in the correct context.

Any suggestions or criticism would be greatly appreciated.

EDIT: I should mention that I’ve got the code-execution bit working, but the server and job server have yet to be written.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:22:49+00:00Added an answer on May 17, 2026 at 10:22 pm

    I have actually written something that probably satisfies your needs: jug. If it does not solve your problems, I promise you I’ll fix any bugs you find.

    The architecture is slightly different: workers all run the same code, but they effectively generate a similar dictionary and ask the central backend “has this been run?”. If not, they run it (there is a locking mechanism too). The backend can simply be the filesystem if you are on an NFS system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some clarification. I have a Reportwriter dll that uses Crystal Reports. It
I was trying to get clarification on this: Method-1: Dim request = CreateRequest(uri) //some
I'm looking for some clarification regarding the behaviour of redirect_to . I have this
I'm looking for a simple-to-learn php framework for an application that is being migrated
Clarification This is part of a script that checks if a user has changed
Clarification/summary for the question -- we're looking for: a hosted bug tracking system, that
For clarification, are you able to use MySQL this way to sort? ORDER BY
I just need some clarification on variables A normal variable has 2 parts to
This is a clarification question I've got from a Java EE 5 migration. I'm
i have some clarification regarding Qt programming. In Qt most of the time we

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.