public static void main(String[] args) throws  Exception {
        String baseFilename = args[0];
        int nShards = Integer.parseInt(args[1]);
        String fileType = (args.length >= 3 ? args[2] : null);

        /* Create shards */
        FastSharder sharder = createSharder(baseFilename, nShards);
        sharder.setAllowSparseDegreesAndVertexData(false);
        if (baseFilename.equals("pipein")) {     // Allow piping graph in
            sharder.shard(System.in);
        } else {
            sharder.shard(new FileInputStream(new File(baseFilename)), fileType);
        }

        /* Run engine */
        GraphChiEngine<Integer, Integer> engine = new GraphChiEngine<Integer, Integer>(baseFilename, nShards);
        engine.setEdataConverter(new IntConverter());
        engine.setVertexDataConverter(new IntConverter());
        engine.setModifiesInedges(false); // Important optimization
        engine.run(new SmokeTest(), 5);

        /* Test vertex iterator */
        Iterator<VertexIdValue<Integer>> iter = VertexAggregator.vertexIterator(engine.numVertices(),
                baseFilename, new IntConverter(), engine.getVertexIdTranslate());

        int i=0;
        while(iter.hasNext()) {
            VertexIdValue<Integer> x = iter.next();
            int internalId = engine.getVertexIdTranslate().forward(x.getVertexId());
            int expectedValue = internalId + 4;
            if (expectedValue != x.getValue()) {
                throw new IllegalStateException("Expected internal value to be " + expectedValue
                        + ", but it was " + x.getValue() + "; internal id=" + internalId + "; orig=" + x.getVertexId());
            }
            if (i % 10000 == 0) {
                logger.info("Scanning vertices: " + i);
            }
            i++;
        }

        if (i != engine.numVertices())
            throw new IllegalStateException("Error in iterator: did not have numVertices vertices: " + i + "/" + engine.numVertices());

        logger.info("Ready.");
    }