Enable parallel tests.
[hoomd-blue.git] / doc / user / command_line_options.dox
blob6639735a31b3aa8da1294d05f1b074d2deaaa3b4
1 /*
2 Highly Optimized Object-oriented Many-particle Dynamics -- Blue Edition
3 (HOOMD-blue) Open Source Software License Copyright 2009-2014 The Regents of
4 the University of Michigan All rights reserved.
6 HOOMD-blue may contain modifications ("Contributions") provided, and to which
7 copyright is held, by various Contributors who have granted The Regents of the
8 University of Michigan the right to modify and/or distribute such Contributions.
10 You may redistribute, use, and create derivate works of HOOMD-blue, in source
11 and binary forms, provided you abide by the following conditions:
13 * Redistributions of source code must retain the above copyright notice, this
14 list of conditions, and the following disclaimer both in the code and
15 prominently in any materials provided with the distribution.
17 * Redistributions in binary form must reproduce the above copyright notice, this
18 list of conditions, and the following disclaimer in the documentation and/or
19 other materials provided with the distribution.
21 * All publications and presentations based on HOOMD-blue, including any reports
22 or published results obtained, in whole or in part, with HOOMD-blue, will
23 acknowledge its use according to the terms posted at the time of submission on:
24 http://codeblue.umich.edu/hoomd-blue/citations.html
26 * Any electronic documents citing HOOMD-Blue will link to the HOOMD-Blue website:
27 http://codeblue.umich.edu/hoomd-blue/
29 * Apart from the above required attributions, neither the name of the copyright
30 holder nor the names of HOOMD-blue's contributors may be used to endorse or
31 promote products derived from this software without specific prior written
32 permission.
34 Disclaimer
36 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' AND
37 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR ANY
39 WARRANTIES THAT THIS SOFTWARE IS FREE OF INFRINGEMENT ARE DISCLAIMED.
41 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
42 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
43 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
45 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
46 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
47 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 /*! \page page_command_line_options Command line options
52 ## Overview
54 Usage: **hoomd** script.py [options]
56 ### Options
58 - **no options given**
60     hoomd will automatically detect the fastest GPU and run on it, or fall back on the CPU if no GPU is found.
62 - <b>-h, --help</b>
64     print a description of all the command line options
66 - <b>--mode</b>={\a cpu | \a gpu}
68     force hoomd to run either on the \a cpu or \a gpu
70 - <b>--gpu</b>=#
72     specify the GPU id that hoomd will use. Implies --mode=gpu.
74 - <b>--ignore-display-gpu</b>
76     prevent hoomd from using any GPU that is attached to a display
78 - <b>--minimize-cpu-usage</b>
80     minimize the CPU usage of hoomd when it runs on a GPU at reduced performance
82 - <b>--gpu_error_checking</b>
84     enable error checks after every GPU kernel call
86 - <b>--notice-level</b>=#
88     specifies the level of notice messages to print
90 - <b>--msg-file=filename</b>
92     specifies a file to write messages (the file is overwritten)
94 - <b>--user</b>
96     user options
98 - *MPI only options*
99     - <b>--nx</b>
101         Number of domains along the x-direction
103     - <b>--ny</b>
105         Number of domains along the y-direction
107     - <b>--nz</b>
109         Number of domains along the z-direction
111     - <b>--linear</b>
113         Force a slab (1D) decomposition along the z-direction
115     - <b>--nrank</b>
117         Number of ranks per partition
119     - <b>--shared-msg-file</b>=prefix
121         specifies the prefix of files to write per-partition output to (filename: *prefix.\<partition_id\>*)
123 ## Detailed description
125 ### Control hoomd execution
127 HOOMD-blue can run on the CPU or the GPU.  To control which,
128 set the `--mode` option on the script command line. Valid settings are `cpu`
129 and `gpu`.
131 hoomd script.py --mode=cpu
133 When `--mode` is set to `gpu` and no other options are specified, hoomd will
134 choose a GPU automatically. It will prioritize the GPU choice based on speed and
135 whether it is attached to a display. Unless you take steps to configure your system
136 (see below), then running a second instance of HOOMD-blue will place it on the same GPU
137 as the first. HOOMD-blue will run correctly with more than one simulation on a GPU as
138 long as there is enough memory, but at reduced performance.
140 You can select the GPU on which to run using the `--gpu` command line option.
142 hoomd script.py --gpu=1
144 Note that specifying `--gpu` implies `--mode=gpu`. To find out which id
145 is assigned to each GPU in your system, download the CUDA SDK for your system
146 from http://www.nvidia.com/object/cuda_get.html and run the `deviceQuery` sample.
148 If you run a script without any options
150 hoomd script.py
152 hoomd first checks if there are any GPUs in the system. If it finds one or more,
153 it makes the same automatic choice described previously. If none are found, it runs on the CPU.
155 ### Multi-GPU (and multi-CPU) execution
157 HOOMD-blue uses MPI domain decomposition for parallel execution. Execute hoomd with `mpirun`, `mpiexec`, or whatever the
158 appropriate launcher is on your system. For more information, see \ref page_mpi.
160 mpirun -n 8 hoomd script.py
163 All command line options apply to MPI execution in the same way as single process runs.
165 ### Automatic free GPU selection
167 You can configure your system for HOOMD-blue to choose free GPUs automatically when each instance is run. To utilize this
168 capability, the system administrator (root) must first use the `nvidia-smi` utility to enable
169 the compute-exclusive mode on all GPUs in the system. With this mode enabled, running hoomd with no options or with the
170 `--mode=gpu` option will result in an automatic choice of the first free GPU from the prioritized list.
172 The compute-exclusive mode allows *only* a **single CUDA application** to run on each GPU. If you have
173 4 compute-exclusive GPUs available in the system, executing a fifth instance of hoomd with `hoomd script.py`
174 will result in the error: `***Error! no CUDA-capable device is available`.
176 ### Minimize the CPU usage of HOOMD-blue
178 When hoomd is running on a GPU, it uses 100% of one CPU core by default. This CPU usage can be
179 decreased significantly by specifying the `--minimize-cpu-usage` command line option:
181 hoomd script.py --minimize-cpu-usage
183 Enabling this option incurs a 10% overall performance reduction, but the CPU usage of hoomd is reduced to only
184 10% of a single CPU core.
186 ### Prevent HOOMD-blue from running on the display GPU
188 Running hoomd on the display GPU works just fine, but it does moderately slow the simulation and causes the display
189 to lag. If you wish to prevent hoomd from running on the display, add the `--ignore-display-gpu` command line flag:
191 hoomd script.py --ignore-display-gpu
194 ### Enable error checking onthe GPU
196 Detailed error checking is off by default to enable the best performance. If you have trouble
197 that appears to be caused by the failure of a calculation to run on the GPU, you
198 should run with GPU error checking enabled to check for any errors returned by the GPU.
200 To do this, run the script with the ``--gpu_error_checking`` command line option:
201 ~~~~
202 hoomd script.py --gpu_error_checking
203 ~~~~
205 ### Control message output
207 You can adjust the level of messages written to `stdout` by a running hoomd script.
208 Set the notice level to a high value to help debug where problems occur. Or set it to a low number to suppress messages.
209 Set it to 0 to remove all notices (warnings and errors are still output).
211 hoomd script.py --notice-level=10
214 All messages (notices, warnings, and errors) can be redirected to a file. The file is overwritten.
216 hoomd script.py --msg-file=messages.out
219 In MPI simulations, messages can be aggregated per partition. To write output for
220 partition 0,1,.. in files `messages.0`, `messages.1`, etc., use
222 mpirun hoomd script.py --shared-msg-file=messages
225 ### Set the MPI domain decomposition
227 When no MPI options are specified, HOOMD uses a minimum surface area selection of the domain decomposition strategy.
229 mpirun -n 8 hoomd script.py
230 # 2x2x2 domain
233 The linear option forces HOOMD-blue to use a 1D slab domain decomposition, which may be faster than a 3D decomposition when running jobs on a single node.
235 mpirun -n 4 hoomd script.py --linear
236 # 1x1x4 domain
239 You can also override the automatic choices completely.
241 mpirun -n 4 hoomd script.py --nx=1 --ny=2 --nz=2
242 # 1x2x2 domain
245 You can group multiple MPI ranks into partitions, to simulate independent replicas.
247 mpirun -n 12 hoomd script.py --nrank=3
249 This sub-divides the total of 12 MPI ranks into four independent partitions, with
250 to which 3 GPUs each are assigned.
252 ### User options
254 User defined options may be passed to a job script via `--user` and retrieved by calling `option.get_user()`. For example,
255 if hoomd is executed with
256 ~~~~
257 hoomd script.py --gpu=2 --ignore-display-gpu --user="--N=5 --rho=0.5"
258 ~~~~
259 then option.get_user() will return ['--N=5', '--rho=0.5'], which is a format suitable for processing by standard
260 tools such as optparse.