Skip to content

Commit c8ccd1e

Browse files
authored
Merge pull request #335 from veg/slurm-support-2.6
Slurm support 2.6
2 parents 128dcf7 + fdc9441 commit c8ccd1e

File tree

22 files changed

+737
-272
lines changed

22 files changed

+737
-272
lines changed

app/absrel/absrel.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ var absrel = function(socket, stream, params) {
5959
"--cpus-per-task=1", // One CPU per task for MPI
6060
`--time=${slurmTime}`, // Converted time limit
6161
`--partition=${config.slurm_partition || "datamonkey"}`, // Use configured partition
62-
"--nodes=1", // Run on a single node
6362
"--export=ALL,slurm_mpi_type=" +
6463
(config.slurm_mpi_type || "pmix") +
6564
"," +

app/bgm/bgm.js

Lines changed: 105 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ var config = require("../../config.json"),
44
model = require("../model").model,
55
util = require("util"),
66
fs = require("fs"),
7-
path = require("path");
7+
path = require("path"),
8+
utilities = require("../../lib/utilities"),
9+
logger = require("../../lib/logger").logger;
810

911
const datatypes = {
1012
"1": "nucleotide",
@@ -53,62 +55,116 @@ var bgm = function(socket, stream, params) {
5355
self.maximum_parents_per_node = parseInt(self.params.analysis.maximum_parents_per_node);
5456
self.minimum_subs_per_site = parseInt(self.params.analysis.minimum_subs_per_site);
5557

56-
self.qsub_params = [
57-
"-l walltime=" +
58-
config.bgm_walltime +
59-
",nodes=1:ppn=" +
60-
config.bgm_procs,
61-
"-q",
62-
config.qsub_queue,
63-
"-v",
64-
"fn=" +
65-
self.fn +
66-
",tree_fn=" +
67-
self.tree_fn +
68-
",sfn=" +
69-
self.status_fn +
70-
",pfn=" +
71-
self.progress_fn +
72-
",rfn=" +
73-
self.results_short_fn +
74-
",treemode=" +
75-
self.treemode +
76-
",genetic_code=" +
77-
self.genetic_code +
78-
",analysis_type=" +
79-
self.type +
80-
",cwd=" +
81-
__dirname +
82-
",msaid=" +
83-
self.msaid +
84-
",datatype=" +
85-
self.datatype +
86-
",substitution_model=" +
87-
self.substitution_model+
88-
",length_of_each_chain=" +
89-
self.length_of_each_chain +
90-
",number_of_burn_in_samples=" +
91-
self.number_of_burn_in_samples +
92-
",number_of_samples=" +
93-
self.number_of_samples +
94-
",maximum_parents_per_node=" +
95-
self.maximum_parents_per_node +
96-
",minimum_subs_per_site=" +
97-
self.minimum_subs_per_site ,
98-
"-o",
99-
self.output_dir,
100-
"-e",
101-
self.output_dir,
102-
self.qsub_script
103-
];
58+
// Define parameters for job submission (different formats for qsub vs slurm)
59+
if (config.submit_type === "slurm") {
60+
// Convert walltime from PBS format (DD:HH:MM:SS) to SLURM format (HH:MM:SS)
61+
let slurmTime = "72:00:00"; // Default 3 days
62+
if (config.bgm_walltime) {
63+
const parts = config.bgm_walltime.split(':');
64+
if (parts.length === 4) {
65+
const days = parseInt(parts[0]);
66+
const hours = parseInt(parts[1]) + (days * 24);
67+
slurmTime = hours + ":" + parts[2] + ":" + parts[3];
68+
} else if (parts.length === 3) {
69+
slurmTime = config.bgm_walltime;
70+
}
71+
}
72+
73+
logger.info("BGM job " + self.id + ": Converted walltime to SLURM format: " + slurmTime);
74+
75+
self.qsub_params = [
76+
"--ntasks=" + config.bgm_procs,
77+
"--cpus-per-task=1",
78+
"--time=" + slurmTime,
79+
"--partition=" + (config.slurm_partition || "datamonkey"),
80+
"--export=ALL,slurm_mpi_type=" +
81+
(config.slurm_mpi_type || "pmix") +
82+
"," +
83+
"fn=" + self.fn +
84+
",tree_fn=" + self.tree_fn +
85+
",sfn=" + self.status_fn +
86+
",pfn=" + self.progress_fn +
87+
",rfn=" + self.results_short_fn +
88+
",genetic_code=" + self.genetic_code +
89+
",analysis_type=" + self.type +
90+
",cwd=" + __dirname +
91+
",msaid=" + self.msaid +
92+
",datatype=" + self.datatype +
93+
",substitution_model=" + self.substitution_model +
94+
",length_of_each_chain=" + self.length_of_each_chain +
95+
",number_of_burn_in_samples=" + self.number_of_burn_in_samples +
96+
",number_of_samples=" + self.number_of_samples +
97+
",maximum_parents_per_node=" + self.maximum_parents_per_node +
98+
",minimum_subs_per_site=" + self.minimum_subs_per_site,
99+
"--output=" + self.output_dir + "/bgm_" + self.id + "_%j.out",
100+
"--error=" + self.output_dir + "/bgm_" + self.id + "_%j.err",
101+
self.qsub_script
102+
];
103+
} else {
104+
self.qsub_params = [
105+
"-l walltime=" +
106+
config.bgm_walltime +
107+
",nodes=1:ppn=" +
108+
config.bgm_procs,
109+
"-q",
110+
config.qsub_queue,
111+
"-v",
112+
"fn=" +
113+
self.fn +
114+
",tree_fn=" +
115+
self.tree_fn +
116+
",sfn=" +
117+
self.status_fn +
118+
",pfn=" +
119+
self.progress_fn +
120+
",rfn=" +
121+
self.results_short_fn +
122+
",treemode=" +
123+
self.treemode +
124+
",genetic_code=" +
125+
self.genetic_code +
126+
",analysis_type=" +
127+
self.type +
128+
",cwd=" +
129+
__dirname +
130+
",msaid=" +
131+
self.msaid +
132+
",datatype=" +
133+
self.datatype +
134+
",substitution_model=" +
135+
self.substitution_model+
136+
",length_of_each_chain=" +
137+
self.length_of_each_chain +
138+
",number_of_burn_in_samples=" +
139+
self.number_of_burn_in_samples +
140+
",number_of_samples=" +
141+
self.number_of_samples +
142+
",maximum_parents_per_node=" +
143+
self.maximum_parents_per_node +
144+
",minimum_subs_per_site=" +
145+
self.minimum_subs_per_site ,
146+
"-o",
147+
self.output_dir,
148+
"-e",
149+
self.output_dir,
150+
self.qsub_script
151+
];
152+
}
153+
154+
logger.info("BGM job " + self.id + ": Using " + config.submit_type + " parameters");
104155

105156
// Write tree to a file
106157
fs.writeFile(self.tree_fn, self.nj, function(err) {
107158
if (err) throw err;
108159
});
109160

161+
// Ensure output directory exists
162+
utilities.ensureDirectoryExists(self.output_dir);
163+
110164
// Ensure the progress file exists
111165
fs.openSync(self.progress_fn, "w");
166+
167+
logger.info("BGM job " + self.id + ": Initializing job");
112168
self.init();
113169
};
114170

app/bgm/bgm.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@
22
#PBS -l nodes=1:ppn=16
33

44
export PATH=/usr/local/bin:$PATH
5+
6+
# Try to load modules if they exist, but don't fail if they don't
7+
if [ -f /etc/profile.d/modules.sh ]; then
8+
source /etc/profile.d/modules.sh
9+
10+
# Load the specific OpenMPI module for ARM architecture
11+
module load openmpi-arm/5.0.5 2>/dev/null || echo "Failed to load openmpi-arm/5.0.5"
12+
13+
# Check if module was loaded successfully
14+
module list 2>&1
15+
16+
# Print library paths for debugging
17+
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
18+
else
19+
echo "Module system not available, using system environment"
20+
fi
521
source /etc/profile.d/modules.sh
622

7-
module load aocc/1.3.0
8-
module load openmpi/gnu/3.1.6
923

1024
FN=$fn
1125
CWD=$cwd

app/busted/busted.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ var busted = function(socket, stream, busted_params) {
8282
"--cpus-per-task=1", // One CPU per task for MPI
8383
`--time=${slurmTime}`, // Converted time limit
8484
`--partition=${config.slurm_partition || "datamonkey"}`, // Use configured partition
85-
"--nodes=1", // Run on a single node
8685
"--export=ALL,slurm_mpi_type=" +
8786
(config.slurm_mpi_type || "pmix") +
8887
"," +

app/busted/busted_submit.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
#!/bin/bash
22

33
export PATH=/usr/local/bin:$PATH
4-
module load aocc/1.3.0
5-
module load openmpi/gnu/3.1.6
4+
5+
# Try to load modules if they exist, but don't fail if they don't
6+
if [ -f /etc/profile.d/modules.sh ]; then
7+
source /etc/profile.d/modules.sh
8+
9+
# Load the specific OpenMPI module for ARM architecture
10+
module load openmpi-arm/5.0.5 2>/dev/null || echo "Failed to load openmpi-arm/5.0.5"
11+
12+
# Check if module was loaded successfully
13+
module list 2>&1
14+
15+
# Print library paths for debugging
16+
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
17+
else
18+
echo "Module system not available, using system environment"
19+
fi
620

721
FN=$fn
822
CWD=$cwd

0 commit comments

Comments
 (0)