[Swift-commit] r8380 - in SwiftApps/subjobs: . mpicatsnsleep

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Fri Feb 27 11:10:08 CST 2015


Author: ketan
Date: 2015-02-27 11:10:08 -0600 (Fri, 27 Feb 2015)
New Revision: 8380

Added:
   SwiftApps/subjobs/mpicatsnsleep/
   SwiftApps/subjobs/mpicatsnsleep/apps
   SwiftApps/subjobs/mpicatsnsleep/catsnsleepmpi.swift
   SwiftApps/subjobs/mpicatsnsleep/cf
   SwiftApps/subjobs/mpicatsnsleep/in.data
   SwiftApps/subjobs/mpicatsnsleep/mpicatnap
   SwiftApps/subjobs/mpicatsnsleep/mpicatnap.c
   SwiftApps/subjobs/mpicatsnsleep/runswift.sh
Removed:
   SwiftApps/subjobs/in.data
Log:
adding dir for mpi test

Deleted: SwiftApps/subjobs/in.data
===================================================================
--- SwiftApps/subjobs/in.data	2015-02-27 17:02:34 UTC (rev 8379)
+++ SwiftApps/subjobs/in.data	2015-02-27 17:10:08 UTC (rev 8380)
@@ -1 +0,0 @@
-this is my input

Added: SwiftApps/subjobs/mpicatsnsleep/apps
===================================================================
--- SwiftApps/subjobs/mpicatsnsleep/apps	                        (rev 0)
+++ SwiftApps/subjobs/mpicatsnsleep/apps	2015-02-27 17:10:08 UTC (rev 8380)
@@ -0,0 +1,3 @@
+localhost cat /bin/cat null null null
+cluster bgsh /home/ketan/SwiftApps/subjobs/bg.sh null null null
+

Added: SwiftApps/subjobs/mpicatsnsleep/catsnsleepmpi.swift
===================================================================
--- SwiftApps/subjobs/mpicatsnsleep/catsnsleepmpi.swift	                        (rev 0)
+++ SwiftApps/subjobs/mpicatsnsleep/catsnsleepmpi.swift	2015-02-27 17:10:08 UTC (rev 8380)
@@ -0,0 +1,15 @@
+type file;
+
+app (file o, file sout, file serr) cat (file i)
+{
+  bgsh "/home/ketan/SwiftApps/subjobs/mpicatnap" @i @o arg("s","1") stdout=@sout stderr=@serr;
+}
+
+file out[]<simple_mapper; location="outdir", prefix="f.",suffix=".out">;
+
+foreach j in [1:toInt(arg("n","1"))] {
+  file data<"data.txt">;
+  file sout<single_file_mapper; file=strcat("outdir/f.",j,".stdout")>;
+  file serr<single_file_mapper; file=strcat("outdir/f.",j,".stderr")>;
+  (out[j],sout,serr) = cat(data);
+}

Added: SwiftApps/subjobs/mpicatsnsleep/cf
===================================================================
--- SwiftApps/subjobs/mpicatsnsleep/cf	                        (rev 0)
+++ SwiftApps/subjobs/mpicatsnsleep/cf	2015-02-27 17:10:08 UTC (rev 8380)
@@ -0,0 +1,6 @@
+use.provider.staging=false
+wrapperlog.always.transfer=false
+execution.retries=0
+provider.staging.pin.swiftfiles=false
+sitedir.keep=false
+use.wrapper.staging=false

Added: SwiftApps/subjobs/mpicatsnsleep/in.data
===================================================================
--- SwiftApps/subjobs/mpicatsnsleep/in.data	                        (rev 0)
+++ SwiftApps/subjobs/mpicatsnsleep/in.data	2015-02-27 17:10:08 UTC (rev 8380)
@@ -0,0 +1 @@
+this is my input

Added: SwiftApps/subjobs/mpicatsnsleep/mpicatnap
===================================================================
(Binary files differ)


Property changes on: SwiftApps/subjobs/mpicatsnsleep/mpicatnap
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: SwiftApps/subjobs/mpicatsnsleep/mpicatnap.c
===================================================================
--- SwiftApps/subjobs/mpicatsnsleep/mpicatnap.c	                        (rev 0)
+++ SwiftApps/subjobs/mpicatsnsleep/mpicatnap.c	2015-02-27 17:10:08 UTC (rev 8380)
@@ -0,0 +1,45 @@
+#include <stdio.h>
+#include <mpi.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int main (argc, argv)
+int argc;
+char *argv[];
+{
+  int rank, size;
+
+  MPI_Init (&argc, &argv);  /* starts MPI */
+
+  char *ifile = argv[1];
+  char *ofile = argv[2];
+  int sleeptime = atoi(argv[3]);
+
+  MPI_Comm_rank (MPI_COMM_WORLD, &rank); /* get current MPI process id (rank) */
+  MPI_Comm_size (MPI_COMM_WORLD, &size); /* get number of MPI processes */
+
+  if (rank==0) {
+    printf("ifile=%s ofile=%s sleeptime=%d\n", ifile, ofile, sleeptime);
+
+    int ifd = open(ifile,O_RDONLY);
+    int ofd = open(ofile,O_WRONLY|O_CREAT,0664);
+    char buf[1024*1024];
+    for(;;) {
+      int rc = read(ifd, buf, sizeof(buf));
+      if (rc <= 0) {
+        close(ifd);
+        close(ofd);
+        break;
+      }
+      write(ofd, buf, rc);
+    }
+  }
+
+  sleep(sleeptime);
+
+  char host[512];
+  gethostname(host, 512);
+  printf( "Hello from process %d of %d on %s\n", rank, size, host);
+  MPI_Finalize();
+  return 0;
+}

Added: SwiftApps/subjobs/mpicatsnsleep/runswift.sh
===================================================================
--- SwiftApps/subjobs/mpicatsnsleep/runswift.sh	                        (rev 0)
+++ SwiftApps/subjobs/mpicatsnsleep/runswift.sh	2015-02-27 17:10:08 UTC (rev 8380)
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+#Old method
+#qsub -A ATPESC2014 -n 512 -t 15 --mode script runswift_script.sh -config cf -tc.file apps -sites.file localcoast.xml "$@"
+
+#build app
+mpixlc mpicatnap.c -o mpicatnap
+
+#New method
+/home/ketan/swift-0.95/cog/modules/swift/dist/swift-svn/bin/swift -sites.file cobalt.xml -config cf -tc.file apps catsnsleepmpi.swift -n=64 -s=2
+
+#A testblock run
+#qsub -A ATPESC2013 -n 32 -t 5 -q low --mode c16 --mode script testblock.sh # --disable_preboot


Property changes on: SwiftApps/subjobs/mpicatsnsleep/runswift.sh
___________________________________________________________________
Added: svn:executable
   + *




More information about the Swift-commit mailing list