Examples of HpcApplicationDeploymentType


Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

        ((GlobusHostType)host.getType()).setGridFTPEndPointArray(new String[]{gridftpAddress});
        /*
           * App
           */
        ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
        HpcApplicationDeploymentType app = (HpcApplicationDeploymentType)appDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        name.setStringValue("EchoLocal");
        app.setApplicationName(name);
        ProjectAccountType projectAccountType = app.addNewProjectAccount();
        projectAccountType.setProjectAccountNumber("sds128");

        QueueType queueType = app.addNewQueue();
        queueType.setQueueName("development");

        app.setCpuCount(1);
        app.setJobType(JobTypeType.SERIAL);
        app.setNodeCount(1);
        app.setProcessorsPerNode(1);

        /*
           * Use bat file if it is compiled on Windows
           */
        app.setExecutableLocation("/bin/echo");

        /*
           * Default tmp location
           */
        String tempDir = "/scratch/01437/ogce/test/";
        String date = (new Date()).toString();
        date = date.replaceAll(" ", "_");
        date = date.replaceAll(":", "_");

        tempDir = tempDir + File.separator
                + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID();

        System.out.println(tempDir);
        app.setScratchWorkingDirectory(tempDir);
        app.setStaticWorkingDirectory(tempDir);
        app.setInputDataDirectory(tempDir + File.separator + "inputData");
        app.setOutputDataDirectory(tempDir + File.separator + "outputData");
        app.setStandardOutput(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stdout");
        app.setStandardError(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stderr");


        /*
           * Service
           */
 
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

    String userName = getUserNameFromContext(context);
    if (userName.equalsIgnoreCase("admin")){
      userName = "CN=zdv575, O=Ultrascan Gateway, C=DE";
    }
   
    HpcApplicationDeploymentType appDepType = (HpcApplicationDeploymentType) context
        .getApplicationContext().getApplicationDeploymentDescription()
        .getType();
   
    createGenericApplication(value, appDepType);
   
    if (appDepType.getApplicationEnvironmentArray().length > 0) {
      createApplicationEnvironment(value,
          appDepType.getApplicationEnvironmentArray(), appDepType);
    }

   
    if (appDepType.getExecutableLocation() != null) {
      FileNameType fNameType = FileNameType.Factory.newInstance();
      fNameType.setStringValue(appDepType.getExecutableLocation());
      if(isParallelJob(appDepType)) {
        JSDLUtils.getOrCreateSPMDApplication(value).setExecutable(fNameType);
        JSDLUtils.getSPMDApplication(value).setSPMDVariation(getSPMDVariation(appDepType));
       
        if(getValueFromMap(appDepType, JSDLUtils.NUMBEROFPROCESSES)!=null){
          NumberOfProcessesType num = NumberOfProcessesType.Factory.newInstance();
          num.setStringValue(getValueFromMap(appDepType, JSDLUtils.NUMBEROFPROCESSES));
          JSDLUtils.getSPMDApplication(value).setNumberOfProcesses(num);
        }
             
        if(getValueFromMap(appDepType, JSDLUtils.PROCESSESPERHOST)!=null){
          ProcessesPerHostType pph = ProcessesPerHostType.Factory.newInstance();
          pph.setStringValue(getValueFromMap(appDepType, JSDLUtils.PROCESSESPERHOST));
          JSDLUtils.getSPMDApplication(value).setProcessesPerHost(pph);
        }
       
        if(getValueFromMap(appDepType, JSDLUtils.THREADSPERHOST)!=null){
          ThreadsPerProcessType tpp = ThreadsPerProcessType.Factory.newInstance();
          tpp.setStringValue(getValueFromMap(appDepType, JSDLUtils.THREADSPERHOST));
          JSDLUtils.getSPMDApplication(value).setThreadsPerProcess(tpp);
         
        }
       
        if(userName != null) {
          UserNameType userNameType = UserNameType.Factory.newInstance();
          userNameType.setStringValue(userName);
          JSDLUtils.getSPMDApplication(value).setUserName(userNameType);
        }
      }
      else {
        JSDLUtils.getOrCreatePOSIXApplication(value).setExecutable(fNameType);
        if(userName != null) {
          UserNameType userNameType = UserNameType.Factory.newInstance();
          userNameType.setStringValue(userName);
          JSDLUtils.getOrCreatePOSIXApplication(value).setUserName(userNameType);
        }
      }
    }
   

    String stdout = (appDepType.getStandardOutput() != null) ? new File(appDepType.getStandardOutput()).getName(): "stdout";
    ApplicationProcessor.setApplicationStdOut(value, appDepType, stdout);
   
 
    String stderr = (appDepType.getStandardError() != null) ? new File(appDepType.getStandardError()).getName() : "stderr";
    ApplicationProcessor.setApplicationStdErr(value, appDepType, stderr);
 
  }
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

public class UASDataStagingProcessor {
 
  public static void generateDataStagingElements(JobDefinitionType value, JobExecutionContext context, String smsUrl) throws Exception{
   
    HpcApplicationDeploymentType appDepType = (HpcApplicationDeploymentType) context
        .getApplicationContext().getApplicationDeploymentDescription()
        .getType();
   
    smsUrl = "BFT:"+smsUrl;
      
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

public class ResourceProcessor {

 
  public static void generateResourceElements(JobDefinitionType value, JobExecutionContext context) throws Exception{
   
    HpcApplicationDeploymentType appDepType = (HpcApplicationDeploymentType) context
        .getApplicationContext().getApplicationDeploymentDescription()
        .getType();
   
    createMemory(value, appDepType);
    TaskDetails taskData = context.getTaskData();
      if(taskData != null && taskData.isSetTaskScheduling()){
        ComputationalResourceScheduling computionResource= taskData.getTaskScheduling();
                try {
                    int cpuCount = computionResource.getTotalCPUCount();
                    if(cpuCount>0){
//                      appDepType.setCpuCount(cpuCount);
                    NumberOfProcessesType num = NumberOfProcessesType.Factory.newInstance();
              String processers = Integer.toString(cpuCount);
            num.setStringValue(processers);
              JSDLUtils.getOrCreateSPMDApplication(value).setNumberOfProcesses(num);
                    }
                } catch (NullPointerException e) {
                    new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    int nodeCount = computionResource.getNodeCount();
                    if(nodeCount>0){
                      appDepType.setNodeCount(nodeCount);
                    }
                } catch (NullPointerException e) {
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    String queueName = computionResource.getQueueName();
                    if (queueName != null) {
                        if(appDepType.getQueue() == null){
                            QueueType queueType = appDepType.addNewQueue();
                            queueType.setQueueName(queueName);
                        }else{
                          appDepType.getQueue().setQueueName(queueName);
                        }
                    }
                } catch (NullPointerException e) {
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    int maxwallTime = computionResource.getWallTimeLimit();
                    if(maxwallTime>0){
                      appDepType.setMaxWallTime(maxwallTime);
                    }
                } catch (NullPointerException e) {
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
        }
   
    if (appDepType.getCpuCount() > 0) {
      RangeValueType rangeType = new RangeValueType();
      rangeType.setLowerBound(Double.NaN);
      rangeType.setUpperBound(Double.NaN);
      rangeType.setExact(appDepType.getCpuCount());
      JSDLUtils.setTotalCPUCountRequirements(value, rangeType);
    }

    if (appDepType.getProcessorsPerNode() > 0) {
      RangeValueType rangeType = new RangeValueType();
      rangeType.setLowerBound(Double.NaN);
      rangeType.setUpperBound(Double.NaN);
      rangeType.setExact(appDepType.getProcessorsPerNode());
      JSDLUtils.setIndividualCPUCountRequirements(value, rangeType);
    }
   
    if (appDepType.getNodeCount() > 0) {
      RangeValueType rangeType = new RangeValueType();
      rangeType.setLowerBound(Double.NaN);
      rangeType.setUpperBound(Double.NaN);
      rangeType.setExact(appDepType.getNodeCount());
      JSDLUtils.setTotalResourceCountRequirements(value, rangeType);
    }
   
    if(appDepType.getMaxWallTime() > 0) {
      RangeValueType cpuTime = new RangeValueType();
      cpuTime.setLowerBound(Double.NaN);
      cpuTime.setUpperBound(Double.NaN);
      long wallTime = appDepType.getMaxWallTime() * 60;
      cpuTime.setExact(wallTime);
      JSDLUtils.setIndividualCPUTimeRequirements(value, cpuTime);
    }
  }
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

    File file = new File(downloadLocation);
    if(!file.exists()){
      file.mkdirs()
    }
   
    HpcApplicationDeploymentType appDepType = (HpcApplicationDeploymentType) jobContext
        .getApplicationContext().getApplicationDeploymentDescription()
        .getType();
   
    String stdout = appDepType.getStandardOutput();
    String stderr = appDepType.getStandardError();
    if(stdout != null) {
      stdout = stdout.substring(stdout.lastIndexOf('/')+1);
    }
   
    if(stderr != null) {
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

      return String.valueOf(num);
    }
  }
 
    private void loadApplicationDescriptionAdvancedOptions() {
        HpcApplicationDeploymentType hpcAppType = getHPCApplicationDescriptionType();
    if (hpcAppType.getJobType()!=null) {
      cmbJobType.setSelectedItem(hpcAppType
          .getJobType().toString());
    }
      txtMaxWallTime.setText(getPropValue(hpcAppType.getMaxWallTime()));
        txtCpuCount.setText(getPropValue(hpcAppType.getCpuCount()));
        txtNodeCount.setText(getPropValue(hpcAppType.getNodeCount()));
        txtProcessorsPerNode.setText(getPropValue(hpcAppType.getProcessorsPerNode()));
        txtMinMemory.setText(getPropValue(hpcAppType.getMinMemory()));
        txtMaxMemory.setText(getPropValue(hpcAppType.getMaxMemory()));
        txtNodeCount.setText(getPropValue(hpcAppType.getNodeCount()));
        txtjobSubmitterCommand.setText(hpcAppType.getJobSubmitterCommand()==null?"":hpcAppType.getJobSubmitterCommand());
        txtinstalledParentPath.setText(hpcAppType.getInstalledParentPath()==null?"":hpcAppType.getInstalledParentPath());
    ProjectAccountType projectAccount = getProjectAccountType();

    txtProjectAccountNumber.setText(projectAccount.getProjectAccountNumber()==null? "":projectAccount.getProjectAccountNumber());
    txtProjectAccountDescription.setText(projectAccount.getProjectAccountDescription()==null? "":projectAccount.getProjectAccountDescription());
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

public class DataStagingProcessor {
 
  public static void generateDataStagingElements(JobDefinitionType value, JobExecutionContext context) throws Exception{
   
    HpcApplicationDeploymentType appDepType = (HpcApplicationDeploymentType) context
        .getApplicationContext().getApplicationDeploymentDescription()
        .getType();

   
    String gridftpEndpoint = ((UnicoreHostType) context.getApplicationContext().getHostDescription().getType())
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

        /*
            Application descriptor creation and saving
         */
        ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
        HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        name.setStringValue("EchoLocal");
        app.setApplicationName(name);
        ProjectAccountType projectAccountType = app.addNewProjectAccount();
        projectAccountType.setProjectAccountNumber("sds128");

        QueueType queueType = app.addNewQueue();
        queueType.setQueueName("normal");

        app.setCpuCount(1);
        app.setJobType(JobTypeType.SERIAL);
        app.setNodeCount(1);
        app.setProcessorsPerNode(1);

        /*
           * Use bat file if it is compiled on Windows
           */
        app.setExecutableLocation("/bin/echo");

        /*
           * Default tmp location
           */
        String tempDir = "/home/ogce/scratch";
        app.setScratchWorkingDirectory(tempDir);
        app.setMaxMemory(10);


        try {
            airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, trestleshpcHostAddress, appDesc);
        } catch (AiravataAPIInvocationException e) {
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

        /*
            Application descriptor creation and saving
         */
        ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
        HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        name.setStringValue("EchoLocal");
        app.setApplicationName(name);
        ProjectAccountType projectAccountType = app.addNewProjectAccount();
        projectAccountType.setProjectAccountNumber("sds128");

        QueueType queueType = app.addNewQueue();
        queueType.setQueueName("normal");

        app.setCpuCount(1);
        app.setJobType(JobTypeType.SERIAL);
        app.setNodeCount(1);
        app.setProcessorsPerNode(1);
        app.setMaxWallTime(10);
        /*
           * Use bat file if it is compiled on Windows
           */
        app.setExecutableLocation("/bin/echo");

        /*
           * Default tmp location
           */
        String tempDir = "/oasis/scratch/trestles/ogce/temp_project/";

    
        app.setScratchWorkingDirectory(tempDir);
        app.setInstalledParentPath("/opt/torque/bin/");

        try {
            airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, trestleshpcHostAddress, appDesc);
        } catch (AiravataAPIInvocationException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }

         /*
        * Service Description creation and saving
        */
        String wrfserviceName = "WRF";
        ServiceDescription wrfServ = new ServiceDescription();
        wrfServ.getType().setName(wrfserviceName);

        List<InputParameterType> wrfinputList = new ArrayList<InputParameterType>();
        List<OutputParameterType> wrfoutputList = new ArrayList<OutputParameterType>();


        InputParameterType wrfinput1 = InputParameterType.Factory.newInstance();
        wrfinput1.setParameterName("WRF_Namelist");
        ParameterType wrfparameterType1 = wrfinput1.addNewParameterType();
        wrfparameterType1.setType(DataType.URI);
        wrfparameterType1.setName("URI");

        InputParameterType wrfinput2 = InputParameterType.Factory.newInstance();
        wrfinput2.setParameterName("WRF_Input_File");
        ParameterType wrfparameterType2 = wrfinput2.addNewParameterType();
        wrfparameterType2.setType(DataType.URI);
        wrfparameterType2.setName("URI");

        InputParameterType wrfinput3 = InputParameterType.Factory.newInstance();
        wrfinput3.setParameterName("WRF_Boundary_File");
        ParameterType wrfparameterType3 = wrfinput3.addNewParameterType();
        wrfparameterType3.setType(DataType.URI);
        wrfparameterType3.setName("URI");

        OutputParameterType wrfOutput1 = OutputParameterType.Factory.newInstance();
        wrfOutput1.setParameterName("WRF_Output");
        ParameterType wrfoutparameterType1 = wrfOutput1.addNewParameterType();
        wrfoutparameterType1.setType(DataType.URI);
        wrfoutparameterType1.setName("URI");

        OutputParameterType wrfOutput2 = OutputParameterType.Factory.newInstance();
        wrfOutput2.setParameterName("WRF_Execution_Log");
        ParameterType wrfoutparameterType2 = wrfOutput2.addNewParameterType();
        wrfoutparameterType2.setType(DataType.URI);
        wrfoutparameterType2.setName("URI");

        wrfinputList.add(wrfinput1);
        wrfinputList.add(wrfinput2);
        wrfinputList.add(wrfinput3);
        wrfoutputList.add(wrfOutput1);
        wrfoutputList.add(wrfOutput2);

        InputParameterType[] wrfinputParamList = wrfinputList.toArray(new InputParameterType[wrfinputList.size()]);
        OutputParameterType[] wrfoutputParamList = wrfoutputList.toArray(new OutputParameterType[wrfoutputList.size()]);

        wrfServ.getType().setInputParametersArray(wrfinputParamList);
        wrfServ.getType().setOutputParametersArray(wrfoutputParamList);
        try {
            airavataAPI.getApplicationManager().saveServiceDescription(wrfServ);
        } catch (AiravataAPIInvocationException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }

        /*
            Application descriptor creation and saving
         */
        ApplicationDescription wrfAppDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
        HpcApplicationDeploymentType wrfApp = (HpcApplicationDeploymentType) wrfAppDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName wrfName = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        wrfName.setStringValue("WRF");
        wrfApp.setApplicationName(wrfName);
        ProjectAccountType wrfprojectAccountType = wrfApp.addNewProjectAccount();
        wrfprojectAccountType.setProjectAccountNumber("sds128");

        QueueType wrfQueueType = wrfApp.addNewQueue();
        wrfQueueType.setQueueName("normal");

        wrfApp.setCpuCount(32);
        wrfApp.setJobType(JobTypeType.MPI);
        wrfApp.setNodeCount(2);
        wrfApp.setProcessorsPerNode(1);
        wrfApp.setMaxWallTime(30);
        /*
           * Use bat file if it is compiled on Windows
           */
        wrfApp.setExecutableLocation("/home/ogce/apps/wrf_wrapper.sh");

        /*
           * Default tmp location
           */
        String wrfTempDir = "/oasis/scratch/trestles/ogce/temp_project/";

        wrfApp.setScratchWorkingDirectory(wrfTempDir);
        wrfApp.setInstalledParentPath("/opt/torque/bin/");

        try {
            airavataAPI.getApplicationManager().saveApplicationDescription(wrfserviceName, trestleshpcHostAddress, wrfAppDesc);
        } catch (AiravataAPIInvocationException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType

        /*
           Application descriptor creation and saving
        */
        ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
        HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        name.setStringValue(serviceName);
        app.setApplicationName(name);
        ProjectAccountType projectAccountType = app.addNewProjectAccount();
        projectAccountType.setProjectAccountNumber("TG-MCB070039N");

        QueueType queueType = app.addNewQueue();
        queueType.setQueueName("normal");

        app.setCpuCount(1);
        app.setJobType(JobTypeType.SERIAL);
        app.setNodeCount(1);
        app.setProcessorsPerNode(1);
        app.setMaxWallTime(10);
        /*
        * Use bat file if it is compiled on Windows
        */
        app.setExecutableLocation("/bin/echo");

        /*
        * Default tmp location
        */
        String tempDir = "/home1/01623/us3";
      
        app.setScratchWorkingDirectory(tempDir);
        app.setInstalledParentPath("/usr/bin/");

        try {
            airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, gsiSshHostNameStampede, appDesc);
        } catch (AiravataAPIInvocationException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.