| | |
Using multiple cores - API wanted
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2008
Posts: 68
Reputation:
Solved Threads: 6
Hello,
A few days ago I visited a lecture of a teacher in an university that was about parallel processing.
He explained why it's good etc, and how you can make programs that use multiple cpus in C.
He used MPI and the code looked nice, wasn't too hard and got the job done. But in order to compile the program u needed to use mpicc (so not gcc, vcc or bcc)
and to run the program you had to write something like:
in that line, you also specify how many cores you want to use.
So my question is: Is there any other multiprocessing api that uses local variables, and messages to coordinate the work of the cpus that can be compiled by visual c++ or devc++ and doesn't need that weird command line to execute. that you can choose the amount of cores inside the program?
I hope that makes sense, else, please reply for a detailed explanation.
Thanks in advance,
Tigran
A few days ago I visited a lecture of a teacher in an university that was about parallel processing.
He explained why it's good etc, and how you can make programs that use multiple cpus in C.
He used MPI and the code looked nice, wasn't too hard and got the job done. But in order to compile the program u needed to use mpicc (so not gcc, vcc or bcc)
and to run the program you had to write something like:
C++ Syntax (Toggle Plain Text)
shell$ /opt/openmpi-1.3.1/bin/mpirun -np 4 a.out
So my question is: Is there any other multiprocessing api that uses local variables, and messages to coordinate the work of the cpus that can be compiled by visual c++ or devc++ and doesn't need that weird command line to execute. that you can choose the amount of cores inside the program?
I hope that makes sense, else, please reply for a detailed explanation.
Thanks in advance,
Tigran
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
•
•
Join Date: Jun 2008
Posts: 68
Reputation:
Solved Threads: 6
Thanks for the reply,
But why are there terms like multithreading and multiprocessing?
For what i've heared (but i'm not sure of) multithreading organises the tasks in one core. But i'm probably wrong
Are these POSIX threads also usable for windows? and are they as fast as the threads in the windows api?
But why are there terms like multithreading and multiprocessing?
For what i've heared (but i'm not sure of) multithreading organises the tasks in one core. But i'm probably wrong

Are these POSIX threads also usable for windows? and are they as fast as the threads in the windows api?
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
I think that if you're dealing with normal computers multithreading will speed-up your program more than enough, but it's still the operating system which has the task to distribute those threads among all the available CPU-cores, so the efficiency also depends on what os you are using ...
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
![]() |
Other Threads in the C++ Forum
- Previous Thread: Parsing Binary files to string
- Next Thread: setw() issue.
| Thread Tools | Search this Thread |
api array arrays based binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game generator givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






