From b5c1a589afdc7f2d2fc539bac15d97701c6955d4 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Fri, 10 Sep 2004 20:41:41 +0000
Subject: [PATCH] Add new functions to switch plugins as required for
 Federation switch.

---
 src/common/switch.h                   |  5 +--
 src/plugins/switch/elan/switch_elan.c | 44 +++++++++++++++++++++++++
 src/plugins/switch/none/switch_none.c | 47 +++++++++++++++++++++++++--
 3 files changed, 92 insertions(+), 4 deletions(-)

diff --git a/src/common/switch.h b/src/common/switch.h
index 86adfee310d..47e26234a66 100644
--- a/src/common/switch.h
+++ b/src/common/switch.h
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Moe Jette <jette@llnl.gov>.
+ *  Written by Morris Jette <jette1@llnl.gov>.
  *  UCRL-CODE-2002-040.
  *  
  *  This file is part of SLURM, a resource management program.
@@ -41,7 +41,8 @@
 /* opaque data structures - no peeking! */
 #ifndef __switch_jobinfo_t_defined
 #  define __switch_jobinfo_t_defined
-   typedef struct switch_jobinfo *switch_jobinfo_t;
+   typedef struct switch_jobinfo   *switch_jobinfo_t;
+   typedef struct switch_node_info *switch_node_info_t;
 #endif
 typedef struct slurm_switch_context * slurm_switch_context_t;
 
diff --git a/src/plugins/switch/elan/switch_elan.c b/src/plugins/switch/elan/switch_elan.c
index 989d1d0f7d8..f55fbfdf791 100644
--- a/src/plugins/switch/elan/switch_elan.c
+++ b/src/plugins/switch/elan/switch_elan.c
@@ -648,6 +648,11 @@ int switch_p_job_attach ( switch_jobinfo_t jobinfo, char ***env,
 	return SLURM_SUCCESS;
 }
 
+extern int switch_get_data_jobinfo(switch_jobinfo_t switch_job,
+	int key, void *resulting_data)
+{
+	return SLURM_SUCCESS;
+}
 
 static int 
 _set_elan_ids(void)
@@ -700,3 +705,42 @@ extern char *switch_p_strerror(int errnum)
 	char *res = _lookup_slurm_api_errtab(errnum);
 	return (res ? res : strerror(errnum));
 }
+
+/*
+ * node switch state monitoring functions
+ * required for IBM Federation switch
+ */
+extern int switch_alloc_node_info(switch_node_info_t *switch_node)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_build_node_info(switch_node_info_t switch_node)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_pack_node_info(switch_node_info_t switch_node,
+	Buf buffer)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_unpack_node_info(switch_node_info_t switch_node,
+	Buf buffer)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_free_node_info(switch_node_info_t switch_node)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_job_complete(switch_node_info_t switch_node,
+	char *nodelist)
+{
+	return SLURM_SUCCESS;
+}
+
+
diff --git a/src/plugins/switch/none/switch_none.c b/src/plugins/switch/none/switch_none.c
index c4c2c52d3dd..265e6876678 100644
--- a/src/plugins/switch/none/switch_none.c
+++ b/src/plugins/switch/none/switch_none.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Moe Jette <jette@llnl.gov>
+ *  Written by Morris Jette <jette1@llnl.gov>
  *  UCRL-CODE-2002-040.
  *  
  *  This file is part of SLURM, a resource management program.
@@ -63,7 +63,7 @@
  */
 const char plugin_name[]        = "switch NONE plugin";
 const char plugin_type[]        = "switch/none";
-const uint32_t plugin_version   = 90;
+const uint32_t plugin_version   = 100;
 
 /*
  * init() is called when the plugin is loaded, before any other functions
@@ -190,6 +190,12 @@ int switch_p_job_attach ( switch_jobinfo_t jobinfo, char ***env,
 	return SLURM_SUCCESS;
 }
 
+extern int switch_get_data_jobinfo(switch_jobinfo_t switch_job,
+	int key, void *resulting_data)
+{
+	return SLURM_SUCCESS;
+}
+
 /*
  * switch functions for other purposes
  */
@@ -208,3 +214,40 @@ extern char *switch_p_strerror(int errnum)
 	return NULL;
 }
 
+/*
+ * node switch state monitoring functions
+ * required for IBM Federation switch 
+ */
+extern int switch_alloc_node_info(switch_node_info_t *switch_node)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_build_node_info(switch_node_info_t switch_node)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_pack_node_info(switch_node_info_t switch_node, 
+	Buf buffer)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_unpack_node_info(switch_node_info_t switch_node,
+	Buf buffer)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_free_node_info(switch_node_info_t switch_node)
+{
+	return SLURM_SUCCESS;
+}
+
+extern int switch_job_complete(switch_node_info_t switch_node,
+	char *nodelist)
+{
+	return SLURM_SUCCESS;
+}
+
-- 
GitLab