Every user runs his own instance of MOOSE, because unlike most of the other codes, setting a simulation requires changing and compiling the MOOSE source code. Consequently preparing MOOSE to run takes the following steps:
- copying the source code (a tarball) to your project folder (in the future it will be replaced by checking out from the SVN code repository)
- untaring and compiling of the MOOSE libraries
- writing your own MOOSE (or ELK) application in C++
- preparing input files (see also cubit mesh generation tool)
- compiling your application
- running it
- analyzing the results
This instruction describes steps 1, 2, 5, and 6. The other steps has been explained during the MOOSE workshop at CAVS (Apr 10-12, 2012), and captured in the MOOSE manual distributed during the workshop (hard copies only).
Steps 1 and 2 needs to be done once (unless the new release of MOOSE is available).
Currently, only US citizens and permanent residents are allowed to use MOOSE (we are working on relaxing this restriction), and you have to apply for the permission to access it (just send email to firstname.lastname@example.org).
Getting the source code
- the source is available from /usr/local/moose/trunk.tar.bz2 (talon, bazooka, jevelin, apex, most Linux workstations at CAVS, including CavsClass-1-Linux, ..., CavsClass-5-Linux).
- If you do not have access to /usr/local/moose folder, it means that you are not authorized to use MOOSE. If you think you should have the access, please email email@example.com
- copy this file to your project folder. Example:
- cd /cavs/cmd/data1/common/haupt
- mkdir myMoose
- cd myMoose
- cp /usr/local/moose/trunk.tar.bz2 .
- go to your project folder, where you copied the tar file to, and unpack it, e.g., by typing the following two commands:
- bunzip2 trunk.tar.bz2
- tar -xvf trunk.tar
- as a result a new folder, called trunk, will be created.
- In the remaining of this document I will refer to this folder as TRUNK (in the above example it stands for /cavs/cmd/data1/common/haupt/myMoose/trunk).
- on talon type swsetup moose; on other machines (bazooka, jevelin, apex, your Linux workstation) use swsetup moose-amd instead.
- cd TRUNK/moose_test
- (it will compile the MOOSE and its tests; it will take a while)
- (it will run all MOOSE tests; it is important to run these test to verify that the MOOSE has been correctly build in your environment; if any test fail (an error message is written to the screen in red) then something went wrong. Please contact Tomasz Haupt if you cannot identify and fix the problem.
Running MOOSE examples
- cd TRUNK/moose_examples
- it will compile all examples in this folder
to compile an individual example
- cd example_folder (e.g., cd ex01_inputfile)
- it will compile the selected example
to make your own example
- choose one example as a "template" and copy it, e.g.:
- in TRUNK/moose_examples cp -r ex07_ics myExample
- cd myExample
- optionally edit the Makefile, eg., change APPLICATION_NAME from ex07 to myExample
- it will create an executable myExample-opt
to run the example
- in the example folder (e.g., $TRUNK/moose_example/ex02_kernel) type ./ex02-opt -i ex02.i
Please see the MOOSE workshop manual for further assistance.
Simple batch scripts for Talon
It is assumed that you have svsetup moose in your .bashrc file
Example 1: run all moose test in one job
#PBS -N Moose_allExamples #PBS -l nodes=1:ppn=12 #PBS -q q192p48h #PBS -l walltime=01:00:00 #PBS -V cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex01_inputfile ./ex01-opt -i ex01.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex02_kernel ./ex02-opt -i ex02.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex03_coupling ./ex03-opt -i ex03.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex04_bcs ./ex04-opt -i dirichlet_bc.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex05_amr ./ex05-opt -i ex05.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex06_transcient ./ex06-opt -i ex06.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex07_ics ./ex07-opt -i steady.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex08_materials ./ex08-opt -i ex08.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex09_stateful_materials ./ex09-opt -i ex09.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex10_aux ./ex10-opt -i ex10.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex11_prec ./ex11-opt -i default.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex12_pbp ./ex12-opt -i ex12.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex13_executioner ./ex13-opt -i ex13.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex14_actions ./ex14-opt -i ex14.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex15_functions ./ex15-opt -i ex15.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex16_pps ./ex16-opt -i ex16.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex17_dampers ./ex17-opt -i ex17.i cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex18_dirac ./ex18-opt -i ex18.i
Example 2: Use mpi to run Moose example 1 using all 12 cores of a single Talon node
#PBS -N Moose_ex01_mpi #PBS -l nodes=1:ppn=12 #PBS -q q192p48h #PBS -l walltime=01:00:00 #PBS -V cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex01_inputfile mpirun -n 12 ./ex01-opt -i ex01.i
Example 3: Use mpi to run Moose example 1 using 24 cores of two Talon nodes. (The example 1 is too small to demonstrate the scalability of Moose, this example is just to demonstrate the syntax for those less familiar with batch scripts.)
#PBS -N Moose_ex01_mpi_24 #PBS -l nodes=2:ppn=12 #PBS -q q192p48h #PBS -l walltime=01:00:00 #PBS -V cd /cavs/hse/ccg/cmd/moose-talon/trunk/moose_examples/ex01_inputfile mpirun -n 24 ./ex01-opt -i ex01.i
- Look at the pages 267-277 in the MOOSE workshop tutorial for more "generic" information
- Note that currently we distribute MOOSE as a tar file and nor check out from svn. This will change in the future.
- If the machine you are using to compile moose is a multicore system, you may speed up the building by using -j option when using make
- Currently, there are two compiled versions of libMesh available (after swsetup moose and swsetup moose-amd), thus you should skip building it by yourself. I am working on providing the debug version of it. If for some reason you insist on having your own build of libZMesh, please contact Tomasz Haupt (firstname.lastname@example.org)
- The Extended Library of Kernels (ELK) is described in pages 276-277 of the workshop manual.
- ELK is in TRUNK/elk
- You run it by executing ./elk-opt -i some_input_file
- the elk folder contains tests (you may need to build them using make)
NOTE: compiling MOOSE in debug mode is not possible at this time. We are working on that.
Feel free to improve this instructions as you gain experience with using MOOSE, or contact Tomasz Haupt (email@example.com)