Sponsored Content
Full Discussion: Multiprocessing Help
Top Forums UNIX for Dummies Questions & Answers Multiprocessing Help Post 302724863 by bakunin on Thursday 1st of November 2012 11:38:23 AM
Old 11-01-2012
Quote:
Originally Posted by Tyler_92
My question is this: The computer I'm using has 12 cores, each with two virtual cores, so I am working with 24 virtual processors. Is there a way to either 1) assign different jobs to different processors, or 2) get all of the processors to collaborate on one job? Does this happen automatically?
Ha - i never thought my work with massively parallel computers would ever be of help here!

In principle, this is possible. The whole point of having several CPUs instead of one is to work on several tasks at the same time - in parallel.

There are some restrictions to this, though: first, as my venerable colleague Corona688 already told you, 24 virtual processors are not 24 real processors. But even setting this point aside, there are two classes of problems:

Suppose i give you a number and ask you to multiply it by 3. It will take you a certain time to compute the result. Now, if i give 50 of these numbers to 50 people, the time to come up with the answer will be more or less the same (save for some slack), because every one of them will compute one result only. This is a problem which "scales" very good.

Now let us alter the problem a bit: i give you a number and ask you to multiply it by 3, the result again by 3, and so forth, 50 times. This time 50 people wouldn't help at all because every result is depending on the previous result and therefore computation of the final result will take the same time, regardless of how many people will work on it. This is a very bad scaling problem.

Real world problems are somewhere in between these extremes and usually contain parts which scale good and parts which scale less good. The art of programming massively parallel computers is to identify the good scaling parts and optimize them to the utmost possible.

OK, so far for theory, which will not directly solve your problem. It answers the second part of your question, though: if all the processors can be brought to work together on one analysis depends - it depends on how well the program doing the analysis was written with SMP in mind. As we probably don't know anything about your program you will be left to simply test it. Try it on a two-processor system (1 processor for the OS to eliminate effects from this side) and on your 12-processor system and look if there are any processing time differences.

I am no OSX expert, but as far as i know setting processor affinity is not supported. It might work to use OpenGrid or similar products, but honestly, i have no idea if this even runs under OSX. Maybe someone else can fill the gaps here. You might consider transferring the analysis to a Linux-Workstation, where such tools indeed exist.

I hope this helps.

bakunin
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multiprocessing under Linux

I'm writing C programs to be executed on a multi-processor UNIX (GNU/Linux, kernel 2.6.11) Do I need to add a special kind of code to somewhere or run a special utility to execute the program file to be executed by all processors? Or is it handled automatically by kernel? (1 Reply)
Discussion started by: rayne
1 Replies

2. Programming

Multiprocessing multipointers

I have a complex problem..... I have to search files on directory "text files" then search on all of them for a word or sentence....the user inter my problem is,,,, if I want to create a child for each file...and point a file by pointer to search...and I don't know how much files i have in... (2 Replies)
Discussion started by: fwrlfo
2 Replies

3. Shell Programming and Scripting

Multiprocessing in Python

Hi there, I have a code that can take in any function with two arguements and do processing. However, I would like to implement a feature whether it can limit a number of process running concurrently so as not take up too much resources. I have tried researching for pool.map however I am unable... (1 Reply)
Discussion started by: alvinoo
1 Replies

4. Shell Programming and Scripting

<< Threading inside multiprocessing using queues >>

Hi All, I am trying to achieve threading inside each process of multiprocessing. I have 2 queues one for multiprocess (process) & another inside each process. when i execute it got hung after below output. My goal here is to go through p_source queue & for each process picks up all t_source... (0 Replies)
Discussion started by: kamauv234
0 Replies
psrinfo(1M)						  System Administration Commands					       psrinfo(1M)

NAME
psrinfo - displays information about processors SYNOPSIS
psrinfo [-p] [-v] [processor_id...] psrinfo [-p] -s processor_id DESCRIPTION
psrinfo displays information about processors. Each physical processor may support multiple virtual processors. Each virtual processor is an entity with its own interrupt ID, capable of executing independent threads. Without the processor_id operand, psrinfo displays one line for each configured processor, displaying whether it is on-line, non-interrupt- ible (designated by no-intr), spare, off-line, faulted or powered off, and when that status last changed. Use the processor_id operand to display information about a specific processor. See OPERANDS. OPTIONS
The following options are supported: -s processor_id Silent mode. Displays 1 if the specified processor is fully on-line. Displays 0 if the specified processor is non-inter- ruptible, spare, off-line, faulted or powered off. Use silent mode when using psrinfo in shell scripts. -p Display the number of physical processors in a system. When combined with the -v option, reports additional information about each physical processor. -v Verbose mode. Displays additional information about the specified processors, including: processor type, floating point unit type and clock speed. If any of this information cannot be determined, psrinfo displays unknown. When combined with the -p option, reports additional information about each physical processor. OPERANDS
The following operands are supported: processor_id The processor ID of the processor about which information is to be displayed. Specify processor_id as an individual processor number (for example, 3), multiple processor numbers separated by spaces (for example, 1 2 3), or a range of processor numbers (for example, 1-4). It is also possible to combine ranges and (indi- vidual or multiple) processor_ids (for example, 1-3 5 7-8 9). EXAMPLES
Example 1: Displaying Information About All Configured Processors in Verbose Mode The following example displays information about all configured processors in verbose mode. psrinfo -v Example 2: Determining If a Processor is On-line The following example uses psrinfo in a shell script to determine if a processor is on-line. if [ "`psrinfo -s 3 2> /dev/null`" -eq 1 ] then echo "processor 3 is up" fi Example 3: Displaying Information About the Physical Processors in the System With no additional arguments, the -p option displays a single integer: the number of physical processors in the system: > psrinfo -p 8 psrinfo also accepts command line arguments (processor IDs): > psrinfo -p 0 512 # IDs 0 and 512 exist on the 1 # same physical processor > psrinfo -p 0 1 # IDs 0 and 1 exist on different 2 # physical processors In this example, virtual processors 0 and 512 exist on the same physical processor. Virtual processors 0 and 1 do not. This is specific to this example and is and not a general rule. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
psradm(1M), p_online(2), processor_info(2), attributes(5) DIAGNOSTICS
psrinfo: processor 9: Invalid argument The specified processor does not exist. SunOS 5.10 21 Feb 2004 psrinfo(1M)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy