-
Notifications
You must be signed in to change notification settings - Fork 27
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
1 parent
0913795
commit 9ce07a6
Showing
60 changed files
with
6,796 additions
and
3,971 deletions.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""General functions for MALA, such as parameters.""" | ||
|
||
from .parameters import Parameters | ||
from .parallelizer import printout, get_rank, get_size, finalize | ||
from .check_modules import check_modules |
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 |
---|---|---|
@@ -1,42 +1,65 @@ | ||
"""Function to check module availability in MALA.""" | ||
|
||
import importlib | ||
|
||
|
||
def check_modules(): | ||
"""Check whether/which optional modules MALA can access.""" | ||
# The optional libs in MALA. | ||
optional_libs = { | ||
"mpi4py": {"available": False, "description": | ||
"Enables inference parallelization."}, | ||
"horovod": {"available": False, "description": | ||
"Enables training parallelization."}, | ||
"lammps": {"available": False, "description": | ||
"Enables descriptor calculation for data preprocessing " | ||
"and inference."}, | ||
"oapackage": {"available": False, "description": | ||
"Enables usage of OAT method for hyperparameter " | ||
"optimization."}, | ||
"total_energy": {"available": False, "description": | ||
"Enables calculation of total energy."}, | ||
"asap3": {"available": False, "description": | ||
"Enables trajectory analysis."}, | ||
"dftpy": {"available": False, "description": | ||
"Enables OF-DFT-MD initialization."}, | ||
"minterpy": {"available": False, "description": | ||
"Enables minterpy descriptor calculation for data preprocessing."} | ||
"mpi4py": { | ||
"available": False, | ||
"description": "Enables inference parallelization.", | ||
}, | ||
"horovod": { | ||
"available": False, | ||
"description": "Enables training parallelization.", | ||
}, | ||
"lammps": { | ||
"available": False, | ||
"description": "Enables descriptor calculation for data preprocessing " | ||
"and inference.", | ||
}, | ||
"oapackage": { | ||
"available": False, | ||
"description": "Enables usage of OAT method for hyperparameter " | ||
"optimization.", | ||
}, | ||
"total_energy": { | ||
"available": False, | ||
"description": "Enables calculation of total energy.", | ||
}, | ||
"asap3": { | ||
"available": False, | ||
"description": "Enables trajectory analysis.", | ||
}, | ||
"dftpy": { | ||
"available": False, | ||
"description": "Enables OF-DFT-MD initialization.", | ||
}, | ||
"minterpy": { | ||
"available": False, | ||
"description": "Enables minterpy descriptor calculation for data preprocessing.", | ||
}, | ||
} | ||
|
||
# Find out if libs are available. | ||
for lib in optional_libs: | ||
optional_libs[lib]["available"] = importlib.util.find_spec(lib) \ | ||
is not None | ||
optional_libs[lib]["available"] = ( | ||
importlib.util.find_spec(lib) is not None | ||
) | ||
|
||
# Print info about libs. | ||
print("The following optional modules are available in MALA:") | ||
for lib in optional_libs: | ||
available_string = "installed" if optional_libs[lib]["available"] \ | ||
else "not installed" | ||
print("{0}: \t {1} \t {2}".format(lib, available_string, | ||
optional_libs[lib]["description"])) | ||
optional_libs[lib]["available"] = \ | ||
available_string = ( | ||
"installed" if optional_libs[lib]["available"] else "not installed" | ||
) | ||
print( | ||
"{0}: \t {1} \t {2}".format( | ||
lib, available_string, optional_libs[lib]["description"] | ||
) | ||
) | ||
optional_libs[lib]["available"] = ( | ||
importlib.util.find_spec(lib) is not None | ||
) |
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
Oops, something went wrong.