You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/running.md
+32-41Lines changed: 32 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,31 @@
2
2
3
3
MFC can be run using `mfc.sh`'s `run` command.
4
4
It supports both interactive and batch execution, the latter being designed for multi-socket systems, namely supercomputers, equipped with a scheduler such as PBS, SLURM, and LSF.
5
-
A full (and updated) list of available arguments can be acquired with `./mfc.sh run -h`.
5
+
A full (and updated) list of available arguments can be acquired with `./mfc.sh run -h`.
6
+
7
+
MFC supports running simulations locally (Linux, MacOS, and Windows) as well as
8
+
several supercomputer clusters, both interactively and through batch submission.
9
+
10
+
> [!IMPORTANT]
11
+
> Running simulations locally should work out of the box. On supported clusters,
12
+
> you can append `-c <computer name>` on the command line to instruct the MFC toolchain
13
+
> to make use of the template file `toolchain/templates/<computer name>.mako`. You can
14
+
> browse that directory and contribute your own files. Since systems and their schedulers
15
+
> do not have a standardized syntax to request certain resources, MFC can only provide
16
+
> support for a restricted subset of common or user-contributed configuration options.
17
+
>
18
+
> Adding a new template file or modifying an existing one will most likely be required if:
19
+
> - You are on a cluster that does not have a template yet.
20
+
> - Your cluster is configured with SLURM and but fails when interactive jobs are
21
+
> launched with `mpirun`.
22
+
> - Something in the existing default or computer template file is incompatible with
23
+
> your system or does not provide a feature you need.
24
+
>
25
+
> If `-c <computer name>` is left unspecified, it defaults to `-c default`.
26
+
27
+
Additional flags can be appended to the MPI executable call using the `-f` (i.e `--flags`) option.
28
+
29
+
Please refer to `./mfc.sh run -h` for a complete list of arguments and options, along with their defaults.
6
30
7
31
## Interactive Execution
8
32
@@ -32,24 +56,16 @@ using 4 cores:
32
56
$ ./mfc.sh run examples/2D_shockbubble/case.py -t simulation post_process -n 4
33
57
```
34
58
35
-
On some computer clusters, MFC might select the wrong MPI program to execute your application
36
-
because it uses a general heuristic for its selection. Notably, `srun` is known to fail on some SLURM
37
-
systems when using GPUs or MPI implementations from different vendors, whereas `mpirun` functions properly. To override and manually specify which
38
-
MPI program you wish to run your application with, please use the `-b <program name>` option (i.e `--binary`).
39
-
40
-
Additional flags can be appended to the MPI executable call using the `-f` (i.e `--flags`) option.
41
-
42
-
Please refer to `./mfc.sh run -h` for a complete list of arguments and options, along with their defaults.
43
-
44
59
## Batch Execution
45
60
46
61
The MFC detects which scheduler your system is using and handles the creation and execution of batch scripts.
47
-
The batch engine is requested with the `-e batch` option.
48
-
Whereas the interactive engine can execute all of MFC's codes in succession, the batch engine requires you to only specify one target with the `-t` option.
49
-
The number of nodes and GPUs can, respectively be specified with the `-N` (i.e `--nodes`) and `-g` (i.e `--gpus-per-node`) options.
62
+
The batch engine is requested via the `-e batch` option.
63
+
The number of nodes can be specified with the `-N` (i.e `--nodes`) option.
64
+
65
+
We provide a list of (baked-in) submission batch scripts in the `toolchain/templates` folder.
@@ -60,26 +76,8 @@ Other useful arguments include:
60
76
-`-a <account name>` to identify the account to be charged for the job. (i.e `--account`)
61
77
-`-p <partition name>` to select the job's partition. (i.e `--partition`)
62
78
63
-
Since some schedulers don't have a standardized syntax to request certain resources, MFC can only provide support for a restricted subset of common configuration options.
64
-
If MFC fails to execute on your system, or if you wish to adjust how the program runs and resources are requested to be allocated, you are invited to modify the template batch script for your queue system.
65
-
Upon execution of `./mfc.sh run`, MFC fills in the template with runtime parameters, to generate the batch file it will submit.
66
-
These files are located in the [templates](https://github.com/MFlowCode/MFC/tree/master/toolchain/templates/) directory.
67
-
To request GPUs, modification of the template will be required on most systems.
68
-
69
-
- Lines that begin with `#>` are ignored and won't figure in the final batch script, not even as a comment.
70
-
71
-
- Statements of the form `${expression}` are string-replaced to provide runtime parameters, most notably execution options.
72
-
You can perform therein any Python operation recognized by the built-in `expr()` function.
73
-
74
79
As an example, one might request GPUs on a SLURM system using the following:
75
80
76
-
```
77
-
#SBATCH --gpus=v100-32:{gpus_per_node*nodes}
78
-
```
79
-
80
-
- Statements of the form `{MFC::expression}` tell MFC where to place the common code, across all batch files, that is required for proper execution.
81
-
They are not intended to be modified by users.
82
-
83
81
**Disclaimer**: IBM's JSRUN on LSF-managed computers does not use the traditional node-based approach to
84
82
allocate resources. Therefore, the MFC constructs equivalent resource-sets in task and GPU count.
85
83
@@ -173,13 +171,6 @@ $ ./mfc.sh run examples/1D_vacuum_restart/restart_case.py -t post_process
173
171
- Oak Ridge National Laboratory's [Summit](https://www.olcf.ornl.gov/summit/):
174
172
175
173
```console
176
-
$ ./mfc.sh run examples/2D_shockbubble/case.py -e batch \
177
-
-N 2 -n 4 -g 4 -t simulation -a <redacted>
178
-
```
179
-
180
-
- University of California, San Diego's [Expanse](https://www.sdsc.edu/services/hpc/expanse/):
run.add_argument("-s", "--scratch", action="store_true", default=False, help="Build from scratch.")
119
-
run.add_argument("--ncu", nargs=argparse.REMAINDER, type=str, help="Profile with NVIDIA Nsight Compute.")
120
-
run.add_argument("--nsys", nargs=argparse.REMAINDER, type=str, help="Profile with NVIDIA Nsight Systems.")
121
-
run.add_argument( "--dry-run", action="store_true", default=False, help="(Batch) Run without submitting batch file.")
122
-
run.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
123
-
run.add_argument( "--no-build", action="store_true", default=False, help="(Testing) Do not rebuild MFC.")
124
-
run.add_argument("--wait", action="store_true", default=False, help="(Batch) Wait for the job to finish.")
125
-
run.add_argument("-f", "--flags", metavar="FLAGS", dest="--", nargs=argparse.REMAINDER, type=str, default=[], help="(Interactive) Arguments to forward to the MPI invocation.")
105
+
run.add_argument("-p", "--partition", metavar="PARTITION", type=str, default="", help="(Batch) Partition for job submission.")
106
+
run.add_argument("-q", "--quality_of_service", metavar="QOS", type=str, default="", help="(Batch) Quality of Service for job submission.")
107
+
run.add_argument("-N", "--nodes", metavar="NODES", type=int, default=1, help="(Batch) Number of nodes.")
108
+
run.add_argument("-n", "--tasks-per-node", metavar="TASKS", type=int, default=1, help="Number of tasks per node.")
run.add_argument("-s", "--scratch", action="store_true", default=False, help="Build from scratch.")
114
+
run.add_argument("--ncu", nargs=argparse.REMAINDER, type=str, help="Profile with NVIDIA Nsight Compute.")
115
+
run.add_argument("--nsys", nargs=argparse.REMAINDER, type=str, help="Profile with NVIDIA Nsight Systems.")
116
+
run.add_argument( "--dry-run", action="store_true", default=False, help="(Batch) Run without submitting batch file.")
117
+
run.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
118
+
run.add_argument( "--no-build", action="store_true", default=False, help="(Testing) Do not rebuild MFC.")
119
+
run.add_argument("--wait", action="store_true", default=False, help="(Batch) Wait for the job to finish.")
120
+
run.add_argument("-f", "--flags", metavar="FLAGS", dest="--", nargs=argparse.REMAINDER, type=str, default=[], help="(Interactive) Arguments to forward to the MPI invocation.")
121
+
run.add_argument("-c", "--computer", metavar="COMPUTER", type=str, default="default", help=f"(Batch) Path to a custom submission file template or one of {format_list_to_string(list(get_baked_templates().keys()))}.")
0 commit comments