01: /*
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file ../GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */
15: package org.griphyn.vdl.classes;
16:
17: import org.griphyn.vdl.classes.*;
18: import java.util.*;
19:
20: /**
21: * This class is a leftover from an earlier version, and now solely
22: * here for the purposes of providing the Condor universe constants.
23: *
24: * @author Jens-S. Vöckler
25: * @author Yong Zhao
26: * @version $Revision: 50 $
27: */
28: public class Executable {
29: /**
30: * Condor vanilla universe to run unmodified jobs.
31: */
32: public static final int CONDOR_VANILLA = 0;
33: /**
34: * Condor standard universe to run condor_compiled jobs.
35: */
36: public static final int CONDOR_STANDARD = 1;
37: /**
38: * Condor scheduler universe to run on the submit host.
39: */
40: public static final int CONDOR_SCHEDULER = 2;
41: /**
42: * Condor globus universe to talk to a GRAM system.
43: */
44: public static final int CONDOR_GLOBUS = 3;
45: /**
46: * Condor PVM universe to do what?
47: */
48: public static final int CONDOR_PVM = 4;
49: /**
50: * Condor Java universe to do what?
51: */
52: public static final int CONDOR_JAVA = 5;
53: /**
54: * Condor MPI universe to do what?
55: */
56: public static final int CONDOR_MPI = 6;
57:
58: /**
59: * Predicate to determine, if an integer is within the valid range for
60: * Condor universes.
61: *
62: * @param x is the integer to test for in-intervall.
63: * @return true, if the integer satisfies {@link Executable#CONDOR_VANILLA}
64: * ≤ x ≤ {@link Executable#CONDOR_MPI}, false otherwise.
65: */
66: public static boolean isInRange(int x) {
67: return ((x >= Executable.CONDOR_VANILLA) && (x <= Executable.CONDOR_MPI));
68: }
69:
70: /**
71: * Converts an integer into the symbolic Condor universe represented by
72: * the constant.
73: *
74: * @param x is the integer with the universe to symbolically convert
75: * @return a string with the symbolic universe name, or null, if the
76: * constant is out of range.
77: */
78: public static String toString(int x) {
79: switch (x) {
80: case Executable.CONDOR_VANILLA:
81: return "vanilla";
82: case Executable.CONDOR_STANDARD:
83: return "standard";
84: case Executable.CONDOR_SCHEDULER:
85: return "scheduler";
86: case Executable.CONDOR_GLOBUS:
87: return "globus";
88: case Executable.CONDOR_PVM:
89: return "pvm";
90: case Executable.CONDOR_JAVA:
91: return "java";
92: case Executable.CONDOR_MPI:
93: return "mpi";
94: default:
95: return null;
96: }
97: }
98: }
|