Add codegeneration for scheduler.