Start a wandb sweep agent in a background Python thread.
call wandb_sweep(config=cfg, project="my-proj", sweep_id=sid)
call wandb_sweep_start_agent(sid, "my-proj", count=5)
do i = 1, 5
call wandb_sweep_next_params(params_json)
! parse params_json, train, log ...
call wandb_sweep_run_done()
end do
call wandb_shutdown()
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | sweep_id | |||
| character(len=*), | intent(in) | :: | project | |||
| integer, | intent(in) | :: | count | |||
| character(len=*), | intent(in), | optional | :: | entity |
subroutine wandb_sweep_start_agent(sweep_id, project, count, entity) !! Start a wandb sweep agent in a background Python thread. !! !! ## Usage pattern !! !! ```fortran !! call wandb_sweep(config=cfg, project="my-proj", sweep_id=sid) !! call wandb_sweep_start_agent(sid, "my-proj", count=5) !! do i = 1, 5 !! call wandb_sweep_next_params(params_json) !! ! parse params_json, train, log ... !! call wandb_sweep_run_done() !! end do !! call wandb_shutdown() !! ``` character(len=*), intent(in) :: sweep_id character(len=*), intent(in) :: project integer, intent(in) :: count character(len=*), optional, intent(in) :: entity character(len=:), allocatable :: c_entity integer(c_int) :: rc if(present(entity))then c_entity = trim(entity) // c_null_char else c_entity = c_null_char end if rc = wandb_sweep_start_agent_c( & trim(sweep_id) // c_null_char, & trim(project) // c_null_char, & c_entity, & int(count, c_int) & ) if(rc /= 0)then write(0,*) "[wf] WARNING: wandb_sweep_start_agent failed (rc=", rc, ")" end if end subroutine wandb_sweep_start_agent