[m-rev.] for review: deep profiling.

Simon Taylor stayl at cs.mu.OZ.AU
Mon May 7 17:59:08 AEST 2001


> deep/mdprof_cgi.m:
> 	The CGI script.
> 
> deep/mdprof_server.m:
> 	The top level predicates of the server.

Neither of these modules appears in the diff.

> Index: array_util.m
> ===================================================================
> +:- pred array_foldl(pred(int, T, U, U), array(T), U, U).
> +:- mode array_foldl(pred(in, in, di, uo) is det, in, di, uo) is det.
> +:- mode array_foldl(pred(in, in, array_di, array_uo) is det, in,
> +	array_di, array_uo) is det.
> +:- mode array_foldl(pred(in, in, in, out) is det, in, in, out) is det.
> +
> +:- pred array_foldl0(pred(int, T, U, U), array(T), U, U).
> +:- mode array_foldl0(pred(in, in, di, uo) is det, in, di, uo) is det.
> +:- mode array_foldl0(pred(in, in, array_di, array_uo) is det, in,
> +	array_di, array_uo) is det.
> +:- mode array_foldl0(pred(in, in, in, out) is det, in, in, out) is det.

It would be nice to avoid having some arrays starting at index one and some
at index zero, although that might be a bit difficult to change now.
At the very least, deep/profile.m should document which arrays start at
what index.

The predicates in this module could also do with some documentation.

> Index: interface.m
> ===================================================================

> +% This module defines the type of the commands that the CGI program (cgi.m)
> +% passes to the deep profiling server (deep.m), as well as utility predicates
> +% for manipulating commands and responses.

The module names in this comment aren't correct.

> Index: server.m
> ===================================================================

> +server(TimeOut, CreatePipes, Debug, Deep) -->
> +	{ DataFileName = Deep ^ data_file_name },
> +	{ InputPipe = to_server_pipe_name(DataFileName) },
> +	{ OutputPipe = from_server_pipe_name(DataFileName) },
> +	(
> +		{ CreatePipes = yes },
> +		{ format("mknod -m a=rw %s p", [s(InputPipe)],
> +			MakeInputPipeCmd) },
> +		{ format("mknod -m a=rw %s p", [s(OutputPipe)],
> +			MakeOutputPipeCmd) },
> +		io__call_system(MakeInputPipeCmd, InputRes),
> +		( { InputRes = ok(0) } ->
> +			[]
> +		;
> +			[]
> +			% { error("could not make pipe to server") }
> +		),
> +		io__call_system(MakeOutputPipeCmd, OutputRes),
> +		( { OutputRes = ok(0) } ->
> +			[]
> +		;
> +			[]
> +			% { error("could not make pipe from server") }
> +		)

Why is the error checking commented out here?

> Index: util.m
> ===================================================================
> +:- pred require_isnt(pred, string).
> +:- mode require_isnt((pred) is semidet, in) is det.
> +
> +require_isnt(Goal, Message) :-
> +	( call(Goal) ->
> +		error(Message)
> +	;
> +		true
> +	).
> +
> +:- pred is_member(T::in, list(T)::in) is semidet.
> +
> +is_member(Elem, List) :-
> +	member(Elem, List).

These aren't used anywhere.

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list