[Swift-commit] r7809 - in demo/xsede.2014.0425: app part06m

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Wed Apr 30 10:01:59 CDT 2014


Author: wilde
Date: 2014-04-30 10:01:57 -0500 (Wed, 30 Apr 2014)
New Revision: 7809

Added:
   demo/xsede.2014.0425/part06m/p6m.swift
Removed:
   demo/xsede.2014.0425/part06m/p4.swift
Modified:
   demo/xsede.2014.0425/app/mdmaxk
Log:
Snapshot of devel changes for MD-based tutorial/demo

Modified: demo/xsede.2014.0425/app/mdmaxk
===================================================================
--- demo/xsede.2014.0425/app/mdmaxk	2014-04-28 20:27:07 UTC (rev 7808)
+++ demo/xsede.2014.0425/app/mdmaxk	2014-04-30 15:01:57 UTC (rev 7809)
@@ -28,10 +28,11 @@
   LASTFILE=FILENAME
 }
 
-END { printf("max Ke for %s is %f\n", LASTFILE, maxKe ) }
+#END { printf("max Ke for %s is %f\n", LASTFILE, maxKe ) }
+ END { printf("%s %f\n", LASTFILE, maxKe ) }
 
 
 
-' $* | sort -n -k2 | tail -$nfiles
+' $* | sort -n -k2 | tail -$nfiles | awk '{print $1}'
 
 # log 1>&2

Deleted: demo/xsede.2014.0425/part06m/p4.swift
===================================================================
--- demo/xsede.2014.0425/part06m/p4.swift	2014-04-28 20:27:07 UTC (rev 7808)
+++ demo/xsede.2014.0425/part06m/p4.swift	2014-04-30 15:01:57 UTC (rev 7809)
@@ -1,43 +0,0 @@
-type file;
-
-(int result) randomInt ()
-{
-  float range = 9999999.0;
-  float rand = java("java.lang.Math","random");
-  string s[] = strsplit(toString(range*rand),"\\.");
-  result = toInt(s[0]);
-}
-
-app (file out, file traj) simulation (string npart, string steps, string mass)
-{
-# mdviz  @out @traj 3 npart steps 50 ".0001" mass "0.1 1.0 0.2 0.05 50.0 0.1" 2.5 2.0 randomInt();
-  md     3 npart steps 10 ".0001" mass "0.1 1.0 0.2 0.05 50.0 0.1" 2.5 2.0 randomInt() @out @traj;
-}
-
-app (file o) analyze (file s[])
-{
-  mdstats filenames(s) stdout=filename(o);
-}
-
-app (file o) convert (file s[])
-{
-  convert filenames(s) filename(o);
-}
-
-int    nsim   = toInt(arg("nsim","10"));
-string npart  = arg("npart","50");
-string steps  = arg("steps","1000");
-string mass   = arg("mass",".005");
-
-file sim[] <simple_mapper; prefix="output/sim_", suffix=".out">;
-file trj[] <simple_mapper; prefix="output/sim_", suffix=".trj.tgz">;
-
-foreach i in [0:nsim-1] {
-  (sim[i],trj[i]) = simulation(npart,steps,mass);
-}
-
-file stats_out<"output/average.out">;
-stats_out = analyze(sim);
-
-#file viz_all<"output/all.gif">;
-#viz_all = convert(gifs);

Copied: demo/xsede.2014.0425/part06m/p6m.swift (from rev 7807, demo/xsede.2014.0425/part06m/p4.swift)
===================================================================
--- demo/xsede.2014.0425/part06m/p6m.swift	                        (rev 0)
+++ demo/xsede.2014.0425/part06m/p6m.swift	2014-04-30 15:01:57 UTC (rev 7809)
@@ -0,0 +1,54 @@
+type file;
+
+(int result) randomInt ()
+{
+  float range = 9999999.0;
+  float rand = java("java.lang.Math","random");
+  string s[] = strsplit(toString(range*rand),"\\.");
+  result = toInt(s[0]);
+}
+
+app (file out, file traj) simulation (string npart, string steps, string mass, int randval)
+{
+# mdviz  @out @traj 3 npart steps 50 ".0001" mass "0.1 1.0 0.2 0.05 50.0 0.1" 2.5 2.0 randomInt();
+  md     3 npart steps 10 ".0001" mass "0.1 1.0 0.2 0.05 50.0 0.1" 2.5 2.0 randval @out @traj;
+}
+
+app (file out) genconfig ()
+{
+  simulate "-n" 1 "-r" 1000000 stdout=filename(out);
+}
+
+app (file o) analyze (file s[])
+{
+  mdstats filenames(s) stdout=filename(o);
+}
+
+app (file o) maxkinetic (file s[])
+{
+  mdmaxk "3" filenames(s) stdout=filename(o);
+}
+
+app (file o) convert (file s[])
+{
+  convert filenames(s) filename(o);
+}
+
+int    nsim  = toInt(arg("nsim","10"));
+string npart = arg("npart","50");
+string steps = arg("steps","1000");
+string mass  = arg("mass",".005");
+
+file sim[] <simple_mapper; prefix="output/sim_", suffix=".out">;
+file trj[] <simple_mapper; prefix="output/sim_", suffix=".trj.tgz">;
+
+foreach i in [0:nsim-1] {
+  int startstate = readData(genconfig());
+  (sim[i],trj[i]) = simulation(npart,steps,mass,startstate);
+}
+
+file stats_out<"output/average.out">;
+stats_out = analyze(sim);
+
+#file viz_all<"output/all.gif">;
+#viz_all = convert(gifs);




More information about the Swift-commit mailing list