-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Han Lin Mai
committed
Jun 14, 2024
1 parent
50c792c
commit bf9032d
Showing
95 changed files
with
641 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
from utils.vasp.vasp_resubmitter import CalculationConverger | ||
import os | ||
|
||
vasp_resubmitter = CalculationConverger(parent_dir=os.getcwd(), | ||
script_template_dir="/home/hmai/CustodianJobfiles", | ||
max_submissions = 1000, | ||
submission_command = "sbatch", | ||
username="hmai") | ||
|
||
vasp_resubmitter.reconverge_all() |
File renamed without changes.
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,42 @@ | ||
from utils.vasp.vasp import DatabaseGenerator | ||
import argparse | ||
import warnings | ||
from multiprocessing import cpu_count | ||
|
||
def main(): | ||
warnings.filterwarnings("ignore") | ||
|
||
# Initialize argument parser | ||
parser = argparse.ArgumentParser(description='Find and compress directories based on specified criteria.') | ||
parser.add_argument('directory', metavar='DIR', type=str, help='the directory to operate on') | ||
parser.add_argument('--extract', action='store_true', help='Extract directories during database generation') | ||
parser.add_argument('--max_dir_count', type=int, help='Maximum directory count for database generation') | ||
parser.add_argument('--read_all_runs_in_dir', action='store_true', default=False, help='Read all runs in directory') | ||
parser.add_argument('--read_error_runs_in_dir', action='store_true', default=False, help='Read directories with errors') | ||
args = parser.parse_args() | ||
|
||
datagen = DatabaseGenerator(args.directory, | ||
max_workers=cpu_count()) | ||
|
||
# Check if max_dir_count is provided as an argument | ||
if args.max_dir_count is not None: | ||
max_dir_count = args.max_dir_count | ||
else: | ||
max_dir_count = 2000 # Default value | ||
|
||
# Call the build_database function with the updated parameters | ||
df = datagen.build_database(extract_directories=args.extract, | ||
read_multiple_runs_in_dir=args.read_all_runs_in_dir, | ||
read_error_dirs=args.read_error_runs_in_dir, | ||
max_dir_count=max_dir_count, | ||
tarball_extensions=(".tar.gz", ".tar.bz2"), | ||
cleanup=False, | ||
keep_filenames_after_cleanup=[], | ||
keep_filename_patterns_after_cleanup=[], | ||
filenames_to_qualify=["OUTCAR", "vasprun.xml"], | ||
all_present=True, | ||
df_filename=None, | ||
df_compression=True) | ||
|
||
if __name__ == '__main__': | ||
main() |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
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,34 @@ | ||
from utils.vasp.vasp import DatabaseGenerator | ||
import argparse | ||
import warnings | ||
from multiprocessing import cpu_count | ||
|
||
def main(): | ||
warnings.filterwarnings("ignore") | ||
|
||
# Initialize argument parser | ||
parser = argparse.ArgumentParser(description='Find and compress directories based on specified criteria.') | ||
parser.add_argument('directory', metavar='DIR', type=str, help='the directory to operate on') | ||
parser.add_argument('--max_dir_count', type=int, help='Maximum directory count for database generation') | ||
parser.add_argument('--read_all_runs_in_dir', action='store_true', default=False, help='Read all runs in directory') | ||
parser.add_argument('--read_error_runs_in_dir', action='store_true', default=False, help='Read directories with errors') | ||
args = parser.parse_args() | ||
|
||
datagen = DatabaseGenerator(args.directory, | ||
max_workers=cpu_count()) | ||
|
||
# Check if max_dir_count is provided as an argument | ||
if args.max_dir_count is not None: | ||
max_dir_count = args.max_dir_count | ||
else: | ||
max_dir_count = 2000 # Default value | ||
|
||
# Call the update_failed_jobs_in_database function with the updated parameters | ||
df = datagen.update_failed_jobs_in_database(df_path=args.directory, | ||
read_error_dirs=args.read_error_runs_in_dir, | ||
read_multiple_runs_in_dir=args.read_all_runs_in_dir, | ||
max_dir_count=max_dir_count, | ||
df_compression=True) | ||
|
||
if __name__ == '__main__': | ||
main() |
Binary file not shown.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
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
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,56 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import sys\n", | ||
"\n", | ||
"from custodian.custodian import Custodian\n", | ||
"from custodian.vasp.handlers import VaspErrorHandler, UnconvergedErrorHandler, NonConvergingErrorHandler, PositiveEnergyErrorHandler\n", | ||
"from custodian.vasp.jobs import VaspJob\n", | ||
"\n", | ||
"output_filename = \"vasp.log\"\n", | ||
"handlers = [VaspErrorHandler(output_filename=output_filename), UnconvergedErrorHandler(), NonConvergingErrorHandler(), PositiveEnergyErrorHandler()]\n", | ||
"jobs = [VaspJob(sys.argv[1:], output_file=output_filename, suffix = \".relax_1\", final=False, settings_override=[{\"dict\": \"INCAR\", \"action\": {\"_set\": {\"KSPACING\": 0.5}}}]),\n", | ||
" VaspJob(sys.argv[1:], output_file=output_filename, suffix = \".relax_2\", final=False,\n", | ||
" settings_override = [{\"file\": \"CONTCAR\", \"action\": {\"_file_copy\": {\"dest\": \"POSCAR\"}}},\n", | ||
" {\"dict\": \"INCAR\", \"action\": {\"_set\": {\"KSPACING\": 0.5, \"EDIFF\": 1E-5, \"EDIFFG\": 1E-4}}}], copy_magmom=True),\n", | ||
" VaspJob(sys.argv[1:], output_file=output_filename, suffix = \"\",\n", | ||
" settings_override = [{\"dict\": \"INCAR\", \"action\": {\"_set\": {\"NSW\": 0, \"LAECHG\": True, \"LCHARGE\": True, \"NELM\": 240, \"EDIFF\": 1E-5}}},\n", | ||
" {\"file\": \"CONTCAR\", \"action\": {\"_file_copy\": {\"dest\": \"POSCAR\"}}}])]\n", | ||
"c = Custodian(handlers, jobs, max_errors=10)\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "pyiron_workflow", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Empty file.
Oops, something went wrong.