~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to src/plugins/topology/3d_torus/topology_3d_torus.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************\
 
2
 *  topology_3d_torus.c - Support for 3-Dimension torus interconnect
 
3
 *      topology, default for Cray XT and Sun Constellation systems
 
4
 *****************************************************************************
 
5
 *  Copyright (C) 2009 Lawrence Livermore National Security.
 
6
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 
7
 *  Written by Morris Jette <jette1@llnl.gov>
 
8
 *  CODE-OCEC-09-009. All rights reserved.
 
9
 *  
 
10
 *  This file is part of SLURM, a resource management program.
 
11
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
12
 *  Please also read the included file: DISCLAIMER.
 
13
 *  
 
14
 *  SLURM is free software; you can redistribute it and/or modify it under
 
15
 *  the terms of the GNU General Public License as published by the Free
 
16
 *  Software Foundation; either version 2 of the License, or (at your option)
 
17
 *  any later version.
 
18
 *
 
19
 *  In addition, as a special exception, the copyright holders give permission 
 
20
 *  to link the code of portions of this program with the OpenSSL library under 
 
21
 *  certain conditions as described in each individual source file, and 
 
22
 *  distribute linked combinations including the two. You must obey the GNU 
 
23
 *  General Public License in all respects for all of the code used other than 
 
24
 *  OpenSSL. If you modify file(s) with this exception, you may extend this 
 
25
 *  exception to your version of the file(s), but you are not obligated to do 
 
26
 *  so. If you do not wish to do so, delete this exception statement from your
 
27
 *  version.  If you delete this exception statement from all source files in 
 
28
 *  the program, then also delete it here.
 
29
 *  
 
30
 *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
 
31
 *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
32
 *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
33
 *  details.
 
34
 *  
 
35
 *  You should have received a copy of the GNU General Public License along
 
36
 *  with SLURM; if not, write to the Free Software Foundation, Inc.,
 
37
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 
38
\*****************************************************************************/
 
39
 
 
40
#if     HAVE_CONFIG_H
 
41
#  include "config.h"
 
42
#endif
 
43
 
 
44
#include <signal.h>
 
45
#include <sys/types.h>
 
46
 
 
47
#include <slurm/slurm_errno.h>
 
48
#include "src/common/slurm_xlator.h"
 
49
 
 
50
/*
 
51
 * These variables are required by the generic plugin interface.  If they
 
52
 * are not found in the plugin, the plugin loader will ignore it.
 
53
 *
 
54
 * plugin_name - a string giving a human-readable description of the
 
55
 * plugin.  There is no maximum length, but the symbol must refer to
 
56
 * a valid string.
 
57
 *
 
58
 * plugin_type - a string suggesting the type of the plugin or its
 
59
 * applicability to a particular form of data or method of data handling.
 
60
 * If the low-level plugin API is used, the contents of this string are
 
61
 * unimportant and may be anything.  SLURM uses the higher-level plugin
 
62
 * interface which requires this string to be of the form
 
63
 *
 
64
 *      <application>/<method>
 
65
 *
 
66
 * where <application> is a description of the intended application of
 
67
 * the plugin (e.g., "task" for task control) and <method> is a description 
 
68
 * of how this plugin satisfies that application.  SLURM will only load
 
69
 * a task plugin if the plugin_type string has a prefix of "task/".
 
70
 *
 
71
 * plugin_version - an unsigned 32-bit integer giving the version number
 
72
 * of the plugin.  If major and minor revisions are desired, the major
 
73
 * version number may be multiplied by a suitable magnitude constant such
 
74
 * as 100 or 1000.  Various SLURM versions will likely require a certain
 
75
 * minimum versions for their plugins as this API matures.
 
76
 */
 
77
const char plugin_name[]        = "topology 3d_torus plugin";
 
78
const char plugin_type[]        = "topology/3d_torus";
 
79
const uint32_t plugin_version   = 100;
 
80
 
 
81
extern void nodes_to_hilbert_curve(void);
 
82
 
 
83
/*
 
84
 * init() is called when the plugin is loaded, before any other functions
 
85
 *      are called.  Put global initialization here.
 
86
 */
 
87
extern int init(void)
 
88
{
 
89
        verbose("%s loaded", plugin_name);
 
90
        return SLURM_SUCCESS;
 
91
}
 
92
 
 
93
/*
 
94
 * fini() is called when the plugin is removed. Clear any allocated 
 
95
 *      storage here.
 
96
 */
 
97
extern int fini(void)
 
98
{
 
99
        return SLURM_SUCCESS;
 
100
}
 
101
 
 
102
/*
 
103
 * topo_build_config - build or rebuild system topology information
 
104
 *      after a system startup or reconfiguration.
 
105
 */
 
106
extern int topo_build_config(void)
 
107
{
 
108
#ifndef HAVE_BG
 
109
        nodes_to_hilbert_curve();
 
110
#endif
 
111
        return SLURM_SUCCESS;
 
112
}
 
113