-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forward batch command from ensembles and ensemblesets
Batch processing after init on ensembles Demonstrate that batch works with apply Ensembles load ScratchRealizations concurrently Implement functionality for turning off concurrency wip, trying to multiprocess process_batch in ensemble Fix parent commit. Now process_batch works for ensembles wip . check this diff later Repair get_smryvalues, but perhaps deprecated Move batch testing to designated test file and yaml-application
- Loading branch information
Showing
6 changed files
with
139 additions
and
49 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Common functions for fmu.ensemble""" | ||
|
||
import os | ||
import sys | ||
|
||
|
||
def use_concurrent(): | ||
"""Determine whether we should use concurrency or not | ||
This is based on both an environment variable | ||
and presence of concurrent.futures. | ||
Returns: | ||
bool: True if concurrency mode should be used | ||
""" | ||
env_name = "FMU_CONCURRENCY" | ||
if "concurrent.futures" in sys.modules: | ||
if env_name not in os.environ: | ||
return True | ||
else: | ||
env_var = os.environ[env_name] | ||
if str(env_var) == "0" or str(env_var).lower() == "false": | ||
return False | ||
else: | ||
return True | ||
else: | ||
# If concurrent.futures is not available, we end here. | ||
return False |
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
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