Giter Site home page Giter Site logo

drmaa-pbs's Introduction

drmaa-pbs

DRMAA PBS Java library, using command executions like qsub and qstat

This library is not complete, and implements DRMAA v1 by calling native commands (qsub, qstat, pbsnodes, etc).

Example

package org.biouno.drmaa_pbs;

import java.util.HashMap;
import java.util.Map;

import org.ggf.drmaa.DrmaaException;
import org.ggf.drmaa.JobTemplate;
import org.ggf.drmaa.Session;
import org.ggf.drmaa.SessionFactory;

public class Test {

    public static void main(String[] args) {
        SessionFactory sf = SessionFactory.getFactory();
        Session s = sf.getSession();

        try {
            // http://biouno.org/2014/06/21/java-drmaa-api-part-1/
            Map<String, String> options = new HashMap<String, String>();
            options.put("os", "UNIX");
            options.put("address", "localhost");
            options.put("port", "10022");
            options.put("username", "testuser");
            options.put("password", "testuser");
            options.put("connectionType", "SCP");
            ((SessionImpl) s).init("ssh", options);
            JobTemplate jt = new JobTemplateImpl();
            jt.setRemoteCommand("/home/testuser/torque.submit");
            String id = s.runJob(jt);
            int i = s.getJobProgramStatus(id);
            System.out.println(i);
            s.deleteJobTemplate(jt);
            System.out.println("Your job has been submitted with id " + id);
            s.exit();
        } catch (DrmaaException de) {
            de.printStackTrace(System.err);
        }

        System.out.println("OK!");
        System.exit(1);
    }

}

The output will be similar to.

Sep 26, 2015 1:26:16 PM org.biouno.drmaa_pbs.SessionImpl runJob
INFO: jobId: 9.localhost

32
Your job has been submitted with id 9.localhost
OK!

Changelog

  • v0.3 - Implemented basic functions for running, stopping and monitoring jobs. Tested on NCI's Raijin which uses a modified version of Pbs Pro (thanks to @kevyin)

drmaa-pbs's People

Contributors

dependabot[bot] avatar kevyin avatar kinow avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kevyin

drmaa-pbs's Issues

Do not parse XMLs manually

At the moment we have a bunch of if conditions for parsing the XMLs, and we also use regular expressions.

Yesterday I committed a fix for a NPE that happened because of one of these if's. This is still possible to happen, and makes our code less readable and brittle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.