[comp.sys.encore] CPU timing while using EPT - how?

aslam@m.cs.uiuc.edu (10/18/89)

Gentle readers, I have two inquiries:

1. How can I time programs when using the EPT  (Encore Parallel Threads)?
When I used to use the multi-tasking routines, task_init, task_create etc.,
I used the routines "timer_init" and "timer_get" to time my code. These
are all documented in section 3P of the man pages. EPT provides a much
more comfortable programming environment than the multi-tasking package; I
would like to determine what this comfort is costing me in terms of multi-cpu
times.

2. Is it possible to install an exception handler for memory alloc disasters?
This is when EPT aborts with a trace like the following:

----------------------------------
Memory allocation statistics 
free:	 0 255 122 48 29 0 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 1 6 16 3 0 1 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 18512, total free: 18352

THREAD(disaster): pid 30359 (0): out of memory
IOT trap
--------------------------------------------

I always check the value returned by malloc but this disaster seems to happen
while malloc is doing its job. What I would like is that I trap such a
disaster and free memory that I am not using and then continue.

I am using UMAX 4.2, R3.2.0 on a 10 processor Multimax.

Sohail Aslam
Department of Computer Science
University of Illinois
arpa		aslam@cs.uiuc.edu
usenet		uiucdcs!aslam
bitnet		aslam@uiucdcs.BITNET

twd@brunix (Tom Doeppner) (10/19/89)

In article <37500009@m.cs.uiuc.edu> aslam@m.cs.uiuc.edu writes:
>
>Gentle readers, I have two inquiries:
>
>1. How can I time programs when using the EPT	(Encore Parallel Threads)?
>When I used to use the multi-tasking routines, task_init, task_create etc.,
>I used the routines "timer_init" and "timer_get" to time my code. These
>are all documented in section 3P of the man pages. EPT provides a much
>more comfortable programming environment than the multi-tasking package; I
>would like to determine what this comfort is costing me in terms of multi-cpu
>times.
>

An undocumented "feature" of EPT (or of at least its progenitor, which
was written at Brown), is that if you set the external integer THREADtimed to
1 before calling THREADgo, at the end of your run the number of microseconds
of real time used, not counting the overhead taken starting up and shutting
down, will be printed out.  Regardless of what you do with TREADtimed, there
is another external variable, this one a pointer to an unsigned integer,
called THREADtimerptr, which points to the free-running real time clock, whose
least significant bit measures microseconds.  (This is set up in the EPT
runtime code by calling time_init[3P].

To use these two variables, you need the declarations:

extern int THREADtimed;
extern unsigned *THREADtimerptr;

>2. Is it possible to install an exception handler for memory alloc disasters?

Unfortunately, no.

>Sohail Aslam
>Department of Computer Science
>University of Illinois
>arpa		aslam@cs.uiuc.edu
>usenet 	uiucdcs!aslam
>bitnet 	aslam@uiucdcs.BITNET


Tom Doeppner
Dept. of Computer Science
Brown University

twd@cs.brown.edu