<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">Greetings,</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial"><span style="line-height:17.8048000335693px">so I tried to use opennp with one of the latest version of clang, </span><code style="line-height:17.8048000335693px;margin:0px;padding:1px 5px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:pre-wrap;background:rgb(238,238,238)">clang version 3.4.2 (tags/RELEASE_34/dot2-final)</code><span style="line-height:17.8048000335693px">. Followed the procedure to compilre and export the library PATHs, Compiling my hello.c using :</span><br></p><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">clang </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">-</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">fopenmp hello</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">c</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">and then running it, still it can't use more than 1 thread:</p><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(43,145,175);background:transparent">Bash</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">-</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">4.1</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">$ </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">./</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">a</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">.</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">out
</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(43,145,175);background:transparent">Hello</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> from thread </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">0</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> nthreads </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">1</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;vertical-align:baseline;clear:both;background-image:initial;background-repeat:initial"><font color="#000000" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="font-size:14px;line-height:17.8048000335693px">I tried to manually export </span></font><code style="color:rgb(0,0,0);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;font-size:14px;line-height:17.8048000335693px;margin:0px;padding:1px 5px;border:0px;vertical-align:baseline;white-space:pre-wrap;background-image:initial;background-color:rgb(238,238,238);background-repeat:initial">export OMP_NUM_THREADS=8</code><font color="#000000" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="font-size:14px;line-height:17.8048000335693px"> but that didn't solve anything as well, As a workaround I define </span></font><span style="color:rgb(68,68,68);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:13px;line-height:17.2800006866455px;background-color:rgb(250,250,250)"> </span><span style="color:rgb(68,68,68);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:13px;line-height:17.2800006866455px;background-color:rgb(250,250,250)">#pragma omp parallel num_threads(#noofthreads) </span>inside the source code but still the issue is there.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">Any suggestions would be appreciated.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial">-Amir</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.8048000335693px;background-image:initial;background-repeat:initial"><a href="http://p.sl/" target="_blank">p.sl</a>: This is the hello.c:</p><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.8048000335693px;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,128,128);background:transparent">#include</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent"><omp.h></span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,128,128);background:transparent">#include</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent"><stdio.h></span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(43,145,175);background:transparent">int</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> main</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">()</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">{</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">
</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,128,128);background:transparent">#pragma</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> omp parallel
printf</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">(</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0);background:transparent">"Hello from thread %d, nthreads %d\n"</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> omp_get_thread_num</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent">(),</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background:transparent"> omp_get_num_threads</span></code></pre></div>