Steve Mohr | 1 Jun 11:08 2010
Picon

Metapost capacity exceeded

Hi

I'm trying to make a large number of plots in Mpost (~1000 of the type below)
I'm getting an error of

! MetaPost capacity exceeded, sorry [independent variables=33554431].

Sample code below

Any ideas how to get around the issue? is there a way to unassign variables?

Many Thanks

Steve

beginfig(377);
draw begingraph(3.5in,2.8in);
gfill "BG\\Countries\\Guyana.txt" withcolor (1,0,0);
gdraw "BG\\Countries\\Guyana.txt";
gfill "BG\\Countries\\Guyana.txt" withcolor (0,0,1);
gdraw "BG\\Countries\\Guyana.txt";
glabel.lft(btex Production (Mt/y) etex rotated 90,OUT);
glabel.bot(btex Time etex,OUT);
setrange("2000","0","2150",".38087595");
autogrid(,otick.lft);
otick.bot(btex 2000 etex, 2000);
otick.bot(btex 2050 etex, 2050);
otick.bot(btex 2100 etex, 2100);
otick.bot(btex 2150 etex, 2150);
closefrom("BG\\Countries\\Guyana.txt");
endgraph;

pair p[], q[], r[], s[], t[];
q[1]:=(-1cm,-1.200000000cm);
r[1]:=(-0.2cm,-1.200000000cm);
s[1]:=(-0.2cm,-1.600000000cm);
t[1]:=(-1cm,-1.600000000cm);
fill q[1]--r[1]--s[1]--t[1]--cycle withcolor (0,0,1);
draw q[1]--r[1]--s[1]--t[1]--cycle;
label.lrt(btex Conventional etex, r[1]);
q[2]:=(4.5cm,-1.200000000cm);
r[2]:=(5.3cm,-1.200000000cm);
s[2]:=(5.3cm,-1.600000000cm);
t[2]:=(4.5cm,-1.600000000cm);
fill q[2]--r[2]--s[2]--t[2]--cycle withcolor (1,0,0);
draw q[2]--r[2]--s[2]--t[2]--cycle;
label.lrt(btex Conventional etex, r[2]);
endfig;

Find it at CarPoint.com.au New, Used, Demo, Dealer or Private?
--
http://tug.org/metapost/
Taco Hoekwater | 1 Jun 16:00 2010

Re: Metapost capacity exceeded


Hi,

Steve Mohr wrote:
>   Hi
> 
> I'm trying to make a large number of plots in Mpost (~1000 of the type 
> below)
> I'm getting an error of
> 
> ! MetaPost capacity exceeded, sorry [independent variables=33554431].
> 
> Sample code below
> 
> Any ideas how to get around the issue? 

Splitting the plots into multiple files is the only option.

> is there a way to unassign variables?

No. The message is not really about variables, it is about unique
instances of variable objects (but that would be quite a mouthful
for an error message).

Due to the linear equation solving, the number if instances grows
faster than the number of variables, and there is a definite limit
that cannot be enlarged (overflow would occur).

This is one of the issues that will be solved by MetaPost 2.0
(expected late summer).

Best wishes,
Taco

--
http://tug.org/metapost/

Nicola | 1 Jun 17:07 2010
Picon

Re: Metapost capacity exceeded

In article <4C05129A.5080300 <at> elvenkind.com>,
 Taco Hoekwater <taco <at> elvenkind.com> wrote:

> Due to the linear equation solving, the number if instances grows
> faster than the number of variables, and there is a definite limit
> that cannot be enlarged (overflow would occur).
> 
> This is one of the issues that will be solved by MetaPost 2.0
> (expected late summer).

This is good news! But, regarding the current version, what are, or 
where are documented, the numeric limits that are hard-coded? For 
example, is it possible to have more than ~16K symbolic tokens defined 
(that is the limit that I can reach in my tests)?

Nicola

--
http://tug.org/metapost/

Taco Hoekwater | 1 Jun 18:07 2010

Re: Metapost capacity exceeded

Nicola wrote:
> 
> But, regarding the current version, what are, or 
> where are documented, the numeric limits that are hard-coded? For 
> example, is it possible to have more than ~16K symbolic tokens defined 
> (that is the limit that I can reach in my tests)?

Not all internal limits are documented, in part because some
are completely fixed, in part because some are fluid, and in
part because nobody cared enough to find the actual max.

I think (but will not guarantee) that the current situation
for hard-code array values 1.2XX is like below:

Configurable:

* main_memory (overall memory)
   default is 50000,
   must be less than 0x10000000

* hash_size  (variable names and identifiers)
   default is 16384,
   max is 0x8000000

* param_size (simultaneous active parameters)
   default is 1500,
   hash_size+3*param_size must be less than 0x10000000

* max_in_open (simultaneous input levels)
   default is 25,
   must be less than about 65500 (but the operating system will
   allow much less than that in practice)

Not configurable:

* variable instances (the one you hit already)
   max is 33554431.

* expansion depth (for macros)
   max is 10000.

* sizes per font (for font objects belonging to figures)
   max is 65535.

* the various tfm generation parameters are limited by
   the tfm file format

And then there are the numeric limits that are documented
as part of the MetaPost language, of course (no variables
may be larger than 4095.999, no intermiate values larger
than 16383.9999, etc.).

Best wishes,
Taco

--
http://tug.org/metapost/

Nicola | 1 Jun 19:09 2010
Picon

Re: Metapost capacity exceeded

In article <4C05302C.5030003 <at> elvenkind.com>,
 Taco Hoekwater <taco <at> elvenkind.com> wrote:

> Nicola wrote:
> > 
> > But, regarding the current version, what are, or 
> > where are documented, the numeric limits that are hard-coded? For 
> > example, is it possible to have more than ~16K symbolic tokens defined 
> > (that is the limit that I can reach in my tests)?
> 
> Not all internal limits are documented, in part because some
> are completely fixed, in part because some are fluid, and in
> part because nobody cared enough to find the actual max.
> 
> I think (but will not guarantee) that the current situation
> for hard-code array values 1.2XX is like below:
> [...]

Thanks! Those figures will be very useful to me! "Configurable" 
parameters are those that can be set during format creation? How do you 
do that?

Nicola

--
http://tug.org/metapost/

taco | 1 Jun 19:34 2010

Re: Metapost capacity exceeded

Nicola wrote:
> In article <4C05302C.5030003 <at> elvenkind.com>,
>  Taco Hoekwater <taco <at> elvenkind.com> wrote:
> 
>> Nicola wrote:
>>> But, regarding the current version, what are, or 
>>> where are documented, the numeric limits that are hard-coded? For 
>>> example, is it possible to have more than ~16K symbolic tokens defined 
>>> (that is the limit that I can reach in my tests)?
>> Not all internal limits are documented, in part because some
>> are completely fixed, in part because some are fluid, and in
>> part because nobody cared enough to find the actual max.
>>
>> I think (but will not guarantee) that the current situation
>> for hard-code array values 1.2XX is like below:
>> [...]
> 
> Thanks! Those figures will be very useful to me! "Configurable" 
> parameters are those that can be set during format creation? How do you 
> do that?

Add a parameter to texmf.cnf. The names are:

   main_memory
   hash_size
   max_in_open
   param_size

Best wishes,
Taco
--
http://tug.org/metapost/

José Carlos Santos | 2 Jun 11:19 2010
Picon

MetaPost and XeTeX

Hi all,

Yesterday, Taco Hoekwater made a reference to MetaPost 2.0. I would like 
to know if this new version will be able to work with XeTeX. The reason 
for this is that recently, and for the first time in many years, I did 
not use MetaPost to create graphics for a text that I was working on. I 
used Asymptote instead, since the text was compiled with XeLaTeX and I 
wanted to be able to use within the graphics the same fonts that were 
used within the text.

Best regards,

Jose Carlos Santos
--
http://tug.org/metapost/

Taco Hoekwater | 2 Jun 13:03 2010

Re: MetaPost and XeTeX


José Carlos Santos wrote:
> Hi all,
> 
> Yesterday, Taco Hoekwater made a reference to MetaPost 2.0. I would like
> to know if this new version will be able to work with XeTeX. [...] and I
> wanted to be able to use within the graphics the same fonts that were
> used within the text.

For label typesetting, I assume?

For the standalone MetaPost the answer is no (unless you limit xetex
to traditional TeX (Type1) fonts and find a way to make it output
traditional dvi). MetaPost is based on PostScript, and as such it does
not support OpenType/TrueType fonts, nor are there short-term plans to
add such support.

It would be possible to combine the library component of metapost
with xetex, much like it is integrated into LuaTeX. Then the label
typesetting can be done in the typesetting engine itself. This would
work even with the current metapost, but you will have to contact a
xetex developer for that.

Best wishes,
Taco

--
http://tug.org/metapost/

José Carlos Santos | 2 Jun 13:30 2010
Picon

Re: MetaPost and XeTeX

On 02-06-2010 12:03, Taco Hoekwater wrote:

>> Yesterday, Taco Hoekwater made a reference to MetaPost 2.0. I would like
>> to know if this new version will be able to work with XeTeX. [...] and I
>> wanted to be able to use within the graphics the same fonts that were
>> used within the text.
>
> For label typesetting, I assume?

Yes, of course.

> For the standalone MetaPost the answer is no (unless you limit xetex
> to traditional TeX (Type1) fonts and find a way to make it output
> traditional dvi). MetaPost is based on PostScript, and as such it does
> not support OpenType/TrueType fonts, nor are there short-term plans to
> add such support.
>
> It would be possible to combine the library component of metapost
> with xetex, much like it is integrated into LuaTeX. Then the label
> typesetting can be done in the typesetting engine itself. This would
> work even with the current metapost, but you will have to contact a
> xetex developer for that.

I think I will do that.

Best regards,

Jose Carlos Santos
--
http://tug.org/metapost/

Dave Crossland | 2 Jun 13:59 2010

Re: MetaPost and XeTeX

Hi,

What about using MP's SVG output?

SVG can make use of OpenType fonts with <at> font-face, I think...

Regards, Dave

On 2 Jun 2010, 12:04 PM, "Taco Hoekwater" <taco <at> elvenkind.com> wrote:

José Carlos Santos wrote: > Hi all, > > Yesterday, Taco Hoekwater made a reference to MetaPost 2....

> to know if this new version will be able to work with XeTeX. [...] and I

> wanted to be able to use within the graphics the same fonts that were > used within the text.

For label typesetting, I assume?

For the standalone MetaPost the answer is no (unless you limit xetex
to traditional TeX (Type1) fonts and find a way to make it output
traditional dvi). MetaPost is based on PostScript, and as such it does
not support OpenType/TrueType fonts, nor are there short-term plans to
add such support.

It would be possible to combine the library component of metapost
with xetex, much like it is integrated into LuaTeX. Then the label
typesetting can be done in the typesetting engine itself. This would
work even with the current metapost, but you will have to contact a
xetex developer for that.

Best wishes,
Taco


--
http://tug.org/metapost/
--
http://tug.org/metapost/

Gmane