Skip to content

Commit

Permalink
add machine env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierCladellas committed Feb 6, 2025
1 parent 60d3424 commit 93c30be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/feelpp/benchmarking/reframe/config/configMachines.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class MachineConfig(BaseModel):
reports_base_dir:str
input_dataset_base_dir:Optional[str] = None
output_app_dir:str
env_variables:Optional[Dict] = {}
containers:Optional[Dict[str,Container]] = {}

platform:Optional[Literal["apptainer","docker","builtin"]] = "builtin"
Expand Down
9 changes: 5 additions & 4 deletions src/feelpp/benchmarking/reframe/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def updateConfig(self, replace = None):
"""
self.reader.updateConfig(replace)

def setEnvVariables(self):
for env_var_name,env_var_value in self.reader.config.env_variables.items():
os.environ[env_var_name] = env_var_value


class MachineSetup(Setup):
""" Machine related setup"""
Expand All @@ -58,6 +62,7 @@ def setupAfterInit(self,rfm_test,app_config):
Args:
rfm_test (reframe class) : The test to apply the setup
"""
self.setEnvVariables()
self.setValidEnvironments(rfm_test)
self.setTags(rfm_test)
self.setPlatform(rfm_test,app_config)
Expand Down Expand Up @@ -137,10 +142,6 @@ def setupBeforeRun(self,rfm_test,machine_config):
def setupAfterInit(self, rfm_test):
self.setEnvVariables()

def setEnvVariables(self):
for env_var_name,env_var_value in self.reader.config.env_variables.items():
os.environ[env_var_name] = env_var_value

def cleanupDirectories(self):
if os.path.exists(self.reader.config.scalability.directory):
shutil.rmtree(self.reader.config.scalability.directory)
Expand Down

0 comments on commit 93c30be

Please sign in to comment.