fix require path
add rank argument to generator script