-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding an example that can launch with SLURM (#19)
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
(ns brevis.distributed-computing.slurm-test | ||
(:use [clojure.test]) | ||
(:require [brevis.distributed-computing.slurm :as slurm] | ||
[brevis.distributed-computing.dc-utils :as dc-utils])) | ||
|
||
(defn -main [& args] | ||
(let [;; First put everything into a map | ||
argmap (apply hash-map | ||
(mapcat #(vector (read-string (first %)) (second %) #_(read-string (second %))) | ||
(partition 2 args))) | ||
;; Then read-string on *some* args, but ignore others | ||
argmap (apply hash-map | ||
(apply concat | ||
(for [[k v] argmap] | ||
[k (cond (= k :output-file) v | ||
:else (read-string v))])))] | ||
(println argmap) | ||
(spit (:output-file argmap) | ||
(with-out-str | ||
(println "Slurm test") | ||
(println argmap))))) | ||
|
||
(defn cluster-launch-slurm | ||
[] | ||
(let [experiment-name "slurm_test_001" | ||
argmaps [{:tag "testrun" | ||
:output-file "testfile.txt"}]] | ||
(dotimes [k (count argmaps)] | ||
(let [argmap (nth argmaps k) | ||
experiment-name (str experiment-name "_" k)] | ||
(slurm/start-runs | ||
[argmap] | ||
"brevis.distributed-computing.slurm-test" | ||
experiment-name | ||
"kharrington" | ||
"fortyfour.ibest.uidaho.edu" | ||
1 | ||
"/Users/kharrington/git/brevis/" | ||
"brevis_dir/" | ||
"00:05:00"))))) |