Example usage for org.apache.hadoop.conf Configuration getInt

List of usage examples for org.apache.hadoop.conf Configuration getInt

Introduction

In this page you can find the example usage for org.apache.hadoop.conf Configuration getInt.

Prototype

public int getInt(String name, int defaultValue) 

Source Link

Document

Get the value of the name property as an int.

Usage

From source file:edu.iu.daal_cov.COVDaalCollectiveMapper.java

License:Apache License

/**
* Mapper configuration./*from w w w .j  av  a2 s .  c  om*/
*/
@Override
protected void setup(Context context) throws IOException, InterruptedException {
    long startTime = System.currentTimeMillis();
    Configuration configuration = context.getConfiguration();
    numMappers = configuration.getInt(Constants.NUM_MAPPERS, 10);
    numThreads = configuration.getInt(Constants.NUM_THREADS, 10);

    //always use the maximum hardware threads to load in data and convert data 
    harpThreads = Runtime.getRuntime().availableProcessors();

    LOG.info("Num Mappers " + numMappers);
    LOG.info("Num Threads " + numThreads);
    LOG.info("Num harp load data threads " + harpThreads);

    long endTime = System.currentTimeMillis();
    LOG.info("config (ms) :" + (endTime - startTime));
    System.out.println("Collective Mapper launched");

}

From source file:edu.iu.daal_linreg.LinRegDaalCollectiveMapper.java

License:Apache License

/**
* Mapper configuration.//from  w w  w .ja  va  2 s . c o m
*/
@Override
protected void setup(Context context) throws IOException, InterruptedException {
    long startTime = System.currentTimeMillis();
    Configuration configuration = context.getConfiguration();
    numMappers = configuration.getInt(Constants.NUM_MAPPERS, 10);
    numThreads = configuration.getInt(Constants.NUM_THREADS, 10);
    testFilePath = configuration.get(Constants.TEST_FILE_PATH, "");
    testGroundTruth = configuration.get(Constants.TEST_TRUTH_PATH, "");

    //always use the maximum hardware threads to load in data and convert data 
    harpThreads = Runtime.getRuntime().availableProcessors();

    LOG.info("Num Mappers " + numMappers);
    LOG.info("Num Threads " + numThreads);
    LOG.info("Num harp load data threads " + harpThreads);

    long endTime = System.currentTimeMillis();
    LOG.info("config (ms) :" + (endTime - startTime));
    System.out.println("Collective Mapper launched");

}

From source file:edu.iu.daal_mom.MOMDaalCollectiveMapper.java

License:Apache License

/**
* Mapper configuration.//from  w  w w.  j a  v a  2  s.com
*/
@Override
protected void setup(Context context) throws IOException, InterruptedException {
    long startTime = System.currentTimeMillis();
    Configuration configuration = context.getConfiguration();
    numMappers = configuration.getInt(Constants.NUM_MAPPERS, 10);
    numThreads = configuration.getInt(Constants.NUM_THREADS, 10);

    //always use the maximum hardware threads to load in data and convert data 
    harpThreads = Runtime.getRuntime().availableProcessors();

    LOG.info("Num Mappers " + numMappers);
    LOG.info("Num Threads " + numThreads);
    LOG.info("Num harp load data threads " + harpThreads);

    long endTime = System.currentTimeMillis();
    LOG.info("config (ms) :" + (endTime - startTime));
    System.out.println("Collective Mapper launched");
}

From source file:edu.iu.daal_naive.NaiveDaalCollectiveMapper.java

License:Apache License

/**
* Mapper configuration./*from w w  w  . jav  a  2s  . co m*/
*/
@Override
protected void setup(Context context) throws IOException, InterruptedException {
    long startTime = System.currentTimeMillis();
    Configuration configuration = context.getConfiguration();
    numMappers = configuration.getInt(Constants.NUM_MAPPERS, 10);
    numThreads = configuration.getInt(Constants.NUM_THREADS, 10);

    vectorSize = configuration.getInt(Constants.VECTOR_SIZE, 20);

    nClasses = configuration.getInt(Constants.NUM_CLASS, 20);

    num_test = configuration.getInt(Constants.NUM_TEST, 20);

    testFilePath = configuration.get(Constants.TEST_FILE_PATH, "");
    testGroundTruth = configuration.get(Constants.TEST_TRUTH_PATH, "");

    //always use the maximum hardware threads to load in data and convert data 
    harpThreads = Runtime.getRuntime().availableProcessors();

    LOG.info("Num Mappers " + numMappers);
    LOG.info("Num Threads " + numThreads);
    LOG.info("Feature Dim " + vectorSize);
    LOG.info("Num classes " + nClasses);
    LOG.info("Num harp load data threads " + harpThreads);

    long endTime = System.currentTimeMillis();
    LOG.info("config (ms) :" + (endTime - startTime));
    System.out.println("Collective Mapper launched");

}

From source file:edu.iu.daal_pca.PCADaalCollectiveMapper.java

License:Apache License

/**
 * Mapper configuration.// www .j a v  a 2  s. c o  m
 */
@Override
protected void setup(Context context) throws IOException, InterruptedException {
    long startTime = System.currentTimeMillis();
    Configuration configuration = context.getConfiguration();
    pointsPerFile = configuration.getInt(Constants.POINTS_PER_FILE, 20);
    vectorSize = configuration.getInt(Constants.VECTOR_SIZE, 20);
    numMappers = configuration.getInt(Constants.NUM_MAPPERS, 10);
    numThreads = configuration.getInt(Constants.NUM_THREADS, 10);

    //always use the maximum hardware threads to load in data and convert data 
    harpThreads = Runtime.getRuntime().availableProcessors();

    LOG.info("Points Per File " + pointsPerFile);
    LOG.info("Vector Size " + vectorSize);
    LOG.info("Num Mappers " + numMappers);
    LOG.info("Num Threads " + numThreads);
    LOG.info("Num harp load data threads " + harpThreads);

    long endTime = System.currentTimeMillis();
    LOG.info("config (ms) :" + (endTime - startTime));
}

From source file:edu.iu.daal_subgraph.SCDaalCollectiveMapper.java

License:Apache License

@Override
protected void setup(Context context) throws IOException, InterruptedException {

    LOG.info("start setup");

    Configuration configuration = context.getConfiguration();
    numMappers = configuration.getInt(SCConstants.NUM_MAPPERS, 10);
    templateFile = configuration.get(SCConstants.TEMPLATE_PATH);
    useLocalMultiThread = configuration.getBoolean(SCConstants.USE_LOCAL_MULTITHREAD, true);
    rotation_pipeline = configuration.getBoolean(SCConstants.ROTATION_PIPELINE, true);

    LOG.info("init templateFile");
    LOG.info(templateFile);//from  w  ww .  ja  v a 2  s  .c om

    numThreads = configuration.getInt(SCConstants.THREAD_NUM, 10);

    //always use the maximum hardware threads to load in data and convert data 
    harpThreads = Runtime.getRuntime().availableProcessors();
    LOG.info("Num Threads " + numThreads);
    LOG.info("Num harp load data threads " + harpThreads);

    numCores = configuration.getInt(SCConstants.CORE_NUM, 24);
    affinity = configuration.get(SCConstants.THD_AFFINITY);
    omp_opt = configuration.get(SCConstants.OMPSCHEDULE);
    tpc = configuration.getInt(SCConstants.TPC, 2);

    send_array_limit = (configuration.getInt(SCConstants.SENDLIMIT, 250)) * 1024L * 1024L;
    nbr_split_len = configuration.getInt(SCConstants.NBRTASKLEN, 0);

    numIteration = configuration.getInt(SCConstants.NUM_ITERATION, 10);
    LOG.info("Harp-DAAL Subgraph Counting Iteration: " + numIteration);

}

From source file:edu.iu.examples.BaseExampleMapper.java

License:Apache License

/**
 * Mapper configuration./*from  ww w  .j av a  2  s.co m*/
 */
@Override
protected void setup(Context context) {
    Configuration configuration = context.getConfiguration();
    cmd = configuration.get(Constants.ARGS_OPERATION, "allreduce");
    numMappers = configuration.getInt(Constants.ARGS_MAPPERS, 1);
    numPartitions = configuration.getInt(Constants.ARGS_PARTITIONS, 1);
    elements = configuration.getInt(Constants.ARGS_ELEMENTS, 1);
    numIterations = configuration.getInt(Constants.ARGS_ITERATIONS, 1);
    dataType = configuration.get(Constants.ARGS_DATA_TYPE, "double");
    verify = configuration.getBoolean(Constants.ARGS_VERIFY, false);
    LOG.info("Example operation " + cmd);
    LOG.info("Num Mappers " + numMappers);
    LOG.info("Num Partitions " + numPartitions);
    LOG.info("Bytes per Partition " + elements);
    LOG.info("Num Iterations " + numIterations);
    LOG.info("Data type " + dataType);
    LOG.info("Verify " + verify);
}

From source file:edu.iu.frlayout.FRCollectiveMapper.java

License:Apache License

public void setup(Context context) {
    Configuration conf = context.getConfiguration();
    layoutFile = conf.get(FRConstants.LAYOUT_FILE);
    totalVtx = conf.getInt(FRConstants.TOTAL_VTX, 10);
    numMaps = conf.getInt(FRConstants.NUM_MAPS, 3);
    partitionPerWorker = conf.getInt(FRConstants.PARTITION_PER_WORKER, 8);
    iteration = conf.getInt(FRConstants.ITERATION, 1);
    area = totalVtx * totalVtx;/*from   ww  w .j ava2  s. c  o m*/
    maxDelta = totalVtx;
    coolExp = 1.5f;
    repulseRad = area * totalVtx;
    k = Math.sqrt(area / totalVtx);
    ks = totalVtx;
    tableID = 0;
}

From source file:edu.iu.kmeans.KMeansCollectiveMapper.java

License:Apache License

/**
 * Mapper configuration.//from  ww w.  j  a v  a  2  s.  co m
 */
@Override
protected void setup(Context context) throws IOException, InterruptedException {
    LOG.info("start setup" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(Calendar.getInstance().getTime()));
    long startTime = System.currentTimeMillis();
    Configuration configuration = context.getConfiguration();
    jobID = configuration.getInt(KMeansConstants.JOB_ID, 0);
    numMappers = configuration.getInt(KMeansConstants.NUM_MAPPERS, 10);
    numCentroids = configuration.getInt(KMeansConstants.NUM_CENTROIDS, 20);
    numCenPartitions = numMappers;
    pointsPerFile = configuration.getInt(KMeansConstants.POINTS_PER_FILE, 20);
    vectorSize = configuration.getInt(KMeansConstants.VECTOR_SIZE, 20);
    cenVecSize = vectorSize + 1;
    iteration = configuration.getInt(KMeansConstants.ITERATION_COUNT, 1);
    numMaxThreads = 32;
    long endTime = System.currentTimeMillis();
    LOG.info("config (ms) :" + (endTime - startTime));
}

From source file:edu.iu.kmeans.regroupallgather.KMeansCollectiveMapper.java

License:Apache License

/**
 * Mapper configuration.//from  w w w  . j a va 2 s  . c  o m
 */
@Override
protected void setup(Context context) throws IOException, InterruptedException {
    long startTime = System.currentTimeMillis();
    Configuration configuration = context.getConfiguration();
    pointsPerFile = configuration.getInt(Constants.POINTS_PER_FILE, 20);
    numCentroids = configuration.getInt(Constants.NUM_CENTROIDS, 20);
    vectorSize = configuration.getInt(Constants.VECTOR_SIZE, 20);
    numMappers = configuration.getInt(Constants.NUM_MAPPERS, 10);
    numCenPars = numMappers;
    cenVecSize = vectorSize + 1;
    numThreads = configuration.getInt(Constants.NUM_THREADS, 10);
    numIterations = configuration.getInt(Constants.NUM_ITERATIONS, 10);
    cenDir = configuration.get(Constants.CEN_DIR);
    LOG.info("Points Per File " + pointsPerFile);
    LOG.info("Num Centroids " + numCentroids);
    LOG.info("Vector Size " + vectorSize);
    LOG.info("Num Mappers " + numMappers);
    LOG.info("Num Threads " + numThreads);
    LOG.info("Num Iterations " + numIterations);
    LOG.info("Cen Dir " + cenDir);
    long endTime = System.currentTimeMillis();
    LOG.info("config (ms) :" + (endTime - startTime));
}