[Swift-commit] r6521 - in SwiftApps/magic-square: . bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Thu May 30 13:15:23 CDT 2013


Author: davidk
Date: 2013-05-30 13:15:23 -0500 (Thu, 30 May 2013)
New Revision: 6521

Added:
   SwiftApps/magic-square/bin/
   SwiftApps/magic-square/bin/hwsq
   SwiftApps/magic-square/bin/readme.txt
   SwiftApps/magic-square/bin/run_hwsq.sh
   SwiftApps/magic-square/clean.sh
   SwiftApps/magic-square/hwsq.m
   SwiftApps/magic-square/hwsq.sh
   SwiftApps/magic-square/magic-square.swift
   SwiftApps/magic-square/myf1.m
   SwiftApps/magic-square/sites.xml
   SwiftApps/magic-square/tc.data
Log:
Initial commit of magic square (tested running locally on beagle)


Added: SwiftApps/magic-square/bin/hwsq
===================================================================
(Binary files differ)


Property changes on: SwiftApps/magic-square/bin/hwsq
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: SwiftApps/magic-square/bin/readme.txt
===================================================================
--- SwiftApps/magic-square/bin/readme.txt	                        (rev 0)
+++ SwiftApps/magic-square/bin/readme.txt	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1,92 @@
+MATLAB Compiler
+
+1. Prerequisites for Deployment 
+
+. Verify the MATLAB Compiler Runtime (MCR) is installed and ensure you    
+  have installed version 7.16.   
+
+. If the MCR is not installed, launch MCRInstaller, located in:
+
+  <matlabroot>*/toolbox/compiler/deploy/glnxa64/MCRInstaller.zip
+
+For more information about the MCR and the MCR Installer, see 
+“Working With the MCR” in the MATLAB Compiler User’s Guide.    
+
+
+
+2. Files to Deploy and Package
+
+Files to package for Standalone 
+================================
+-hwsq 
+-run_hwsq.sh (shell script run to temporarily set environment variables and execute the 
+              application)
+   -to run the shell script, type
+   
+       ./run_hwsq.sh <mcr_directory> <argument_list>
+       
+    at Linux or Mac command prompt. <mcr_directory> is the directory 
+    where version 7.16 of MCR is installed or the directory where 
+    MATLAB is installed on the machine. <argument_list> is all the 
+    arguments you want to pass to your application. For example, 
+
+    If you have version 7.16 of MCR installed in 
+    /mathworks/home/application/R2010a/v716, run the shell script as:
+    
+       ./run_hwsq.sh /mathworks/home/application/R2010a/v716
+       
+    If you have MATLAB installed in /mathworks/devel/application/matlab, 
+    run the shell script as:
+    
+       ./run_hwsq.sh /mathworks/devel/application/matlab
+-MCRInstaller.zip
+   -include when building component by clicking "Add MCR" link 
+    in deploytool
+-This readme file 
+
+3. Definitions
+
+For information on deployment terminology, go to 
+http://www.mathworks.com/help. Select your product and see 
+the Glossary in the User’s Guide.
+
+
+* NOTE: <matlabroot> is the directory where MATLAB is installed on the target machine.
+
+
+4. Appendix 
+
+A. Linux x86-64 systems:
+   On the target machine, add the MCR directory to the environment variable 
+   LD_LIBRARY_PATH by issuing the following commands:
+
+        NOTE: <mcr_root> is the directory where MCR is installed
+              on the target machine.         
+
+            setenv LD_LIBRARY_PATH
+                $LD_LIBRARY_PATH:
+                <mcr_root>/v716/runtime/glnxa64:
+                <mcr_root>/v716/bin/glnxa64:
+                <mcr_root>/v716/sys/os/glnxa64:
+                <mcr_root>/v716/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:
+                <mcr_root>/v716/sys/java/jre/glnxa64/jre/lib/amd64/server:
+                <mcr_root>/v716/sys/java/jre/glnxa64/jre/lib/amd64 
+            setenv XAPPLRESDIR <mcr_root>/v716/X11/app-defaults
+
+
+     
+        NOTE: To make these changes persistent after logout on Linux 
+              or Mac machines, modify the .cshrc file to include this  
+              setenv command.
+        NOTE: The environment variable syntax utilizes forward 
+              slashes (/), delimited by colons (:).  
+        NOTE: When deploying standalone applications, it is possible 
+              to run the shell script file run_hwsq.sh 
+              instead of setting environment variables. See 
+              section 2 "Files to Deploy and Package".    
+
+
+
+
+
+

Added: SwiftApps/magic-square/bin/run_hwsq.sh
===================================================================
--- SwiftApps/magic-square/bin/run_hwsq.sh	                        (rev 0)
+++ SwiftApps/magic-square/bin/run_hwsq.sh	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1,39 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  eval "${exe_dir}"/hwsq $args
+fi
+exit
+


Property changes on: SwiftApps/magic-square/bin/run_hwsq.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/magic-square/clean.sh
===================================================================
--- SwiftApps/magic-square/clean.sh	                        (rev 0)
+++ SwiftApps/magic-square/clean.sh	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1 @@
+rm -rf *.log *.rlog *.d *.kml *.swiftx *.dat


Property changes on: SwiftApps/magic-square/clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/magic-square/hwsq.m
===================================================================
--- SwiftApps/magic-square/hwsq.m	                        (rev 0)
+++ SwiftApps/magic-square/hwsq.m	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1,7 @@
+function m = hwsq(infile,outfile,fac)
+n = dlmread(infile)
+if ischar(fac)
+    fac=str2num(fac);
+end
+m = myf1(n,fac)
+dlmwrite(outfile,m)

Added: SwiftApps/magic-square/hwsq.sh
===================================================================
--- SwiftApps/magic-square/hwsq.sh	                        (rev 0)
+++ SwiftApps/magic-square/hwsq.sh	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1 @@
+/lustre/beagle/davidk/magic-square/bin/run_hwsq.sh /soft/matlab/7.13 "$@"  


Property changes on: SwiftApps/magic-square/hwsq.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/magic-square/magic-square.swift
===================================================================
--- SwiftApps/magic-square/magic-square.swift	                        (rev 0)
+++ SwiftApps/magic-square/magic-square.swift	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1,16 @@
+type file;
+
+app (file outdata) hwsq (file indata, int factor)
+{
+  runhwsq @indata @outdata factor;
+}
+
+file degreeData<"degree.dat">;
+
+int factors[] = [0:9];
+file squareMats[] <simple_mapper; prefix="sqmat.",suffix=".dat">;
+
+foreach f, i in factors {
+  squareMats[i] = hwsq (degreeData, f);
+}
+

Added: SwiftApps/magic-square/myf1.m
===================================================================
--- SwiftApps/magic-square/myf1.m	                        (rev 0)
+++ SwiftApps/magic-square/myf1.m	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1,7 @@
+function m = myf1(n,fac)
+
+if ischar(n)
+    n=str2num(n);
+end
+g = magic(n)
+m = g * fac

Added: SwiftApps/magic-square/sites.xml
===================================================================
--- SwiftApps/magic-square/sites.xml	                        (rev 0)
+++ SwiftApps/magic-square/sites.xml	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1,9 @@
+<config>
+   <pool handle="localhost">
+      <execution provider="coaster" jobmanager="local:local"/>
+      <profile namespace="karajan" key="jobThrottle">0</profile>
+      <profile namespace="karajan" key="initialScore">10000</profile>
+      <filesystem provider="local"/>
+      <workdirectory>/lustre/beagle/davidk/swiftwork</workdirectory>
+   </pool>
+</config>

Added: SwiftApps/magic-square/tc.data
===================================================================
--- SwiftApps/magic-square/tc.data	                        (rev 0)
+++ SwiftApps/magic-square/tc.data	2013-05-30 18:15:23 UTC (rev 6521)
@@ -0,0 +1 @@
+localhost runhwsq /lustre/beagle/davidk/magic-square/hwsq.sh




More information about the Swift-commit mailing list