@@ -72,7 +72,7 @@ def machineSettings(
7272 forceUsername = None ,
7373):
7474 """
75- This script uses the config json file and completes the information required to run each code (like modules, tunnels)
75+ This script uses the config json file and completes the information required to run each code
7676
7777 forceUsername is used to override the json file (for TRANSP PRF), adding also an identity and scratch
7878 """
@@ -82,7 +82,7 @@ def machineSettings(
8282 machine = s ["preferences" ][code ]
8383
8484 """
85- Set-up per code and machine (loading modules, tunnels, etc)
85+ Set-up per code and machine
8686 -------------------------------------------------
8787 """
8888
@@ -101,14 +101,18 @@ def machineSettings(
101101 "port" : None ,
102102 "identity" : None ,
103103 "partition" : None ,
104- "modules" : "source $MITIM_PATH/config/mitim.bashrc" ,
104+ "modules" : "source $MITIM_PATH/config/mitim.bashrc" ,
105105 "folderWork" : scratch ,
106106 "exclude" : s [machine ]["exclude" ] if "exclude" in s [machine ] else None ,
107107 "isTunnelSameMachine" : bool (s [machine ]["isTunnelSameMachine" ])
108108 if "isTunnelSameMachine" in s [machine ]
109109 else False ,
110110 }
111111
112+ # I can give extra things to load in the config file
113+ if "modules" in s [machine ] and s [machine ]["modules" ] is not None and s [machine ]["modules" ] != "" :
114+ machineSettings ["modules" ] = f'{ machineSettings ["modules" ]} \n { s [machine ]["modules" ]} '
115+
112116 checkers = ["identity" , "partition" , "tunnel" , "port" ]
113117 for i in checkers :
114118 if i in s [machine ]:
@@ -119,27 +123,12 @@ def machineSettings(
119123 "folderWorkTunnel"
120124 ] = f"{ s [machine ]['scratch_tunnel' ]} /{ nameScratch } "
121125
122- # ************************************************************************************************************************
123- # Issues
124- # ************************************************************************************************************************
125-
126- # For some reason, going into iris does not know what $MITIM_PATH is even if it's defined in bash... so do this trick until I find a solution:
127- if machine == "iris" :
128- machineSettings [
129- "modules"
130- ] = f"source /home/{ s [machine ]['username' ]} /MITIM/config/mitim.bashrc"
131-
132126 # ************************************************************************************************************************
133127 # Specific case of being already in the machine where I need to run
134128 # ************************************************************************************************************************
135129
136- AmIAlreadyHere = (
137- ((machine in ["mfews" ]) and ("mfews" in socket .gethostname ()))
138- or ((machine in ["iris" ]) and ("iris" in socket .gethostname ()))
139- or ((machine in ["engaging" ]) and (isThisEngaging ()))
140- )
141-
142- if AmIAlreadyHere :
130+ # Am I already in this machine?
131+ if machine in socket .gethostname ():
143132 # Avoid tunneling and porting if I'm already there
144133 machineSettings ["tunnel" ] = machineSettings ["port" ] = None
145134
0 commit comments