<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — OpenMP and Appgraphics]]></title>
		<link>http://forums.approximatrix.com/viewtopic.php?id=654</link>
		<atom:link href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=654&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in OpenMP and Appgraphics.]]></description>
		<lastBuildDate>Thu, 12 Oct 2017 16:29:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: OpenMP and Appgraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3046#p3046</link>
			<description><![CDATA[<p>There was a bug in our OpenMP implementation that assumed that a pointer to thread information is always initialized.&nbsp; Because AppGraphics uses Windows-native threading (as opposed to OpenMP constructs), the graphical user interface thread did not have this OpenMP-related thread pointer available, causing the program to crash.</p><p>The OpenMP library was updated to initialize a new thread information pointer immediately if OpenMP requests thread information and nothing is available.&nbsp; It should allow our OpenMP implementation to properly co-exist with Windows threads.</p><p>The fix will be included in Simply Fortran 2.40, due out shortly.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 12 Oct 2017 16:29:31 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3046#p3046</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenMP and Appgraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3036#p3036</link>
			<description><![CDATA[<p>Thanks Jeff! I will look forward into that.</p><p>This simple piece of code can recreate the problem when compiled with the &quot;enable OpenMP&quot; option enabled</p><div class="codebox"><pre><code>program  test
    use appgraphics
    implicit none
    integer::screen,button
    screen=initwindow(200,200,title=&#039;test&#039;,closeflag=.true.)
    button = createbutton(0,0,200,200,&#039;testbutton&#039;,testsubroutine)

    call loop()
    call closewindow(screen)
    contains
        subroutine testsubroutine()
            implicit none
!$OMP PARALLEL
            write(*,*)&#039;Hello, world!&#039;
!$OMP END PARALLEL
        end subroutine
end program</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Narodth)]]></author>
			<pubDate>Tue, 03 Oct 2017 05:31:24 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3036#p3036</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenMP and Appgraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3035#p3035</link>
			<description><![CDATA[<p>I&#039;m not exactly sure why your program is locking up, but I do have some suggestions.&nbsp; One important fact to keep in mind is that subroutines called from button clicks are not running in your main program thread, but, rather, the graphical user interface thread.&nbsp; Any long-running calculations should not be handled in that subroutine directly.&nbsp; I normally suggest using the button handler to set a variable and release the main program from idle.&nbsp; Once un-idled, the program will take some action based on the value of that variable.&nbsp; The &quot;Conway&#039;s Game of Life&quot; example that comes with Simply Fortran uses this method.</p><p>Additionally, OpenMP relies on Windows threading routines internally, and it might make some assumptions about the program&#039;s current state in regards to threads. Since AppGraphics programs are already using multiple threads, there may be some sort of deadlock occurring.&nbsp; I&#039;m not positive, though, why that would occur.</p><p>I&#039;ll look into it more on my end, but I would strongly suggest keeping all OpenMP calls within the main program by using the equivalent of a message loop to handle button presses.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 02 Oct 2017 11:41:07 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3035#p3035</guid>
		</item>
		<item>
			<title><![CDATA[OpenMP and Appgraphics]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3032#p3032</link>
			<description><![CDATA[<p>Hello, when I try to do some parallel programing with OpenMP it works perfectly, until I try to do it anywhere inside a subroutine called from clicking a button from Appgraphics. The program just stops working with the respective windows message, am I doing something wrong?</p><p>I&#039;m running version 2.39.2491 on Windows 7 Ultimate</p>]]></description>
			<author><![CDATA[null@example.com (Narodth)]]></author>
			<pubDate>Sun, 01 Oct 2017 15:42:20 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3032#p3032</guid>
		</item>
	</channel>
</rss>
