> < ^ Date: Thu, 23 Feb 1995 10:02:00 -0500
> < ^ From: Alexander Hulpke <hulpke@math.colostate.edu >
> < ^ Subject: Re: Some questions

Dear Gap-Forum,

Johannes M"uller asked:

First: can you tell me, what number X (given to GAPEMX.EXE with parameter -m
Xm) works best (fastest) with respect to invoking Editor or computation of
large objects (garbage collection etc.).

These are in fact a couple of questions. I suppose you are using GAP under
Your optimization conditions contradict each other in some way. I will just
give a set of basic rules, by which you might find a suitable setting.

- Unless you only work with numbers, 3.5 or 4MB is a lower limit to be able
to work reasonably with GAP. If you set a lower limit, it is very likely,
that GAP will extend its workspace automatically.
- You can use the -g command line option to see the performance of garbage
collections and the total allocated memory to deduce the needed memory
space. As a rule of thumb, you should have at least 100kB free after a
garbage collection to get satisfactorial results.
- If you allocate more memory than what fits into the main memory, GAP will
have to swap. This reduces computing speed enormously. Unless you
desperately need more memory, try to restrict yourself to the free RAM.
As I have not much experience with DOS systems, I have no idea, how much
memory remains after loading DOS and probably various TSR's.
- As DOS has no provisions for multi-tasking, at least parts of GAP have to
be swapped to disk whenver an editor is called. I'm not sure, whether this
is always the whole memory area or only the lower 640kB. This might depend
on the editor as well. Probably using some kind of TSR editor and 'Read'
instead of 'Edit' might increase the turnaround times.
If using an ordinary editor, probably setting the memory limit as tight as
possible increases turnaround times, but computations might become slow.
- Swapping speed is obviously depending on further hardware specifics.

My own tests (I have a 386-PC with 8Mb) brought this: Calling GAP with -m 4m
results in (a little) faster Execution as -m 6m being faster as -m 7m.

So probably 4MB is the right amount for your work. If 'Edit'ing takes up a
smaller part, then increasing the memory might be useful.
It is likely, that 7MB already is beyond the RAM capacity (considering,
that the OS and the GAP kernel have to fit into memory as well).

Second: I'm in need of a function returning the (rounded) modulus of a
cyclotomic, e.g. something like AbsVal(1+E(4)) giving something about
1414/1000. Is there something I haven't found? (gap3r4p0)

No. At the moment, GAP's implementation of field extensions is a purely
algebraic one. There is no way to extend valuation information from the
ground field to the extension.
It would be possible to write a function 'AbsVal' in the GAP language, that
would utilize the canonical embedding E(n)->exp(2\pi i/n) and get an
approximation of the value by numerical evaluation. However this would
require about 3-4 pages of code. Also the reliability (i.e. numerical
stability) of this coude might me doubtful when comparing elements, which
are 'close together'. Finally the resulting code would be quite slow.
I must admit that I don't feel tempted to write such code.

Are you sure, you'll *really* need this absolute value? For many
applications one can find some way around this problem. For example, getting
bounds would be much easier.

Thanx & Bye, Johannes

You're welcome,


-- Alexander Hulpke, Lehrstuhl D f"ur Mathematik, RWTH, 52056 Aachen,
ahulpke@bert.math.rwth-aachen.de ,
until April '95: Concordia University, Montreal, Canada

> < [top]