Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: How can I limit the number of Cores in multi-process programming

by milesjin (Initiate)
on Nov 17, 2015 at 08:31 UTC ( [id://1147893]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How can I limit the number of Cores in multi-process programming
in thread How can I limit the number of Cores in multi-process programming

It's load balanced farm. User requests hosts with max_cpu specification, if your jobs use more cpu cores, would get warnings and the job would be killed.

Thanks

Replies are listed 'Best First'.
Re^5: How can I limit the number of Cores in multi-process programming
by Corion (Patriarch) on Nov 17, 2015 at 08:34 UTC

    Have you had a look at Parallel::ForkManager? It can be easily used to move from unbounded fork() to running with a limited number of children.

      Hi Corion,

      Thanks. Yes, I have checked the Parallel::ForkManager. Parallel::ForkManager is good enough for my taks. It can limit the number of processes, not CPU cores.

Re^5: How can I limit the number of Cores in multi-process programming
by BrowserUk (Patriarch) on Nov 17, 2015 at 09:23 UTC
    It's load balanced farm.

    Then you are going to have to either: a)limit the number of processes you run to match the number of cpu's you are allowed; or b) ask the operations/support people for that system if there is an API available for your purpose.

    In a single cpu, multicore system; any processes can and will be scheduled to run on the next available processor and it may run on a different processor for each timeslice. This is entirely transparent to the user-level code and it makes it pretty much impossible for application code to measure which and how many cores it is using at any given time. The solution to the problem on these types of system is to use an OS api that sets a mask for those cpus this process (or thread) is allowed to be scheduled to. On windows this is SetProcessAffinityMask(); there is probably a similar api available on modern versions of *nix, though I don't think it is a part of the POSIX spec.

    But, on a processor farm, the OS itself doesn't manage the allocation of processes to cpus, and each of those CPUs probably have multiple cores; so you'll need an API provided by the load-balancer to provide you with the control you need.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Thanks a lot for your time. It's helpful.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1147893]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-03-29 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found