[Swift-commit] r7441 - in trunk: bin libexec

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Wed Dec 18 11:43:06 CST 2013


Author: davidk
Date: 2013-12-18 11:43:05 -0600 (Wed, 18 Dec 2013)
New Revision: 7441

Modified:
   trunk/bin/swiftdebug
   trunk/libexec/swift-int.k
Log:
Display files staged out by each task


Modified: trunk/bin/swiftdebug
===================================================================
--- trunk/bin/swiftdebug	2013-12-18 16:43:49 UTC (rev 7440)
+++ trunk/bin/swiftdebug	2013-12-18 17:43:05 UTC (rev 7441)
@@ -12,6 +12,7 @@
     host             => '$',
     replicationGroup => '$',
     stageIn          => '$',
+    stageOut         => '$',
     startTime        => '$',
     stopTime         => '$',
     taskNumber       => '$',
@@ -64,6 +65,11 @@
       return;
    }
 
+   elsif ( $message =~ /FILE_STAGE_OUT_START/ ) {
+      &taskStagingOut($message);
+      return;
+   }
+
    elsif ( $message =~ m/$keyword_regexp/ ) {
       print "$message";
       return;
@@ -90,10 +96,9 @@
 sub taskStarted() {
    # Input: JOB_START jobid=sleep-k5t2pajl tr=sleep arguments=[1] tmpdir=sleep-run002/jobs/k/sleep-k5t2pajl host=westmere
    $_[0] =~ s/jobid=|tr=|arguments=|tmpdir=|hostdir=//g;
-   my $arguments = getBracketedText($_[0]);
-   $_[0] =~ s/$arguments/\[arguments\]/g;
-   my ( $date, $ignore, $taskid, $app, $notarguments, $workdir, $junk ) = split(/\s+/, $_[0]);
-
+   my ( $date, $ignore, $taskid, $app, $remainder ) = split(/\s+/, $_[0], 5);
+   my $arguments = &getBracketedText($remainder);
+   my $workdir = (split(/\s+/, $_[0]))[-2];
    my $t = $tasks{$taskid};
    $t->app($app);
    $t->workdir($workdir);
@@ -118,6 +123,18 @@
    $t->stageIn($files);
 }
 
+sub taskStagingOut() {
+   # Input: FILE_STAGE_OUT_START srcname=catsn.0001.out srcdir=catsn-run015/shared/output srchost=westmere destdir=output desthost=localhost provider=file jobid=cat-xpyldpjl
+   $_[0] =~ s/srcname=|srcdir=|srchost=|destdir=|desthost=|provider=|jobid=//g;
+   my ( $date, $junk, $srcname, $srcdir, $srchost, $destdir, $desthost, $provider, $taskid ) = split(/\s+/, $_[0]);
+   my $t = $tasks{$taskid};
+   if(defined($t->stageOut())) {
+      $t->stageOut($t->stageOut() . "$srcname ");
+   } else {
+      $t->stageOut("$srcname");
+   }
+}
+
 sub getBracketedText() {
    $_[0] =~ /\[([^\]]*)\]/x;
    my $result = $1;
@@ -135,7 +152,8 @@
              "\tStart time = %s\n" .
              "\tStop time = %s\n" .
              "\tWork directory = %s\n" .
-             "\tStaged in files = %s\n",
+             "\tStaged in files = %s\n" .
+             "\tStaged out files = %s\n",
              $value->taskNumber, 
              $value->app, 
              $value->arguments,
@@ -144,6 +162,7 @@
              $value->stopTime,
              $value->workdir,
              $value->stageIn,
+             $value->stageOut,
    }
 }
 

Modified: trunk/libexec/swift-int.k
===================================================================
--- trunk/libexec/swift-int.k	2013-12-18 16:43:49 UTC (rev 7440)
+++ trunk/libexec/swift-int.k	2013-12-18 17:43:05 UTC (rev 7441)
@@ -269,7 +269,7 @@
 				fullRemote := dircat(rdir, bname)
 
 				log(LOG:DEBUG, "FILE_STAGE_OUT_START srcname={bname} srcdir={rdir} srchost={host} ",
-					"destdir={ldir} desthost={dhost} provider={provider}")
+					"destdir={ldir} desthost={dhost} provider={provider} jobid={jobid}")
 				//make sure we do have the directory on the client side
 				dir:make(ldir, host=dhost, provider=provider)
 				policy := cdm:query(file)




More information about the Swift-commit mailing list