(improve this text by edits in appropriate places; blog remarks into Hiccups section at the bottom)
This page is probably woefully incomplete, but it worked for me without causing a catastrophic meltdown, yet. I hope group members more knowledgeable will edit this page where needed so this is safer to do. -- Dustin 2009-02-26
See comments in hiccups. John Gibson 2009-03-09
This might also be helpful when students start using the PACE cluster, as I'm pretty sure you send the cluster script files.
# First script echo "That's easy"
The first line is very important, don't leave it out. The second line is just a comment on what your script does, documentation good. The line without the '#' is what the computer actually executes.
[dustin@localhost test_script]$ chmod 755 my_script
[dustin@localhost test_script]$ ./my_script
It is important when you create a shell script to enter the commands into the script file exactly as you want them executed, with no typos or logic errors, or else the script file will bail on you and your preparation will be for not.
We are going to create a script file to compute the 1-D unstable manifold of the Nagata Upper Branch Solution, similar to the tutorial example, just a different solution. You might want to save this for the end of the day, so all of your data will be available fresh in the morning the next day.
#!/bin/bash #Some documentation here about what your script file does - documentation is extremely important. wget http://channelflow.org/database/a1.14_g2.5_Re400/UB.ff fieldplots -o plot UB arnoldi --flow UB.ff addfields 1 UB 0.01 ef1 UBp01ef1 addfields 1 UB -0.01 ef1 UBm01ef1 couette -T0 0 -T1 400 -o data-UBp01ef1 UBp01ef1 couette -T0 0 -T1 400 -o data-UBm01ef1 UBm01ef1 seriesprops -T0 0 -T1 400 data-UBp01ef1 -o props-UBp01ef1 seriesprops -T0 0 -T1 400 data-UBm01ef1 -o props-UBm01ef1 movieframes -T0 0 -T1 400 data-UBp01ef1 -o frames-UBp01ef1 movieframes -T0 0 -T1 400 data-UBm01ef1 -0 frames-UBm01ef1
[dustin@localhost UB-eqb2]$ chmod 755 UB_manif_script
[dustin@localhost UB-eqb2]$ ./UB_manif_script
(blog here: prepend the latest post at the top)
My verdict: thumbs up and no obvious possibilities for melted computers. I've found shell scripts such as these to be very useful for running a series of predefined calculations such as computing statistics and making movies of orbits, and doing poor man's continuation of existing solutions. For these shell scripts are adequate. For the PACE cluster, jobs are submitted to a job queue with “qsub” and monitored with “qstat”. It's somewhat like shell scripting but not entirely. I have written a few shell functions that simplify the job submission procedure and need to post and document them. I am also feeling the need (quite strongly, in fact) to enable more sophisticated scripting with channelflow utilities and functions. For example, shell scripts are not flexible and mathematical enough for doing adaptive continuation, where you adjust the size of the parameter steps based on the second derivative of the continuation curve, or for switching the continuation parameter in order to turn the corner around a bifurcation point. For this, we either need to write a new channelflow utility that combines the quadratic continuation and solution-finding algorithms, or we need to use a more sophisticated scripting language like Python. There are merits to either approach. I would dearly love to work on either but it would take a few days focused effort. This would be a very good project for anyone interested in continuation. John F. Gibson 2009-03-09
Because many of us sleep some hours of the day and can't keep watchful guard over our computers at all times during the day even though our computers would like to be doing calculations even though we aren't here, I thought it would be useful if I posted a HowTo of writing shell scripts. I know these will be particularly helpful for me because I am still a first year grad student and I have lots of homework and can't man a terminal at all hours of the day. — Dustin Spieker 2009-02-26