Algebraic multigrid is usually called in the same way as a direct solver. For example, there are three distributed-memory parallel algebraic multigrid packages (and a bunch of other methods, direct and iterative) that may be used as runtime options with PETSc's same Solve call.