Newsgroups: comp.parallel.pvm
From: cc0luism@lucano (Luis Melendez Aganzo)
Subject: Re: Pablo SDDF -> PICL Converter avaiable?
Organization: University of Cordoba
Date: 30 Sep 1994 15:01:34 GMT
Message-ID: <36h98e$k07@obelix.cica.es>

Swen Schaub (glam1292@servus08.rus.uni-stuttgart.de) wrote:
: has somebody any information whether there exists a converter
: for tracefiles:
:    Pablo SDDF (the format PVM tracing writes)
:  to
:    PICL (the format ParaGraph can read and display) ?

I don't know if this will help you, but included in the XAB3 distribution, 
there is a script for converting between the format generated by abmon3
(PVM3) to PICL.
It is called topg3 and uses another gawk script:

****************top3. CUT HERE***************************************
#!/bin/csh -f

foreach i ($argv)
	gawk -f pg3.aw $i.xab | sort +1n -2 +2n -3 > $i.trf
#	awk -f pg.aw $i | sort +1n -2 +2n -3 +0n -1 > $i.trf
	end

****************pg3.aw. CUT HERE**************************************

#Awk script for converting xab3 tracefiles to ParaGraph format
#8/23/93 Wilson Swee (wilsons@cs.cmu.edu) created.
#12/21/93 Fixed bug in pvm_spawn (Wilson).

BEGIN { curnode = 0;

		picl["trace_start"]	= 1;
		picl["open"] 		= 2;
		picl["load"] 		= 3;
		picl["send"] 		= 4;
		picl["recv"] 		= 6;
		picl["recv_blocking"] 	= 7;
		picl["recv_waking"] 	= 8;
		picl["message"] 	= 9;
		picl["sync"] 		= 10;
		picl["compstats"] 	= 11;
		picl["commstats"] 	= 12;
		picl["close"] 		= 13;
		picl["trace_level"] 	= 14;
		picl["trace_mark"] 	= 15;
		picl["trace_message"] 	= 16;
		picl["trace_stop"] 	= 17;
		picl["trace_flush"] 	= 18;
		picl["trace_exit"] 	= 19;
		picl["trace_begin"] 	= 20;
		picl["trace_end"] 	= 21;
		picl["host"]		= -32768;

		xab3["pvm_mytid"]	= 26;		#enroll,whoami
		xab3["pvm_spawn"]	= 49;		#initiate
		xab3["pvm_exit"]	= 9;		#leave
		xab3["pvm_recv_entry"]	= 42;		#rcv
		xab3["pvm_send"]	= 43;		#snd
		xab3["pvm_rcv_done"]	= 64;		#rcv_done
		xab3["pvm_mcast"]	= 23;
		}

# get rid of the extra lines
/^[^0-9]/  { next; }

$5 == xab3["pvm_spawn"] {
	n=11
	while (n <= NF) {
	k=$n
	if (node[k] == "") {
		node[k] = curnode++
		print picl["trace_start"], 0, 0, node[k], 0, 0, 0
		n++;
	}
	}
}
# assign a node number 
$5 ==  xab3["pvm_mytid"] { 
	if (node[$3] == "") {
		node[$3] = curnode++ 
		if(bsec == "") {
			# store the base time
			while (length($2) < 6) $2 = "0" $2;
			bsec = $1 "." $2;
			}
		# start tracing on this node
		print picl["trace_start"], 0, 0, node[$3], 0, 0, 0;
		}
	}


$5 == xab3["pvm_send"] {
	while (length($2) < 6) $2 = "0" $2;
	ttime = $1 "." $2;
	test = ttime;
	ttime = ttime - bsec;
	xtime=sprintf("%6.6f", ttime);
	nsf = split(xtime, tsec, ".");
	while (length(tsec[2]) < 6) tsec[2] = tsec[2] "0";
	   dest = node[$8];
# if dest is not assigned yet, give a new node number
	   if (dest == "") {
		node[$8] = curnode++;
		dest = node[$8];
		}
	   print picl["send"], tsec[1], tsec[2], node[$3], dest, $9, $10;
	   split(itime[$3], it, ".");
	   while(length(it[2]) < 6) it[2] = it[2] "0";
	   print picl["compstats"], tsec[1],tsec[2], node[$3], it[1], it[2];
}

$5 == xab3["pvm_mcast"] {
	while (length($2) < 6) $2 = "0" $2;
	ttime = $1"."$2;
	ttime = ttime - bsec;
	xtime=sprintf("%6.6f", ttime);
	nsf = split(xtime, tsec, ".");
	while (length(tsec[2]) < 6) tsec[2] = tsec[2] "0";
	p=10
# parse through list of tids
	while (p <= NF){
		k=$p
		dest = node[k];
	   	if (dest == "") {
			node[k] = curnode++;
			dest = node[k];
		}
		print picl["send"], tsec[1], tsec[2], node[$3], dest, $8, $9
		p++;
		split(itime[$3], it, ".");
		while(length(it[2]) < 6) it[2] = it[2] "0";
	   	print picl["compstats"], tsec[1],tsec[2], node[$3], it[1], it[2];
		} 
      	}


# if it's rcv, generate the PICL event
$5 == xab3["pvm_recv_entry"] { 
	while (length($2) < 6) $2 = "0" $2;
	ttime = $1 "." $2;
	ttime = ttime - bsec;
	xtime=sprintf("%6.6f", ttime);
	rtime[$3]=xtime;
	split(xtime, tsec, ".");
	while (length(tsec[2]) < 6) tsec[2] = tsec[2] "0";
	print picl["recv_blocking"], tsec[1], tsec[2], node[$3], $9;
	split(itime[$3], it, ".");
	while(length(it[2]) < 6) it[2] = it[2] "0";
   	print picl["compstats"], tsec[1],tsec[2], node[$3], it[1], it[2];
	}

# if it's rcv_done
$5 == xab3["pvm_rcv_done"] {
	while (length($2) < 6) $2 = "0" $2;
	ttime = $1 "." $2;
	ttime = ttime - bsec;
	xtime=sprintf("%6.6f", ttime);
	itime[$3]=itime[$3] + xtime - rtime[$3];
	split(xtime, tsec, ".");
	while (length(tsec[2]) < 6) tsec[2] = tsec[2] "0";
	print picl["recv_waking"], tsec[1], tsec[2], node[$3], node[$8], $9, $10;
	split(itime[$3], it, ".");
	while(length(it[2]) < 6) it[2] = it[2] "0";
	print picl["compstats"], tsec[1], tsec[2], node[$3], it[1], it[2]
	}
	

# if it's leave
$5 == xab3["pvm_exit"] {
	while (length($2) < 6) $2 = "0" $2;
	ttime = $1 "." $2;
	ttime = ttime - bsec;
	xtime=sprintf("%6.6f", ttime);
	split(xtime, tsec, ".");
	while (length(tsec[2]) < 6) tsec[2] = tsec[2] "0";
	print picl["close"], tsec[1], tsec[2], node[$3]
	}

--
+-----------------------------------^---------------------------------------+
| Luis Melendez                     ^  email: cc0luism@lucano.uco.es        |
| Centro de Calculo Cientifico      ^  Tlf: 957-218119                      |
| Universidad de Cordoba (SPAIN)    ^  MIME Spoken Here                     |
| gopher://gopher.uco.es            ^  http://www.uco.es                    |
+-----------------------------------^---------------------------------------+


