Skip to content
Snippets Groups Projects
Commit 0b30a844 authored by Moe Jette's avatar Moe Jette
Browse files

Minor tweaks for new makefiles. - Jette

parent e2ca5dbc
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,6 @@ slurmctld_SOURCES = Controller.c \ ...@@ -32,7 +32,6 @@ slurmctld_SOURCES = Controller.c \
#Mach_Stat_Mgr_CFLAGS = -DDEBUG_MODULE $(AM_CFLAGS) #Mach_Stat_Mgr_CFLAGS = -DDEBUG_MODULE $(AM_CFLAGS)
#Partition_Mgr_CFLAGS = -DDEBUG_MODULE $(AM_CFLAGS) #Partition_Mgr_CFLAGS = -DDEBUG_MODULE $(AM_CFLAGS)
#Read_Config_CFLAGS = -DDEBUG_MODULE $(AM_CFLAGS) #Read_Config_CFLAGS = -DDEBUG_MODULE $(AM_CFLAGS)
#Read_Proc_CFLAGS = -DDEBUG_MODULE $(AM_CFLAGS)
# debug modules to built as binaries: # debug modules to built as binaries:
# #
...@@ -41,7 +40,7 @@ slurmctld_SOURCES = Controller.c \ ...@@ -41,7 +40,7 @@ slurmctld_SOURCES = Controller.c \
# #
# Note: automake 1.5 will complain about these... # Note: automake 1.5 will complain about these...
# #
Read_Config : Read_Config_d.o Read_Config : Read_Config_d.o Node_Mgr.o Partition_Mgr.o
Controller : Controller_d.o Controller : Controller_d.o
Node_Mgr : Node_Mgr_d.o Node_Mgr : Node_Mgr_d.o
Partition_Mgr : Partition_Mgr_d.o Partition_Mgr : Partition_Mgr_d.o
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Author: Moe Jette, jette@llnl.gov * Author: Moe Jette, jette@llnl.gov
*/ */
#define DEBUG_SYSTEM 1
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif #endif
...@@ -103,12 +105,12 @@ main(int argc, char * argv[]) { ...@@ -103,12 +105,12 @@ main(int argc, char * argv[]) {
printf("Find_Node_Record failure 2\n"); printf("Find_Node_Record failure 2\n");
else if (Node_Ptr->LastResponse != (time_t)678) else if (Node_Ptr->LastResponse != (time_t)678)
printf("Node defaults not set\n"); printf("Node defaults not set\n");
printf("NOTE: We execte Delete_Node_Record to report not finding a record for lx04\n"); printf("NOTE: We expect Delete_Node_Record to report not finding a record for lx04\n");
Error_Code = Delete_Node_Record("lx04"); Error_Code = Delete_Node_Record("lx04");
if (Error_Code != ENOENT) printf("Delete_Node_Record failure 1\n"); if (Error_Code != ENOENT) printf("Delete_Node_Record failure 1\n");
Error_Code = Delete_Node_Record("lx02"); Error_Code = Delete_Node_Record("lx02");
if (Error_Code != 0) printf("Delete_Node_Record failure 2\n"); if (Error_Code != 0) printf("Delete_Node_Record failure 2\n");
printf("NOTE: We execte Delete_Node_Record to report not finding a record for lx02\n"); printf("NOTE: We expect Find_Node_Record to report not finding a record for lx02\n");
Node_Ptr = Find_Node_Record("lx02"); Node_Ptr = Find_Node_Record("lx02");
if (Node_Ptr != 0) printf("Find_Node_Record failure 3\n"); if (Node_Ptr != 0) printf("Find_Node_Record failure 3\n");
...@@ -175,7 +177,7 @@ unsigned *BitMapCopy(unsigned *BitMap) { ...@@ -175,7 +177,7 @@ unsigned *BitMapCopy(unsigned *BitMap) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "BitMapCopy: unable to allocate memory\n"); fprintf(stderr, "BitMapCopy: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "BitMapCopy: unable to allocate memory\n") syslog(LOG_ALERT, "BitMapCopy: unable to allocate memory\n");
#endif #endif
return NULL; return NULL;
} /* if */ } /* if */
...@@ -220,7 +222,7 @@ char *BitMapPrint(unsigned *BitMap) { ...@@ -220,7 +222,7 @@ char *BitMapPrint(unsigned *BitMap) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "BitMapPrint: unable to allocate memory\n"); fprintf(stderr, "BitMapPrint: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "BitMapPrint: unable to allocate memory\n") syslog(LOG_ALERT, "BitMapPrint: unable to allocate memory\n");
#endif #endif
return NULL; return NULL;
} /* if */ } /* if */
...@@ -293,7 +295,7 @@ struct Config_Record *Create_Config_Record(int *Error_Code) { ...@@ -293,7 +295,7 @@ struct Config_Record *Create_Config_Record(int *Error_Code) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Create_Config_Record: unable to allocate memory\n"); fprintf(stderr, "Create_Config_Record: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Create_Config_Record: unable to allocate memory\n") syslog(LOG_ALERT, "Create_Config_Record: unable to allocate memory\n");
#endif #endif
*Error_Code = ENOMEM; *Error_Code = ENOMEM;
return (struct Config_Record *)NULL; return (struct Config_Record *)NULL;
...@@ -313,7 +315,7 @@ struct Config_Record *Create_Config_Record(int *Error_Code) { ...@@ -313,7 +315,7 @@ struct Config_Record *Create_Config_Record(int *Error_Code) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Create_Config_Record: unable to allocate memory\n"); fprintf(stderr, "Create_Config_Record: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Create_Config_Record: unable to allocate memory\n") syslog(LOG_ALERT, "Create_Config_Record: unable to allocate memory\n");
#endif #endif
free(Config_Point); free(Config_Point);
*Error_Code = ENOMEM; *Error_Code = ENOMEM;
...@@ -326,7 +328,7 @@ struct Config_Record *Create_Config_Record(int *Error_Code) { ...@@ -326,7 +328,7 @@ struct Config_Record *Create_Config_Record(int *Error_Code) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Create_Config_Record: unable to allocate memory\n"); fprintf(stderr, "Create_Config_Record: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Create_Config_Record: unable to allocate memory\n") syslog(LOG_ALERT, "Create_Config_Record: unable to allocate memory\n");
#endif #endif
if (Config_Point->Feature != (char *)NULL) free(Config_Point->Feature); if (Config_Point->Feature != (char *)NULL) free(Config_Point->Feature);
free(Config_Point); free(Config_Point);
...@@ -389,7 +391,14 @@ int Delete_Node_Record(char *name) { ...@@ -389,7 +391,14 @@ int Delete_Node_Record(char *name) {
struct Node_Record *Node_Record_Point; /* Pointer to Node_Record */ struct Node_Record *Node_Record_Point; /* Pointer to Node_Record */
Node_Record_Point = Find_Node_Record(name); Node_Record_Point = Find_Node_Record(name);
if (Node_Record_Point == NULL) return ENOENT; if (Node_Record_Point == (struct Node_Record *)NULL) {
#if DEBUG_MODULE
fprintf(stderr, "Delete_Node_Record: Attempt to delete non-existent node %s\n", name);
#else
syslog(LOG_ALERT, "Delete_Node_Record: Attempt to delete non-existent node %s\n", name);
#endif
return ENOENT;
} /* if */
strcpy(Node_Record_Point->Name, ""); strcpy(Node_Record_Point->Name, "");
Node_Record_Point->NodeState = STATE_DOWN; Node_Record_Point->NodeState = STATE_DOWN;
...@@ -403,7 +412,7 @@ void Dump_Hash() { ...@@ -403,7 +412,7 @@ void Dump_Hash() {
if (Hash_Table == NULL) return; if (Hash_Table == NULL) return;
for (i=0; i<Node_Record_Count; i++) { for (i=0; i<Node_Record_Count; i++) {
if (Hash_Table[i] == (int)NULL) continue; if (strlen((Node_Record_Table_Ptr+Hash_Table[i])->Name) == 0) continue;
printf("Hash:%d:%s\n", i, (Node_Record_Table_Ptr+Hash_Table[i])->Name); printf("Hash:%d:%s\n", i, (Node_Record_Table_Ptr+Hash_Table[i])->Name);
} /* for */ } /* for */
} /* Dump_Hash */ } /* Dump_Hash */
...@@ -426,7 +435,7 @@ struct Node_Record *Find_Node_Record(char *name) { ...@@ -426,7 +435,7 @@ struct Node_Record *Find_Node_Record(char *name) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Find_Node_Record: Hash table lookup failure for %s\n", name); fprintf(stderr, "Find_Node_Record: Hash table lookup failure for %s\n", name);
#else #else
syslog(LOG_DEBUG, "Find_Node_Record: Hash table lookup failure for %s\n", name) syslog(LOG_DEBUG, "Find_Node_Record: Hash table lookup failure for %s\n", name);
#endif #endif
} /* if */ } /* if */
...@@ -443,6 +452,11 @@ struct Node_Record *Find_Node_Record(char *name) { ...@@ -443,6 +452,11 @@ struct Node_Record *Find_Node_Record(char *name) {
return (Node_Record_Table_Ptr+i); return (Node_Record_Table_Ptr+i);
} /* for */ } /* for */
#if DEBUG_SYSTEM
fprintf(stderr, "Find_Node_Record: Lookup failure for %s\n", name);
#else
syslog(LOG_ERR, "Find_Node_Record: Lookup failure for %s\n", name);
#endif
return (struct Node_Record *)NULL; return (struct Node_Record *)NULL;
} /* Find_Node_Record */ } /* Find_Node_Record */
...@@ -527,7 +541,7 @@ int Init_Node_Conf() { ...@@ -527,7 +541,7 @@ int Init_Node_Conf() {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Init_Node_Conf: list_create can not allocate memory\n"); fprintf(stderr, "Init_Node_Conf: list_create can not allocate memory\n");
#else #else
syslog(LOG_ALARM, "Init_Node_Conf: list_create can not allocate memory\n"); syslog(LOG_ALERT, "Init_Node_Conf: list_create can not allocate memory\n");
#endif #endif
return ENOMEM; return ENOMEM;
} /* if */ } /* if */
...@@ -556,7 +570,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx, ...@@ -556,7 +570,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx,
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Parse_Node_Name: unable to allocate memory\n"); fprintf(stderr, "Parse_Node_Name: unable to allocate memory\n");
#else #else
syslog(LOG_ERR, "Parse_Node_Name: unable to allocate memory\n") syslog(LOG_ERR, "Parse_Node_Name: unable to allocate memory\n");
#endif #endif
return ENOMEM; return ENOMEM;
} /* if */ } /* if */
...@@ -579,7 +593,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx, ...@@ -579,7 +593,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx,
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Parse_Node_Name: Invalid '[' in node name %s\n", NodeName); fprintf(stderr, "Parse_Node_Name: Invalid '[' in node name %s\n", NodeName);
#else #else
syslog(LOG_ALERT, "Parse_Node_Name: Invalid '[' in node name %s\n", NodeName) syslog(LOG_ALERT, "Parse_Node_Name: Invalid '[' in node name %s\n", NodeName);
#endif #endif
free(Format[0]); free(Format[0]);
return EINVAL; return EINVAL;
...@@ -607,7 +621,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx, ...@@ -607,7 +621,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx,
NodeName[i], NodeName); NodeName[i], NodeName);
#else #else
syslog(LOG_ALERT, "Parse_Node_Name: Invalid '%c' in node name %s\n", syslog(LOG_ALERT, "Parse_Node_Name: Invalid '%c' in node name %s\n",
NodeName[i], NodeName) NodeName[i], NodeName);
#endif #endif
free(Format[0]); free(Format[0]);
return EINVAL; return EINVAL;
...@@ -626,7 +640,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx, ...@@ -626,7 +640,7 @@ int Parse_Node_Name(char *NodeName, char **Format, int *Start_Inx, int *End_Inx,
NodeName[i], NodeName); NodeName[i], NodeName);
#else #else
syslog(LOG_ALERT, "Parse_Node_Name: Invalid '%c' in node name %s\n", syslog(LOG_ALERT, "Parse_Node_Name: Invalid '%c' in node name %s\n",
NodeName[i], NodeName) NodeName[i], NodeName);
#endif #endif
free(Format[0]); free(Format[0]);
return EINVAL; return EINVAL;
...@@ -671,7 +685,7 @@ void Rehash() { ...@@ -671,7 +685,7 @@ void Rehash() {
#endif #endif
return; return;
} /* if */ } /* if */
memset(Hash_Table, 0, (sizeof(int *) * Node_Record_Count)); memset(Hash_Table, 0, (sizeof(int) * Node_Record_Count));
for (i=0; i<Node_Record_Count; i++) { for (i=0; i<Node_Record_Count; i++) {
if (strlen((Node_Record_Table_Ptr+i)->Name) == 0) continue; if (strlen((Node_Record_Table_Ptr+i)->Name) == 0) continue;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Author: Moe Jette, jette@llnl.gov * Author: Moe Jette, jette@llnl.gov
*/ */
#define DEBUG_SYSTEM 1
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif #endif
...@@ -36,6 +38,7 @@ main(int argc, char * argv[]) { ...@@ -36,6 +38,7 @@ main(int argc, char * argv[]) {
Default_Part.MaxTime = 223344; Default_Part.MaxTime = 223344;
Default_Part.MaxNodes = 556677; Default_Part.MaxNodes = 556677;
printf("Create some partitions and test defaults\n");
Part_Ptr = Create_Part_Record(&Error_Code); Part_Ptr = Create_Part_Record(&Error_Code);
if (Error_Code) if (Error_Code)
printf("Create_Part_Record error %d\n", Error_Code); printf("Create_Part_Record error %d\n", Error_Code);
...@@ -139,7 +142,7 @@ struct Part_Record *Create_Part_Record(int *Error_Code) { ...@@ -139,7 +142,7 @@ struct Part_Record *Create_Part_Record(int *Error_Code) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Create_Part_Record: unable to allocate memory\n"); fprintf(stderr, "Create_Part_Record: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Create_Part_Record: unable to allocate memory\n") syslog(LOG_ALERT, "Create_Part_Record: unable to allocate memory\n");
#endif #endif
if (Part_Record_Point->Nodes != NULL) free(Part_Record_Point->Nodes); if (Part_Record_Point->Nodes != NULL) free(Part_Record_Point->Nodes);
if (Part_Record_Point->AllowGroups != NULL) free(Part_Record_Point->AllowGroups); if (Part_Record_Point->AllowGroups != NULL) free(Part_Record_Point->AllowGroups);
...@@ -189,6 +192,11 @@ int Delete_Part_Record(char *name) { ...@@ -189,6 +192,11 @@ int Delete_Part_Record(char *name) {
} /* while */ } /* while */
list_iterator_destroy(Part_Record_Iterator); list_iterator_destroy(Part_Record_Iterator);
#if DEBUG_SYSTEM
fprintf(stderr, "Delete_Part_Record: Attempt to delete non-existent partition %s\n", name);
#else
syslog(LOG_ERR, "Delete_Part_Record: Attempt to delete non-existent partition %s\n", name);
#endif
return ENOENT; return ENOENT;
} /* Delete_Part_Record */ } /* Delete_Part_Record */
...@@ -239,7 +247,7 @@ int Init_Part_Conf() { ...@@ -239,7 +247,7 @@ int Init_Part_Conf() {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Init_Part_Conf: list_create can not allocate memory\n"); fprintf(stderr, "Init_Part_Conf: list_create can not allocate memory\n");
#else #else
syslog(LOG_ALARM, "Init_Part_Conf: list_create can not allocate memory\n"); syslog(LOG_ALERT, "Init_Part_Conf: list_create can not allocate memory\n");
#endif #endif
return ENOMEM; return ENOMEM;
} /* if */ } /* if */
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Author: Moe Jette, jette@llnl.gov * Author: Moe Jette, jette@llnl.gov
*/ */
#define DEBUG_SYSTEM 1
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif #endif
...@@ -14,6 +16,7 @@ ...@@ -14,6 +16,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <syslog.h>
#include "slurm.h" #include "slurm.h"
#include "list.h" #include "list.h"
...@@ -143,7 +146,7 @@ int Build_BitMaps() { ...@@ -143,7 +146,7 @@ int Build_BitMaps() {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Build_BitMaps: unable to allocate memory\n"); fprintf(stderr, "Build_BitMaps: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n") syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n");
#endif #endif
return ENOMEM; return ENOMEM;
} /* if */ } /* if */
...@@ -172,7 +175,7 @@ int Build_BitMaps() { ...@@ -172,7 +175,7 @@ int Build_BitMaps() {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Build_BitMaps: unable to allocate memory\n"); fprintf(stderr, "Build_BitMaps: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n") syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n");
#endif #endif
return ENOMEM; return ENOMEM;
} /* if */ } /* if */
...@@ -208,7 +211,7 @@ int Build_BitMaps() { ...@@ -208,7 +211,7 @@ int Build_BitMaps() {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Build_BitMaps: unable to allocate memory\n"); fprintf(stderr, "Build_BitMaps: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n") syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n");
#endif #endif
return ENOMEM; return ENOMEM;
} /* if */ } /* if */
...@@ -229,7 +232,7 @@ int Build_BitMaps() { ...@@ -229,7 +232,7 @@ int Build_BitMaps() {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Build_BitMaps: unable to allocate memory\n"); fprintf(stderr, "Build_BitMaps: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n") syslog(LOG_ALERT, "Build_BitMaps: unable to allocate memory\n");
#endif #endif
free(AllPart_NodeBitMap); free(AllPart_NodeBitMap);
return ENOMEM; return ENOMEM;
...@@ -740,7 +743,7 @@ int Read_SLURM_Conf (char *File_Name) { ...@@ -740,7 +743,7 @@ int Read_SLURM_Conf (char *File_Name) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Read_SLURM_Conf: unable to allocate memory\n"); fprintf(stderr, "Read_SLURM_Conf: unable to allocate memory\n");
#else #else
syslog(LOG_ALERT, "Read_SLURM_Conf: unable to allocate memory\n") syslog(LOG_ALERT, "Read_SLURM_Conf: unable to allocate memory\n");
#endif #endif
return ENOMEM; return ENOMEM;
} /* if */ } /* if */
...@@ -748,14 +751,14 @@ int Read_SLURM_Conf (char *File_Name) { ...@@ -748,14 +751,14 @@ int Read_SLURM_Conf (char *File_Name) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Read_SLURM_Conf: BackupController value not specified.\n"); fprintf(stderr, "Read_SLURM_Conf: BackupController value not specified.\n");
#else #else
syslog(LOG_WARN, "Read_SLURM_Conf: BackupController value not specified.\n") syslog(LOG_WARNING, "Read_SLURM_Conf: BackupController value not specified.\n");
#endif #endif
} /* if */ } /* if */
if (ControlMachine == NULL) { if (ControlMachine == NULL) {
#if DEBUG_SYSTEM #if DEBUG_SYSTEM
fprintf(stderr, "Read_SLURM_Conf: ControlMachine value not specified.\n"); fprintf(stderr, "Read_SLURM_Conf: ControlMachine value not specified.\n");
#else #else
syslog(LOG_ALERT, "Read_SLURM_Conf: ControlMachine value not specified.\n") syslog(LOG_ALERT, "Read_SLURM_Conf: ControlMachine value not specified.\n");
#endif #endif
return EINVAL; return EINVAL;
} /* if */ } /* if */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment