File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change 55from jinja2 import Template
66
77from mache .machine_info import MachineInfo , discover_machine
8+ from mache .spack .script import get_spack_script
89from mache .spack .shared import _get_yaml_data
910from mache .version import __version__
1011
@@ -105,23 +106,18 @@ def make_spack_env(
105106
106107 modules = ''
107108
108- for shell_filename in [f'{ machine } .sh' , f'{ machine } _{ compiler } _{ mpi } .sh' ]:
109- # load modules, etc. for this machine
110- path = (
111- importlib_resources .files ('mache.spack.templates' ) / shell_filename
112- )
113- try :
114- with open (str (path )) as fp :
115- template = Template (fp .read ())
116- except FileNotFoundError :
117- # there's nothing to add, which is fine
118- continue
119- bash_script = template .render (
120- e3sm_lapack = include_e3sm_lapack ,
121- e3sm_hdf5_netcdf = include_e3sm_hdf5_netcdf ,
122- )
123-
124- modules = f'{ modules } \n { bash_script } '
109+ bash_script = get_spack_script (
110+ spack_path ,
111+ env_name ,
112+ compiler ,
113+ mpi ,
114+ 'sh' ,
115+ machine ,
116+ None ,
117+ include_e3sm_lapack ,
118+ include_e3sm_hdf5_netcdf ,
119+ )
120+ modules = f'{ modules } \n { bash_script } '
125121
126122 path = (
127123 importlib_resources .files ('mache.spack.templates' )
You can’t perform that action at this time.
0 commit comments