@@ -193,30 +193,34 @@ def run(
193
193
batch = create_batch (
194
194
modeler = simulation ,
195
195
folder_name = folder_name ,
196
+ solver_version = solver_version
196
197
# parent_tasks=[task_id]
197
198
)
198
199
batch .run ()
200
+ # postprocess(
201
+ # batch_id,
202
+ # solver_version=solver_version,
203
+ # worker_group=worker_group,
204
+ # pay_type=pay_type,
205
+ # priority=priority,
206
+ # ) # TODO FIX
207
+
199
208
from ..core .http_util import http
200
209
resp = http .post (
201
210
f"tidy3d/projects/{ batch_id } /postprocess" ,
202
211
{
203
- "batchType" : "RF_SWEEP"
212
+ "batchType" : "RF_SWEEP" ,
213
+ "solverVersion" : "dario-rf-0.0.0"
204
214
},
205
215
)
206
216
print (resp )
207
- # start(
208
- # task_id,
209
- # solver_version=solver_version,
210
- # worker_group=worker_group,
211
- # pay_type=pay_type,
212
- # priority=priority,
213
- # )
214
217
# monitor(task_id, verbose=verbose)
215
218
# data = load(
216
219
# task_id=task_id, path=path, verbose=verbose, progress_callback=progress_callback_download
217
220
# )
218
221
# if isinstance(simulation, ModeSolver):
219
222
# simulation._patch_data(data=data)
223
+ # print(resp)
220
224
# return data
221
225
else :
222
226
task_id = upload (
@@ -470,6 +474,7 @@ def start(
470
474
worker_group : Optional [str ] = None ,
471
475
pay_type : Union [PayType , str ] = PayType .AUTO ,
472
476
priority : Optional [int ] = None ,
477
+ resource_id : Optional [str ] = None ,
473
478
) -> None :
474
479
"""Start running the simulation associated with task.
475
480
@@ -490,9 +495,12 @@ def start(
490
495
----
491
496
To monitor progress, can call :meth:`monitor` after starting simulation.
492
497
"""
498
+ if not resource_id :
499
+ resource_id = task_id
500
+
493
501
if priority is not None and (priority < 1 or priority > 10 ):
494
502
raise ValueError ("Priority must be between '1' and '10' if specified." )
495
- task = SimulationTask .get (task_id )
503
+ task = SimulationTask .get (resource_id )
496
504
if not task :
497
505
raise ValueError ("Task not found." )
498
506
task .submit (
@@ -502,6 +510,48 @@ def start(
502
510
priority = priority ,
503
511
)
504
512
513
+ @wait_for_connection
514
+ def postprocess (
515
+ task_id : TaskId ,
516
+ solver_version : Optional [str ] = None ,
517
+ worker_group : Optional [str ] = None ,
518
+ pay_type : Union [PayType , str ] = PayType .AUTO ,
519
+ priority : Optional [int ] = None ,
520
+ resource_id : Optional [str ] = None ,
521
+ ) -> None :
522
+ """Start running the simulation associated with task.
523
+
524
+ Parameters
525
+ ----------
526
+
527
+ task_id : str
528
+ Unique identifier of task on server. Returned by :meth:`upload`.
529
+ solver_version: str = None
530
+ target solver version.
531
+ worker_group: str = None
532
+ worker group
533
+ pay_type: Union[PayType, str] = PayType.AUTO
534
+ Which method to pay the simulation
535
+ priority: int = None
536
+ Task priority for vGPU queue (1=lowest, 10=highest).
537
+ Note
538
+ ----
539
+ To monitor progress, can call :meth:`monitor` after starting simulation.
540
+ """
541
+ if not resource_id :
542
+ resource_id = task_id
543
+
544
+ if priority is not None and (priority < 1 or priority > 10 ):
545
+ raise ValueError ("Priority must be between '1' and '10' if specified." )
546
+ task = SimulationTask .get (resource_id )
547
+ if not task :
548
+ raise ValueError ("Task not found." )
549
+ task .postprocess (
550
+ solver_version = solver_version ,
551
+ worker_group = worker_group ,
552
+ pay_type = pay_type ,
553
+ priority = priority ,
554
+ )
505
555
506
556
@wait_for_connection
507
557
def get_run_info (task_id : TaskId ) -> tuple [Optional [float ], Optional [float ]]:
0 commit comments