[Swift-commit] r7805 - in demo/xsede.2014.0425: . part04m src/md
wilde at ci.uchicago.edu
wilde at ci.uchicago.edu
Sat Apr 26 16:11:05 CDT 2014
Author: wilde
Date: 2014-04-26 16:11:04 -0500 (Sat, 26 Apr 2014)
New Revision: 7805
Added:
demo/xsede.2014.0425/part04m/
demo/xsede.2014.0425/part04m/p4.swift
demo/xsede.2014.0425/part04m/swift.properties
Modified:
demo/xsede.2014.0425/src/md/md.c
Log:
Added random state var to md command line. Added part04m to generate N simulations with one viz output per sim.
Added: demo/xsede.2014.0425/part04m/p4.swift
===================================================================
--- demo/xsede.2014.0425/part04m/p4.swift (rev 0)
+++ demo/xsede.2014.0425/part04m/p4.swift 2014-04-26 21:11:04 UTC (rev 7805)
@@ -0,0 +1,43 @@
+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 o, file v) simulation (string npart, string steps, string mass)
+{
+# mdviz @o @v 3 npart steps 50 ".0001" mass "0.1 1.0 0.2 0.05 50.0 0.1" 2.5 2.0 randomInt();
+ mdviz @o @v 3 npart steps 10 ".0001" mass "0.1 1.0 0.2 0.05 50.0 0.1" 2.5 2.0 randomInt();
+}
+
+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 sims[] <simple_mapper; prefix="output/sim_", suffix=".out">;
+file gifs[] <simple_mapper; prefix="output/sim_", suffix=".gif">;
+
+foreach i in [0:nsim-1] {
+ (sims[i],gifs[i]) = simulation(npart,steps,mass);
+}
+
+file stats_out<"output/average.out">;
+stats_out = analyze(sims);
+
+file viz_all<"output/all.gif">;
+viz_all = convert(gifs);
Added: demo/xsede.2014.0425/part04m/swift.properties
===================================================================
--- demo/xsede.2014.0425/part04m/swift.properties (rev 0)
+++ demo/xsede.2014.0425/part04m/swift.properties 2014-04-26 21:11:04 UTC (rev 7805)
@@ -0,0 +1,2 @@
+site=midway-westmere
+site.midway-westmere.slurm.exclusive=false
Modified: demo/xsede.2014.0425/src/md/md.c
===================================================================
--- demo/xsede.2014.0425/src/md/md.c 2014-04-26 18:18:37 UTC (rev 7804)
+++ demo/xsede.2014.0425/src/md/md.c 2014-04-26 21:11:04 UTC (rev 7805)
@@ -166,6 +166,10 @@
{
scale_offset = atof ( argv[9] );
}
+ if ( 10 < argc )
+ {
+ seed = atof ( argv[10] );
+ }
/*
Report.
@@ -181,6 +185,7 @@
printf ( " PRINTINFO, the pass-through info to c-ray, is %s\n", printinfo );
printf ( " SCALE_FACTOR, the particle position scaling factor, is %f\n", scale_factor );
printf ( " SCALE_OFFSET, the particle position scaling offset, is %f\n", scale_offset );
+ printf ( " SEED, the simulation randomization seed, is %d\n", seed );
/*
Allocate memory.
*/
More information about the Swift-commit
mailing list