Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure server #133

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,4 @@ htmlcov/*
#VSCode files
.vscode/*
.vscode/launch.json
.code-workspace
53 changes: 47 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,58 @@
{
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"name": "Python: RMG_Env",
"type": "python",
"request": "launch",
"program": "${file}",
"env": {"PYDEVD_WARN_EVALUATION_TIMEOUT": "500"},
"program": "~/Code/RMG-Py/rmg.py",
"console": "integratedTerminal",
"justMyCode": true
"justMyCode": false,
"args": ["${input:pickDir}/input.py"]
},
{
"name": "Python: ARC_Env",
"type": "python",
"request": "launch",
"program": "~/Code/ARC/ARC.py",
"console": "integratedTerminal",
"justMyCode": false,
"args": ["${input:pickDir}/input.yml"]
},
{
"name": "Python: Restart_ARC_Env",
"type": "python",
"request": "launch",
"program": "~/Code/ARC/ARC.py",
"console": "integratedTerminal",
"justMyCode": false,
"args": ["${input:pickDir}/restart.yml"]
},
{
"name": "Python: T3_Env",
"type": "python",
"request": "launch",
"program": "~/Code/T3/T3.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["${input:pickDir}/input.yml"]
}
],
"inputs": [
{
"id": "pickDir",
"type": "command",
"command": "extension.commandvariable.file.pickFile",
"args":{
"include":"**/*",
"display": "fileName",
"description": "Subdirectory to process",
"showDirs": true,
"fromFolder":{"fixed":"/home/calvin/Code/Runs/"}
}
}
]
}
}
7 changes: 2 additions & 5 deletions T3.code-workspace
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"folders": [
{
"path": "."
},
{
"path": "../ARC"
"path": "../../../../.t3"
},
{
"path": "../RMG-Py"
"path": "."
}
],
"settings": {}
Expand Down
19 changes: 0 additions & 19 deletions requirements.txt

This file was deleted.

45 changes: 25 additions & 20 deletions t3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from t3.common import PROJECTS_BASE_PATH, VALID_CHARS, delete_root_rmg_log, get_species_by_label, time_lapse
from t3.logger import Logger
from t3.runners.rmg_runner import rmg_runner
from t3.runners.rmg_adapter import RMGAdapter
from t3.schema import InputBase
from t3.simulate.factory import simulate_factory
from t3.utils.writer import write_pdep_network_file, write_rmg_input_file
Expand Down Expand Up @@ -618,29 +619,29 @@ def run_rmg(self, restart_rmg: bool = False):
and not os.path.isdir(self.paths['RMG T3 kinetics lib']):
self.rmg['database']['kinetics_libraries'].pop(self.rmg['database']['kinetics_libraries'].index(t3_kinetics_lib))

write_rmg_input_file(
rmg=self.rmg,
t3=self.t3,
iteration=self.iteration,
path=self.paths['RMG input'],
walltime=self.t3['options']['max_RMG_walltime'],
)

# Creating the RMG Adapter class - allow for SSH
# We will need self.rmg
rmg_adapter = RMGAdapter(
rmg=self.rmg,
t3=self.t3,
iteration=self.iteration,
paths=self.paths,
logger=self.logger,
walltime=self.t3['options']['max_RMG_walltime'],
max_iterations=self.t3['options']['max_rmg_iterations'],
verbose=self.verbose,
t3_project_name=self.project,
restart_rmg=restart_rmg,
)
rmg_adapter.run_rmg()
if not os.path.isfile(self.paths['RMG input']):
raise ValueError(f"The RMG input file {self.paths['RMG input']} could not be written.")
tic = datetime.datetime.now()

max_rmg_exceptions_allowed = self.t3['options']['max_RMG_exceptions_allowed']
rmg_exception_encountered = rmg_runner(rmg_input_file_path=self.paths['RMG input'],
job_log_path=self.paths['RMG job log'],
logger=self.logger,
memory=self.rmg['memory'] * 1000 if self.rmg['memory'] is not None else None,
max_iterations=self.t3['options']['max_rmg_iterations'],
verbose=self.verbose,
t3_project_name=self.project,
rmg_execution_type=self.rmg['rmg_execution_type'],
restart_rmg=restart_rmg,
)
if rmg_exception_encountered:

if rmg_adapter.rmg_exception_encountered:
self.rmg_exceptions_counter += 1
if self.rmg_exceptions_counter > max_rmg_exceptions_allowed:
self.logger.error(f'This is the {get_number_with_ordinal_indicator(self.rmg_exceptions_counter)} '
Expand All @@ -652,10 +653,14 @@ def run_rmg(self, restart_rmg: bool = False):
f'This is the {get_number_with_ordinal_indicator(self.rmg_exceptions_counter)} '
f'exception raised by RMG.\n'
f'The maximum number of exceptions allowed is {max_rmg_exceptions_allowed}.')

elapsed_time = time_lapse(tic)
self.logger.info(f'RMG terminated, execution time: {elapsed_time}')





#
def determine_species_and_reactions_to_calculate(self) -> bool:
"""
Determine which species and reactions in the executed RMG job should be calculated.
Expand Down
Loading
Loading