<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Maple API - Simulate ("...too many files opened.")</title>
    <link>http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Fri, 12 Jun 2026 19:14:27 GMT</lastBuildDate>
    <pubDate>Fri, 12 Jun 2026 19:14:27 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Maple API - Simulate ("...too many files opened.")</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Maple API - Simulate ("...too many files opened.")</title>
      <link>http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened</link>
    </image>
    <item>
      <title>suggestions</title>
      <link>http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened?ref=Feed:MaplePrimes:Maple API - Simulate ("...too many files opened."):Comments#answer130319</link>
      <itunes:summary>&lt;p&gt;For each loop iteration, once each call to Simulate is finished, could you call iostatus, and then programmatically extract the strings of which .msys files are still opened for WRITE, and fclose them? Maybe things would go wrong, and subsequent Simulate runs in that same Maple session would fail miserably, but who knows it might work.&lt;/p&gt;
&lt;p&gt;An alternative might be to write a batch file that runs commandline interface cmaple.exe against a text .mpl script, in a loop. Each invocation of cmaple file could could read z and parameter values from a text data file (or even receive those as input from the batch script). The overhead of relaunching cmaple each time might be less than (or comparable to) the simulation time (if lucky).&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;For each loop iteration, once each call to Simulate is finished, could you call iostatus, and then programmatically extract the strings of which .msys files are still opened for WRITE, and fclose them? Maybe things would go wrong, and subsequent Simulate runs in that same Maple session would fail miserably, but who knows it might work.&lt;/p&gt;
&lt;p&gt;An alternative might be to write a batch file that runs commandline interface cmaple.exe against a text .mpl script, in a loop. Each invocation of cmaple file could could read z and parameter values from a text data file (or even receive those as input from the batch script). The overhead of relaunching cmaple each time might be less than (or comparable to) the simulation time (if lucky).&lt;/p&gt;</description>
      <guid>130319</guid>
      <pubDate>Fri, 03 Feb 2012 23:34:27 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>LinkModel</title>
      <link>http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened?ref=Feed:MaplePrimes:Maple API - Simulate ("...too many files opened."):Comments#answer130330</link>
      <itunes:summary>&lt;p&gt;Are you sure it is the call to A:-Simulate() that is leaving the file handles open?&amp;nbsp; I haven't been able to reproduce that behavior.&amp;nbsp; However, repeated calls to MapleSim:-LinkModel() does create more open file handles.&amp;nbsp; I'll submit this as an SCR.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Are you sure it is the call to A:-Simulate() that is leaving the file handles open?&amp;nbsp; I haven't been able to reproduce that behavior.&amp;nbsp; However, repeated calls to MapleSim:-LinkModel() does create more open file handles.&amp;nbsp; I'll submit this as an SCR.&lt;/p&gt;</description>
      <guid>130330</guid>
      <pubDate>Sat, 04 Feb 2012 21:07:09 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
    <item>
      <title>could you show how to do this alternative?</title>
      <link>http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened?ref=Feed:MaplePrimes:Maple API - Simulate ("...too many files opened."):Comments#comment145676</link>
      <itunes:summary>&lt;p&gt;Hi Pagan,&lt;/p&gt;
&lt;p&gt;I'm having some memory allocation issues that I want to work around by going to command line and calling maple sessions in a loop, in order to restart it prior to doing independent calculations over a grid of parameter values---and I think I've basically been trying to do what you've suggested here as an alternative in the second paragraph. I'm just having a problem sorting out how to call maple in a for loop, define a few parameters according to the loop variable(s), and then execute a .mpl file with those param values, before quitting maple.&lt;/p&gt;
&lt;p&gt;For example, if I've got HelloWorld.mpl on my desktop, which just contains the line print("Hello World!");, I can open Terminal on my Mac and execute&lt;/p&gt;
&lt;p&gt;export MAPLE="/Library/Frameworks/Maple.framework/Versions/16"&lt;br&gt;for i in 1 2 3 4 5&lt;br&gt;do&lt;br&gt; $MAPLE/bin/maple /Users/Daryl/Desktop/HelloWorld.mpl; &lt;br&gt;done&lt;/p&gt;
&lt;p&gt;This opens maple, prints "Hello World!", and then quits, five times over. But what I want to be able to do is print i each time. So I want to open maple inside the for loop like this, define something like a:=$i, and then execute a .mpl file with the line print(a); and then quit.&lt;/p&gt;
&lt;p&gt;Ultimately, it would be wonderful to be able to process this in parallel, so if you have any tips on how to do that I'd really appreciate it, but even solving this more immediate problem would be huge for me, since I've only got 8 processors and can just execute that many for loops individually.&lt;/p&gt;
&lt;p&gt;Thanks very much for any help you're able to offer!&lt;/p&gt;
&lt;p&gt;Daryl&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Hi Pagan,&lt;/p&gt;
&lt;p&gt;I'm having some memory allocation issues that I want to work around by going to command line and calling maple sessions in a loop, in order to restart it prior to doing independent calculations over a grid of parameter values---and I think I've basically been trying to do what you've suggested here as an alternative in the second paragraph. I'm just having a problem sorting out how to call maple in a for loop, define a few parameters according to the loop variable(s), and then execute a .mpl file with those param values, before quitting maple.&lt;/p&gt;
&lt;p&gt;For example, if I've got HelloWorld.mpl on my desktop, which just contains the line print("Hello World!");, I can open Terminal on my Mac and execute&lt;/p&gt;
&lt;p&gt;export MAPLE="/Library/Frameworks/Maple.framework/Versions/16"&lt;br&gt;for i in 1 2 3 4 5&lt;br&gt;do&lt;br&gt; $MAPLE/bin/maple /Users/Daryl/Desktop/HelloWorld.mpl; &lt;br&gt;done&lt;/p&gt;
&lt;p&gt;This opens maple, prints "Hello World!", and then quits, five times over. But what I want to be able to do is print i each time. So I want to open maple inside the for loop like this, define something like a:=$i, and then execute a .mpl file with the line print(a); and then quit.&lt;/p&gt;
&lt;p&gt;Ultimately, it would be wonderful to be able to process this in parallel, so if you have any tips on how to do that I'd really appreciate it, but even solving this more immediate problem would be huge for me, since I've only got 8 processors and can just execute that many for loops individually.&lt;/p&gt;
&lt;p&gt;Thanks very much for any help you're able to offer!&lt;/p&gt;
&lt;p&gt;Daryl&lt;/p&gt;</description>
      <guid>145676</guid>
      <pubDate>Tue, 09 Apr 2013 07:38:40 Z</pubDate>
      <itunes:author>daryljanzen</itunes:author>
      <author>daryljanzen</author>
    </item>
    <item>
      <title>numeric?</title>
      <link>http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened?ref=Feed:MaplePrimes:Maple API - Simulate ("...too many files opened."):Comments#comment145681</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened#comment145676"&gt;@daryljanzen&lt;/a&gt; I saw your &lt;a href="http://www.mapleprimes.com/questions/145579-Can-I-Write-A-Shell-Script-That-Executes"&gt;earlier Question&lt;/a&gt;, and the first things that came to mind were:&lt;/p&gt;
&lt;p&gt;Is this numeric computation?&lt;/p&gt;
&lt;p&gt;Could it be possible that serial (nonparallel) version might be optimized? This is often true of Maple code written by people coming to Maple from some other computing environment.&lt;/p&gt;
&lt;p&gt;You example code in that earlier question involved Arrays. Is that what most of your code is like, and if the computations are numeric and could be done at double precision then optimizing it may be possible. Are you using datatype=float[8] Arrays? Is your code able to run under evalhf, or can some of the your procedures be Compiled? If memory allocation is an issue then are inplace computations possible for parts of your code?&lt;/p&gt;
&lt;p&gt;You might be able to use the Grid package to automate running dispatched instances in parallel, or you might be able to run a shell script on some Maple code that accepts parameter values. But experience tells me that the best course of action might be first to investigate whether your serial version could be optimized for memory and speed performance. Are you able to upload your full code in a Comment on your earlier Question? If not the full code, then how about a working, representative portion which exhibits the issues?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/130317-Maple-API--Simulate-too-Many-Files-Opened#comment145676"&gt;@daryljanzen&lt;/a&gt; I saw your &lt;a href="http://www.mapleprimes.com/questions/145579-Can-I-Write-A-Shell-Script-That-Executes"&gt;earlier Question&lt;/a&gt;, and the first things that came to mind were:&lt;/p&gt;
&lt;p&gt;Is this numeric computation?&lt;/p&gt;
&lt;p&gt;Could it be possible that serial (nonparallel) version might be optimized? This is often true of Maple code written by people coming to Maple from some other computing environment.&lt;/p&gt;
&lt;p&gt;You example code in that earlier question involved Arrays. Is that what most of your code is like, and if the computations are numeric and could be done at double precision then optimizing it may be possible. Are you using datatype=float[8] Arrays? Is your code able to run under evalhf, or can some of the your procedures be Compiled? If memory allocation is an issue then are inplace computations possible for parts of your code?&lt;/p&gt;
&lt;p&gt;You might be able to use the Grid package to automate running dispatched instances in parallel, or you might be able to run a shell script on some Maple code that accepts parameter values. But experience tells me that the best course of action might be first to investigate whether your serial version could be optimized for memory and speed performance. Are you able to upload your full code in a Comment on your earlier Question? If not the full code, then how about a working, representative portion which exhibits the issues?&lt;/p&gt;</description>
      <guid>145681</guid>
      <pubDate>Tue, 09 Apr 2013 09:57:34 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
  </channel>
</rss>