Newsgroups: comp.parallel.pvm
Path: ukc!uknet!EU.net!Germany.EU.net!news.dfn.de!tubsibr!strauss
From: strauss@ibr.cs.tu-bs.de (Frank Strauss)
Subject: Re: Converting Xab3 tracefiles for Paragraph ?
Message-ID: <1994Feb15.191003.18949@ibr.cs.tu-bs.de>
Keywords: Xab3, Paragraph, tracefiles
Sender: postnntp@ibr.cs.tu-bs.de (Mr. Nntp Inews Entry)
Organization: TU Braunschweig, Informatik (Bueltenweg), Germany
References: <1994Feb14.120252.9666@ibr.cs.tu-bs.de> <1994Feb14.122147.10632@ibr.cs.tu-bs.de>
Date: Tue, 15 Feb 1994 19:10:03 GMT
Lines: 164

strauss@ibr.cs.tu-bs.de (Frank Strauss) writes:

>strauss@ibr.cs.tu-bs.de (Frank Strauss) writes:

I don't talk myself everyday, ... but today I will make an exception. :-)

I tried to use the awk script for converting Xab3 traces to Paragraph
trace files. I found two littles bugs, also in a "patched" version by
Marc Buffat. They start looking for lists of tids at the wrong position.
Here is my patched one:

#Awk script for converting xab3 tracefiles to ParaGraph format
#8/23/93 Wilson Swee
# modifier par Marc BUFFAT pour pvm 3.2 11/11/93
# modified by Frank Strauss (strauss@ibr.cs.tu-bs.de) 02/15/94
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=12
	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++ 
		# store the base time
		if (bsec=="") {
		 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=11
# 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]
	}


