<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Call to system function]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=737</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=737&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Call to system function.]]></description>
		<lastBuildDate>Sat, 11 Jul 2020 09:53:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3533#p3533</link>
			<description><![CDATA[<p>Jeff,</p><p>Just a last update on this for now. The program that I was testing went for over 6 days without halting. I had to shut it down yesterday afternoon as we had power outages. So I am pretty sure that sim instance is &quot;cured&quot;. I will not know if this issue can be put to bed going forward without many more sim instances to try against and since this is always been a random issue, it will take months of more instance before I will know more. </p><p>In the last few days, I have started three new sims (with the new SF 3.13 compiles), two on Win7 platforms and one on Win10 and no bad behaviors yet.</p><p>Thanks again for all your support.<br />Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Sat, 11 Jul 2020 09:53:44 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3533#p3533</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3531#p3531</link>
			<description><![CDATA[<p>Jeff,</p><p>The old sim that would regularly crash has now run for over two days with new the SF 3.13 recompile. I am still not ready to claim victory but it is looking better. Only running many new instances of sims will give better confidence that the issue is not showing up. I have had sims have an early crash and then never do it again. I have had sims that will crash every several hours and ones that never will halt. That is why this is so frustrating.&nbsp; </p><p>That said, in my tiny little brain, I have my doubts that this is your OpenMP issue; I am truly a horrid programmer.</p><p>Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Mon, 06 Jul 2020 20:34:22 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3531#p3531</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3530#p3530</link>
			<description><![CDATA[<p>Rod,</p><p>How did the simulation work on 3.13?&nbsp; I&#039;ll start poking around in our OpenMP library a bit more to see if I can identify any glaring problems, but I think I&#039;ll actually have to find a long-running, non-trivial code to hunt down and find the intermittent bug.&nbsp; There must be a place in our library that&#039;s violating memory access if you&#039;re only seeing crashes with OpenMP, but everything seems fine without it.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 06 Jul 2020 15:05:01 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3530#p3530</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3528#p3528</link>
			<description><![CDATA[<p>Jeff, </p><p>An update on what I have done in the last couple days. After a trying to test using running sims, I decided to make a new sim and test the code. The new sim did fail while using OpenMP. Then I ran that sim with OpenMP off. It ran for over 12 hours with failing, so I halted it. I did try running it again using the OpenMP extentions but after more that four hours would not crash. Frustrated, I stopped testing with this new sim. </p><p>I downloaded the SF 3.13 release and installed it. </p><p>I rethought using my one current sim that does fail and decided to update the code a bit since this is code that dates back to the beginning of March. I updated the code with some changes so that the old sim will run without issues and then recompiled with the new SF release. This older sim has now run for nearly 16 hours without halting using OpenMP extensions. This is not completely unexpected though as this sim was a long running sim that I was restarting hourly and it would only show remnant halted windows maybe once or twice a week; implying that it would halt within the hourly runtime window rarely. </p><p>The newly created code is encouraging but the code is &quot;different&quot; and I have seen simple changes to the code make one sim versus another stable or not. In addition, the changes I made have nothing to do with the code in the multi-threaded part of the code. </p><p>I will update later after more run time.</p><p>Rod</p><p>PS. As soon as I push submit on this post, the test sim will crash! LOL!.</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Sun, 05 Jul 2020 13:54:54 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3528#p3528</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3526#p3526</link>
			<description><![CDATA[<p>Jeff,</p><p>For short tests (a few hours) with no OpenMP, the programs seems to run without issue. I have not tested this recently on R3 though. However, what runs for a few hours single threaded, is only a few minutes with multi-threaded code. The multi-threaded code may run for days (or just a few minutes) without halting. Since it is so random it is hard to know. </p><p>As far as processors on Windows 10, one machine has 4 threads available and the other gas 16. For the 4 threaded system, the simulation uses all of them. For the 16 threaded system, I have two simulations running with 8 threads each. I use the affinity setting with the start command to segregate the threads between simulation runs. For example in a batch file I use the following to start the simulation on the 16 threaded system:</p><p> start&nbsp; /low&nbsp; /affinity 0xff00 riod.exe</p><p>This command will only allow the program to use the last 8 system threads. </p><p>I will try test the simulation on the 4 thread with no OpenMP for a while and see how that works. <br />EDIT: I forgot that the current simulation of my 4 thread system is not crashing, the previous one did it, ugh! I will try to create a new sim that will crash, then test without OpenMP. This could take a while...</p><p>Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Fri, 03 Jul 2020 12:59:58 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3526#p3526</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3525#p3525</link>
			<description><![CDATA[<p>Rod,</p><p>I&#039;m concerned the error is in our OpenMP implementation, which has significant customizations.&nbsp; Have you tried running a simulation with OpenMP disabled with Simply Fortran 3 on Windows 10?</p><p>Also, how many processors do the Windows 10 machines report?&nbsp; I&#039;m wondering if perhaps they have significantly more threads running in your simulation than the Windows 7 machines.</p><p><em>EDIT:</em> Also, Simply Fortran 3.13 was recently released with an updated compiler.&nbsp; You might try installing that as well.&nbsp; I&#039;m not hopeful that it will solve the crashing problem, though.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 02 Jul 2020 19:35:32 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3525#p3525</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3524#p3524</link>
			<description><![CDATA[<p>Jeff,</p><p>I just was checking back here when I noticed that I never really followed up on this thread. I have been using SF R3 since then (4 months). I still have the crash issue but it is different. For simulations running on Windows 7 pro machines, the program is very stable, no crashes. For Window 10 pro machines, I get random crashes for most simulation runs. </p><p>As I write this, I have three Win7Pro machines running seven simulation instances. They are completely stable and will run happily for weeks/months untouched. </p><p>I have two Win10Pro machines running three simulation instances. Two of those three instances will crash randomly after half an hour or several hours. Understand that a crash in this case is that the simulation instance just stops, the CMD prompt that it runs in halts and the CPU using those threads goes idle. I have a work around for this behavior by just stopping the program every hour and restarting it but this is a real nuisance. </p><p>I really don&#039;t expect any help since we have gone over this many times; I just wanted to follow with the latest.</p><p>Thanks,</p><p>Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Wed, 01 Jul 2020 17:37:56 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3524#p3524</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3433#p3433</link>
			<description><![CDATA[<p>Hi Jeff,</p><p>I have done a fair amount of testing with the new version. I have not seen the specific problem reported earlier but it is too early to really tell. There is still another issue that has me perplexed that is probably related but I am not sure. </p><p>Specifically, I run my program in a command prompt that I start with batch program which opens the CMD.EXE window with the Start command. Here is in essence the command I start with: </p><p>start &quot;N0x00ff_Program&quot; /low&nbsp; /affinity 0x00ff program.exe</p><p>However, sometimes, obviously not always, this start method will close out immediately after starting. I notice most on my Windows 10 machine. If I open a static CMD prompt with the same affinity restrictions, the program will run just fine. I am not sure what could be causing this. </p><p>In any event, I will be upgrading my license to SF R3 shortly. Thanks for your support. </p><p>Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Tue, 03 Mar 2020 14:32:58 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3433#p3433</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3430#p3430</link>
			<description><![CDATA[<p>Rod,</p><p>There is the possibility that the OpenMP library we had been providing was not properly sizing the stack on subsequent threads, making the linker flag useless with OpenMP.&nbsp; I seem to remember having to fix that issue at some point, but I may be mistaken.&nbsp; Let me know if it works with the latest version.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Fri, 28 Feb 2020 12:09:58 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3430#p3430</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3427#p3427</link>
			<description><![CDATA[<p>Jeff, </p><p>I already have a stack allocation as per my option:</p><p>Wl,--stack,150000000; not as much as your suggestion but seems to be more than adequate. For example, the offending task that would crash with only a total memory footprint of 5.1 MBytes as per task manager. I routinely run this with 10 times the number of particles without incident. I have one running with 50,000 particles and it only uses 14 Mbytes, so I don&#039;t think this is a stack problem (note I changed my code to allocate the arrays sizes at run time to be the exact size needed). As I said before, you and I have had several exchanges about this in the past and this issue still comes back to bite me. Ugh.</p><p>That all said, I downloaded the SF load for R3 in trial mode, compiled my code and exchanged the code on the machine that was crashing. The new code breezed right through the crash point and is still running. I am causously optimistic that this will help to rid me of this scourge. I will run that code for a few days to be sure and if all is well, I have convinced my CFO (read the wife) that I need to buy a new license for the new version. </p><p>FYI, here is my R 2.41. Makefile if you are interested:</p><p>#<br /># Automagically generated by Approximatrix Simply Fortran 2.41<br />#<br />FC=&quot;C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe&quot;<br />CC=&quot;C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe&quot;<br />AR=&quot;C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\ar.exe&quot;<br />WRC=&quot;C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\windres.exe&quot;<br />RM=rm -f</p><br /><p>OPTFLAGS= -O3 -fgraphite-identity -floop-interchange -floop-strip-mine -floop-block -floop-parallelize-all -mtune=native</p><p>SPECIALFLAGS=$(IDIR)</p><p>RCFLAGS=-O coff</p><p>PRJ_FFLAGS= -fopenmp</p><p>PRJ_CFLAGS=</p><p>PRJ_LFLAGS=-Wl,--stack,150000000 -lgomp</p><p>FFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_FFLAGS) -Jmodules </p><p>CFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_CFLAGS)</p><p>&quot;build\riod.o&quot;: &quot;.\riod.f90&quot;<br />&nbsp; &nbsp; @echo Compiling .\riod.f90<br />&nbsp; &nbsp; @$(FC) -c -o &quot;build\riod.o&quot; $(FFLAGS) &quot;.\riod.f90&quot;</p><p>clean: .SYMBOLIC<br />&nbsp; &nbsp; @echo Deleting build\riod.o and related files<br />&nbsp; &nbsp; @$(RM) &quot;build\riod.o&quot;<br />&nbsp; &nbsp; @echo Deleting default icon resource<br />&nbsp; &nbsp; @$(RM) &quot;build\sf_default_resource.res&quot;<br />&nbsp; &nbsp; @echo Deleting riod.exe<br />&nbsp; &nbsp; @$(RM) &quot;riod.exe&quot;</p><p>&quot;riod.exe&quot;:&nbsp; &quot;build\riod.o&quot; &quot;build\Riod-MP-F90.prj.target&quot;<br />&nbsp; &nbsp; @echo Generating riod.exe<br />&nbsp; &nbsp; @$(FC) -o &quot;riod.exe&quot; -static -fopenmp &quot;build\riod.o&quot; $(LDIR) $(PRJ_LFLAGS)</p><p>all: &quot;riod.exe&quot; .SYMBOLIC</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Thu, 27 Feb 2020 23:22:19 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3427#p3427</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3426#p3426</link>
			<description><![CDATA[<p>Rod,</p><p>I was unaware that OpenMP was being used. The crash is almost certainly caused by an insufficient stack.&nbsp; Try adding the following flag to the Linker box in Compiler Flags under Project Options:</p><div class="codebox"><pre><code>-Wl,--stack,256000000</code></pre></div><p>The above will cause the stack to be 256MB for each thread (so be aware of memory issues).&nbsp; OpenMP changes how some allocation occurs, and stack space can be exhausted quickly.&nbsp; Let me know if the above works.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 27 Feb 2020 16:19:00 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3426#p3426</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3425#p3425</link>
			<description><![CDATA[<p>I tried the EXECUTE_COMMAND_LINE call in my code and it crashes too with the same memory segmentation fault. This problem has been going on for years now and I find no way to figure it out. Clearly as I have indicated before, it does not occur if I compile without the OpenMP extensions. However, this makes no sense to me since all the code is running single threaded when the system calls happen.</p><p>This problem also seems to only happen with certain parameter conditions. The simulation I am running when it crashes has 5001 particles but if I run it with fewer or more, it may not crash. I am just not getting what is happening. </p><p>Since we have rehashed this before, I don&#039;t expect to get any answers. Maybe an upgrade will help. Sigh.</p><p>Rod</p><p>PS. Just to follow up, I run the same simulation that crashes on one machine and run it on my development system but this time with even more frequent calls to the subroutine that has the EXECUTE_COMMAND_LINE calls and it does not crash.</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Thu, 27 Feb 2020 13:30:27 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3425#p3425</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3424#p3424</link>
			<description><![CDATA[<p>Rod,</p><p>You&#039;re already using a &quot;GNU Extension,&quot; so the <em>EXECUTE_COMMAND_LINE</em> call would be more reliable if you ever want to try another compiler.&nbsp; GNU Fortran will allow Fortran 2008 intrinsic procedures in basically any Fortran source code unless specifically instructed to conform to a different standard.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Wed, 26 Feb 2020 20:45:14 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3424#p3424</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3423#p3423</link>
			<description><![CDATA[<p>Thanks Jeff. </p><p>Will EXECUTE_COMMAND_LINE work with a FORTRAN90 compilation? I see this system call is a FORTRAN 2008 feature. I guess I can give it a try.</p><p>Thanks again.</p><p>Rod</p>]]></description>
			<author><![CDATA[null@example.com (grogley)]]></author>
			<pubDate>Wed, 26 Feb 2020 18:56:52 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3423#p3423</guid>
		</item>
		<item>
			<title><![CDATA[Re: Call to system function]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3422#p3422</link>
			<description><![CDATA[<p>Rod,</p><p>Either should be fine, and I&#039;m not sure why there is a crash on the first.&nbsp; I would suggest, however, switching to <a href="http://simplyfortran.com/docs/compiler/EXECUTE_005fCOMMAND_005fLINE.html#EXECUTE_005fCOMMAND_005fLINE">EXECUTE_COMMAND_LINE</a>, which has a form similar to the subroutine call you&#039;ve shown. This call is part of the Fortran standard and would be portable across compilers.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Wed, 26 Feb 2020 18:46:51 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3422#p3422</guid>
		</item>
	</channel>
</rss>
