Skip to content

Commit 069aa95

Browse files
authored
πŸ“ Document "✨ Add --runtime_usage flag (FCP-INDI/C-PAC#1701) (#276)
2 parents 25dd533 + 3618e54 commit 069aa95

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

β€Ž.circleci/config.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ commands:
1515
command: |
1616
sudo apt-get update && sudo apt-get -y install git python3-dev graphviz graphviz-dev libgraphviz-dev pkg-config python3-sphinx
1717
pip install --user -r requirements.txt
18-
pip install --user -r https://raw.githubusercontent.com/FCP-INDI/C-PAC/<< parameters.version >>/requirements.txt
18+
pip install --user -r https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/C-PAC/<< parameters.version >>/requirements.txt
1919
pip install --user git+https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git@<< parameters.version >>
2020
git clone https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git /home/circleci/build/C-PAC
2121
cd /home/circleci/build/C-PAC

β€Ždocs/_sources/_static/custom.cssβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ div.bodywrapper section {
2121
background-color: white;
2222
padding: 0 20px 30px 20px;
2323
}
24+
div.bodywrapper section > p {
25+
padding-bottom: 1ex;
26+
}
2427
div.bodywrapper section h2 {
2528
margin-block-start: 0;
2629
padding-block-start: 0.83em;

β€Ždocs/_sources/developer/nodes.rstβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ C-PAC automatically creates a JSON-like file called ``callback.log`` (via the fu
1818
* specified maximum number of threads per Node, and
1919
* threads used at runtime.
2020

21+
A ``callback.log`` can be provided to the pipeline configuration file (see :doc:`/user/compute_config`) or with the commandline flag ``--runtime_usage``. If a callback log is provided in the pipeline configuration, nodes with names that match nodes recorded in that pipeline log will have their memory estimates overridden by the values in the callback log plus a buffer percent (provided with the ``--runtime_buffer`` flag or in the pipeline configuration file).
22+
2123
When a developer creates or modifies a Node in C-PAC, a ``mem_gb`` and ``n_procs`` argument should be provided unless the respective defaults of 0.2 and None (number of available system cores) are expected to be sufficient. When testing, the ``mem_gb`` and ``n_procs`` arguments should be adjusted if the observed memory and/or thread usage of a Node exceeds the estimate.
2224

2325
For nodes that will use a varying amount of memory depending on the node's input data, the optional parameter ``mem_x`` takes a tuple of ``(memory multiplier, input file, multiplier mode)`` where ``memory multiplier`` is a number and ``input file`` is the string name of the Node input to multiply such that the memory estimate returned by the ``mem_gb`` attribute is the ``mem_gb`` argument plus ``memory multiplier`` times the dimensions of the ``input file`` as specified in the ``multiplier mode`` (``xyzt`` (spatial Γ— temporal; default), ``xyz`` (spatial), or just ``t`` (temporal)).

β€Ždocs/_sources/user/anat.rstβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ Configuring CPAC to Run Anatomical Tissue Segmentation
355355

356356
#. **Erosion - [On, Off]:** Whether or not to use erosion to erode binarized tissue masks.
357357

358-
#. **Erosion Proportion - [float]:** Set the erosion proportion, if use erosion to erode binarized tissue masks. The default is 0.6.
358+
#. **Erosion Proportion - [float]:** Set the target volume ratio, if using erosion to erode binarized tissue masks. The default is 0.6.
359359

360360
.. figure:: /_images/seg_gui_2.png
361361

β€Ždocs/_sources/user/compute_config.rstβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Computer Settings
88

99
#. **Maximum Cores Per Participant - [integer]:** Number of cores (on a single machine) or slots on a node (cluster/grid) per subject. Slots are cores on a cluster/grid node. 'Number of Cores Per Participant' multiplied by 'Number of Participants to Run Simultaneously' must not be greater than the total number of cores. Dedicating more than one core/CPU per participant will direct C-PAC to parallelize the motion correction and time series registration transform application steps, for a speed increase.
1010

11+
#. **Raise Insufficient - [True, False]:** If True (default), C-PAC will raise an error before trying to run a pipeline if it estimates the given data and pipeline configuration will exceed the memory or core limits. If False, C-PAC will raise a warning and continue to run the pipeline even if it estimates the given data and pipeline configuration will exceed the memory or core limits.
12+
13+
#. **Observed Usage:** The resource usage of each node depends on many factors, including the data, the pipeline configuration, and the system. To run many subjects with optimimzed resource estimation, first run a single subject with the desired number of cores and with a generous memory limit. Then, provide the ``callback.log`` generated from that initial run when you run the rest of the subjects.
14+
#. **Callback log - [text]:** The path to a callback log file from a previous run, including any resource-management parameters that will be applied in this run, like ``n_cpus`` and ``num_ants_threads``. This file is used override memory estimates with previously observed memory usage. Can be overridden with the commandline flag ``--runtime_usage``.
15+
#. **Buffer - [percent]:** A percent of the previously observed memory usage that is to be added to the memory estimate. Default: 10. Can be overridden with the commandline flag ``--runtime_buffer``.
16+
1117
#. **Number of Participants to Run Simultaneously - [integer]:** This number depends on computing resources.
1218

1319
#. **Number of Cores for Anatomical Registration (ANTS) - [integer]:** This number depends on computing resources.

0 commit comments

Comments
Β (0)