<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div dir="ltr" >yes, that is what I do too</div>
<div dir="ltr" ><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" ><br>Alexandre<br><br>-----------------------------------------------------------------------------------------------------<br><span style="color:#0000CD;" >Alexandre Eichenberger, Master Inventor, Advanced Compiler Technologies</span><br><span style="color:#0000CD;" >- research</span>: compiler optimization (OpenMP, multithreading, SIMD)<br><span style="color:#0000CD;" >- info:</span> alexe@us.ibm.com http://www.research.ibm.com/people/a/alexe<br><span style="color:#0000CD;" >- phone</span>: 914-945-1812 (work) 914-312-3618 (cell)</div></div></div></div></div></div>
<div dir="ltr" > </div>
<div dir="ltr" > </div>
<blockquote data-history-content-modified="1" dir="ltr" style="border-left:solid #aaaaaa 2px; margin-left:5px; padding-left:5px; direction:ltr; margin-right:0px" >----- Original message -----<br>From: Alexey Bataev <a.bataev@hotmail.com><br>To: Joseph Schuchart <schuchart@hlrs.de><br>Cc: Alexandre Eichenberger/Watson/IBM@IBMUS, "openmp-dev@lists.llvm.org" <openmp-dev@lists.llvm.org><br>Subject: Re: [Openmp-dev] Using the runtime C interface<br>Date: Wed, Nov 2, 2016 10:27 AM<br> <br><!--Notes ACF
<meta http-equiv="Content-Type" content="text/html; charset=utf8" >-->
<div>Hi Joseph,</div>
<div id="AppleMailSignature" >You can use 'clang -c -S -emit-llvm -o -' to see the real calls of OpenMP runtime functions<br><br>Best regards,
<div>Alexey Bataev</div></div>
<div><br>2 нояб. 2016 г., в 17:24, Joseph Schuchart via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank" >openmp-dev@lists.llvm.org</a>> написал(а):<br> </div>
<blockquote type="cite" ><div><p>Alexandre,</p>
<p>Thanks for your swift reply. Which LLVM files are you refering to in particular? Ideally I would like to use something like clang -E to see how the OpenMP pragmas are resolved to particular library calls (unfortunately, pragmas are carried through this step). I am not too familiar with the LLVM tool-suite so I am not sure about any tools to dump intermediate presentations.</p>
<p>So far I have tried to use "clang -E" and "clang -ast-print" but all of them still contain the pragmas. Do you have any suggestions how to get a representation of the library calls that are generated?</p>
<p>Joseph</p> 

<div>On 10/27/2016 09:44 PM, Alexandre Eichenberger wrote:</div>
<blockquote cite="mid:OFE150A02A.13BC4B8D-ON00258059.006C2E34-00258059.006C75EE@notes.na.collabserv.com" type="cite" ><div dir="ltr" style="font-family:"Helvetica Neue", Helvetica, Arial,        sans-serif;font-size:10.5pt" ><div dir="ltr" >Joseph</div>
<div dir="ltr" > </div>
<div dir="ltr" >Best is to create a few examples and look at the llvm files being generated. The construct that generates the fork call is #pragma omp parallel. Here is the template:</div>
<div dir="ltr" > </div>
<div dir="ltr" >EXTERN void __kmpc_fork_call(klegacy_Indent *loc, int32_t argc, klegacy_ParFctPtr microtask, ...);</div>
<div dir="ltr" > </div>
<div dir="ltr" > </div>
<div dir="ltr" >where the first is unused, the second is the number of parameters to the microtask, the function to be called, and the params.</div>
<div dir="ltr" > </div>
<div dir="ltr" >Parameters are typically used to pass references and first private values. If you have no shared/private values in your model, you can ignore them.</div>
<div dir="ltr" ><div dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" ><br>Alexandre<br><br>-----------------------------------------------------------------------------------------------------<br><span style="color:#0000CD;" >Alexandre Eichenberger, Master Inventor, Advanced Compiler Technologies</span><br><span style="color:#0000CD;" >- research</span>: compiler optimization (OpenMP, multithreading, SIMD)<br><span style="color:#0000CD;" >- info:</span> <a href="mailto:alexe@us.ibm.com" target="_blank" >alexe@us.ibm.com</a> <a href="http://www.research.ibm.com/people/a/alexe" target="_blank" >http://www.research.ibm.com/people/a/alexe</a><br><span style="color:#0000CD;" >- phone</span>: 914-945-1812 (work) 914-312-3618 (cell)</div></div></div></div></div></div>
<div dir="ltr" > </div>
<div dir="ltr" > </div>
<blockquote data-history-content-modified="1" dir="ltr" style="border-left:solid #aaaaaa 2px; margin-left:5px;          padding-left:5px; direction:ltr; margin-right:0px" >----- Original message -----<br>From: Joseph Schuchart via Openmp-dev <a href="mailto:openmp-dev@lists.llvm.org" target="_blank" > <openmp-dev@lists.llvm.org></a><br>Sent by: "Openmp-dev" <a href="mailto:openmp-dev-bounces@lists.llvm.org" target="_blank" > <openmp-dev-bounces@lists.llvm.org></a><br>To: openmp-dev <a href="mailto:openmp-dev@lists.llvm.org" target="_blank" > <openmp-dev@lists.llvm.org></a><br>Cc:<br>Subject: [Openmp-dev] Using the runtime C interface<br>Date: Wed, Oct 26, 2016 8:55 AM<br> 
<div><font face="Default Monospace,Courier              New,Courier,monospace" size="2" >All,<br><br>I am currently working on a research project with the goal to create a<br>C++ abstraction for creating tasks similar to tasking in OpenMP but with<br>added functionality and only relying on standard C++ language features.<br>In order to allow for an easy integration with existing OpenMP<br>applications, I would like to use an existing OpenMP runtime as a basis<br>so that users can only port parts of their application while keeping<br>most of the existing code. Eventually all created tasks will be<br>scheduled by the same runtime.<br><br>The LLVM OpenMP runtime seems to be a good fit as it comes with a<br>documented API [1] and supports multiple compilers. Thanks to the<br>documentation and the library code, I think I have a good understanding<br>of how to create tasks with depdendencies using __kmpc_omp_task_alloc()<br>and __kmpc_omp_task_with_deps(). However, it is not clear to me how<br>threads can be spawned correctly. I assume that __kmpc_fork_call() is<br>the right place to look at but I fail to understand how a microtask<br>should exactly behave, e.g., which functions to call while waiting for<br>tasks to be created in another thread. Is there any publicly available<br>example on how to use the API correctly without any OpenMP pragmas? Or<br>is it possible to extract such an example from OpenMP code using the<br>LLVM compiler?<br><br>Any pointers are much appreciated.<br><br>Cheers<br>Joseph<br><br>[1] <a href="http://openmp.llvm.org/Reference.pdf" moz-do-not-send="true" target="_blank" ><span> </span></a><a href="http://openmp.llvm.org/Reference.pdf" target="_blank" >http://openmp.llvm.org/Reference.pdf</a><br><br>--<br>Dipl.-Inf. Joseph Schuchart<br>High Performance Computing Center Stuttgart (HLRS)<br>Nobelstr. 19<br>D-70569 Stuttgart<br><br>Tel.: +49(0)711-68565890<br>Fax: +49(0)711-6856832<br>E-Mail: <a href="mailto:schuchart@hlrs.de" target="_blank" >schuchart@hlrs.de</a><br><br>_______________________________________________<br>Openmp-dev mailing list<br><a href="mailto:Openmp-dev@lists.llvm.org" target="_blank" >Openmp-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" target="_blank" >http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a></font></div></blockquote>
<div dir="ltr" > </div></div></blockquote> 

<div><font face="Default Monospace,Courier New,Courier,monospace" size="2" >--<br>Dipl.-Inf. Joseph Schuchart<br>High Performance Computing Center Stuttgart (HLRS)<br>Nobelstr. 19<br>D-70569 Stuttgart<br><br>Tel.: +49(0)711-68565890<br>Fax: +49(0)711-6856832<br>E-Mail: <a href="mailto:schuchart@hlrs.de" target="_blank" >schuchart@hlrs.de</a></font></div></div></blockquote>
<blockquote type="cite" ><div><span>_______________________________________________</span><br><span>Openmp-dev mailing list</span><br><span><a href="mailto:Openmp-dev@lists.llvm.org" target="_blank" >Openmp-dev@lists.llvm.org</a></span><br><span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" target="_blank" >http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a></span></div></blockquote></blockquote>
<div dir="ltr" > </div></div><BR>