Forum Jar
 
Forum Jar : OpenMP Forum : simple example don't work
See other topics in OpenMP Forum

OpenMP Forum
 
Important rules for using OpenMP Forum
• No offensive words are allowed in this forum.
• To prevent spams, you must not use the words "http" ".com" or "/"(slashes) in this forum.
 

Alert! Please do not buy anything or pay anyone on this forum. Scammers have been reported on our forum. Please also do not go to any links posted on here. We have been reported about links to websites that contain viruses. Thank you.

 
Topic: simple example don't work
Hello,
I want to test openMp. I want to launch 4 threads that execute in parallel on windows using VS 2010

#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
int main (int argc, char *argv[])
{
int nthreads, tid;
int threads = 100;
int id ;
omp_set_num_threads(4);
#pragma omp parallel(4)
{
threads = omp_get_num_threads();
id = omp_get_thread_num();
std::cout << "hello from thread: "<<id << "out of "<<std::endl;
std::cout << threads <<std::endl;
}
system("pause");
return 0;


}
The problem that I have always one thread which works.

by guest Sat Feb 25 21:26:21 UTC 2017

edmil

by iband Wed Sep 27 02:41:21 UTC 2017

allin

by -khan Wed Sep 27 03:24:23 UTC 2017

sajid

by javid Wed Sep 27 03:52:22 UTC 2017

chloe

by smith Wed Sep 27 03:54:39 UTC 2017

mcLou

by ghlin Wed Sep 27 04:02:26 UTC 2017

carry

by lucas Wed Sep 27 04:05:39 UTC 2017

plaid

by cymru Wed Sep 27 04:14:40 UTC 2017

k.bla

by ckman Wed Sep 27 04:28:33 UTC 2017

lords

by lords Wed Sep 27 04:33:54 UTC 2017

lords

by lords Wed Sep 27 04:36:30 UTC 2017

lords

by lords Wed Sep 27 04:39:11 UTC 2017

lords

by lords Wed Sep 27 04:52:14 UTC 2017

lords

by lords Wed Sep 27 04:52:25 UTC 2017


by Sun Nov 26 03:13:09 UTC 2017
 
Post a new comment
 
Message:

Name (optional):


By posting a comment, you indicate that you have agreed to our terms of use.

Feel adventurous? Check out random forums on Forum Jar!
Related Forums
Application programming interface Forum
Shared memory Forum
Multiprocessing Forum
C (programming language) Forum
C++ Forum
Fortran Forum
Unix Forum
Microsoft Windows Forum
Compiler directive Forum
Environment variable Forum
Programmer Forum
Supercomputer Forum
Parallel programming Forum
Computer cluster Forum
Message Passing Interface Forum
Thread (computer science) Forum
Runtime environment Forum
Preprocessor directive Forum
Function (computer science) Forum
Task parallelism Forum
Data parallelism Forum
Environment variables Forum
Header file Forum
Race condition Forum
Numerical Integration Forum
Differential Equations Forum
Intel Parallel Studio Forum
Sun Studio (software) Forum
GNU Compiler Collection Forum
Coarse-grained Forum
Fine-grained Forum
Speedup Forum
Amdahl's law Forum
Symmetric multiprocessing Forum
Memory bandwidth Forum
Load balancing (computing) Forum
Processor affinity Forum
Concurrency (computer science) Forum
Parallel computing Forum
Parallel programming model Forum
POSIX Threads Forum
Unified Parallel C Forum


sponsored links: free polls | free chat rooms (weirdtown chat) | widgets for myspace | make chat room | free chat room list | review websites | snowboard or ski | chat vocab

terms of use | privacy policy
©2011 forumjar.com All rights reserved.