Search in sources :

Example 1 with ThreadPool

use of es.bsc.compss.util.ThreadPool 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)

Example 2 with ThreadPool

use of es.bsc.compss.util.ThreadPool in project compss by bsc-wdc.

the class WSJob method init.

public static void init() throws Exception {
    // Create thread that will handle job submission requests
    if (callerQueue == null) {
        callerQueue = new RequestQueue<>();
    } else {
        callerQueue.clear();
    }
    caller = new WSCaller(callerQueue);
    callerPool = new ThreadPool(POOL_SIZE, POOL_NAME, caller);
    try {
        callerPool.startThreads();
    } catch (Exception e) {
        logger.error(THREAD_POOL_ERR, e);
        throw e;
    }
}
Also used : ThreadPool(es.bsc.compss.util.ThreadPool) CannotLoadException(es.bsc.compss.exceptions.CannotLoadException)

Aggregations

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