Search in sources :

Example 1 with PBSJobConfiguration

use of org.apache.airavata.gfac.impl.job.PBSJobConfiguration in project airavata by apache.

the class Factory method getJobManagerConfiguration.

public static JobManagerConfiguration getJobManagerConfiguration(ResourceJobManager resourceJobManager) throws GFacException {
    if (resourceJobManager == null)
        return null;
    ResourceConfig resourceConfig = Factory.getResourceConfig(resourceJobManager.getResourceJobManagerType());
    OutputParser outputParser;
    try {
        Class<? extends OutputParser> aClass = Class.forName(resourceConfig.getCommandOutputParser()).asSubclass(OutputParser.class);
        outputParser = aClass.getConstructor().newInstance();
    } catch (Exception e) {
        throw new GFacException("Error while instantiating output parser for " + resourceJobManager.getResourceJobManagerType().name());
    }
    String templateFileName = GFacUtils.getTemplateFileName(resourceJobManager.getResourceJobManagerType());
    switch(resourceJobManager.getResourceJobManagerType()) {
        case PBS:
            return new PBSJobConfiguration(templateFileName, ".pbs", resourceJobManager.getJobManagerBinPath(), resourceJobManager.getJobManagerCommands(), outputParser);
        case SLURM:
            return new SlurmJobConfiguration(templateFileName, ".slurm", resourceJobManager.getJobManagerBinPath(), resourceJobManager.getJobManagerCommands(), outputParser);
        case LSF:
            return new LSFJobConfiguration(templateFileName, ".lsf", resourceJobManager.getJobManagerBinPath(), resourceJobManager.getJobManagerCommands(), outputParser);
        case UGE:
            return new UGEJobConfiguration(templateFileName, ".pbs", resourceJobManager.getJobManagerBinPath(), resourceJobManager.getJobManagerCommands(), outputParser);
        case FORK:
            return new ForkJobConfiguration(templateFileName, ".sh", resourceJobManager.getJobManagerBinPath(), resourceJobManager.getJobManagerCommands(), outputParser);
        // We don't have a job configuration manager for CLOUD type
        default:
            return null;
    }
}
Also used : LSFJobConfiguration(org.apache.airavata.gfac.impl.job.LSFJobConfiguration) GFacException(org.apache.airavata.gfac.core.GFacException) UGEJobConfiguration(org.apache.airavata.gfac.impl.job.UGEJobConfiguration) ForkJobConfiguration(org.apache.airavata.gfac.impl.job.ForkJobConfiguration) ResourceConfig(org.apache.airavata.gfac.core.config.ResourceConfig) OutputParser(org.apache.airavata.gfac.core.cluster.OutputParser) SlurmJobConfiguration(org.apache.airavata.gfac.impl.job.SlurmJobConfiguration) CredentialStoreException(org.apache.airavata.credential.store.store.CredentialStoreException) AppCatalogException(org.apache.airavata.registry.cpi.AppCatalogException) RegistryException(org.apache.airavata.registry.cpi.RegistryException) AiravataException(org.apache.airavata.common.exception.AiravataException) GFacException(org.apache.airavata.gfac.core.GFacException) ApplicationSettingsException(org.apache.airavata.common.exception.ApplicationSettingsException) PBSJobConfiguration(org.apache.airavata.gfac.impl.job.PBSJobConfiguration)

Aggregations

AiravataException (org.apache.airavata.common.exception.AiravataException)1 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)1 CredentialStoreException (org.apache.airavata.credential.store.store.CredentialStoreException)1 GFacException (org.apache.airavata.gfac.core.GFacException)1 OutputParser (org.apache.airavata.gfac.core.cluster.OutputParser)1 ResourceConfig (org.apache.airavata.gfac.core.config.ResourceConfig)1 ForkJobConfiguration (org.apache.airavata.gfac.impl.job.ForkJobConfiguration)1 LSFJobConfiguration (org.apache.airavata.gfac.impl.job.LSFJobConfiguration)1 PBSJobConfiguration (org.apache.airavata.gfac.impl.job.PBSJobConfiguration)1 SlurmJobConfiguration (org.apache.airavata.gfac.impl.job.SlurmJobConfiguration)1 UGEJobConfiguration (org.apache.airavata.gfac.impl.job.UGEJobConfiguration)1 AppCatalogException (org.apache.airavata.registry.cpi.AppCatalogException)1 RegistryException (org.apache.airavata.registry.cpi.RegistryException)1