|
14 | 14 |
|
15 | 15 | # You should have received a copy of the GNU Lesser General Public |
16 | 16 | # License along with C-PAC. If not, see <https://www.gnu.org/licenses/>. |
| 17 | +"""Run C-PAC.""" |
| 18 | + |
17 | 19 | from multiprocessing import Process |
18 | 20 | import os |
19 | 21 | from time import strftime |
|
23 | 25 | import yaml |
24 | 26 |
|
25 | 27 | from CPAC.longitudinal_pipeline.longitudinal_workflow import anat_longitudinal_wf |
| 28 | +from CPAC.pipeline.utils import get_shell |
26 | 29 | from CPAC.utils.configuration import check_pname, Configuration, set_subject |
27 | 30 | from CPAC.utils.configuration.yaml_template import upgrade_pipeline_to_1_8 |
28 | 31 | from CPAC.utils.ga import track_run |
@@ -100,10 +103,7 @@ def run_condor_jobs(c, config_file, subject_list_file, p_name): |
100 | 103 |
|
101 | 104 | # Create and run script for CPAC to run on cluster |
102 | 105 | def run_cpac_on_cluster(config_file, subject_list_file, cluster_files_dir): |
103 | | - """ |
104 | | - Function to build a SLURM batch job submission script and |
105 | | - submit it to the scheduler via 'sbatch'. |
106 | | - """ |
| 106 | + """Build a batch job submission script and submit to the scheduler.""" |
107 | 107 | # Import packages |
108 | 108 | import getpass |
109 | 109 | import re |
@@ -137,7 +137,6 @@ def run_cpac_on_cluster(config_file, subject_list_file, cluster_files_dir): |
137 | 137 | time_limit = "%d:00:00" % hrs_limit |
138 | 138 |
|
139 | 139 | # Batch file variables |
140 | | - shell = subprocess.getoutput("echo $SHELL") |
141 | 140 | user_account = getpass.getuser() |
142 | 141 | num_subs = len(sublist) |
143 | 142 |
|
@@ -174,7 +173,7 @@ def run_cpac_on_cluster(config_file, subject_list_file, cluster_files_dir): |
174 | 173 | # Set up config dictionary |
175 | 174 | config_dict = { |
176 | 175 | "timestamp": timestamp, |
177 | | - "shell": shell, |
| 176 | + "shell": get_shell(), |
178 | 177 | "job_name": "CPAC_" + pipeline_config.pipeline_setup["pipeline_name"], |
179 | 178 | "num_tasks": num_subs, |
180 | 179 | "queue": pipeline_config.pipeline_setup["system_config"]["on_grid"]["SGE"][ |
|
0 commit comments