Using DRMAA with Unicluster Express
Using DRMAA with Unicluster Express
Distributed Resource Management Application API (DRMAA) is a high-level API that allows Grid applications to submit, monitor and control jobs to one or more DRM systems. Grid Engine comes with support for C/C++ and java, and one can also download bindings for ruby and python. There is also a nice collection of HowTos that should provide a great start for anyone looking to start writing DRMAA applications. The latest version of Unicluster Express (UCE) bundles Grid Engine 6.1u3, which is installed under $GLOBUS_LOCATION/sge. The $GLOBUS_LOCATION refers to the UCE installation directory (/usr/local/unicluster by default), and all of the DRMAA libraries and java files are located in the $GLOBUS_LOCATION/sge/lib directory. In order to run DRMAA applications, one has to set $LD_LIBRARY_PATH to point to the appropriate (architecture dependent) directory. For my development (64-bit linux) cluster with default UCE installation I used the following setup:
$ source /usr/local/unicluster/unicluster-user-env.sh $ export LD_LIBRARY_PATH=/usr/local/unicluster/sge/lib/lx24-amd64 $ export JAVA_HOME=/opt/jdk $ export PATH=$JAVA_HOME/bin:$PATH
A very simple example of a java DRMAA application that submits a job to Grid Engine is shown below:
$ cat SimpleJob.java
import org.ggf.drmaa.DrmaaException;
import org.ggf.drmaa.JobTemplate;
import org.ggf.drmaa.Session;
import org.ggf.drmaa.SessionFactory;
public class SimpleJob {
public static void main(String[] args) {
SessionFactory factory = SessionFactory.getFactory();
Session session = factory.getSession();
try {
session.init("");
JobTemplate jt = session.createJobTemplate();
jt.setRemoteCommand("/home/veseli/simple_job.sh");
String id = session.runJob(jt);
System.out.println("Your job has been submitted with id " + id);
}
catch (DrmaaException e) {
System.out.println("Error: " + e.getMessage());
}
}
}
One can compile and run the above example using something like the following:
$ javac -classpath /usr/local/unicluster/sge/lib/drmaa.jar SimpleJob.java $ java -classpath .:/usr/local/unicluster/sge/lib/drmaa.jar SimpleJob Your job has been submitted with id 14 $ qstat -f queuename qtype used/tot. load_avg arch states ---------------------------------------------------------------------------- all.q@horatio.psvm.univa.com BP 1/1 0.36 lx24-amd64 14 0.55500 simple_job veseli r 06/20/2008 12:24:59 1 ---------------------------------------------------------------------------- all.q@romeo.psvm.univa.com BP 0/1 0.39 lx24-amd64 ---------------------------------------------------------------------------- all.q@yorick.psvm.univa.com BP 0/1 0.45 lx24-amd64 ---------------------------------------------------------------------------- headnodes.q@petruchio.psvm.uni IP 0/1 0.15 lx24-amd64 ---------------------------------------------------------------------------- special.q@horatio.psvm.univa.c BIP 0/1 0.36 lx24-amd64
I should point out that DRMAA is designed to be independent of any particular DRM. Those users that need job submission features or flags specific to Grid Engine can either use the “native specification” attribute, or they can use the “job category” attribute together with “qtask” files. In order to set native specification attribute in java one would use setNativeSpecification() method of the JobTemplate class (before the job submission line in the code):
jt.setNativeSpecification("-q special.q");
This method, however, makes your application dependent on the specific DRM you are working with at the moment. The above line will be interpreted correctly by Grid Engine, but may not be understood by other DRMs. In most cases a better solution is to use the job category attribute instead, and specify the DRM-dependent flags in the qtask file. For example, in order to submit your job to a particular Grid Engine queue in the java code one would have something like
jt.setJobCategory("special");
and use the qtask file to translate the “special” job category into appropriate Grid Engine flags:
$ cat ~/.qtask special -q special.q
The cluster global qtask file (defines cluster wide defaults) in UCE resides at $GLOBUS_LOCATION/sge/default/common/qtask. As shown above, user-specific qtask files that override and enhance cluster-wide definitions are found at ~/.qtask.
منبع : http://gridgurus.typepad.com



Grid Engine 6.2 will come with some interesting new features. In addition to advance resource reservations and array job interdependencies, this release will also contain a new Service Domain Manager (SDM) module, which will allow distributing computational resources between different services, such as different Grid Engine clusters or application servers. For example, SDM will be able to withdraw unneeded machines from one cluster (or application server) and assign it to a different one or keep it in its “spare resource pool”. It is also worth mentioning that Grid Engine (and SDM) documentation is moving to Sun’s


The emergence of cloud computing as a resource on the grid has led to a huge resurgence in interest in utility computing. Looking at the history of utility computing allows us to identify three canonical interaction models that also apply to cloud computing.
Xgrid : اپل همراه Tiger Server نرمافزار 1.0 Xgrid را نيز عرضه ميكند. نرمافزار رايانش توزيعي اپل، كار ساخت ابررايانههاي موردنياز مراكز علمي و تحقيقاتي را بسيار سادهتر و كم هزينهتر از قبل خواهد ساخت. Xgrid 1.0 براي انجام پردازشهاي توزيعي از ده هزار كار در انتظار پردازش، ده هزار وظيفه در هر كار در انتظار پردازش، دو گيگابايت داده در هر كار منتظر پردازش، يك گيگابايت داده در هر وظيفه و مجموعاً ده گيگابايت نتيجه مرجوعي پشتيباني ميكند.