[m-rev.] for review: dd_speedtest

Ian MacLarty maclarty at cs.mu.OZ.AU
Tue Aug 9 16:56:03 AEST 2005


On Thu, 4 Aug 2005, Ian MacLarty wrote:

> > > @@ -2396,8 +2406,8 @@
> > >      fprintf(stderr, "Total CPU time = %.2f\n",
> > >          MR_get_user_cpu_miliseconds() / 1000.0);
> > >      pid = getpid();
> > > -    sprintf(cmdstr, "ps -o pid,rss | grep %i | awk '{print $2}' 1>&2", pid);
> > > -    fprintf(stderr, "RSS = ");
> > > +    sprintf(cmdstr, "ps -hp %i -o rss,vsz | "
> > > +    	"awk '{print \"RSS = \" $1 \"\\nVSZ = \" $2}' 1>&2", pid);
> > >      system(cmdstr);
> >
> > The old code here worked on aral, but the new one doesn't. Neither the old
> > nor the new code works on mundula (Solaris).
> >
>
> Should I just revert to the old version then?  I don't know a general way to
> get this information that will work on all platforms.
>

I have changed the above to:

diff -bu trace/mercury_trace_declarative.c trace/mercury_trace_declarative.c
--- trace/mercury_trace_declarative.c	3 Aug 2005 13:05:52 -0000
+++ trace/mercury_trace_declarative.c	9 Aug 2005 06:37:16 -0000
@@ -2406,7 +2406,7 @@
     fprintf(stderr, "Total CPU time = %.2f\n",
         MR_get_user_cpu_miliseconds() / 1000.0);
     pid = getpid();
-    sprintf(cmdstr, "ps -hp %i -o rss,vsz | "
+    sprintf(cmdstr, "ps -p %i -o rss,vsz | tail -1 |"
     	"awk '{print \"RSS = \" $1 \"\\nVSZ = \" $2}' 1>&2", pid);
     system(cmdstr);

This works on mundula, aral and jupiter.

Ian.

--------------------------------------------------------------------------
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