Repository: airavata Updated Branches: refs/heads/master 0f7a1940e -> 99dd1bacc
Added samples for Ultrascan MPI Jobs. AIRAVATA-1059 Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/21040aed Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/21040aed Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/21040aed Branch: refs/heads/master Commit: 21040aed6b3efdd2c07ff5af4725bc329f1b8086 Parents: 59cc938 Author: raminder <[email protected]> Authored: Fri Mar 7 11:20:45 2014 -0500 Committer: raminder <[email protected]> Committed: Fri Mar 7 11:20:45 2014 -0500 ---------------------------------------------------------------------- .../client/samples/CreateLaunchExperiment.java | 66 ++++++++++++++++++-- .../airavata/client/tools/DocumentCreator.java | 4 +- 2 files changed, 62 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/21040aed/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java index 5d8c69b..78ebeb9 100644 --- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java +++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java @@ -49,7 +49,7 @@ import java.util.Set; public class CreateLaunchExperiment { //FIXME: Read from a config file - public static final String THRIFT_SERVER_HOST = "localhost"; + public static final String THRIFT_SERVER_HOST = "149.165.228.109"; public static final int THRIFT_SERVER_PORT = 8930; private final static Logger logger = LoggerFactory.getLogger(CreateLaunchExperiment.class); private static final String DEFAULT_USER = "defauly.registry.user"; @@ -60,8 +60,8 @@ public class CreateLaunchExperiment { AiravataUtils.setExecutionAsClient(); final Airavata.Client airavata = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT); System.out.println("API version is " + airavata.GetAPIVersion()); - addDescriptors(); - final String expId = createLocalExperiment(airavata); + addDescriptors(); + final String expId = createExperiment(airavata); System.out.println("Experiment ID : " + expId); launchExperiment(airavata, expId); System.out.println("Launched successfully"); @@ -121,9 +121,10 @@ public class CreateLaunchExperiment { public static void addDescriptors() throws AiravataAPIInvocationException,ApplicationSettingsException { try { DocumentCreator documentCreator = new DocumentCreator(getAiravataAPI()); - documentCreator.createEchoAppLocalHostDocs(); +// documentCreator.createEchoAppLocalHostDocs(); // documentCreator.createEchoAppGramDocs(); -// documentCreator.createEchoAppGSISSHDocs(); + documentCreator.createEchoAppGSISSHDocs(); +// documentCreator.createUltrascanGSISSHDocs(); } catch (AiravataAPIInvocationException e) { logger.error("Unable to create airavata API", e.getMessage()); throw new AiravataAPIInvocationException(e); @@ -168,7 +169,60 @@ public class CreateLaunchExperiment { Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("project1", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs); simpleExperiment.setExperimentOutputs(exOut); - ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128"); + ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "uot111"); + scheduling.setResourceHostId("gsissh-trestles"); + UserConfigurationData userConfigurationData = new UserConfigurationData(); + userConfigurationData.setAiravataAutoSchedule(false); + userConfigurationData.setOverrideManualScheduledParams(false); + userConfigurationData.setComputationalResourceScheduling(scheduling); + simpleExperiment.setUserConfigurationData(userConfigurationData); + return client.createExperiment(simpleExperiment); + } catch (AiravataSystemException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new AiravataSystemException(e); + } catch (InvalidRequestException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new InvalidRequestException(e); + } catch (AiravataClientException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new AiravataClientException(e); + }catch (TException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new TException(e); + } + } + + public static String createUS3Experiment (Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException { + try{ + List<DataObjectType> exInputs = new ArrayList<DataObjectType>(); + DataObjectType input = new DataObjectType(); + input.setKey("input"); + input.setType(DataType.URI.toString()); + input.setValue("file:///home/airavata/input/hpcinput.tar"); + exInputs.add(input); + + List<DataObjectType> exOut = new ArrayList<DataObjectType>(); + DataObjectType output = new DataObjectType(); + output.setKey("output"); + output.setType(DataType.URI.toString()); + output.setValue(""); + DataObjectType output1 = new DataObjectType(); + output1.setKey("stdout"); + output1.setType(DataType.STD_OUT.toString()); + output1.setValue(""); + DataObjectType output2 = new DataObjectType(); + output2.setKey("stderr"); + output2.setType(DataType.STD_ERR.toString()); + output2.setValue(""); + exOut.add(output); + exOut.add(output1); + exOut.add(output2); + + + Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("project1", "admin", "US3Experiment", "UltrascanApp", "UltrascanApp", exInputs); + simpleExperiment.setExperimentOutputs(exOut); + + ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 2, 32, 0, "normal", 0, 0, 0, "uot111"); scheduling.setResourceHostId("gsissh-trestles"); UserConfigurationData userConfigurationData = new UserConfigurationData(); userConfigurationData.setAiravataAutoSchedule(false); http://git-wip-us.apache.org/repos/asf/airavata/blob/21040aed/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java ---------------------------------------------------------------------- diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java b/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java index 7d63aae..9fbaa5c 100644 --- a/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java +++ b/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java @@ -264,7 +264,7 @@ public class DocumentCreator { name.setStringValue("EchoLocal"); app.setApplicationName(name); ProjectAccountType projectAccountType = app.addNewProjectAccount(); - projectAccountType.setProjectAccountNumber("sds128"); + projectAccountType.setProjectAccountNumber("uot111"); QueueType queueType = app.addNewQueue(); queueType.setQueueName("normal"); @@ -282,7 +282,7 @@ public class DocumentCreator { /* * Default tmp location */ - String tempDir = "/home/ogce/scratch"; + String tempDir = "/oasis/projects/nsf/uot111/us3/airavata-workdirs/"; String date = (new Date()).toString(); date = date.replaceAll(" ", "_"); date = date.replaceAll(":", "_");
