Skip to content

Commit

Permalink
Merge pull request #161 from dessn/tmp
Browse files Browse the repository at this point in the history
add REFACTORED and LEGACY options to scone for debugging refactor
  • Loading branch information
helenqu authored Mar 8, 2024
2 parents 6124222 + 8ec7458 commit 299a0cd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pippin/classifiers/scone.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,19 @@ def classify(self, mode):

slurm_script = self.make_model_sbatch_script()

self.logger.info(f"Submitting batch job {self.model_sbatch_job_path}")

# TODO: nersc needs `module load esslurm` to sbatch gpu jobs, maybe make
# this shell command to a file so diff systems can define their own
subprocess.run([f"python {Path(self.path_to_classifier) / 'run.py'} --config_path {self.config_path}"], shell=True)
file_to_run = 'run.py'
if self.options.get("REFACTORED", False):
file_to_run = 'run_refactor.py'
elif self.options.get("LEGACY", False):
file_to_run = 'run_legacy.py'
path = Path(self.path_to_classifier) / file_to_run
path = path if path.exists() else Path(self.path_to_classifier) / 'run.py'
cmd = f"python {str(path)} --config_path {self.config_path}"
subprocess.run([cmd], shell=True)
self.logger.info(f"Running command: {cmd}")

return True

def predict(self):
Expand Down

0 comments on commit 299a0cd

Please sign in to comment.