PROC root.process(CHAN OF SP fs, ts, []INT memory)
...
:
In fact, non-configured programs let you grab free memory using the above
method by using the environment variable IBOARDSIZE. The `icollect'
tool calculates the free space via ( IBOARDSIZE - ( work.space + code +
vector.space ) ), and passes that to the program as a vector parameter.
However, I am using a transputer network and I do not know how to tell the
configurer to give me free memory via the appropriate argument. This
should be possible on the basis that the memory size of each processor
is declared via `SET (memsize := 4 * M)' or whatever in the .pgm file.
A cut from my pgm configuration file reads thus:
PAR
PROCESSOR pc
#USE "root_cntl.c5h"
root.control(fs, ts, report.to.root[0], pc.id, []INT memory)
PROCESSOR main.pipe[0]
#USE "buff_cntl.c9h"
buffer.control(report.to.0, report.to.root[0], main.pipe.0.id, []INT mem)
.... so on
But of course, on compilation, we get complaints about the undeclared
memory arrays. Declaring the array gives you exactly what you
declare; not the amount of free memory. I am sure there is some kind of
magic keyword that I need, but I cannot find it in my INMOS manuals.
I am aware that using `ilist' can tell me the memory requirements of each
process; calculate the free space on each transputer board and declare
the memory arrays in the root processes. It is, however, painful to
change the array sizes and recompile whenever the program size changes
or I change the boards. Can anybody tell me how to use the configurer?
Thanks in advance for any help,
Kneale J. Rothwell
Research Associate, University of Kent at Canterbury