-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hi, I was wondering what would be the best approach to run a list of independent commands in parallel that use input file from the same location.
My approach is to create a mapset for each command, so that for each process i repeat something like:
import uuid
mapset = str(uuid.uuid4())
with Session(gisdb="grassdata",
location="location_name"):
gcore.run_command("g.mapset", flags="c", mapset=mapset)
with Session(gisdb="grassdata",
location="location_name", mapset=mapset):
gcore.run_command('r.process.data',
param='value-for-process-i_n,
output=prefix_param-value-for-process-i_n)
gcore.run_command('r.export.output',
input=prefix_param-value-for-process-i_n,
output=prefix_param-value-for-process-i_n)I run this for each process by changing just the value for the input parameters and then I remove such mapset after the session exit with a brute rm -rf /path/to/location_name/mapset_uuid_name
Is there an option to use grass-session with a temporary mapset that gets created when the session starts and removed when it exit?
Metadata
Metadata
Assignees
Labels
No labels