Search in sources :

Example 1 with Dispatcher

use of es.bsc.compss.comm.Dispatcher in project compss by bsc-wdc.

the class GATAdaptor method init.

public void init() {
    // Create request queues
    copyQueue = new RequestQueue<DataOperation>();
    safeQueue = new RequestQueue<DataOperation>();
    String adaptor = System.getProperty(COMPSsConstants.GAT_FILE_ADAPTOR);
    if (debug) {
        logger.debug("Initializing GAT");
    }
    pool = new ThreadPool(GAT_POOL_SIZE, POOL_NAME, new Dispatcher(copyQueue));
    try {
        pool.startThreads();
    } catch (Exception e) {
        ErrorManager.error(THREAD_POOL_ERR, e);
    }
    safePool = new ThreadPool(SAFE_POOL_SIZE, SAFE_POOL_NAME, new Dispatcher(safeQueue));
    try {
        safePool.startThreads();
    } catch (Exception e) {
        ErrorManager.error(THREAD_POOL_ERR, e);
    }
    // GAT adaptor path
    if (debug) {
        logger.debug("Initializing GAT Tranfer Context");
    }
    transferContext = new GATContext();
    /*
         * We need to try the local adaptor when both source and target hosts are local, because ssh file adaptor cannot
         * perform local operations
         */
    transferContext.addPreference("File.adaptor.name", adaptor + ", srcToLocalToDestCopy, local");
}
Also used : DataOperation(es.bsc.compss.types.data.operation.DataOperation) GATContext(org.gridlab.gat.GATContext) ThreadPool(es.bsc.compss.util.ThreadPool) Dispatcher(es.bsc.compss.comm.Dispatcher) URISyntaxException(java.net.URISyntaxException) ConstructConfigurationException(es.bsc.compss.exceptions.ConstructConfigurationException)

Aggregations

Dispatcher (es.bsc.compss.comm.Dispatcher)1 ConstructConfigurationException (es.bsc.compss.exceptions.ConstructConfigurationException)1 DataOperation (es.bsc.compss.types.data.operation.DataOperation)1 ThreadPool (es.bsc.compss.util.ThreadPool)1 URISyntaxException (java.net.URISyntaxException)1 GATContext (org.gridlab.gat.GATContext)1