[torqueusers] Bugs/glitches in torque 2.3.0?
Steve Snelgrove
ssnelgrove at clusterresources.com
Tue Apr 8 14:31:47 MDT 2008
Sorry, I generated the first patch out of the trunk and because of a
previous attempt at fixing the ncpus problem, the patch failed when I
ran it against 2.3. Here is a better one for 2.3.
-------------- next part --------------
Index: src/resmom/mom_server.c
===================================================================
--- src/resmom/mom_server.c (revision 2076)
+++ src/resmom/mom_server.c (revision 2077)
@@ -668,11 +668,24 @@
extern struct config *config_array;
+/**
+ * gen_size
+ *
+ * For the size attribute to be returned, it must be
+ * defined in the pbs_mom config file. The syntax
+ * is unique in that you must ask for the size of
+ * either a file or a file system.
+ *
+ * For example:
+ * size[fs=/]
+ * size[file=/home/user/test.txt]
+ */
void
gen_size(char *name,char **BPtr, int *BSpace)
{
struct config *ap;
struct rm_attribute *attr;
+ char *value;
ap = rm_search(config_array,name);
if (ap)
@@ -680,11 +693,15 @@
attr = momgetattr(ap->c_u.c_value);
if (attr)
{
- MUSNPrintF(BPtr,BSpace,"%s=%s",
- name,
- attr);
- (*BPtr)++; /* Need to start the next string after the null */
- (*BSpace)--;
+ value = dependent(name,attr);
+ if (value && *value)
+ {
+ MUSNPrintF(BPtr,BSpace,"%s=%s",
+ name,
+ value);
+ (*BPtr)++; /* Need to start the next string after the null */
+ (*BSpace)--;
+ }
}
}
}
Index: src/resmom/linux/mom_mach.c
===================================================================
--- src/resmom/linux/mom_mach.c (revision 2076)
+++ src/resmom/linux/mom_mach.c (revision 2077)
@@ -3330,14 +3330,11 @@
while (!feof(fp))
{
- if (fscanf(fp,"%s %*[^\n]%*c",
- label) != 1)
+ if (fscanf(fp,"%s %*[^\n]%*c", label) == 0)
{
- fclose(fp);
- return(NULL);
+ getc(fp); /* must do something to get to eof */
}
-
- if (strcmp("processor",label) == 0)
+ else if (strcmp("processor",label) == 0)
procs++;
}
More information about the torqueusers
mailing list