code: def set_backend(backend_name: str):
    
    global _backend, _backend_name
    _backend_name = backend_name
  
    assert not ncluster_globals.task_launched, "Not allowed to change backend after launching a task (this pattern is error-prone)"
    if backend_name == 'aws':
      _backend = aws_backend
    elif backend_name == 'local':
      _backend = local_backend
    else:
      assert False, f"Unknown backend {backend_name}"
    ncluster_globals.LOGDIR_ROOT = _backend.LOGDIR_ROOT
docs: Sets backend (local or aws)