mauischeduler-cvs_notes Mailing List for Maui Scheduler (Page 2)
Brought to you by:
mauisched,
mitchmurphy
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(63) |
Dec
(92) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(170) |
Feb
(96) |
Mar
(27) |
Apr
(78) |
May
(24) |
Jun
(4) |
Jul
(2) |
Aug
(5) |
Sep
(2) |
Oct
(19) |
Nov
(19) |
Dec
(6) |
2003 |
Jan
(5) |
Feb
(1) |
Mar
(7) |
Apr
(18) |
May
(1) |
Jun
(25) |
Jul
(18) |
Aug
(8) |
Sep
(10) |
Oct
(14) |
Nov
(2) |
Dec
|
2004 |
Jan
(7) |
Feb
(2) |
Mar
(14) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
(22) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Aaron S. <mau...@us...> - 2004-04-03 05:47:31
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/sched In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27351 Modified Files: Tag: Maui_1_8 Sched.java Log Message: handle sub-second sleep interval Index: Sched.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/Sched.java,v retrieving revision 1.26 retrieving revision 1.26.2.1 diff -C2 -d -r1.26 -r1.26.2.1 *** Sched.java 29 Mar 2004 22:25:06 -0000 1.26 --- Sched.java 3 Apr 2004 05:35:15 -0000 1.26.2.1 *************** *** 47,50 **** --- 47,52 ---- public final transient static String sleepIntervalProperty = ".sleep"; + public final transient static String sleepSubIntervalProperty = ".subsleep"; + public final transient static String classProperty = ".class"; *************** *** 78,81 **** --- 80,88 ---- /** + * Sleep interval in milliseconds + */ + protected transient int sleepSubInterval=0; + + /** * Master Reservations (sorted by finishtime). */ *************** *** 193,196 **** --- 200,209 ---- : sleepInterval; + // sleep interval + str = props.getProperty(prefix+sleepSubIntervalProperty); + sleepSubInterval = (str != null) + ? Integer.parseInt(str) + : sleepSubInterval; + // admins str = props.getProperty(prefix+adminsProperty); *************** *** 318,322 **** do { try { ! wait(sleepInterval); } catch (InterruptedException e) { Log.err.println(e.getMessage()); --- 331,335 ---- do { try { ! wait(sleepInterval+sleepSubInterval); } catch (InterruptedException e) { Log.err.println(e.getMessage()); |
From: Aaron S. <mau...@us...> - 2004-04-03 05:45:46
|
Update of /cvsroot/mauischeduler/mauisched/share In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27109 Modified Files: Tag: Maui_1_8 maui.properties.in Log Message: Configuration for sub-second sleep interval Index: maui.properties.in =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/share/maui.properties.in,v retrieving revision 1.25 retrieving revision 1.25.6.1 diff -C2 -d -r1.25 -r1.25.6.1 *** maui.properties.in 16 Apr 2003 05:43:54 -0000 1.25 --- maui.properties.in 3 Apr 2004 05:33:23 -0000 1.25.6.1 *************** *** 88,91 **** --- 88,93 ---- # Sleep interval in seconds sched.sleep=5 + # Extra sleep interval in milliseconds + sched.subsleep=0 # Basic matcher handles simple Schedulable reservations (for jobs) |
From: Aaron S. <mau...@us...> - 2004-03-29 22:36:38
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6933/src/unm/maui/server Modified Files: CheckJob.java CheckNode.java CheckRes.java Log Message: It's annoying that TreeMap is not synchronized. Index: CheckJob.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/CheckJob.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CheckJob.java 25 Mar 2004 22:20:25 -0000 1.12 --- CheckJob.java 29 Mar 2004 22:25:06 -0000 1.13 *************** *** 120,124 **** buf.append("<nodes>\n"); Enumeration enum = slotHash.keys(); ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); NodeID nodeID; while (enum.hasMoreElements()) { --- 120,124 ---- buf.append("<nodes>\n"); Enumeration enum = slotHash.keys(); ! Map tree = Collections.synchronizedMap(new TreeMap()); NodeID nodeID; while (enum.hasMoreElements()) { Index: CheckNode.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/CheckNode.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CheckNode.java 25 Mar 2004 22:20:25 -0000 1.10 --- CheckNode.java 29 Mar 2004 22:25:06 -0000 1.11 *************** *** 125,129 **** } else if (verbose) { // verbose ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap(features));// ordering Object[] keys = tree.keySet().toArray(); int len = keys.length; --- 125,129 ---- } else if (verbose) { // verbose ! Map tree = Collections.synchronizedMap(new TreeMap(features));// ordering Object[] keys = tree.keySet().toArray(); int len = keys.length; Index: CheckRes.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/CheckRes.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CheckRes.java 25 Mar 2004 22:20:25 -0000 1.10 --- CheckRes.java 29 Mar 2004 22:25:06 -0000 1.11 *************** *** 114,118 **** +"' slotscount='"+res.getSlotsCount()+"'>\n"); Enumeration enum = slotHash.keys(); ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); NodeID nodeID; while (enum.hasMoreElements()) { --- 114,118 ---- +"' slotscount='"+res.getSlotsCount()+"'>\n"); Enumeration enum = slotHash.keys(); ! Map tree = Collections.synchronizedMap(new TreeMap()); NodeID nodeID; while (enum.hasMoreElements()) { |
From: Aaron S. <mau...@us...> - 2004-03-29 22:36:38
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6933/src/unm/util Modified Files: HashTree.java Log Message: It's annoying that TreeMap is not synchronized. Index: HashTree.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/util/HashTree.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HashTree.java 25 Mar 2004 22:20:26 -0000 1.3 --- HashTree.java 29 Mar 2004 22:25:07 -0000 1.4 *************** *** 170,173 **** --- 170,177 ---- } + public synchronized int size () { + return super.size(); + } + /* public synchronized boolean containsKey (Object hashkey) { *************** *** 230,234 **** private Hashtable hash = new Hashtable(); // Hash of Integer -> value ! private TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); private Object parentkey; int counter = 0; --- 234,238 ---- private Hashtable hash = new Hashtable(); // Hash of Integer -> value ! private Map tree = Collections.synchronizedMap(new TreeMap()); private Object parentkey; int counter = 0; |
From: Aaron S. <mau...@us...> - 2004-03-29 22:36:38
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/wiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6933/src/unm/maui/wiki Modified Files: Wiki.java Log Message: It's annoying that TreeMap is not synchronized. Index: Wiki.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/wiki/Wiki.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Wiki.java 25 Mar 2004 22:20:25 -0000 1.28 --- Wiki.java 29 Mar 2004 22:25:07 -0000 1.29 *************** *** 755,759 **** int len = wikiNodesHash.size(); Enumeration enum = wikiNodesHash.keys(); ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); for (int i=0; i<len; i++) { nodeID = (NodeID)enum.nextElement(); --- 755,759 ---- int len = wikiNodesHash.size(); Enumeration enum = wikiNodesHash.keys(); ! Map tree = Collections.synchronizedMap(new TreeMap()); for (int i=0; i<len; i++) { nodeID = (NodeID)enum.nextElement(); *************** *** 1213,1217 **** // not all hosts responded! Get their NodeIDs and mark // them as UNKNOWN! ! TreeMap tree = new TreeMap(respondedHash); Object[] keys = tree.keySet().toArray(); int len = keys.length; --- 1213,1217 ---- // not all hosts responded! Get their NodeIDs and mark // them as UNKNOWN! ! Map tree = Collections.synchronizedMap(new TreeMap(respondedHash)); Object[] keys = tree.keySet().toArray(); int len = keys.length; *************** *** 1295,1299 **** Hashtable slothash = jobRes.getSlotHash(); Enumeration enum = slothash.keys(); ! TreeMap tree = new TreeMap(); NodeID local; for (int i=0; i<len; i++) { --- 1295,1299 ---- Hashtable slothash = jobRes.getSlotHash(); Enumeration enum = slothash.keys(); ! Map tree = Collections.synchronizedMap(new TreeMap()); NodeID local; for (int i=0; i<len; i++) { *************** *** 1353,1357 **** Hashtable slothash = jobRes.getSlotHash(); Enumeration enum = slothash.keys(); ! TreeMap tree = new TreeMap(); NodeID nodeID; for (int i=0; i<len; i++) { --- 1353,1357 ---- Hashtable slothash = jobRes.getSlotHash(); Enumeration enum = slothash.keys(); ! Map tree = Collections.synchronizedMap(new TreeMap()); NodeID nodeID; for (int i=0; i<len; i++) { |
From: Aaron S. <mau...@us...> - 2004-03-29 22:36:37
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/sched In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6933/src/unm/maui/sched Modified Files: BasicPrio.java Sched.java Log Message: It's annoying that TreeMap is not synchronized. Index: BasicPrio.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/BasicPrio.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BasicPrio.java 4 Mar 2004 00:51:04 -0000 1.8 --- BasicPrio.java 29 Mar 2004 22:25:06 -0000 1.9 *************** *** 266,270 **** * @see Prioritizer#prioritize */ ! public void prioritize (MauiDB db, HashTree queue) throws MauiException { --- 266,270 ---- * @see Prioritizer#prioritize */ ! public synchronized void prioritize (MauiDB db, HashTree queue) throws MauiException { Index: Sched.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/Sched.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Sched.java 25 Mar 2004 22:20:25 -0000 1.25 --- Sched.java 29 Mar 2004 22:25:06 -0000 1.26 *************** *** 80,84 **** * Master Reservations (sorted by finishtime). */ ! protected HashTree reservations = (HashTree)Collections.synchronizedMap(new HashTree()); /** --- 80,84 ---- * Master Reservations (sorted by finishtime). */ ! protected HashTree reservations = new HashTree(); /** *************** *** 108,112 **** * @see Prioritizer */ ! protected HashTree queue = (HashTree)Collections.synchronizedMap(new HashTree()); /** --- 108,112 ---- * @see Prioritizer */ ! protected HashTree queue = new HashTree(); /** |
From: Aaron S. <mau...@us...> - 2004-03-29 22:36:37
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6933/src/unm/maui/client Modified Files: MauiUser.java ShowQueue.java Log Message: It's annoying that TreeMap is not synchronized. Index: MauiUser.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/client/MauiUser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MauiUser.java 25 Mar 2004 22:20:25 -0000 1.2 --- MauiUser.java 29 Mar 2004 22:25:03 -0000 1.3 *************** *** 108,112 **** * Hashtable of feature value mapping. */ ! protected TreeMap mapHash = (TreeMap)Collections.synchronizedMap(new TreeMap()); /** --- 108,112 ---- * Hashtable of feature value mapping. */ ! protected Map mapHash = Collections.synchronizedMap(new TreeMap()); /** Index: ShowQueue.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/client/ShowQueue.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ShowQueue.java 25 Mar 2004 22:20:25 -0000 1.13 --- ShowQueue.java 29 Mar 2004 22:25:06 -0000 1.14 *************** *** 81,87 **** private String headerRes = ""; ! private TreeMap activeTree = (TreeMap)Collections.synchronizedMap(new TreeMap()); ! private TreeMap queuedTree = (TreeMap)Collections.synchronizedMap(new TreeMap()); ! private TreeMap resTree = (TreeMap)Collections.synchronizedMap(new TreeMap()); /** --- 81,87 ---- private String headerRes = ""; ! private Map activeTree = Collections.synchronizedMap(new TreeMap()); ! private Map queuedTree = Collections.synchronizedMap(new TreeMap()); ! private Map resTree = Collections.synchronizedMap(new TreeMap()); /** |
From: Aaron S. <mau...@us...> - 2004-03-29 22:36:37
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/rm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6933/src/unm/maui/rm Modified Files: Slot.java Log Message: It's annoying that TreeMap is not synchronized. Index: Slot.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/rm/Slot.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Slot.java 25 Mar 2004 22:20:25 -0000 1.7 --- Slot.java 29 Mar 2004 22:25:06 -0000 1.8 *************** *** 67,71 **** // Tree of ReservationIDs sorted in order of starttime. ! private TreeMap reservations = (TreeMap)Collections.synchronizedMap(new TreeMap()); private Reservation[] rezes = new Reservation[0]; --- 67,71 ---- // Tree of ReservationIDs sorted in order of starttime. ! private TreeMap reservations = new TreeMap(); private Reservation[] rezes = new Reservation[0]; *************** *** 105,109 **** * @param resID ReservationID */ ! public void addReservation (Reservation res) { reservations.put(new Long(res.getStartTime()), res); genReservationArray(); --- 105,109 ---- * @param resID ReservationID */ ! public synchronized void addReservation (Reservation res) { reservations.put(new Long(res.getStartTime()), res); genReservationArray(); *************** *** 114,118 **** * @param resID ReservationID */ ! public void cancelReservation (Reservation res) { if (res == null) { --- 114,118 ---- * @param resID ReservationID */ ! public synchronized void cancelReservation (Reservation res) { if (res == null) { *************** *** 178,182 **** * @return boolean */ ! public boolean isActive () { Long key = null; try { --- 178,182 ---- * @return boolean */ ! public synchronized boolean isActive () { Long key = null; try { |
From: Aaron S. <mau...@us...> - 2004-03-25 22:31:23
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/wiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591/src/unm/maui/wiki Modified Files: Wiki.java Log Message: safety save Index: Wiki.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/wiki/Wiki.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Wiki.java 22 Apr 2003 20:22:24 -0000 1.27 --- Wiki.java 25 Mar 2004 22:20:25 -0000 1.28 *************** *** 755,759 **** int len = wikiNodesHash.size(); Enumeration enum = wikiNodesHash.keys(); ! TreeMap tree = new TreeMap(); for (int i=0; i<len; i++) { nodeID = (NodeID)enum.nextElement(); --- 755,759 ---- int len = wikiNodesHash.size(); Enumeration enum = wikiNodesHash.keys(); ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); for (int i=0; i<len; i++) { nodeID = (NodeID)enum.nextElement(); |
From: Aaron S. <mau...@us...> - 2004-03-25 22:31:23
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/sched In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591/src/unm/maui/sched Modified Files: Sched.java Log Message: safety save Index: Sched.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/Sched.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Sched.java 14 Feb 2004 09:30:46 -0000 1.24 --- Sched.java 25 Mar 2004 22:20:25 -0000 1.25 *************** *** 80,84 **** * Master Reservations (sorted by finishtime). */ ! protected HashTree reservations = new HashTree(); /** --- 80,84 ---- * Master Reservations (sorted by finishtime). */ ! protected HashTree reservations = (HashTree)Collections.synchronizedMap(new HashTree()); /** *************** *** 108,112 **** * @see Prioritizer */ ! protected HashTree queue = new HashTree(); /** --- 108,112 ---- * @see Prioritizer */ ! protected HashTree queue = (HashTree)Collections.synchronizedMap(new HashTree()); /** |
From: Aaron S. <mau...@us...> - 2004-03-25 22:31:23
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591/src/unm/maui/server Modified Files: CheckJob.java CheckNode.java CheckRes.java Log Message: safety save Index: CheckJob.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/CheckJob.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CheckJob.java 12 Oct 2002 06:29:24 -0000 1.11 --- CheckJob.java 25 Mar 2004 22:20:25 -0000 1.12 *************** *** 120,124 **** buf.append("<nodes>\n"); Enumeration enum = slotHash.keys(); ! TreeMap tree = new TreeMap(); NodeID nodeID; while (enum.hasMoreElements()) { --- 120,124 ---- buf.append("<nodes>\n"); Enumeration enum = slotHash.keys(); ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); NodeID nodeID; while (enum.hasMoreElements()) { Index: CheckNode.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/CheckNode.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CheckNode.java 3 Apr 2003 18:47:58 -0000 1.9 --- CheckNode.java 25 Mar 2004 22:20:25 -0000 1.10 *************** *** 125,129 **** } else if (verbose) { // verbose ! TreeMap tree = new TreeMap(features);// ordering Object[] keys = tree.keySet().toArray(); int len = keys.length; --- 125,129 ---- } else if (verbose) { // verbose ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap(features));// ordering Object[] keys = tree.keySet().toArray(); int len = keys.length; Index: CheckRes.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/CheckRes.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CheckRes.java 13 Apr 2002 10:04:05 -0000 1.9 --- CheckRes.java 25 Mar 2004 22:20:25 -0000 1.10 *************** *** 114,118 **** +"' slotscount='"+res.getSlotsCount()+"'>\n"); Enumeration enum = slotHash.keys(); ! TreeMap tree = new TreeMap(); NodeID nodeID; while (enum.hasMoreElements()) { --- 114,118 ---- +"' slotscount='"+res.getSlotsCount()+"'>\n"); Enumeration enum = slotHash.keys(); ! TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); NodeID nodeID; while (enum.hasMoreElements()) { |
From: Aaron S. <mau...@us...> - 2004-03-25 22:31:23
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/rm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591/src/unm/maui/rm Modified Files: Slot.java Log Message: safety save Index: Slot.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/rm/Slot.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Slot.java 5 Jan 2003 22:26:25 -0000 1.6 --- Slot.java 25 Mar 2004 22:20:25 -0000 1.7 *************** *** 67,71 **** // Tree of ReservationIDs sorted in order of starttime. ! private TreeMap reservations = new TreeMap(); private Reservation[] rezes = new Reservation[0]; --- 67,71 ---- // Tree of ReservationIDs sorted in order of starttime. ! private TreeMap reservations = (TreeMap)Collections.synchronizedMap(new TreeMap()); private Reservation[] rezes = new Reservation[0]; |
From: Aaron S. <mau...@us...> - 2004-03-25 22:31:23
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591/src/unm/util Modified Files: HashTree.java Log Message: safety save Index: HashTree.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/util/HashTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HashTree.java 14 Apr 2002 01:31:09 -0000 1.2 --- HashTree.java 25 Mar 2004 22:20:26 -0000 1.3 *************** *** 51,54 **** --- 51,57 ---- * HACK NOTE This is incomplete, we need to override other TreeMap * functions... + * <p> + * For synchronized access, you should create this like so: + * HashTree ht = (HashTree)Collections.synchronizedMap(new HashTree()); */ public class HashTree extends TreeMap { *************** *** 227,231 **** private Hashtable hash = new Hashtable(); // Hash of Integer -> value ! private TreeMap tree = new TreeMap(); private Object parentkey; int counter = 0; --- 230,234 ---- private Hashtable hash = new Hashtable(); // Hash of Integer -> value ! private TreeMap tree = (TreeMap)Collections.synchronizedMap(new TreeMap()); private Object parentkey; int counter = 0; |
From: Aaron S. <mau...@us...> - 2004-03-25 22:31:17
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591/src/unm/maui/client Modified Files: MauiUser.java ShowQueue.java Log Message: safety save Index: MauiUser.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/client/MauiUser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MauiUser.java 17 Jan 2004 09:48:54 -0000 1.1 --- MauiUser.java 25 Mar 2004 22:20:25 -0000 1.2 *************** *** 108,112 **** * Hashtable of feature value mapping. */ ! protected TreeMap mapHash = new TreeMap(); /** --- 108,112 ---- * Hashtable of feature value mapping. */ ! protected TreeMap mapHash = (TreeMap)Collections.synchronizedMap(new TreeMap()); /** Index: ShowQueue.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/client/ShowQueue.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ShowQueue.java 8 Apr 2002 19:45:28 -0000 1.12 --- ShowQueue.java 25 Mar 2004 22:20:25 -0000 1.13 *************** *** 81,87 **** private String headerRes = ""; ! private TreeMap activeTree = new TreeMap(); ! private TreeMap queuedTree = new TreeMap(); ! private TreeMap resTree = new TreeMap(); /** --- 81,87 ---- private String headerRes = ""; ! private TreeMap activeTree = (TreeMap)Collections.synchronizedMap(new TreeMap()); ! private TreeMap queuedTree = (TreeMap)Collections.synchronizedMap(new TreeMap()); ! private TreeMap resTree = (TreeMap)Collections.synchronizedMap(new TreeMap()); /** |
From: Aaron S. <mau...@us...> - 2004-03-25 22:31:16
|
Update of /cvsroot/mauischeduler/mauisched In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591 Modified Files: ChangeLog Log Message: safety save Index: ChangeLog =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ChangeLog 25 Oct 2003 23:23:09 -0000 1.13 --- ChangeLog 25 Mar 2004 22:20:25 -0000 1.14 *************** *** 1,2 **** --- 1,15 ---- + Thu Mar 25 12:29:46 HST 2004 Aaron <mau...@us...> + * Believe I fixed a synchronization bug when using TreeMaps + which was causing random NPEs. + + Fri Jan 16 23:50:54 HST 2004 Aaron <mau...@us...> + + * Added support for min QoS value in DB table prio_qos. + Previously we had just assumed the value of 0. + + * Added a new "checkuser" command that can provide a mapping + of attributes of running jobs and reservation to the + nodes/slots they are active on. + Thu Oct 16 21:59:22 HST 2003 Aaron <mau...@us...> |
From: Aaron S. <mau...@us...> - 2004-03-04 01:11:54
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/sched In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6127/src/unm/maui/sched Modified Files: BasicPolicy.java BasicPrio.java Log Message: bugfix: use "normalized" QoS value for determining policy ... Index: BasicPolicy.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/BasicPolicy.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** BasicPolicy.java 31 Oct 2003 01:15:39 -0000 1.11 --- BasicPolicy.java 4 Mar 2004 00:51:04 -0000 1.12 *************** *** 114,118 **** charge = db.getColumn("sysbank", "charge_if_low_qos", "auth", auth); ! if ((job.getQos() > low_qos) || charge.equalsIgnoreCase("Y")) { if (Log.logging("sched")) { Log.out.println("pre debiting bank for "+slotsecs+" slotsecs for job="+job); --- 114,120 ---- charge = db.getColumn("sysbank", "charge_if_low_qos", "auth", auth); ! int normalized_qos = BasicPrio.getNormalizedQos(db, job); ! ! if ((normalized_qos > low_qos) || charge.equalsIgnoreCase("Y")) { if (Log.logging("sched")) { Log.out.println("pre debiting bank for "+slotsecs+" slotsecs for job="+job); Index: BasicPrio.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/BasicPrio.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BasicPrio.java 17 Jan 2004 09:50:37 -0000 1.7 --- BasicPrio.java 4 Mar 2004 00:51:04 -0000 1.8 *************** *** 56,60 **** * @param job Job * @return int[] min, max ! * @exception SchedException if something goes wrong */ public static int[] getQosMinMax (MauiDB db, Job job) --- 56,60 ---- * @param job Job * @return int[] min, max ! * @exception MauiException if something goes wrong */ public static int[] getQosMinMax (MauiDB db, Job job) *************** *** 143,203 **** /** ! * Construct. ! */ ! public BasicPrio () { ! } ! ! /** ! * @see Prioritizer#assignProperties ! */ ! public void assignProperties ( ! String prefix, Properties props) ! { ! } ! ! /** ! * @see Prioritizer#prioritize ! */ ! public void prioritize (MauiDB db, HashTree queue) ! throws MauiException ! { ! // get jobs ! Object[] jobs = queue.htInFix(); ! int len = jobs.length; ! ! // drain queue and refit ! queue.clear(); ! for (int i=0; i<len; i++) { ! Job job = (Job)jobs[i]; ! fitJob(db, queue, job); ! } ! } ! ! /** ! * @see Prioritizer#fitJob ! */ ! public void fitJob (MauiDB db, HashTree queue, Job job) ! throws MauiException ! { ! // handle job QoS ! getQos(db, job); ! ! // calculate final priority ! int prio = job.getQos(); ! ! // insert job into queue in priority order ! queue.htPut(new Integer(prio), job.getJobID(), job); ! } ! ! /** ! * Get job QoS. * <p> * This gets the appropriate QoS value for the job from the ! * database. It sets the QoS on the job. * @param db MauiDB * @param job Job * @exception SchedException if something goes wrong */ ! protected int getQos (MauiDB db, Job job) throws MauiException { --- 143,156 ---- /** ! * Get Normalized Job QoS. * <p> * This gets the appropriate QoS value for the job from the ! * database. * @param db MauiDB * @param job Job + * @return int QoS * @exception SchedException if something goes wrong */ ! public static int getNormalizedQos (MauiDB db, Job job) throws MauiException { *************** *** 240,244 **** } qos = Integer.parseInt(str); - job.setQos(qos); return qos; } --- 193,196 ---- *************** *** 294,297 **** --- 246,313 ---- } + return qos; + } + + /** + * Construct. + */ + public BasicPrio () { + } + + /** + * @see Prioritizer#assignProperties + */ + public void assignProperties ( + String prefix, Properties props) + { + } + + /** + * @see Prioritizer#prioritize + */ + public void prioritize (MauiDB db, HashTree queue) + throws MauiException + { + // get jobs + Object[] jobs = queue.htInFix(); + int len = jobs.length; + + // drain queue and refit + queue.clear(); + for (int i=0; i<len; i++) { + Job job = (Job)jobs[i]; + fitJob(db, queue, job); + } + } + + /** + * @see Prioritizer#fitJob + */ + public void fitJob (MauiDB db, HashTree queue, Job job) + throws MauiException + { + // handle job QoS + getQos(db, job); + + // calculate final priority + int prio = job.getQos(); + + // insert job into queue in priority order + queue.htPut(new Integer(prio), job.getJobID(), job); + } + + /** + * Get job QoS. + * <p> + * This gets the appropriate QoS value for the job from the + * database. It sets the QoS on the job. + * @param db MauiDB + * @param job Job + * @exception SchedException if something goes wrong + */ + protected int getQos (MauiDB db, Job job) + throws MauiException + { + int qos = getNormalizedQos(db, job); // rest qos job.setQos(qos); |
From: Aaron S. <mau...@us...> - 2004-02-14 09:37:06
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/sched In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6067 Modified Files: Sched.java Log Message: tweak Index: Sched.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/Sched.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Sched.java 6 Feb 2004 00:07:55 -0000 1.23 --- Sched.java 14 Feb 2004 09:30:46 -0000 1.24 *************** *** 760,766 **** for (int i=0; i<len; i++) { res = rezes[i]; ! String rid = res.getReservationID(); ! if ((rid != null) && rid.equals(resID)) { ! return res; } } --- 760,768 ---- for (int i=0; i<len; i++) { res = rezes[i]; ! if (res != null) { ! String rid = res.getReservationID(); ! if ((rid != null) && rid.equals(resID)) { ! return res; ! } } } |
From: Aaron S. <mau...@us...> - 2004-02-06 00:10:35
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/sched In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10287/src/unm/maui/sched Modified Files: Sched.java Log Message: fix possible race-condition-induced NPE Index: Sched.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/Sched.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Sched.java 3 Jun 2003 01:17:32 -0000 1.22 --- Sched.java 6 Feb 2004 00:07:55 -0000 1.23 *************** *** 760,764 **** for (int i=0; i<len; i++) { res = rezes[i]; ! if (res.getReservationID().equals(resID)) { return res; } --- 760,765 ---- for (int i=0; i<len; i++) { res = rezes[i]; ! String rid = res.getReservationID(); ! if ((rid != null) && rid.equals(resID)) { return res; } |
From: Aaron S. <mau...@us...> - 2004-01-17 09:50:40
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/sched In directory sc8-pr-cvs1:/tmp/cvs-serv6556 Modified Files: BasicPrio.java Log Message: min QoS changes for tfahey & HPCMP Index: BasicPrio.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/sched/BasicPrio.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** BasicPrio.java 14 Apr 2002 01:49:05 -0000 1.6 --- BasicPrio.java 17 Jan 2004 09:50:37 -0000 1.7 *************** *** 66,70 **** String str, auths; Vector vec = new Vector(3); ! int min=Integer.MAX_VALUE, max=Integer.MIN_VALUE, qos; // get DB uuser and QoS auth types --- 66,70 ---- String str, auths; Vector vec = new Vector(3); ! Vector vec2 = new Vector(3); // get DB uuser and QoS auth types *************** *** 95,103 **** } ! // getQoS str = db.getColumn("prio_qos", "max", "auth", auth); if (str != null) { vec.addElement(str); } } } catch (Exception e) { --- 95,109 ---- } ! // getQoS upperbound str = db.getColumn("prio_qos", "max", "auth", auth); if (str != null) { vec.addElement(str); } + + // getQoS lowerbound + str = db.getColumn("prio_qos", "min", "auth", auth); + if (str != null) { + vec2.addElement(str); + } } } catch (Exception e) { *************** *** 106,109 **** --- 112,116 ---- // find max and min values of the selected QoS upperbounds + int min=Integer.MAX_VALUE, max=Integer.MIN_VALUE; int size = vec.size(); for (int i=0; i<size; i++) { *************** *** 118,122 **** } ! return new int[] {min, max}; } --- 125,143 ---- } ! // find max and min values of the selected QoS lowerbounds ! int lowmin=Integer.MAX_VALUE, lowmax=Integer.MIN_VALUE; ! size = vec2.size(); ! for (int i=0; i<size; i++) { ! str = (String)vec2.elementAt(i); ! int val = Integer.parseInt(str); ! if (val > lowmax) { ! lowmax = val; ! } ! if (val < lowmin) { ! lowmin = val; ! } ! } ! ! return new int[] {min, max, lowmin, lowmax}; } *************** *** 224,229 **** int[] mm = getQosMinMax(db, job); ! int min = mm[0]; ! int max = mm[1]; // check whether ORing or ANDing QoS values --- 245,252 ---- int[] mm = getQosMinMax(db, job); ! int min = mm[0]; ! int max = mm[1]; ! int lowmin = mm[2]; ! int lowmax = mm[3]; // check whether ORing or ANDing QoS values *************** *** 245,263 **** if (AND) { // ANDing all ranges, job QoS must be at or below smallest ! // upperbound if (qos > min) { ! Log.out.println("QoS for job "+job+" reset to "+min); qos = min; } else { ! Log.out.println("QoS for job "+job+" is "+qos); } } else { // ORing all ranges, job QoS must be at or below largest ! // upperbound if (qos > max) { ! Log.out.println("QoS for job "+job+" reset to "+max); qos = max; } else { ! Log.out.println("QoS for job "+job+" is "+qos); } } --- 268,294 ---- if (AND) { // ANDing all ranges, job QoS must be at or below smallest ! // upperbound and at or above largest lowerbound ! if (qos < lowmax) { ! Log.out.println("AND: QoS for job "+job+" reset to min "+lowmax); ! qos = lowmax; ! } if (qos > min) { ! Log.out.println("AND: QoS for job "+job+" reset to "+min); qos = min; } else { ! Log.out.println("AND: QoS for job "+job+" is "+qos); } } else { // ORing all ranges, job QoS must be at or below largest ! // upperbound and at or above smallest lowerbound ! if (qos < lowmin) { ! Log.out.println("OR: QoS for job "+job+" reset to min "+lowmin); ! qos = lowmin; ! } if (qos > max) { ! Log.out.println("OR: QoS for job "+job+" reset to "+max); qos = max; } else { ! Log.out.println("OR: QoS for job "+job+" is "+qos); } } |
From: Aaron S. <mau...@us...> - 2004-01-17 09:50:12
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/server In directory sc8-pr-cvs1:/tmp/cvs-serv6439 Modified Files: ResControl.java Log Message: QoS minimum value change for tfahey & HPCMP Index: ResControl.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/ResControl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ResControl.java 14 Apr 2002 01:49:05 -0000 1.3 --- ResControl.java 17 Jan 2004 09:50:09 -0000 1.4 *************** *** 121,133 **** MauiDB db = scheduler.getDB(); ! // get max QoS int[] mm = BasicPrio.getQosMinMax(db, job); ! int max = mm[1]; ! // make sure QoS is not above max configured int q = Integer.parseInt(qos); ! if (q > max) { ! q = max; ! mesg = "QoS set to configured limit of "+max; } job.setQos(q); --- 121,141 ---- MauiDB db = scheduler.getDB(); ! // get large range min/max QoS (ORing) int[] mm = BasicPrio.getQosMinMax(db, job); ! int max = mm[1]; ! int lowmin = mm[2]; ! // make sure QoS is not above min/max configured int q = Integer.parseInt(qos); ! if ((q < lowmin) || (q > max)) { ! mesg = ""; ! if (q < lowmin) { ! q = lowmin; ! mesg += "QoS set to configured min limit of "+lowmin+" "; ! } ! if (q > max) { ! q = max; ! mesg += "QoS set to configured max limit of "+max; ! } } job.setQos(q); |
From: Aaron S. <mau...@us...> - 2004-01-17 09:49:45
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/server In directory sc8-pr-cvs1:/tmp/cvs-serv6361 Modified Files: BasicWorker.java Added Files: CheckUser.java Log Message: Added "checkuser" command --- NEW FILE: CheckUser.java --- /* -*- mode: java; c-basic-indent: 4; tab-width: 8; indent-tabs-mode: nil -*- */ /* vim: set ts=8 sw=4 */ /* ******************************************************************* * * Copyright (C) 2000-2001 * The University of New Mexico * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: CheckUser.java,v 1.1 2004/01/17 09:49:42 mauisched Exp $ * * *******************************************************************/ package unm.maui.server; import java.util.*; import gnu.regexp.*; import unm.util.*; import unm.maui.*; import unm.maui.sched.*; import unm.maui.rm.*; import unm.maui.res.*; /** * CheckUser command handler. */ public class CheckUser extends CommHandlerImpl { /** * Construct. */ public CheckUser (Scheduler scheduler, String user) { super(scheduler, user); } /** * @see CommHandlerImpl#updateXML */ public String updateXML () throws MauiException { StringBuffer buf = new StringBuffer(XML_HEADER); long now = Misc.currentEpochTime(); buf.append("<mauiupdate version='0.5' update='nodeuserupdate' ts='"+now+"'>\n"); Node[] nodes; Slot[] slots; RM manager = scheduler.getRM(); RMID rmID = manager.getRMID(); buf.append("<nodeuserupdate rm='"+rmID+"'>\n"); // map slots to their running jobs Hashtable globalJobMap = new Hashtable(); Hashtable runHash = scheduler.getRunHash(); Enumeration enum = runHash.keys(); while (enum.hasMoreElements()) { String jobid = (String)enum.nextElement(); Job job = (Job)runHash.get(jobid); Reservation res = job.getReservation(); Hashtable slothash = res.getSlotHash(); Enumeration enum2 = slothash.elements(); while (enum2.hasMoreElements()) { SlotID[] slotids = (SlotID[])enum2.nextElement(); int lenj = slotids.length; for (int j=0; j<lenj; j++) { String slotid = ""+slotids[j]; Vector vec = (Vector)globalJobMap.get(slotid); if (vec == null) { vec = new Vector(); globalJobMap.put(slotid, vec); } vec.addElement(job); } } } // map slots to their reservations Hashtable globalRezMap = new Hashtable(); Reservation[] rezes = scheduler.getReservations(); int len = rezes.length; for (int i=0; i<len; i++) { Reservation res = rezes[i]; if (res instanceof SysReservation) { Hashtable slothash = res.getSlotHash(); Enumeration enum2 = slothash.elements(); while (enum2.hasMoreElements()) { SlotID[] slotids = (SlotID[])enum2.nextElement(); int lenj = slotids.length; for (int j=0; j<lenj; j++) { String slotid = ""+slotids[j]; Vector vec = (Vector)globalRezMap.get(slotid); if (vec == null) { vec = new Vector(); globalRezMap.put(slotid, vec); } vec.addElement(res); } } } } nodes = manager.getNodes(); for (int j=0; j<nodes.length; j++) { Node node = nodes[j]; buf.append("<node2 id='"+node+"'>\n"); slots = node.getSlots(); for (int k=0; k<slots.length; k++) { Slot slot = slots[k]; String slotid = slot.getSlotID().toString(); Vector jobvec = (Vector)globalJobMap.get(slotid); Vector resvec = (Vector)globalRezMap.get(slotid); int jsize=0; int rsize=0; if (jobvec != null) { jsize = jobvec.size(); } if (resvec != null) { rsize = resvec.size(); } if ((jsize > 0) || (rsize > 0)) { buf.append("<slot2 id='"+slotid+"'>\n"); for (int l=0; l<jsize; l++) { Job job = (Job)jobvec.elementAt(l); String jobid = job.getJobID(); String user = job.getUser(); String group = job.getGroup(); String account = job.getAccount(); buf.append("<slotuser jobid='").append(jobid).append("' user='") .append(user).append("' group='").append(group) .append("' account='").append(account).append("' />\n"); } for (int l=0; l<rsize; l++) { SysReservation res = (SysReservation)resvec.elementAt(l); String resid = res.getReservationID(); String auth = res.getAuth(); buf.append("<slotres resid='").append(resid).append("' auth='") .append(auth).append("' />\n"); } buf.append("</slot2>\n"); } else { buf.append("<slot2 id='"+slotid+"' />\n"); } } buf.append("</node2>\n"); } buf.append("</nodeuserupdate></mauiupdate>\n"); return buf.toString(); } } Index: BasicWorker.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/server/BasicWorker.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** BasicWorker.java 29 May 2003 09:00:09 -0000 1.10 --- BasicWorker.java 17 Jan 2004 09:49:42 -0000 1.11 *************** *** 409,412 **** --- 409,418 ---- String feature = atts.getValue("feature"); mesg = (new CheckNode(scheduler, user, id, verb, feature)).updateXML(); + } else if (qName.equals("checkuser")) { + if (Log.logging("server")) { + Log.out.println("checkuser"); + } + String user = atts.getValue("user"); + mesg = (new CheckUser(scheduler, user)).updateXML(); } else if (qName.equals("showq")) { if (Log.logging("server")) { |
From: Aaron S. <mau...@us...> - 2004-01-17 09:48:57
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui/client In directory sc8-pr-cvs1:/tmp/cvs-serv6264 Added Files: MauiUser.java Log Message: added "checkuser" command --- NEW FILE: MauiUser.java --- /* -*- mode: java; c-basic-indent: 4; tab-width: 8; indent-tabs-mode: nil -*- */ /* vim: set ts=8 sw=4 */ /* ******************************************************************* * * Copyright (C) 2000-2001 * The University of New Mexico * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: MauiUser.java,v 1.1 2004/01/17 09:48:54 mauisched Exp $ * * *******************************************************************/ package unm.maui.client; import java.util.*; import java.net.*; import java.io.*; import gnu.getopt.*; import org.xml.sax.*; import unm.util.*; import unm.maui.*; import unm.maui.misc.*; /** * MauiUser. */ public class MauiUser extends CryptixClient { /** * Documentation representation of a Node. */ protected static class DocNode { public String id; public String host; public Stack slots=new Stack(); public DocNode (String id) { this.id = id; this.host = unm.maui.wiki.Wiki.getHostPart(id); } } /** * Documentation representation of a Slot. */ protected static class DocSlot { public String id; public Vector slotusers=new Vector(); public Vector slotrezes=new Vector(); public DocSlot (String id) { this.id = id; } } /** * Mapping features. */ protected boolean mapping = false; /** * Show reservations instead of jobs. */ protected String other = null; /** * Show job username. */ protected boolean do_user; /** * Show job group. */ protected boolean do_group; /** * Show job account. */ protected boolean do_account; /** * Show jobID. */ protected boolean do_jobid; /** * Stack of nodes. */ protected Stack nodesStack = new Stack(); /** * Hashtable of feature value mapping. */ protected TreeMap mapHash = new TreeMap(); /** * ASCII mapping character. */ protected byte nextChar = 0x41; /** * Output line width in chars. */ protected int outputw = 79; private String cluster = null; private int doing = 0x0; private int maxcellw = 0; /** * Construct. */ public MauiUser (String user, String group, String comm) throws SAXException { super(user, group, comm); // extra arguments... xargs = "\n\t-m | --map\t\tshow mapping (visual printouts)"+ "\n\t-w | --width <chars>\tdisplay width for visual mode (default: "+outputw+")"+ "\n"+ "\n\t-j | --jobid\t\tshow jobid (default)"+ "\n\t-u | --user\t\tshow user"+ "\n\t-g | --group\t\tshow UNIX group"+ "\n\t-a | --account\t\tshow account"+ "\n"+ "\n\t-o | --other <id>\t\tshow reservation id"; baseopts += "o:Azmugajw:"; LongOpt[] lopts = new LongOpt[longopts.length+9]; System.arraycopy(longopts, 0, lopts, 0, longopts.length); lopts[lopts.length-9] = new LongOpt("other", LongOpt.REQUIRED_ARGUMENT, null, 'o'); lopts[lopts.length-8] = new LongOpt("auth", LongOpt.NO_ARGUMENT, null, 'A'); lopts[lopts.length-7] = new LongOpt("resid", LongOpt.NO_ARGUMENT, null, 'z'); lopts[lopts.length-6] = new LongOpt("map", LongOpt.NO_ARGUMENT, null, 'm'); lopts[lopts.length-5] = new LongOpt("user", LongOpt.NO_ARGUMENT, null, 'u'); lopts[lopts.length-4] = new LongOpt("group", LongOpt.NO_ARGUMENT, null, 'g'); lopts[lopts.length-3] = new LongOpt("account", LongOpt.NO_ARGUMENT, null, 'a'); lopts[lopts.length-2] = new LongOpt("jobid", LongOpt.NO_ARGUMENT, null, 'j'); lopts[lopts.length-1] = new LongOpt("width", LongOpt.REQUIRED_ARGUMENT, null, 'w'); longopts = lopts; mapHash.put("Empty", new Byte((byte)'.')); } /** * Handle argument. */ protected void handleArg (Getopt g, int c) { switch (c) { case 'o': other = g.getOptarg(); break; case 'm': mapping = true; break; case 'u': do_user = true; break; case 'g': do_group = true; break; case 'a': do_account = true; break; case 'j': do_jobid = true; break; case 'w': try { outputw = Integer.parseInt(g.getOptarg()); } catch (NumberFormatException nfe) { System.out.println("specify an integer value for the width!"); usage(); } break; default: System.out.println("No such argument `"+c+"'"); usage(); break; } } /** * Parse arguments. */ protected Getopt parseArgs (String comm, String[] args) { Getopt g = super.parseArgs(comm, args); // get remaining tokens for (int i = g.getOptind(); i < args.length ; i++) { } if (!do_user && !do_group && !do_account && !do_jobid) { do_user = true; } return g; } /** * Get XML command string. * @return String */ public String toXML () { StringBuffer buf = new StringBuffer(XML_HEADER); long now = Misc.currentEpochTime(); buf.append("<mauicomm version='0.5' comm='"+comm+"' ts='").append(now).append("'>\n"); buf.append("<"+comm+" user='").append(user).append("'/>\n"); buf.append("</mauicomm>\n"); return buf.toString(); } /** * Perform client command. */ public void command () throws Exception { mesg = toXML(); // connect Socket sock = new Socket(host, port); // send message sendMessage(sock.getOutputStream()); // recv message mesg = new String(recvMessage(sock.getInputStream())); if (rawpacket) { // print raw message System.out.print(mesg); System.out.flush(); System.out.close(); return; } exception = null; try { xr.parse(new InputSource(new StringReader(mesg))); } catch (Exception e) { if (!isReallyOK) { System.err.println(e.getMessage()); } } if (exception != null) { throw exception; } } // --------------------------------------------------------------- // Parser Callbacks ... // --------------------------------------------------------------- public void startElement (String uri, String name, String qName, Attributes atts) { super.startElement(uri, name, qName, atts); if (exception != null) { // don't bother continuing processing if there was an // error return; } DocNode node; DocSlot slot; int size = nodesStack.size(); int len; if (qName.equals("nodeuserupdate")) { cluster = atts.getValue("rm"); if (!mapping) { //System.out.println("RM="+cluster); } } else if (qName.equals("node2")) { String id = atts.getValue("id"); node = new DocNode(id); nodesStack.push(node); } else if (qName.equals("slot2")) { String id = atts.getValue("id"); slot = new DocSlot(id); node = (DocNode)nodesStack.peek(); node.slots.push(slot); } else if (qName.equals("slotuser") && (other == null)) { String jobid = atts.getValue("jobid"); String user = atts.getValue("user"); String group = atts.getValue("group"); String account = atts.getValue("account"); node = (DocNode)nodesStack.peek(); slot = (DocSlot)node.slots.peek(); String nodeid = node.id; String val = ""; if (do_jobid) { val += jobid+" "; } if (do_user) { val += user+" "; } if (do_group) { val += group+" "; } if (do_account) { val += account+" "; } if (!mapping) { System.out.println(nodeid+" = "+val); } else { if (!mapHash.containsKey(val)) { mapHash.put(val, new Byte(nextChar++)); } slot.slotusers.addElement(val); } } else if (qName.equals("slotres") && (other != null)) { String resid = atts.getValue("resid"); String auth = atts.getValue("auth"); node = (DocNode)nodesStack.peek(); slot = (DocSlot)node.slots.peek(); String nodeid = node.id; String val = resid; if (resid.equals(other)) { if (!mapping) { System.out.println(nodeid+" = "+val); } else { if (!mapHash.containsKey(val)) { mapHash.put(val, new Byte(nextChar++)); } slot.slotrezes.addElement(val); } } } } public void endElement (String uri, String name, String qName) { super.endElement(uri, name, qName); if (exception != null) { return; } if (!qName.equals("mauiupdate") || !mapping) { return; } if (mapping) { // print mapping features printVisualMap(); } } // --------------------------------------------------------------- // ASC HACK NOTE: gawd this is nasty protected void printVisualMap () { try { String pad = new String(new byte[outputw]); pad = pad.replace('\0', ' '); final String div = pad.replace(' ', '-'); // print header Vector mapStrings = null; System.out.println(div); String type = (other != null) ? "reservation" : "job"; String str = "|Cluster="+cluster+" showing "+type+" map"; System.out.println(str+pad.substring(0, outputw-str.length()-1)+"|"); Object[] keys = mapHash.keySet().toArray(); int keylen=keys.length; for (int i=0; i<keylen; i++) { String key = (String)keys[i]; byte b = ((Byte)mapHash.get(key)).byteValue(); str = "|"+key+" => "+(char)b; System.out.println(str+pad.substring(0, outputw-str.length()-1)+"|"); } // ignore beginning and ending `|' spacers outputw -= 2; // print out the mapping System.out.println(div); int size = nodesStack.size(); Vector hostsVec = new Vector(); for (int i=0; i<=size; i++) { DocNode node = null; Stack slots = null; if (i<size) { node = (DocNode)nodesStack.elementAt(i); slots = (Stack)node.slots; } if ((i==size) || (i%outputw == 0)) { if (mapStrings != null) { int len = mapStrings.size(); for (int l=0; l<len; l++) { String mapString = (String)mapStrings.elementAt(l); System.out.println("|"+mapString+pad.substring(0, outputw-mapString.length())+"|s"+l); } // output names in vertical column format int vecsize = hostsVec.size(); for (int j=0; j<maxcellw; j++) { String hostline = ""; for (int k=0; k<vecsize; k++) { String host = (String)hostsVec.elementAt(k); if (j < host.length()) { hostline += host.charAt(j); } else { hostline += ' '; } } System.out.println("|"+hostline+pad.substring(0, outputw-hostline.length())+"|"); } System.out.println("|"+pad.substring(0, outputw)+"|"); } if (i==size) { break; } hostsVec = new Vector(); int len = slots.size(); mapStrings=new Vector(len); for (int j=0; j<len; j++) { mapStrings.addElement(""); } } int len = slots.size(); for (int j=0; j<len; j++) { DocSlot slot = (DocSlot)slots.elementAt(j); String mapString = (String)mapStrings.elementAt(j); String val=null; if (other != null) { Vector vec = slot.slotrezes; if (vec.size() > 0) { val = (String)vec.elementAt(0); // ASC HACK NOTE: hardcoded ... } } else { Vector vec = slot.slotusers; if (vec.size() > 0) { val = (String)vec.elementAt(0); // ASC HACK NOTE: hardcoded ... } } byte b = 0x00; if (val == null) { b = ((Byte)mapHash.get("Empty")).byteValue(); } else { b = ((Byte)mapHash.get(val) ).byteValue(); } mapString += (char)b; mapStrings.setElementAt(mapString, j); } // save host int hostlen = node.host.length(); if (hostlen > maxcellw) { maxcellw = hostlen; } hostsVec.addElement(node.host); } System.out.println(div); } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); } } } |
From: Aaron S. <mau...@us...> - 2004-01-17 09:48:18
|
Update of /cvsroot/mauischeduler/mauisched/src/unm/maui In directory sc8-pr-cvs1:/tmp/cvs-serv6136 Modified Files: CryptixClient.java Log Message: added "checkuser" command Index: CryptixClient.java =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/unm/maui/CryptixClient.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CryptixClient.java 11 Apr 2002 20:56:24 -0000 1.11 --- CryptixClient.java 17 Jan 2004 09:48:15 -0000 1.12 *************** *** 210,213 **** --- 210,215 ---- } else if (comm.equals("checknode")) { client = new MauiNode(user, group, comm); + } else if (comm.equals("checkuser")) { + client = new MauiUser(user, group, comm); } else if (comm.equals("checkres")) { client = new MauiRes(user, group, comm); |
From: Aaron S. <mau...@us...> - 2004-01-17 09:47:44
|
Update of /cvsroot/mauischeduler/mauisched/share In directory sc8-pr-cvs1:/tmp/cvs-serv6038 Modified Files: mauicomm.dtd mauiupdate.dtd Log Message: added new "checkuser" XML command Index: mauicomm.dtd =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/share/mauicomm.dtd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mauicomm.dtd 17 Dec 2002 18:59:24 -0000 1.5 --- mauicomm.dtd 17 Jan 2004 09:47:41 -0000 1.6 *************** *** 2,6 **** <!ELEMENT mauicomm (canceljob | cancelres | checkjob | checknode | checkres | holdjob | ! mauicontrol | rescontrol | mauisubmit | releasejob | setres | showq)> <!ATTLIST mauicomm version NMTOKEN #REQUIRED --- 2,6 ---- <!ELEMENT mauicomm (canceljob | cancelres | checkjob | checknode | checkres | holdjob | ! checkuser | mauicontrol | rescontrol | mauisubmit | releasejob | setres | showq)> <!ATTLIST mauicomm version NMTOKEN #REQUIRED *************** *** 36,39 **** --- 36,44 ---- > + <!ELEMENT checkuser EMPTY> + <!ATTLIST checkuser + user NMTOKEN #REQUIRED + > + <!ELEMENT checkres EMPTY> <!ATTLIST checkres Index: mauiupdate.dtd =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/share/mauiupdate.dtd,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mauiupdate.dtd 12 Oct 2002 06:32:10 -0000 1.6 --- mauiupdate.dtd 17 Jan 2004 09:47:41 -0000 1.7 *************** *** 1,5 **** <!-- Maui Scheduler Update DTD (client/server protocol version 0.5) --> ! <!ELEMENT mauiupdate (queue | jobupdate | mauiresponse | nodeupdate | resupdate)> <!ATTLIST mauiupdate version NMTOKEN #REQUIRED --- 1,5 ---- <!-- Maui Scheduler Update DTD (client/server protocol version 0.5) --> ! <!ELEMENT mauiupdate (queue | jobupdate | mauiresponse | nodeuserupdate | nodeupdate | resupdate)> <!ATTLIST mauiupdate version NMTOKEN #REQUIRED *************** *** 19,22 **** --- 19,25 ---- <!ATTLIST nodeupdate rm CDATA #REQUIRED> + <!ELEMENT nodeuserupdate (node2*)> + <!ATTLIST nodeuserupdate rm CDATA #REQUIRED> + <!ELEMENT resupdate (resid, resstart, resduration, resstate, restype, authtype, auth, reslimits?, nodes? *************** *** 177,180 **** --- 180,186 ---- <!ATTLIST node id NMTOKEN #REQUIRED> + <!ELEMENT node2 (slot2*)> + <!ATTLIST node2 id NMTOKEN #REQUIRED> + <!ELEMENT reqfeatures (feature*)> *************** *** 182,185 **** --- 188,208 ---- <!ATTLIST slot id NMTOKEN #REQUIRED> + <!ELEMENT slot2 (slotuser*, slotres*)> + <!ATTLIST slot2 id NMTOKEN #REQUIRED> + + <!ELEMENT slotuser EMPTY> + <!ATTLIST slotuser + jobid NMTOKEN #IMPLIED + user NMTOKEN #IMPLIED + group NMTOKEN #IMPLIED + account NMTOKEN #IMPLIED + > + + <!ELEMENT slotres EMPTY> + <!ATTLIST slotres + resid NMTOKEN #IMPLIED + auth NMTOKEN #IMPLIED + > + <!ELEMENT reslimit EMPTY> <!ATTLIST reslimit |
From: Aaron S. <mau...@us...> - 2004-01-17 09:46:53
|
Update of /cvsroot/mauischeduler/mauisched/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv5919 Modified Files: maui_create_db.sh.in maui_upgrade_db.sh.in Log Message: changes for tfahey & HPCMP Index: maui_create_db.sh.in =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/scripts/maui_create_db.sh.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** maui_create_db.sh.in 25 Jul 2003 20:36:49 -0000 1.10 --- maui_create_db.sh.in 17 Jan 2004 09:46:49 -0000 1.11 *************** *** 197,200 **** --- 197,201 ---- # user, group, or account auth CHAR(255) NOT NULL PRIMARY KEY, + min INT NOT NULL DEFAULT 0, def INT NOT NULL DEFAULT 0, max INT NOT NULL DEFAULT 0, Index: maui_upgrade_db.sh.in =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/scripts/maui_upgrade_db.sh.in,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** maui_upgrade_db.sh.in 25 Jul 2003 20:36:49 -0000 1.6 --- maui_upgrade_db.sh.in 17 Jan 2004 09:46:49 -0000 1.7 *************** *** 109,114 **** ##################################################################### ! ALTER TABLE sysbank add column low_qos INT UNSIGNED NOT NULL DEFAULT 0; ! ALTER TABLE sysbank add column charge_if_low_qos ENUM("Y", "N") NOT NULL DEFAULT "Y"; OPTIMIZE TABLE sysbank; --- 109,114 ---- ##################################################################### ! ALTER TABLE sysbank ADD COLUMN low_qos INT UNSIGNED NOT NULL DEFAULT 0; ! ALTER TABLE sysbank ADD COLUMN charge_if_low_qos ENUM("Y", "N") NOT NULL DEFAULT "Y"; OPTIMIZE TABLE sysbank; *************** *** 122,124 **** --- 122,149 ---- fi + version=`echo 'SELECT version FROM admin ORDER BY time DESC LIMIT 1;' | mysql -N -uroot -p"$dbpass" $host $port @MAUI_DB@` + if [ "$version" -eq 3 ] ; then + # upgrade database to version 2 + cat<<EOF | mysql -N -uroot -p"$dbpass" $host $port + + USE @MAUI_DB@; + + ##################################################################### + # + # Maui Scheduler DB 3 --> 4 + # + ##################################################################### + + ALTER TABLE prio_qos ADD COLUMN min INT NOT NULL DEFAULT 0 AFTER auth; + OPTIMIZE TABLE prio_qos; + + INSERT INTO admin VALUES('4', NOW(), 'upgraded to 4'); + + EOF + if test "x$?" = 'x1' ; then \ + echo "cannot upgrade database to v4..." + exit 1 + fi + fi + echo "done!" |