Now that the nightly tarball has safely been made, let's try this
commit again. Remove the svn:ignore from problematic directories and try a merge from /tmp-public/plpa-merge-area2. This commit was SVN r17718.
Этот коммит содержится в:
родитель
9413d6cf5d
Коммит
ea5c0cb4a2
@ -1210,10 +1210,10 @@ static int get_ib_dev_distance(struct ibv_device *dev)
|
|||||||
{
|
{
|
||||||
opal_paffinity_base_cpu_set_t cpus;
|
opal_paffinity_base_cpu_set_t cpus;
|
||||||
opal_carto_base_node_t *hca_node;
|
opal_carto_base_node_t *hca_node;
|
||||||
int min_distance = -1, i, max_proc_id;
|
int min_distance = -1, i, max_proc_id, num_processors;
|
||||||
const char *hca = ibv_get_device_name(dev);
|
const char *hca = ibv_get_device_name(dev);
|
||||||
|
|
||||||
if(opal_paffinity_base_max_processor_id(&max_proc_id) != OMPI_SUCCESS)
|
if(opal_paffinity_base_get_processor_info(&num_processors, &max_proc_id) != OMPI_SUCCESS)
|
||||||
max_proc_id = 100; /* Choose something big enough */
|
max_proc_id = 100; /* Choose something big enough */
|
||||||
|
|
||||||
hca_node = carto_base_find_node(host_topo, hca);
|
hca_node = carto_base_find_node(host_topo, hca);
|
||||||
|
@ -167,7 +167,7 @@ extern "C" {
|
|||||||
* @return int - OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
* @return int - OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
||||||
* supported
|
* supported
|
||||||
*/
|
*/
|
||||||
OPAL_DECLSPEC int opal_paffinity_base_max_processor_id(int *max_processor_id);
|
OPAL_DECLSPEC int opal_paffinity_base_get_processor_info(int *num_processors, int *max_processor_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the max socket number
|
* Return the max socket number
|
||||||
@ -177,7 +177,7 @@ extern "C" {
|
|||||||
* @return int - OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
* @return int - OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
||||||
* supported
|
* supported
|
||||||
*/
|
*/
|
||||||
OPAL_DECLSPEC int opal_paffinity_base_max_socket(int *max_socket);
|
OPAL_DECLSPEC int opal_paffinity_base_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the max core number for a given socket
|
* Return the max core number for a given socket
|
||||||
@ -188,7 +188,7 @@ extern "C" {
|
|||||||
* @return int - OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
* @return int - OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
||||||
* supported
|
* supported
|
||||||
*/
|
*/
|
||||||
OPAL_DECLSPEC int opal_paffinity_base_max_core(int socket, int *max_core);
|
OPAL_DECLSPEC int opal_paffinity_base_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indication of whether a component was successfully selected or
|
* Indication of whether a component was successfully selected or
|
||||||
|
@ -63,27 +63,28 @@ int opal_paffinity_base_map_to_socket_core(int processor_id, int *socket, int *c
|
|||||||
return opal_paffinity_base_module->paff_map_to_socket_core(processor_id, socket, core);
|
return opal_paffinity_base_module->paff_map_to_socket_core(processor_id, socket, core);
|
||||||
}
|
}
|
||||||
|
|
||||||
int opal_paffinity_base_max_processor_id(int *max_processor_id)
|
|
||||||
|
int opal_paffinity_base_get_processor_info(int *num_processors, int *max_processor_id)
|
||||||
{
|
{
|
||||||
if (!opal_paffinity_base_selected) {
|
if (!opal_paffinity_base_selected) {
|
||||||
return OPAL_ERR_NOT_FOUND;
|
return OPAL_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
return opal_paffinity_base_module->paff_max_processor_id(max_processor_id);
|
return opal_paffinity_base_module->paff_get_processor_info(num_processors, max_processor_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int opal_paffinity_base_max_socket(int *max_socket)
|
int opal_paffinity_base_get_socket_info(int *num_sockets, int *max_socket_num)
|
||||||
{
|
{
|
||||||
if (!opal_paffinity_base_selected) {
|
if (!opal_paffinity_base_selected) {
|
||||||
return OPAL_ERR_NOT_FOUND;
|
return OPAL_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
return opal_paffinity_base_module->paff_max_socket(max_socket);
|
return opal_paffinity_base_module->paff_get_socket_info(num_sockets, max_socket_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
int opal_paffinity_base_max_core(int socket, int *max_core)
|
int opal_paffinity_base_get_core_info(int socket, int *num_cores, int *max_core_num)
|
||||||
{
|
{
|
||||||
if (!opal_paffinity_base_selected) {
|
if (!opal_paffinity_base_selected) {
|
||||||
return OPAL_ERR_NOT_FOUND;
|
return OPAL_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
return opal_paffinity_base_module->paff_max_core(socket, max_core);
|
return opal_paffinity_base_module->paff_get_core_info(socket, num_cores, max_core_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,9 +45,9 @@ static int linux_module_set(opal_paffinity_base_cpu_set_t cpumask);
|
|||||||
static int linux_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
static int linux_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
||||||
static int linux_module_map_to_processor_id(int socket, int core, int *processor_id);
|
static int linux_module_map_to_processor_id(int socket, int core, int *processor_id);
|
||||||
static int linux_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
static int linux_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
||||||
static int linux_module_max_processor_id(int *max_processor_id);
|
static int linux_module_get_processor_info(int *num_processors, int *max_processor_id);
|
||||||
static int linux_module_max_socket(int *max_socket);
|
static int linux_module_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||||
static int linux_module_max_core(int socket, int *max_core);
|
static int linux_module_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Linux paffinity module
|
* Linux paffinity module
|
||||||
@ -64,9 +64,9 @@ static const opal_paffinity_base_module_1_1_0_t module = {
|
|||||||
linux_module_get,
|
linux_module_get,
|
||||||
linux_module_map_to_processor_id,
|
linux_module_map_to_processor_id,
|
||||||
linux_module_map_to_socket_core,
|
linux_module_map_to_socket_core,
|
||||||
linux_module_max_processor_id,
|
linux_module_get_processor_info,
|
||||||
linux_module_max_socket,
|
linux_module_get_socket_info,
|
||||||
linux_module_max_core,
|
linux_module_get_core_info,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -168,18 +168,18 @@ static int linux_module_map_to_socket_core(int processor_id, int *socket, int *c
|
|||||||
return opal_paffinity_linux_plpa_map_to_socket_core(processor_id, socket, core);
|
return opal_paffinity_linux_plpa_map_to_socket_core(processor_id, socket, core);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int linux_module_max_processor_id(int *max_processor_id)
|
static int linux_module_get_processor_info(int *num_processors, int *max_processor_id)
|
||||||
{
|
{
|
||||||
return opal_paffinity_linux_plpa_max_processor_id(max_processor_id);
|
return opal_paffinity_linux_plpa_get_processor_info(num_processors, max_processor_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int linux_module_max_socket(int *max_socket)
|
static int linux_module_get_socket_info(int *num_sockets, int *max_socket_num)
|
||||||
{
|
{
|
||||||
return opal_paffinity_linux_plpa_max_socket(max_socket);
|
return opal_paffinity_linux_plpa_get_socket_info(num_sockets, max_socket_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int linux_module_max_core(int socket, int *max_core)
|
static int linux_module_get_core_info(int socket, int *num_cores, int *max_core_num)
|
||||||
{
|
{
|
||||||
return opal_paffinity_linux_plpa_max_core(socket, max_core);
|
return opal_paffinity_linux_plpa_get_core_info(socket, num_cores, max_core_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# Corporation. All rights reserved.
|
# Corporation. All rights reserved.
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
# Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -13,7 +14,7 @@
|
|||||||
|
|
||||||
SUBDIRS = src
|
SUBDIRS = src
|
||||||
DIST_SUBDIRS = config $(SUBDIRS)
|
DIST_SUBDIRS = config $(SUBDIRS)
|
||||||
EXTRA_DIST = README VERSION LICENSE AUTHORS
|
EXTRA_DIST = README VERSION LICENSE AUTHORS autogen.sh
|
||||||
|
|
||||||
if PLPA_BUILD_STANDALONE
|
if PLPA_BUILD_STANDALONE
|
||||||
dist-hook:
|
dist-hook:
|
||||||
|
@ -3,7 +3,7 @@ Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
|||||||
Corporation. All rights reserved.
|
Corporation. All rights reserved.
|
||||||
Copyright (c) 2004-2005 The Regents of the University of California.
|
Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
|
Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
$COPYRIGHT$
|
$COPYRIGHT$
|
||||||
|
|
||||||
Additional copyrights may follow
|
Additional copyrights may follow
|
||||||
@ -21,16 +21,15 @@ version 1.0.
|
|||||||
|
|
||||||
- New command: plpa-taskset. It is intended as a drop-in replacement
|
- New command: plpa-taskset. It is intended as a drop-in replacement
|
||||||
for the "taskset" command, except it also understands sockets and
|
for the "taskset" command, except it also understands sockets and
|
||||||
cores. See the man page for more details.
|
cores. See "plpa-taskset --help" for more details
|
||||||
- Renamed "plpa_info" to "plpa-info".
|
- Renamed "plpa_info" to "plpa-info".
|
||||||
- Added PLPA_{MAJOR|MINOR|RELEASE}_VERSION integer macros in plpa.h.
|
- Added PLPA_{MAJOR|MINOR|RELEASE}_VERSION integer macros in plpa.h.
|
||||||
This release, they have the values of 1, 1, and 0, respectively.
|
This release, they have the values of 1, 1, and 0, respectively.
|
||||||
- Add new API functions to map from (socket,core) back and forth from
|
- Add new API functions to map from (socket,core) back and forth from
|
||||||
the Linux virtual processor ID. Thanks to AMD for the initial code
|
the Linux virtual processor ID. Thanks to AMD for the initial code
|
||||||
contribution that made this possible. See the man page for
|
contribution that made this possible. See the documentation for
|
||||||
plpa_map_to_processor_id(3) as a starting point for more
|
plpa_map_to_processor_id() as a starting point for more
|
||||||
information.
|
information.
|
||||||
- Added man pages for executables and API functions.
|
|
||||||
- Various fixes to "included" mode.
|
- Various fixes to "included" mode.
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
|||||||
Corporation. All rights reserved.
|
Corporation. All rights reserved.
|
||||||
Copyright (c) 2004-2005 The Regents of the University of California.
|
Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
|
Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
$COPYRIGHT$
|
$COPYRIGHT$
|
||||||
|
|
||||||
See LICENSE file for a rollup of all copyright notices.
|
See LICENSE file for a rollup of all copyright notices.
|
||||||
@ -202,26 +202,31 @@ Linux variants.
|
|||||||
How do I use PLPA?
|
How do I use PLPA?
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
There are two main uses of the PLPA:
|
There are three main uses of the PLPA:
|
||||||
|
|
||||||
1. Using the plpa_info executable to check if your system supports
|
1. Using the plpa-info executable to check if your system supports
|
||||||
processor affinity and the PLPA can determine which to use at run-time.
|
processor affinity and the PLPA can determine which to use at run-time.
|
||||||
2. Developers using the PLPA library to enable source and binary Linux
|
2. Developers using the PLPA library to enable source and binary Linux
|
||||||
processor affinity portability.
|
processor affinity portability.
|
||||||
|
3. Using the plpa-taskset executable to bind arbitrary executables to
|
||||||
|
Linux virtual procesor IDs and/or specific sockets/core.
|
||||||
|
|
||||||
In more detail:
|
In more detail:
|
||||||
|
|
||||||
1. The plpa_info executable is a simple call into the PLPA library
|
1. The plpa-info executable is a simple call into the PLPA library
|
||||||
that checks which API variant the system it is running on has. If
|
that checks which API variant the system it is running on has. If
|
||||||
the kernel supports processor affinity and the PLPA is able to
|
the kernel supports processor affinity and the PLPA is able to
|
||||||
figure out which API variant to use, it prints "PLPA_PROBE_OK".
|
figure out which API variant to use, it prints "Kernel affinity
|
||||||
Other responses indicate an error.
|
support: no". Other responses indicate an error.
|
||||||
|
|
||||||
Since the PLPA library abstracts this kind of problem away, this is
|
Since the PLPA library abstracts this kind of problem away, this is
|
||||||
more a diagnostic tool than anything else. Note that plpa_info is
|
more a diagnostic tool than anything else. Note that plpa-info is
|
||||||
*only* compiled and installed if PLPA is installed as a standalone
|
*only* compiled and installed if PLPA is installed as a standalone
|
||||||
package (see below).
|
package (see below).
|
||||||
|
|
||||||
|
See "plpa-info --help" for more information. A man page does not
|
||||||
|
yet exist, unfortunately.
|
||||||
|
|
||||||
2. Developers can use this package by including the <plpa.h> header
|
2. Developers can use this package by including the <plpa.h> header
|
||||||
file and using the following prototypes:
|
file and using the following prototypes:
|
||||||
|
|
||||||
@ -280,6 +285,25 @@ In more detail:
|
|||||||
functions on an unsupported kernel will not allocate any memory;
|
functions on an unsupported kernel will not allocate any memory;
|
||||||
invoking plpa_finalize() is therefore unnecessary, but harmless.
|
invoking plpa_finalize() is therefore unnecessary, but harmless.
|
||||||
|
|
||||||
|
See plpa.h for a bit more information on these functions. Detailed
|
||||||
|
documentation such as man pages is still lacking, unfortunately.
|
||||||
|
|
||||||
|
3. The plpa-taskset executable represents an evolution of the
|
||||||
|
venerable "taskset(1)" command. It allows binding of arbitrary
|
||||||
|
processes to specific Linux virtual processors and/or specific
|
||||||
|
sockets/cores. It supports all the same command line syntax of the
|
||||||
|
taskset command, but also supports additional syntax for specifying
|
||||||
|
sockets/cores (plpa-taskset will figure out the mapping from the
|
||||||
|
socket/core specification to the appropriate Linux virtual
|
||||||
|
processor IDs).
|
||||||
|
|
||||||
|
Hence, you can launch processor-bound jobs without needing to
|
||||||
|
modify their source code to call the PLPA library.
|
||||||
|
|
||||||
|
See "plpa-taskset --help" for more information on the command line
|
||||||
|
options available, and brief examples of usage. A man page does
|
||||||
|
not yet exist, unfortunately.
|
||||||
|
|
||||||
===========================================================================
|
===========================================================================
|
||||||
|
|
||||||
How do I compile / install the PLPA as a standalone package?
|
How do I compile / install the PLPA as a standalone package?
|
||||||
@ -303,7 +327,7 @@ step as root or some other privileged user.
|
|||||||
- <plpa.h> in $includedir (typically $prefix/include)
|
- <plpa.h> in $includedir (typically $prefix/include)
|
||||||
- libplpa.la and libplpa.a and/or libplpa.so in $libdir (typically
|
- libplpa.la and libplpa.a and/or libplpa.so in $libdir (typically
|
||||||
$prefix/lib)
|
$prefix/lib)
|
||||||
- plpa_info executable in $bindir (typically $prefix/bin)
|
- plpa-info executable in $bindir (typically $prefix/bin)
|
||||||
|
|
||||||
Note that since PLPA builds itself with GNU Libtool, it can be built
|
Note that since PLPA builds itself with GNU Libtool, it can be built
|
||||||
as a static or shared library (or both). The default is to build a
|
as a static or shared library (or both). The default is to build a
|
||||||
@ -331,7 +355,7 @@ with it?).
|
|||||||
When used in "included" mode, PLPA will:
|
When used in "included" mode, PLPA will:
|
||||||
|
|
||||||
- not install any header files
|
- not install any header files
|
||||||
- not build or install plpa_info
|
- not build or install plpa-info or plpa-taskset
|
||||||
- not build libplpa.* -- instead, it will build libplpa_included.*
|
- not build libplpa.* -- instead, it will build libplpa_included.*
|
||||||
|
|
||||||
There are two ways to put PLPA into "included" mode. From the
|
There are two ways to put PLPA into "included" mode. From the
|
||||||
@ -354,12 +378,6 @@ m4_include(path/to/plpa.m4)
|
|||||||
|
|
||||||
The following macros can then be used from your configure script:
|
The following macros can then be used from your configure script:
|
||||||
|
|
||||||
- PLPA_INIT(action-upon-success, action-upon-failure)
|
|
||||||
Invoke the PLPA tests and setup the PLPA to build. A traversal of
|
|
||||||
"make" into the PLPA directory should build everything (it is safe
|
|
||||||
to list the PLPA directory in the SUBDIRS of a higher-level
|
|
||||||
Makefile.am, for example).
|
|
||||||
|
|
||||||
- PLPA_STANDALONE
|
- PLPA_STANDALONE
|
||||||
Force the building of PLPA in standalone mode. Overrides the
|
Force the building of PLPA in standalone mode. Overrides the
|
||||||
--enable-included-mode command line switch.
|
--enable-included-mode command line switch.
|
||||||
@ -376,7 +394,36 @@ The following macros can then be used from your configure script:
|
|||||||
type/symbol clashes, and everything will compile and link
|
type/symbol clashes, and everything will compile and link
|
||||||
successfully. If you both include PLPA and do not change the symbol
|
successfully. If you both include PLPA and do not change the symbol
|
||||||
prefix, it is likely that you will get multiple symbol definitions
|
prefix, it is likely that you will get multiple symbol definitions
|
||||||
when linking.
|
when linking if an external PLPA is linked against your library /
|
||||||
|
application. Note that the PLPA_CPU_*() macros are *NOT* prefixed
|
||||||
|
(because they are only used when compiling and therefore present no
|
||||||
|
link/run-time conflicts), but all other types, enum values, and
|
||||||
|
symbols are. Enum values are prefixed with an upper-case
|
||||||
|
translation if the prefix supplied. For example,
|
||||||
|
PLPA_SET_SYMBOL_PREFIX(foo_) will result in foo_init() and
|
||||||
|
FOO_PROBE_OK. Tip: It might be good to include "plpa" in the
|
||||||
|
prefix, just for clarity.
|
||||||
|
|
||||||
|
- PLPA_DISABLE_EXECUTABLES
|
||||||
|
Provides the same result as the --disable-executables configure
|
||||||
|
flag, and is implicit in included mode.
|
||||||
|
|
||||||
|
- PLPA_INIT(action-upon-success, action-upon-failure)
|
||||||
|
Invoke the PLPA tests and setup the PLPA to build. A traversal of
|
||||||
|
"make" into the PLPA directory should build everything (it is safe
|
||||||
|
to list the PLPA directory in the SUBDIRS of a higher-level
|
||||||
|
Makefile.am, for example). PLPA_INIT must be invoked after the
|
||||||
|
INCLUDED / STANDALONE / SET_SYMBOL_PREFIX macros.
|
||||||
|
|
||||||
|
- PLPA_DO_AM_CONDITIONALS
|
||||||
|
If you embed PLPA in a larger project and build it conditionally
|
||||||
|
(e.g., if PLPA_INIT is in a conditional), you must unconditionally
|
||||||
|
invoke PLPA_DO_AM_CONDITIONALS to avoid warnings from Automake (for
|
||||||
|
the cases where PLPA is not selected to be built). This macro is
|
||||||
|
necessary because PLPA uses some AM_CONDITIONALs to build itself;
|
||||||
|
AM_CONDITIONALs cannot be defined conditionally. It is safe (but
|
||||||
|
unnecessary) to call PLPA_DO_AM_CONDITIONALS even if PLPA_INIT is
|
||||||
|
invoked unconditionally.
|
||||||
|
|
||||||
Here's an example of integrating with a larger project named sandbox:
|
Here's an example of integrating with a larger project named sandbox:
|
||||||
|
|
||||||
@ -395,7 +442,7 @@ shell$ edit configure.ac
|
|||||||
...add error checking for plpa_happy=no case...
|
...add error checking for plpa_happy=no case...
|
||||||
shell$ edit src/my_program.c
|
shell$ edit src/my_program.c
|
||||||
...add #include <plpa.h>...
|
...add #include <plpa.h>...
|
||||||
...add calls to plpa_sched_setaffinity()...
|
...add calls to sandbox_plpa_sched_setaffinity()...
|
||||||
shell$ aclocal
|
shell$ aclocal
|
||||||
shell$ autoconf
|
shell$ autoconf
|
||||||
shell$ libtoolize --automake
|
shell$ libtoolize --automake
|
||||||
@ -410,8 +457,8 @@ shell$ make
|
|||||||
How can I tell if PLPA is working?
|
How can I tell if PLPA is working?
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
Run plpa_info; if it says "PLPA_PROBE_OK", then PLPA is working
|
Run plpa-info; if it says "Kernel affinity support: yes", then PLPA is
|
||||||
properly.
|
working properly.
|
||||||
|
|
||||||
If you want to compile your own test program to verify it, try
|
If you want to compile your own test program to verify it, try
|
||||||
compiling and running the following:
|
compiling and running the following:
|
||||||
@ -421,7 +468,8 @@ compiling and running the following:
|
|||||||
#include <plpa.h>
|
#include <plpa.h>
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
if (PLPA_PROBE_OK == plpa_api_probe()) {
|
plpa_api_type_t p;
|
||||||
|
if (0 == plpa_api_probe(&p) && PLPA_PROBE_OK == p) {
|
||||||
printf("All is good!\n");
|
printf("All is good!\n");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
(from helpful AMD engineers...)
|
|
||||||
|
|
||||||
Jeff,
|
|
||||||
|
|
||||||
Bill asked me to expand on what I previously wrote by documenting the
|
|
||||||
/sys interface. Without further ado:
|
|
||||||
|
|
||||||
All the information you need for determining the topology of a given
|
|
||||||
core is located in the /sys/devices/system/cpu/cpuX/topology/
|
|
||||||
directory, where X is a core number from 0 to N - 1, given N total
|
|
||||||
cores present on the system. On an AMD64 system, this directory will
|
|
||||||
contain the following entries, readable in ASCII form:
|
|
||||||
|
|
||||||
physical_package_id - which socket am I in?
|
|
||||||
core_id - in my socket, which core am
|
|
||||||
I? (0 or 1
|
|
||||||
for dual-core CPUs)
|
|
||||||
core_siblings - who are my sibling cores in this
|
|
||||||
socket? (see below)
|
|
||||||
thread_siblings - who are my sibling threads
|
|
||||||
in this
|
|
||||||
socket? (not really useful for AMD64)
|
|
||||||
|
|
||||||
The sibling fields are given as bit masks of core IDs, represented as
|
|
||||||
hexdecimal numbers delimited by commas into groups of eight for easier
|
|
||||||
readability. So for example, given a kernel that supports a maximum
|
|
||||||
of 128 cores:
|
|
||||||
|
|
||||||
cparrott@compute-2:~> cat
|
|
||||||
/sys/devices/system/cpu/cpu0/topology/core_siblings
|
|
||||||
00000000,00000000,00000000,00000003
|
|
||||||
|
|
||||||
would tell us that cores 0 and 1 are the sibling cores of core 0.
|
|
||||||
Each core is included in its own sibling core mask, so you would still
|
|
||||||
get a meaningful result if you happened to be running on a single-core
|
|
||||||
system.
|
|
||||||
|
|
||||||
Given that these are NUMA systems, you may assume that each socket may
|
|
||||||
or may not have a region of memory associated with it. Most systems
|
|
||||||
do, but I have seen a few that had sockets without associated memory.
|
|
||||||
My dual-Opteron Linux workstation system at my desk is a prime example
|
|
||||||
of this -- all of its memory appears to the kernel as being directly
|
|
||||||
connected to socket 0.
|
|
||||||
|
|
||||||
Unfortunately, I am not aware of an easy mechanism for determining the
|
|
||||||
memory associated with a given socket, although this information does
|
|
||||||
show up in the kernel messages buffer during boot. (i.e. run dmesg)
|
|
||||||
Perhaps Ray might know.
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
Followup to this:
|
|
||||||
|
|
||||||
The /sys/devices/system/node/ directory tree contains the memory node
|
|
||||||
topology. Of particular interest here is numastat entry: this will
|
|
||||||
give stats on which of this node's pages are physically located here
|
|
||||||
versus foreign nodes, for example.
|
|
||||||
|
|
||||||
Unfortunately, memory mappings for specific address ranges to nodes
|
|
||||||
are not available. I suspect that this is probably due to the fact
|
|
||||||
that Linux uses virtual addressing everywhere in userland, so any
|
|
||||||
physical address ranges corresponding to a particular memory node are
|
|
||||||
meaningless in userland.
|
|
@ -16,12 +16,12 @@ release=0
|
|||||||
# requirement is that it must be entirely printable ASCII characters
|
# requirement is that it must be entirely printable ASCII characters
|
||||||
# and have no white space.
|
# and have no white space.
|
||||||
|
|
||||||
greek=a1
|
greek=
|
||||||
|
|
||||||
# If want_svn=1, then the SVN r number will be included in the overall
|
# If want_svn=1, then the SVN r number will be included in the overall
|
||||||
# PLPA version number in some form.
|
# PLPA version number in some form.
|
||||||
|
|
||||||
want_svn=1
|
want_svn=0
|
||||||
|
|
||||||
# If svn_r=-1, then the SVN r numbere will be obtained dynamically at
|
# If svn_r=-1, then the SVN r numbere will be obtained dynamically at
|
||||||
# run time, either 1) via the "svnversion" command (if this is a
|
# run time, either 1) via the "svnversion" command (if this is a
|
||||||
@ -33,4 +33,4 @@ want_svn=1
|
|||||||
# distribution tarball is being made from an SVN checkout, the value
|
# distribution tarball is being made from an SVN checkout, the value
|
||||||
# of svn_r in this file is replaced with the output of "svnversion".
|
# of svn_r in this file is replaced with the output of "svnversion".
|
||||||
|
|
||||||
svn_r=-1
|
svn_r=r147:149
|
||||||
|
8764
opal/mca/paffinity/linux/plpa/aclocal.m4
поставляемый
Обычный файл
8764
opal/mca/paffinity/linux/plpa/aclocal.m4
поставляемый
Обычный файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -10,7 +10,7 @@
|
|||||||
# University of Stuttgart. All rights reserved.
|
# University of Stuttgart. All rights reserved.
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
# Copyright (c) 2007 Cisco, Inc. All rights reserved.
|
# Copyright (c) 2007-2008 Cisco, Inc. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -325,6 +325,7 @@ run_gnu_tools() {
|
|||||||
find_and_delete missing
|
find_and_delete missing
|
||||||
find_and_delete mkinstalldirs
|
find_and_delete mkinstalldirs
|
||||||
find_and_delete libtool
|
find_and_delete libtool
|
||||||
|
find_and_delete configure
|
||||||
|
|
||||||
# Run the GNU tools
|
# Run the GNU tools
|
||||||
|
|
||||||
@ -360,13 +361,13 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test -f VERSION -a -f configure.ac -a -f src/libplpa/plpa_bottom.h ; then
|
if test -f VERSION -a -f configure.ac -a -f src/libplpa/plpa.h.in ; then
|
||||||
# Top level of PLPA tree
|
# Top level of PLPA tree
|
||||||
uptime > /dev/null
|
uptime > /dev/null
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
You must run this script from either the top level of the OMPI
|
You must run this script from either the top level of the PLPA
|
||||||
directory tree or the top-level of an MCA component directory tree.
|
directory tree or the top-level of an MCA component directory tree.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
142
opal/mca/paffinity/linux/plpa/config/compile
Исполняемый файл
142
opal/mca/paffinity/linux/plpa/config/compile
Исполняемый файл
@ -0,0 +1,142 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Wrapper for compilers which do not understand `-c -o'.
|
||||||
|
|
||||||
|
scriptversion=2005-05-14.22
|
||||||
|
|
||||||
|
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, 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 General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# This file is maintained in Automake, please report
|
||||||
|
# bugs to <bug-automake@gnu.org> or send patches to
|
||||||
|
# <automake-patches@gnu.org>.
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
'')
|
||||||
|
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
-h | --h*)
|
||||||
|
cat <<\EOF
|
||||||
|
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||||
|
|
||||||
|
Wrapper for compilers which do not understand `-c -o'.
|
||||||
|
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||||
|
arguments, and rename the output as expected.
|
||||||
|
|
||||||
|
If you are trying to build a whole package this is not the
|
||||||
|
right script to run: please start by reading the file `INSTALL'.
|
||||||
|
|
||||||
|
Report bugs to <bug-automake@gnu.org>.
|
||||||
|
EOF
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-v | --v*)
|
||||||
|
echo "compile $scriptversion"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ofile=
|
||||||
|
cfile=
|
||||||
|
eat=
|
||||||
|
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$eat"; then
|
||||||
|
eat=
|
||||||
|
else
|
||||||
|
case $1 in
|
||||||
|
-o)
|
||||||
|
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||||
|
# So we strip `-o arg' only if arg is an object.
|
||||||
|
eat=1
|
||||||
|
case $2 in
|
||||||
|
*.o | *.obj)
|
||||||
|
ofile=$2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set x "$@" -o "$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*.c)
|
||||||
|
cfile=$1
|
||||||
|
set x "$@" "$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set x "$@" "$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -z "$ofile" || test -z "$cfile"; then
|
||||||
|
# If no `-o' option was seen then we might have been invoked from a
|
||||||
|
# pattern rule where we don't need one. That is ok -- this is a
|
||||||
|
# normal compilation that the losing compiler can handle. If no
|
||||||
|
# `.c' file was seen then we are probably linking. That is also
|
||||||
|
# ok.
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Name of file we expect compiler to create.
|
||||||
|
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||||
|
|
||||||
|
# Create the lock directory.
|
||||||
|
# Note: use `[/.-]' here to ensure that we don't use the same name
|
||||||
|
# that we are using for the .o file. Also, base the name on the expected
|
||||||
|
# object file name, since that is what matters with a parallel build.
|
||||||
|
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
|
||||||
|
while true; do
|
||||||
|
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
# FIXME: race condition here if user kills between mkdir and trap.
|
||||||
|
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||||
|
|
||||||
|
# Run the compile.
|
||||||
|
"$@"
|
||||||
|
ret=$?
|
||||||
|
|
||||||
|
if test -f "$cofile"; then
|
||||||
|
mv "$cofile" "$ofile"
|
||||||
|
elif test -f "${cofile}bj"; then
|
||||||
|
mv "${cofile}bj" "$ofile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rmdir "$lockdir"
|
||||||
|
exit $ret
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
1526
opal/mca/paffinity/linux/plpa/config/config.guess
поставляемый
Исполняемый файл
1526
opal/mca/paffinity/linux/plpa/config/config.guess
поставляемый
Исполняемый файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
1658
opal/mca/paffinity/linux/plpa/config/config.sub
поставляемый
Исполняемый файл
1658
opal/mca/paffinity/linux/plpa/config/config.sub
поставляемый
Исполняемый файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
584
opal/mca/paffinity/linux/plpa/config/depcomp
Исполняемый файл
584
opal/mca/paffinity/linux/plpa/config/depcomp
Исполняемый файл
@ -0,0 +1,584 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# depcomp - compile a program generating dependencies as side-effects
|
||||||
|
|
||||||
|
scriptversion=2006-10-15.18
|
||||||
|
|
||||||
|
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, 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 General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
'')
|
||||||
|
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
-h | --h*)
|
||||||
|
cat <<\EOF
|
||||||
|
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||||
|
|
||||||
|
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||||
|
as side-effects.
|
||||||
|
|
||||||
|
Environment variables:
|
||||||
|
depmode Dependency tracking mode.
|
||||||
|
source Source file read by `PROGRAMS ARGS'.
|
||||||
|
object Object file output by `PROGRAMS ARGS'.
|
||||||
|
DEPDIR directory where to store dependencies.
|
||||||
|
depfile Dependency file to output.
|
||||||
|
tmpdepfile Temporary file to use when outputing dependencies.
|
||||||
|
libtool Whether libtool is used (yes/no).
|
||||||
|
|
||||||
|
Report bugs to <bug-automake@gnu.org>.
|
||||||
|
EOF
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-v | --v*)
|
||||||
|
echo "depcomp $scriptversion"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||||
|
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||||
|
depfile=${depfile-`echo "$object" |
|
||||||
|
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||||
|
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||||
|
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
|
||||||
|
# Some modes work just like other modes, but use different flags. We
|
||||||
|
# parameterize here, but still list the modes in the big case below,
|
||||||
|
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||||
|
# here, because this file can only contain one case statement.
|
||||||
|
if test "$depmode" = hp; then
|
||||||
|
# HP compiler uses -M and no extra arg.
|
||||||
|
gccflag=-M
|
||||||
|
depmode=gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$depmode" = dashXmstdout; then
|
||||||
|
# This is just like dashmstdout with a different argument.
|
||||||
|
dashmflag=-xM
|
||||||
|
depmode=dashmstdout
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$depmode" in
|
||||||
|
gcc3)
|
||||||
|
## gcc 3 implements dependency tracking that does exactly what
|
||||||
|
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||||
|
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||||
|
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||||
|
## the command line argument order; so add the flags where they
|
||||||
|
## appear in depend2.am. Note that the slowdown incurred here
|
||||||
|
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||||
|
*) set fnord "$@" "$arg" ;;
|
||||||
|
esac
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
done
|
||||||
|
"$@"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
mv "$tmpdepfile" "$depfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
gcc)
|
||||||
|
## There are various ways to get dependency output from gcc. Here's
|
||||||
|
## why we pick this rather obscure method:
|
||||||
|
## - Don't want to use -MD because we'd like the dependencies to end
|
||||||
|
## up in a subdir. Having to rename by hand is ugly.
|
||||||
|
## (We might end up doing this anyway to support other compilers.)
|
||||||
|
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||||
|
## -MM, not -M (despite what the docs say).
|
||||||
|
## - Using -M directly means running the compiler twice (even worse
|
||||||
|
## than renaming).
|
||||||
|
if test -z "$gccflag"; then
|
||||||
|
gccflag=-MD,
|
||||||
|
fi
|
||||||
|
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||||
|
## The second -e expression handles DOS-style file names with drive letters.
|
||||||
|
sed -e 's/^[^:]*: / /' \
|
||||||
|
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||||
|
## This next piece of magic avoids the `deleted header file' problem.
|
||||||
|
## The problem is that when a header file which appears in a .P file
|
||||||
|
## is deleted, the dependency causes make to die (because there is
|
||||||
|
## typically no way to rebuild the header). We avoid this by adding
|
||||||
|
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||||
|
## this for us directly.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" |
|
||||||
|
## Some versions of gcc put a space before the `:'. On the theory
|
||||||
|
## that the space means something, we add a space to the output as
|
||||||
|
## well.
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
hp)
|
||||||
|
# This case exists only to let depend.m4 do its work. It works by
|
||||||
|
# looking at the text of this script. This case will never be run,
|
||||||
|
# since it is checked for above.
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
sgi)
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||||
|
else
|
||||||
|
"$@" -MDupdate "$tmpdepfile"
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
|
||||||
|
# Clip off the initial element (the dependent). Don't try to be
|
||||||
|
# clever and replace this with sed code, as IRIX sed won't handle
|
||||||
|
# lines with more than a fixed number of characters (4096 in
|
||||||
|
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||||
|
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||||
|
# dependency line.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||||
|
tr '
|
||||||
|
' ' ' >> $depfile
|
||||||
|
echo >> $depfile
|
||||||
|
|
||||||
|
# The second pass generates a dummy entry for each header file.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||||
|
>> $depfile
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
aix)
|
||||||
|
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||||
|
# in a .u file. In older versions, this file always lives in the
|
||||||
|
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||||
|
# start of each line; $object doesn't have directory information.
|
||||||
|
# Version 6 uses the directory in both cases.
|
||||||
|
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||||
|
tmpdepfile="$stripped.u"
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" -Wc,-M
|
||||||
|
else
|
||||||
|
"$@" -M
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then :
|
||||||
|
else
|
||||||
|
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||||
|
tmpdepfile="$stripped.u"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
outname="$stripped.o"
|
||||||
|
# Each line is of the form `foo.o: dependent.h'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
|
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||||
|
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
icc)
|
||||||
|
# Intel's C compiler understands `-MD -MF file'. However on
|
||||||
|
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||||
|
# ICC 7.0 will fill foo.d with something like
|
||||||
|
# foo.o: sub/foo.c
|
||||||
|
# foo.o: sub/foo.h
|
||||||
|
# which is wrong. We want:
|
||||||
|
# sub/foo.o: sub/foo.c
|
||||||
|
# sub/foo.o: sub/foo.h
|
||||||
|
# sub/foo.c:
|
||||||
|
# sub/foo.h:
|
||||||
|
# ICC 7.1 will output
|
||||||
|
# foo.o: sub/foo.c sub/foo.h
|
||||||
|
# and will wrap long lines using \ :
|
||||||
|
# foo.o: sub/foo.c ... \
|
||||||
|
# sub/foo.h ... \
|
||||||
|
# ...
|
||||||
|
|
||||||
|
"$@" -MD -MF "$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
# Each line is of the form `foo.o: dependent.h',
|
||||||
|
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
|
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||||
|
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
# correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||||
|
sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
hp2)
|
||||||
|
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||||
|
# compilers, which have integrated preprocessors. The correct option
|
||||||
|
# to use with these is +Maked; it writes dependencies to a file named
|
||||||
|
# 'foo.d', which lands next to the object file, wherever that
|
||||||
|
# happens to be.
|
||||||
|
# Much of this is similar to the tru64 case; see comments there.
|
||||||
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
tmpdepfile1=$dir$base.d
|
||||||
|
tmpdepfile2=$dir.libs/$base.d
|
||||||
|
"$@" -Wc,+Maked
|
||||||
|
else
|
||||||
|
tmpdepfile1=$dir$base.d
|
||||||
|
tmpdepfile2=$dir$base.d
|
||||||
|
"$@" +Maked
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||||
|
do
|
||||||
|
test -f "$tmpdepfile" && break
|
||||||
|
done
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||||
|
# Add `dependent.h:' lines.
|
||||||
|
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||||
|
;;
|
||||||
|
|
||||||
|
tru64)
|
||||||
|
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||||
|
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||||
|
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||||
|
# dependencies in `foo.d' instead, so we check for that too.
|
||||||
|
# Subdirectories are respected.
|
||||||
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
# With Tru64 cc, shared objects can also be used to make a
|
||||||
|
# static library. This mechanism is used in libtool 1.4 series to
|
||||||
|
# handle both shared and static libraries in a single compilation.
|
||||||
|
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||||
|
#
|
||||||
|
# With libtool 1.5 this exception was removed, and libtool now
|
||||||
|
# generates 2 separate objects for the 2 libraries. These two
|
||||||
|
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||||
|
# in $dir$base.o.d. We have to check for both files, because
|
||||||
|
# one of the two compilations can be disabled. We should prefer
|
||||||
|
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||||
|
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||||
|
# the former would cause a distcleancheck panic.
|
||||||
|
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||||
|
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||||
|
"$@" -Wc,-MD
|
||||||
|
else
|
||||||
|
tmpdepfile1=$dir$base.o.d
|
||||||
|
tmpdepfile2=$dir$base.d
|
||||||
|
tmpdepfile3=$dir$base.d
|
||||||
|
tmpdepfile4=$dir$base.d
|
||||||
|
"$@" -MD
|
||||||
|
fi
|
||||||
|
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
|
do
|
||||||
|
test -f "$tmpdepfile" && break
|
||||||
|
done
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
|
# That's a tab and a space in the [].
|
||||||
|
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
#nosideeffect)
|
||||||
|
# This comment above is used by automake to tell side-effect
|
||||||
|
# dependency tracking mechanisms from slower ones.
|
||||||
|
|
||||||
|
dashmstdout)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout, regardless of -o.
|
||||||
|
"$@" || exit $?
|
||||||
|
|
||||||
|
# Remove the call to Libtool.
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove `-o $object'.
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-o)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
$object)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
test -z "$dashmflag" && dashmflag=-M
|
||||||
|
# Require at least two characters before searching for `:'
|
||||||
|
# in the target name. This is to cope with DOS-style filenames:
|
||||||
|
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||||
|
"$@" $dashmflag |
|
||||||
|
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
dashXmstdout)
|
||||||
|
# This case only exists to satisfy depend.m4. It is never actually
|
||||||
|
# run, as this mode is specially recognized in the preamble.
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
makedepend)
|
||||||
|
"$@" || exit $?
|
||||||
|
# Remove any Libtool call
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
# X makedepend
|
||||||
|
shift
|
||||||
|
cleared=no
|
||||||
|
for arg in "$@"; do
|
||||||
|
case $cleared in
|
||||||
|
no)
|
||||||
|
set ""; shift
|
||||||
|
cleared=yes ;;
|
||||||
|
esac
|
||||||
|
case "$arg" in
|
||||||
|
-D*|-I*)
|
||||||
|
set fnord "$@" "$arg"; shift ;;
|
||||||
|
# Strip any option that makedepend may not understand. Remove
|
||||||
|
# the object too, otherwise makedepend will parse it as a source file.
|
||||||
|
-*|$object)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"; shift ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||||
|
touch "$tmpdepfile"
|
||||||
|
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||||
|
' | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||||
|
;;
|
||||||
|
|
||||||
|
cpp)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout.
|
||||||
|
"$@" || exit $?
|
||||||
|
|
||||||
|
# Remove the call to Libtool.
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove `-o $object'.
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-o)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
$object)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
"$@" -E |
|
||||||
|
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||||
|
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||||
|
sed '$ s: \\$::' > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
cat < "$tmpdepfile" >> "$depfile"
|
||||||
|
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
msvisualcpp)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout, regardless of -o,
|
||||||
|
# because we must use -o when running libtool.
|
||||||
|
"$@" || exit $?
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case "$arg" in
|
||||||
|
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||||
|
set fnord "$@"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
"$@" -E |
|
||||||
|
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||||
|
echo " " >> "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
none)
|
||||||
|
exec "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unknown depmode $depmode" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
507
opal/mca/paffinity/linux/plpa/config/install-sh
Исполняемый файл
507
opal/mca/paffinity/linux/plpa/config/install-sh
Исполняемый файл
@ -0,0 +1,507 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
|
scriptversion=2006-10-14.15
|
||||||
|
|
||||||
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
|
# following copyright and license.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1994 X Consortium
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to
|
||||||
|
# deal in the Software without restriction, including without limitation the
|
||||||
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
# sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||||
|
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# Except as contained in this notice, the name of the X Consortium shall not
|
||||||
|
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||||
|
# ings in this Software without prior written authorization from the X Consor-
|
||||||
|
# tium.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# FSF changes to this file are in the public domain.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch.
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
IFS=" "" $nl"
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit="${DOITPROG-}"
|
||||||
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put in absolute file names if you don't have them in your path;
|
||||||
|
# or use environment vars.
|
||||||
|
|
||||||
|
mvprog="${MVPROG-mv}"
|
||||||
|
cpprog="${CPPROG-cp}"
|
||||||
|
chmodprog="${CHMODPROG-chmod}"
|
||||||
|
chownprog="${CHOWNPROG-chown}"
|
||||||
|
chgrpprog="${CHGRPPROG-chgrp}"
|
||||||
|
stripprog="${STRIPPROG-strip}"
|
||||||
|
rmprog="${RMPROG-rm}"
|
||||||
|
mkdirprog="${MKDIRPROG-mkdir}"
|
||||||
|
|
||||||
|
posix_glob=
|
||||||
|
posix_mkdir=
|
||||||
|
|
||||||
|
# Desired mode of installed file.
|
||||||
|
mode=0755
|
||||||
|
|
||||||
|
chmodcmd=$chmodprog
|
||||||
|
chowncmd=
|
||||||
|
chgrpcmd=
|
||||||
|
stripcmd=
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
mvcmd="$mvprog"
|
||||||
|
src=
|
||||||
|
dst=
|
||||||
|
dir_arg=
|
||||||
|
dstarg=
|
||||||
|
no_target_directory=
|
||||||
|
|
||||||
|
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
|
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||||
|
or: $0 [OPTION]... -d DIRECTORIES...
|
||||||
|
|
||||||
|
In the 1st form, copy SRCFILE to DSTFILE.
|
||||||
|
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||||
|
In the 4th, create DIRECTORIES.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-c (ignored)
|
||||||
|
-d create directories instead of installing files.
|
||||||
|
-g GROUP $chgrpprog installed files to GROUP.
|
||||||
|
-m MODE $chmodprog installed files to MODE.
|
||||||
|
-o USER $chownprog installed files to USER.
|
||||||
|
-s $stripprog installed files.
|
||||||
|
-t DIRECTORY install into DIRECTORY.
|
||||||
|
-T report an error if DSTFILE is a directory.
|
||||||
|
--help display this help and exit.
|
||||||
|
--version display version info and exit.
|
||||||
|
|
||||||
|
Environment variables override the default commands:
|
||||||
|
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||||
|
"
|
||||||
|
|
||||||
|
while test $# -ne 0; do
|
||||||
|
case $1 in
|
||||||
|
-c) shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-d) dir_arg=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
--help) echo "$usage"; exit $?;;
|
||||||
|
|
||||||
|
-m) mode=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
case $mode in
|
||||||
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
|
echo "$0: invalid mode: $mode" >&2
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-s) stripcmd=$stripprog
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-t) dstarg=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-T) no_target_directory=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
|
--) shift
|
||||||
|
break;;
|
||||||
|
|
||||||
|
-*) echo "$0: invalid option: $1" >&2
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
|
||||||
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
|
# When -t is used, the destination is already specified.
|
||||||
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$dstarg"; then
|
||||||
|
# $@ is not empty: it contains at least $arg.
|
||||||
|
set fnord "$@" "$dstarg"
|
||||||
|
shift # fnord
|
||||||
|
fi
|
||||||
|
shift # arg
|
||||||
|
dstarg=$arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
echo "$0: no input file specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# It's OK to call `install-sh -d' without argument.
|
||||||
|
# This can happen when creating conditional directories.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
|
|
||||||
|
# Set umask so as not to create temps with too-generous modes.
|
||||||
|
# However, 'strip' requires both read and write access to temps.
|
||||||
|
case $mode in
|
||||||
|
# Optimize common cases.
|
||||||
|
*644) cp_umask=133;;
|
||||||
|
*755) cp_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw='% 200'
|
||||||
|
fi
|
||||||
|
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||||
|
*)
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw=,u+rw
|
||||||
|
fi
|
||||||
|
cp_umask=$mode$u_plus_rw;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for src
|
||||||
|
do
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $src in
|
||||||
|
-*) src=./$src ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
dst=$src
|
||||||
|
dstdir=$dst
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
if test ! -f "$src" && test ! -d "$src"; then
|
||||||
|
echo "$0: $src does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dstarg"; then
|
||||||
|
echo "$0: no destination specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dst=$dstarg
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $dst in
|
||||||
|
-*) dst=./$dst ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; won't work
|
||||||
|
# if double slashes aren't ignored.
|
||||||
|
if test -d "$dst"; then
|
||||||
|
if test -n "$no_target_directory"; then
|
||||||
|
echo "$0: $dstarg: Is a directory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
dstdir=$dst
|
||||||
|
dst=$dstdir/`basename "$src"`
|
||||||
|
dstdir_status=0
|
||||||
|
else
|
||||||
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
obsolete_mkdir_used=false
|
||||||
|
|
||||||
|
if test $dstdir_status != 0; then
|
||||||
|
case $posix_mkdir in
|
||||||
|
'')
|
||||||
|
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||||
|
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||||
|
umask=`umask`
|
||||||
|
case $stripcmd.$umask in
|
||||||
|
# Optimize common cases.
|
||||||
|
*[2367][2367]) mkdir_umask=$umask;;
|
||||||
|
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
mkdir_umask=`expr $umask + 22 \
|
||||||
|
- $umask % 100 % 40 + $umask % 20 \
|
||||||
|
- $umask % 10 % 4 + $umask % 2
|
||||||
|
`;;
|
||||||
|
*) mkdir_umask=$umask,go-w;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# With -d, create the new directory with the user-specified mode.
|
||||||
|
# Otherwise, rely on $mkdir_umask.
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
mkdir_mode=-m$mode
|
||||||
|
else
|
||||||
|
mkdir_mode=
|
||||||
|
fi
|
||||||
|
|
||||||
|
posix_mkdir=false
|
||||||
|
case $umask in
|
||||||
|
*[123567][0-7][0-7])
|
||||||
|
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||||
|
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||||
|
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||||
|
|
||||||
|
if (umask $mkdir_umask &&
|
||||||
|
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
if test -z "$dir_arg" || {
|
||||||
|
# Check for POSIX incompatibilities with -m.
|
||||||
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
|
case $ls_ld_tmpdir in
|
||||||
|
d????-?r-*) different_mode=700;;
|
||||||
|
d????-?--*) different_mode=755;;
|
||||||
|
*) false;;
|
||||||
|
esac &&
|
||||||
|
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||||
|
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||||
|
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
then posix_mkdir=:
|
||||||
|
fi
|
||||||
|
rmdir "$tmpdir/d" "$tmpdir"
|
||||||
|
else
|
||||||
|
# Remove any dirs left behind by ancient mkdir implementations.
|
||||||
|
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||||
|
fi
|
||||||
|
trap '' 0;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if
|
||||||
|
$posix_mkdir && (
|
||||||
|
umask $mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||||
|
)
|
||||||
|
then :
|
||||||
|
else
|
||||||
|
|
||||||
|
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||||
|
# or it failed possibly due to a race condition. Create the
|
||||||
|
# directory the slow way, step by step, checking for races as we go.
|
||||||
|
|
||||||
|
case $dstdir in
|
||||||
|
/*) prefix=/ ;;
|
||||||
|
-*) prefix=./ ;;
|
||||||
|
*) prefix= ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $posix_glob in
|
||||||
|
'')
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=true
|
||||||
|
else
|
||||||
|
posix_glob=false
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
oIFS=$IFS
|
||||||
|
IFS=/
|
||||||
|
$posix_glob && set -f
|
||||||
|
set fnord $dstdir
|
||||||
|
shift
|
||||||
|
$posix_glob && set +f
|
||||||
|
IFS=$oIFS
|
||||||
|
|
||||||
|
prefixes=
|
||||||
|
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
test -z "$d" && continue
|
||||||
|
|
||||||
|
prefix=$prefix$d
|
||||||
|
if test -d "$prefix"; then
|
||||||
|
prefixes=
|
||||||
|
else
|
||||||
|
if $posix_mkdir; then
|
||||||
|
(umask=$mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
test -d "$prefix" || exit 1
|
||||||
|
else
|
||||||
|
case $prefix in
|
||||||
|
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||||
|
*) qprefix=$prefix;;
|
||||||
|
esac
|
||||||
|
prefixes="$prefixes '$qprefix'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
prefix=$prefix/
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -n "$prefixes"; then
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
(umask $mkdir_umask &&
|
||||||
|
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||||
|
test -d "$dstdir" || exit 1
|
||||||
|
obsolete_mkdir_used=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||||
|
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||||
|
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||||
|
else
|
||||||
|
|
||||||
|
# Make a couple of temp file names in the proper directory.
|
||||||
|
dsttmp=$dstdir/_inst.$$_
|
||||||
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
|
# Trap to clean up those temp files at exit.
|
||||||
|
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||||
|
|
||||||
|
# Copy the file name to the temp name.
|
||||||
|
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
|
#
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||||
|
#
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||||
|
|| {
|
||||||
|
# The rename failed, perhaps because mv can't rename something else
|
||||||
|
# to itself, or perhaps because mv is so ancient that it does not
|
||||||
|
# support -f.
|
||||||
|
|
||||||
|
# Now remove or move aside any old file at destination location.
|
||||||
|
# We try this two ways since rm can't unlink itself on some
|
||||||
|
# systems and the destination file might be busy for other
|
||||||
|
# reasons. In this case, the final cleanup might fail but the new
|
||||||
|
# file should still install successfully.
|
||||||
|
{
|
||||||
|
if test -f "$dst"; then
|
||||||
|
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||||
|
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||||
|
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||||
|
|| {
|
||||||
|
echo "$0: cannot unlink or rename $dst" >&2
|
||||||
|
(exit 1); exit 1
|
||||||
|
}
|
||||||
|
else
|
||||||
|
:
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
$doit $mvcmd "$dsttmp" "$dst"
|
||||||
|
}
|
||||||
|
} || exit 1
|
||||||
|
|
||||||
|
trap '' 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
7739
opal/mca/paffinity/linux/plpa/config/ltmain.sh
Исполняемый файл
7739
opal/mca/paffinity/linux/plpa/config/ltmain.sh
Исполняемый файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
367
opal/mca/paffinity/linux/plpa/config/missing
Исполняемый файл
367
opal/mca/paffinity/linux/plpa/config/missing
Исполняемый файл
@ -0,0 +1,367 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Common stub for a few missing GNU programs while installing.
|
||||||
|
|
||||||
|
scriptversion=2006-05-10.23
|
||||||
|
|
||||||
|
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, 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 General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
run=:
|
||||||
|
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||||
|
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||||
|
|
||||||
|
# In the cases where this matters, `missing' is being run in the
|
||||||
|
# srcdir already.
|
||||||
|
if test -f configure.ac; then
|
||||||
|
configure_ac=configure.ac
|
||||||
|
else
|
||||||
|
configure_ac=configure.in
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg="missing on your system"
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--run)
|
||||||
|
# Try to run requested program, and just exit if it succeeds.
|
||||||
|
run=
|
||||||
|
shift
|
||||||
|
"$@" && exit 0
|
||||||
|
# Exit code 63 means version mismatch. This often happens
|
||||||
|
# when the user try to use an ancient version of a tool on
|
||||||
|
# a file that requires a minimum version. In this case we
|
||||||
|
# we should proceed has if the program had been absent, or
|
||||||
|
# if --run hadn't been passed.
|
||||||
|
if test $? = 63; then
|
||||||
|
run=:
|
||||||
|
msg="probably too old"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
-h|--h|--he|--hel|--help)
|
||||||
|
echo "\
|
||||||
|
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||||
|
|
||||||
|
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||||
|
error status if there is no known handling for PROGRAM.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help display this help and exit
|
||||||
|
-v, --version output version information and exit
|
||||||
|
--run try to run the given command, and emulate it if it fails
|
||||||
|
|
||||||
|
Supported PROGRAM values:
|
||||||
|
aclocal touch file \`aclocal.m4'
|
||||||
|
autoconf touch file \`configure'
|
||||||
|
autoheader touch file \`config.h.in'
|
||||||
|
autom4te touch the output file, or create a stub one
|
||||||
|
automake touch all \`Makefile.in' files
|
||||||
|
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
flex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
help2man touch the output file
|
||||||
|
lex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
makeinfo touch the output file
|
||||||
|
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||||
|
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
|
||||||
|
Send bug reports to <bug-automake@gnu.org>."
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||||
|
echo "missing $scriptversion (GNU Automake)"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*)
|
||||||
|
echo 1>&2 "$0: Unknown \`$1' option"
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Now exit if we have it, but it failed. Also exit now if we
|
||||||
|
# don't have it and --version was passed (most likely to detect
|
||||||
|
# the program).
|
||||||
|
case $1 in
|
||||||
|
lex|yacc)
|
||||||
|
# Not GNU programs, they don't have --version.
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar)
|
||||||
|
if test -n "$run"; then
|
||||||
|
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||||
|
exit 1
|
||||||
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
|
# Could not run --version or --help. This is probably someone
|
||||||
|
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||||
|
# $TOOL exists and not knowing $TOOL uses missing.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If it does not exist, or fails to run (possibly an outdated version),
|
||||||
|
# try to emulate it.
|
||||||
|
case $1 in
|
||||||
|
aclocal*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||||
|
any GNU archive site."
|
||||||
|
touch aclocal.m4
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoconf)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`${configure_ac}'. You might want to install the
|
||||||
|
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||||
|
archive site."
|
||||||
|
touch configure
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoheader)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||||
|
from any GNU archive site."
|
||||||
|
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||||
|
test -z "$files" && files="config.h"
|
||||||
|
touch_files=
|
||||||
|
for f in $files; do
|
||||||
|
case $f in
|
||||||
|
*:*) touch_files="$touch_files "`echo "$f" |
|
||||||
|
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||||
|
*) touch_files="$touch_files $f.in";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
touch $touch_files
|
||||||
|
;;
|
||||||
|
|
||||||
|
automake*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||||
|
You might want to install the \`Automake' and \`Perl' packages.
|
||||||
|
Grab them from any GNU archive site."
|
||||||
|
find . -type f -name Makefile.am -print |
|
||||||
|
sed 's/\.am$/.in/' |
|
||||||
|
while read f; do touch "$f"; done
|
||||||
|
;;
|
||||||
|
|
||||||
|
autom4te)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, but is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them.
|
||||||
|
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||||
|
archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo "#! /bin/sh"
|
||||||
|
echo "# Created by GNU Automake missing as a replacement of"
|
||||||
|
echo "# $ $@"
|
||||||
|
echo "exit 0"
|
||||||
|
chmod +x $file
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
bison|yacc)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' $msg. You should only need it if
|
||||||
|
you modified a \`.y' file. You may need the \`Bison' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Bison' from any GNU archive site."
|
||||||
|
rm -f y.tab.c y.tab.h
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.y)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.c
|
||||||
|
fi
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.h
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test ! -f y.tab.h; then
|
||||||
|
echo >y.tab.h
|
||||||
|
fi
|
||||||
|
if test ! -f y.tab.c; then
|
||||||
|
echo 'main() { return 0; }' >y.tab.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
lex|flex)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.l' file. You may need the \`Flex' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Flex' from any GNU archive site."
|
||||||
|
rm -f lex.yy.c
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.l)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test ! -f lex.yy.c; then
|
||||||
|
echo 'main() { return 0; }' >lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
help2man)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a dependency of a manual page. You may need the
|
||||||
|
\`Help2man' package in order for those modifications to take
|
||||||
|
effect. You can get \`Help2man' from any GNU archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo ".ab help2man is required to generate this page"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
makeinfo)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||||
|
indirectly affecting the aspect of the manual. The spurious
|
||||||
|
call might also be the consequence of using a buggy \`make' (AIX,
|
||||||
|
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||||
|
the \`GNU make' package. Grab either from any GNU archive site."
|
||||||
|
# The file to touch is that specified with -o ...
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -z "$file"; then
|
||||||
|
# ... or it is the one specified with @setfilename ...
|
||||||
|
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||||
|
file=`sed -n '
|
||||||
|
/^@setfilename/{
|
||||||
|
s/.* \([^ ]*\) *$/\1/
|
||||||
|
p
|
||||||
|
q
|
||||||
|
}' $infile`
|
||||||
|
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||||
|
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||||
|
fi
|
||||||
|
# If the file does not exist, the user really needs makeinfo;
|
||||||
|
# let's fail without touching anything.
|
||||||
|
test -f $file || exit 1
|
||||||
|
touch $file
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar)
|
||||||
|
shift
|
||||||
|
|
||||||
|
# We have already tried tar in the generic part.
|
||||||
|
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||||
|
# messages.
|
||||||
|
if (gnutar --version > /dev/null 2>&1); then
|
||||||
|
gnutar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
if (gtar --version > /dev/null 2>&1); then
|
||||||
|
gtar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
firstarg="$1"
|
||||||
|
if shift; then
|
||||||
|
case $firstarg in
|
||||||
|
*o*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/o//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case $firstarg in
|
||||||
|
*h*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/h//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||||
|
You may want to install GNU tar or Free paxutils, or check the
|
||||||
|
command line arguments."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, and is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them. Check the \`README' file,
|
||||||
|
it often tells you about the needed prerequisites for installing
|
||||||
|
this package. You may also peek at any GNU archive site, in case
|
||||||
|
some other package would contain this missing \`$1' program."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
@ -5,7 +5,7 @@
|
|||||||
# Corporation. All rights reserved.
|
# Corporation. All rights reserved.
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
# Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -22,6 +22,8 @@
|
|||||||
AC_DEFUN([PLPA_INIT],[
|
AC_DEFUN([PLPA_INIT],[
|
||||||
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
||||||
AC_REQUIRE([AC_PROG_CC])
|
AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_REQUIRE([AM_PROG_LEX])
|
||||||
|
AC_REQUIRE([AC_PROG_YACC])
|
||||||
|
|
||||||
# Check for syscall()
|
# Check for syscall()
|
||||||
AC_CHECK_FUNC([syscall], [happy=1], [happy=0])
|
AC_CHECK_FUNC([syscall], [happy=1], [happy=0])
|
||||||
@ -81,6 +83,15 @@ int i = 1;],
|
|||||||
[$2])
|
[$2])
|
||||||
PLPA_DO_AM_CONDITIONALS
|
PLPA_DO_AM_CONDITIONALS
|
||||||
|
|
||||||
|
AC_CONFIG_FILES(
|
||||||
|
plpa_config_prefix[/Makefile]
|
||||||
|
plpa_config_prefix[/config/Makefile]
|
||||||
|
plpa_config_prefix[/src/Makefile]
|
||||||
|
plpa_config_prefix[/src/libplpa/Makefile]
|
||||||
|
plpa_config_prefix[/src/plpa-info/Makefile]
|
||||||
|
plpa_config_prefix[/src/plpa-taskset/Makefile]
|
||||||
|
)
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
unset happy
|
unset happy
|
||||||
])dnl
|
])dnl
|
||||||
@ -101,56 +112,37 @@ AC_DEFUN([PLPA_INCLUDED],[
|
|||||||
m4_define([plpa_config_prefix],[$1])
|
m4_define([plpa_config_prefix],[$1])
|
||||||
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
||||||
plpa_mode=included
|
plpa_mode=included
|
||||||
|
PLPA_DISABLE_EXECUTABLES
|
||||||
|
])dnl
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
dnl JMS: No fortran bindings yet
|
||||||
|
dnl # Set whether the fortran bindings will be built or not
|
||||||
|
dnl AC_DEFUN([PLPA_FORTRAN],[
|
||||||
|
dnl AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
||||||
|
dnl
|
||||||
|
dnl # Need [] around entire following line to escape m4 properly
|
||||||
|
dnl [plpa_tmp=`echo $1 | tr '[:upper:]' '[:lower:]'`]
|
||||||
|
dnl if test "$1" = "0" -o "$1" = "n"; then
|
||||||
|
dnl plpa_fortran=no
|
||||||
|
dnl elif test "$1" = "1" -o "$1" = "y"; then
|
||||||
|
dnl plpa_fortran=yes
|
||||||
|
dnl else
|
||||||
|
dnl AC_MSG_WARN([Did not understand PLPA_FORTRAN argument ($1) -- ignored])
|
||||||
|
dnl fi
|
||||||
|
dnl ])dnl
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Disable building the executables
|
||||||
|
AC_DEFUN([PLPA_DISABLE_EXECUTABLES],[
|
||||||
|
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
||||||
plpa_executables=no
|
plpa_executables=no
|
||||||
])dnl
|
])dnl
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
# Set whether the fortran bindings will be built or not
|
|
||||||
AC_DEFUN([PLPA_FORTRAN],[
|
|
||||||
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
|
||||||
|
|
||||||
# Need [] around entire following line to escape m4 properly
|
|
||||||
[plpa_tmp=`echo $1 | tr '[:upper:]' '[:lower:]'`]
|
|
||||||
if test "$1" = "0" -o "$1" = "n"; then
|
|
||||||
plpa_fortran=no
|
|
||||||
elif test "$1" = "1" -o "$1" = "y"; then
|
|
||||||
plpa_fortran=yes
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([Did not understand PLPA_FORTRAN argument ($1) -- ignored])
|
|
||||||
fi
|
|
||||||
])dnl
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Set whether to build and install the executables or not
|
|
||||||
AC_DEFUN([PLPA_EXECUTABLES],[
|
|
||||||
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
|
||||||
|
|
||||||
# Need [] around entire following line to escape m4 properly
|
|
||||||
[plpa_tmp=`echo $1 | tr '[:upper:]' '[:lower:]'`]
|
|
||||||
if test "$1" = "0" -o "$1" = "n"; then
|
|
||||||
plpa_executables=no
|
|
||||||
elif test "$1" = "1" -o "$1" = "y"; then
|
|
||||||
plpa_executables=yes
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([Did not understand PLPA_EXECUTABLES argument ($1) -- ignored])
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# need to check for plpa_mode = included and plpa_executables=yes
|
|
||||||
# and print a big AC_MSG_WARN if both are true
|
|
||||||
|
|
||||||
if test "$plpa_mode" = "included" -a "$plpa_executables" = "yes" ; then
|
|
||||||
AC_MSG_WARN([ Attempting to build executables in included mode ])
|
|
||||||
AC_MSG_WARN([ This will fail - libplpa_included will be built ])
|
|
||||||
AC_MSG_WARN([ Executables expect libplpa ])
|
|
||||||
fi
|
|
||||||
|
|
||||||
])dnl
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Specify the symbol prefix
|
# Specify the symbol prefix
|
||||||
AC_DEFUN([PLPA_SET_SYMBOL_PREFIX],[
|
AC_DEFUN([PLPA_SET_SYMBOL_PREFIX],[
|
||||||
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
AC_REQUIRE([_PLPA_INTERNAL_SETUP])
|
||||||
@ -181,15 +173,16 @@ AC_DEFUN([_PLPA_INTERNAL_SETUP],[
|
|||||||
plpa_mode=standalone
|
plpa_mode=standalone
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fortran bindings, or no?
|
dnl JMS: No fortran bindings yet
|
||||||
AC_ARG_ENABLE([fortran],
|
dnl # Fortran bindings, or no?
|
||||||
AC_HELP_STRING([--disable-fortran],
|
dnl AC_ARG_ENABLE([fortran],
|
||||||
[Using --disable-fortran disables building the Fortran PLPA API bindings]))
|
dnl AC_HELP_STRING([--disable-fortran],
|
||||||
if test "$enable_fortran" = "yes" -o "$enable_fortran" = ""; then
|
dnl [Using --disable-fortran disables building the Fortran PLPA API bindings]))
|
||||||
plpa_fortran=yes
|
dnl if test "$enable_fortran" = "yes" -o "$enable_fortran" = ""; then
|
||||||
else
|
dnl plpa_fortran=yes
|
||||||
plpa_fortran=no
|
dnl else
|
||||||
fi
|
dnl plpa_fortran=no
|
||||||
|
dnl fi
|
||||||
|
|
||||||
# Build and install the executables or no?
|
# Build and install the executables or no?
|
||||||
AC_ARG_ENABLE([executables],
|
AC_ARG_ENABLE([executables],
|
||||||
@ -224,21 +217,16 @@ AC_DEFUN([_PLPA_INIT],[
|
|||||||
|
|
||||||
# We need to set a path for header, etc files depending on whether
|
# We need to set a path for header, etc files depending on whether
|
||||||
# we're standalone or included. this is taken care of by PLPA_INCLUDED.
|
# we're standalone or included. this is taken care of by PLPA_INCLUDED.
|
||||||
# Move AC_CONFIG_HEADER and AC_CONFIG_FILES to here, using the
|
|
||||||
# path prefix from PLPA_INCLUDED
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for PLPA config prefix])
|
AC_MSG_CHECKING([for PLPA config prefix])
|
||||||
AC_MSG_RESULT(plpa_config_prefix)
|
AC_MSG_RESULT(plpa_config_prefix)
|
||||||
|
|
||||||
|
# Note that plpa_config.h *MUST* be listed first so that it
|
||||||
|
# becomes the "main" config header file. Any AM_CONFIG_HEADERs
|
||||||
|
# after that (plpa.h) will only have selective #defines replaced,
|
||||||
|
# not the entire file.
|
||||||
|
AM_CONFIG_HEADER(plpa_config_prefix[/src/libplpa/plpa_config.h])
|
||||||
AM_CONFIG_HEADER(plpa_config_prefix[/src/libplpa/plpa.h])
|
AM_CONFIG_HEADER(plpa_config_prefix[/src/libplpa/plpa.h])
|
||||||
AC_CONFIG_FILES(
|
|
||||||
plpa_config_prefix[/Makefile]
|
|
||||||
plpa_config_prefix[/config/Makefile]
|
|
||||||
plpa_config_prefix[/src/Makefile]
|
|
||||||
plpa_config_prefix[/src/libplpa/Makefile]
|
|
||||||
plpa_config_prefix[/src/plpa-info/Makefile]
|
|
||||||
plpa_config_prefix[/src/plpa-taskset/Makefile]
|
|
||||||
)
|
|
||||||
|
|
||||||
# What prefix are we using?
|
# What prefix are we using?
|
||||||
AC_MSG_CHECKING([for PLPA symbol prefix])
|
AC_MSG_CHECKING([for PLPA symbol prefix])
|
||||||
@ -251,9 +239,10 @@ AC_DEFUN([_PLPA_INIT],[
|
|||||||
[The PLPA symbol prefix in all caps])
|
[The PLPA symbol prefix in all caps])
|
||||||
AC_MSG_RESULT([$plpa_symbol_prefix_value])
|
AC_MSG_RESULT([$plpa_symbol_prefix_value])
|
||||||
|
|
||||||
# Check for fortran
|
dnl JMS: No fortran bindings yet
|
||||||
AC_MSG_CHECKING([whether to build PLPA Fortran API])
|
dnl # Check for fortran
|
||||||
AC_MSG_RESULT([$plpa_fortran])
|
dnl AC_MSG_CHECKING([whether to build PLPA Fortran API])
|
||||||
|
dnl AC_MSG_RESULT([$plpa_fortran])
|
||||||
|
|
||||||
# Check whether to build the exectuables or not
|
# Check whether to build the exectuables or not
|
||||||
AC_MSG_CHECKING([whether to build PLPA executables])
|
AC_MSG_CHECKING([whether to build PLPA executables])
|
||||||
@ -263,9 +252,6 @@ AC_DEFUN([_PLPA_INIT],[
|
|||||||
if test "$plpa_executables" = "yes"; then
|
if test "$plpa_executables" = "yes"; then
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
fi
|
fi
|
||||||
# Always need these for make dist (both included and standalone)
|
|
||||||
AM_PROG_LEX
|
|
||||||
AC_PROG_YACC
|
|
||||||
|
|
||||||
# Success
|
# Success
|
||||||
$1
|
$1
|
||||||
@ -279,7 +265,8 @@ AC_DEFUN([_PLPA_INIT],[
|
|||||||
AC_DEFUN([PLPA_DO_AM_CONDITIONALS],[
|
AC_DEFUN([PLPA_DO_AM_CONDITIONALS],[
|
||||||
if test "$plpa_did_am_conditionals" != "yes"; then
|
if test "$plpa_did_am_conditionals" != "yes"; then
|
||||||
AM_CONDITIONAL([PLPA_BUILD_STANDALONE], [test "$plpa_mode" = "standalone"])
|
AM_CONDITIONAL([PLPA_BUILD_STANDALONE], [test "$plpa_mode" = "standalone"])
|
||||||
AM_CONDITIONAL(PLPA_BUILD_FORTRAN, [test "$plpa_fortran" = "yes"])
|
dnl JMS: No fortran bindings yet
|
||||||
|
dnl AM_CONDITIONAL(PLPA_BUILD_FORTRAN, [test "$plpa_fortran" = "yes"])
|
||||||
AM_CONDITIONAL(PLPA_BUILD_EXECUTABLES, [test "$plpa_executables" = "yes"])
|
AM_CONDITIONAL(PLPA_BUILD_EXECUTABLES, [test "$plpa_executables" = "yes"])
|
||||||
fi
|
fi
|
||||||
plpa_did_am_conditionals=yes
|
plpa_did_am_conditionals=yes
|
||||||
|
223
opal/mca/paffinity/linux/plpa/config/ylwrap
Исполняемый файл
223
opal/mca/paffinity/linux/plpa/config/ylwrap
Исполняемый файл
@ -0,0 +1,223 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# ylwrap - wrapper for lex/yacc invocations.
|
||||||
|
|
||||||
|
scriptversion=2005-05-14.22
|
||||||
|
|
||||||
|
# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, 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 General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# This file is maintained in Automake, please report
|
||||||
|
# bugs to <bug-automake@gnu.org> or send patches to
|
||||||
|
# <automake-patches@gnu.org>.
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
'')
|
||||||
|
echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
--basedir)
|
||||||
|
basedir=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
-h|--h*)
|
||||||
|
cat <<\EOF
|
||||||
|
Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
|
||||||
|
|
||||||
|
Wrapper for lex/yacc invocations, renaming files as desired.
|
||||||
|
|
||||||
|
INPUT is the input file
|
||||||
|
OUTPUT is one file PROG generates
|
||||||
|
DESIRED is the file we actually want instead of OUTPUT
|
||||||
|
PROGRAM is program to run
|
||||||
|
ARGS are passed to PROG
|
||||||
|
|
||||||
|
Any number of OUTPUT,DESIRED pairs may be used.
|
||||||
|
|
||||||
|
Report bugs to <bug-automake@gnu.org>.
|
||||||
|
EOF
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-v|--v*)
|
||||||
|
echo "ylwrap $scriptversion"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
# The input.
|
||||||
|
input="$1"
|
||||||
|
shift
|
||||||
|
case "$input" in
|
||||||
|
[\\/]* | ?:[\\/]*)
|
||||||
|
# Absolute path; do nothing.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# Relative path. Make it absolute.
|
||||||
|
input="`pwd`/$input"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
pairlist=
|
||||||
|
while test "$#" -ne 0; do
|
||||||
|
if test "$1" = "--"; then
|
||||||
|
shift
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
pairlist="$pairlist $1"
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# The program to run.
|
||||||
|
prog="$1"
|
||||||
|
shift
|
||||||
|
# Make any relative path in $prog absolute.
|
||||||
|
case "$prog" in
|
||||||
|
[\\/]* | ?:[\\/]*) ;;
|
||||||
|
*[\\/]*) prog="`pwd`/$prog" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# FIXME: add hostname here for parallel makes that run commands on
|
||||||
|
# other machines. But that might take us over the 14-char limit.
|
||||||
|
dirname=ylwrap$$
|
||||||
|
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
|
||||||
|
mkdir $dirname || exit 1
|
||||||
|
|
||||||
|
cd $dirname
|
||||||
|
|
||||||
|
case $# in
|
||||||
|
0) $prog "$input" ;;
|
||||||
|
*) $prog "$@" "$input" ;;
|
||||||
|
esac
|
||||||
|
ret=$?
|
||||||
|
|
||||||
|
if test $ret -eq 0; then
|
||||||
|
set X $pairlist
|
||||||
|
shift
|
||||||
|
first=yes
|
||||||
|
# Since DOS filename conventions don't allow two dots,
|
||||||
|
# the DOS version of Bison writes out y_tab.c instead of y.tab.c
|
||||||
|
# and y_tab.h instead of y.tab.h. Test to see if this is the case.
|
||||||
|
y_tab_nodot="no"
|
||||||
|
if test -f y_tab.c || test -f y_tab.h; then
|
||||||
|
y_tab_nodot="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The directory holding the input.
|
||||||
|
input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
|
||||||
|
# Quote $INPUT_DIR so we can use it in a regexp.
|
||||||
|
# FIXME: really we should care about more than `.' and `\'.
|
||||||
|
input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
|
||||||
|
|
||||||
|
while test "$#" -ne 0; do
|
||||||
|
from="$1"
|
||||||
|
# Handle y_tab.c and y_tab.h output by DOS
|
||||||
|
if test $y_tab_nodot = "yes"; then
|
||||||
|
if test $from = "y.tab.c"; then
|
||||||
|
from="y_tab.c"
|
||||||
|
else
|
||||||
|
if test $from = "y.tab.h"; then
|
||||||
|
from="y_tab.h"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test -f "$from"; then
|
||||||
|
# If $2 is an absolute path name, then just use that,
|
||||||
|
# otherwise prepend `../'.
|
||||||
|
case "$2" in
|
||||||
|
[\\/]* | ?:[\\/]*) target="$2";;
|
||||||
|
*) target="../$2";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# We do not want to overwrite a header file if it hasn't
|
||||||
|
# changed. This avoid useless recompilations. However the
|
||||||
|
# parser itself (the first file) should always be updated,
|
||||||
|
# because it is the destination of the .y.c rule in the
|
||||||
|
# Makefile. Divert the output of all other files to a temporary
|
||||||
|
# file so we can compare them to existing versions.
|
||||||
|
if test $first = no; then
|
||||||
|
realtarget="$target"
|
||||||
|
target="tmp-`echo $target | sed s/.*[\\/]//g`"
|
||||||
|
fi
|
||||||
|
# Edit out `#line' or `#' directives.
|
||||||
|
#
|
||||||
|
# We don't want the resulting debug information to point at
|
||||||
|
# an absolute srcdir; it is better for it to just mention the
|
||||||
|
# .y file with no path.
|
||||||
|
#
|
||||||
|
# We want to use the real output file name, not yy.lex.c for
|
||||||
|
# instance.
|
||||||
|
#
|
||||||
|
# We want the include guards to be adjusted too.
|
||||||
|
FROM=`echo "$from" | sed \
|
||||||
|
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
|
||||||
|
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
|
||||||
|
TARGET=`echo "$2" | sed \
|
||||||
|
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
|
||||||
|
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
|
||||||
|
|
||||||
|
sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
|
||||||
|
-e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
|
||||||
|
|
||||||
|
# Check whether header files must be updated.
|
||||||
|
if test $first = no; then
|
||||||
|
if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
|
||||||
|
echo "$2" is unchanged
|
||||||
|
rm -f "$target"
|
||||||
|
else
|
||||||
|
echo updating "$2"
|
||||||
|
mv -f "$target" "$realtarget"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# A missing file is only an error for the first file. This
|
||||||
|
# is a blatant hack to let us support using "yacc -d". If -d
|
||||||
|
# is not specified, we don't want an error when the header
|
||||||
|
# file is "missing".
|
||||||
|
if test $first = yes; then
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
first=no
|
||||||
|
done
|
||||||
|
else
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove the directory.
|
||||||
|
cd ..
|
||||||
|
rm -rf $dirname
|
||||||
|
|
||||||
|
exit $ret
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
13714
opal/mca/paffinity/linux/plpa/configure
поставляемый
Исполняемый файл
13714
opal/mca/paffinity/linux/plpa/configure
поставляемый
Исполняемый файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -10,7 +10,7 @@
|
|||||||
# University of Stuttgart. All rights reserved.
|
# University of Stuttgart. All rights reserved.
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
# Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -66,7 +66,7 @@ AH_TOP([/* -*- c -*-
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -74,23 +74,18 @@ AH_TOP([/* -*- c -*-
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PLPA_H
|
#ifndef PLPA_CONFIG_H
|
||||||
#define PLPA_H
|
#define PLPA_CONFIG_H
|
||||||
])
|
])
|
||||||
AH_BOTTOM([
|
AH_BOTTOM([
|
||||||
#if defined(__cplusplus) || defined(c_plusplus)
|
#endif /* PLPA_CONFIG_H */
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
#include "plpa_bottom.h"
|
|
||||||
#if defined(__cplusplus) || defined(c_plusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif /* PLPA_H */
|
|
||||||
])
|
])
|
||||||
|
|
||||||
# Compiler stuff
|
# Compiler stuff
|
||||||
|
CFLAGS_save="$CFLAGS"
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
|
CFLAGS="$CFLAGS_save"
|
||||||
|
|
||||||
# For the common developer case, if we're in a Subversion checkout and
|
# For the common developer case, if we're in a Subversion checkout and
|
||||||
# using the GNU compilers, turn on maximum warnings unless
|
# using the GNU compilers, turn on maximum warnings unless
|
||||||
|
199
opal/mca/paffinity/linux/plpa/contrib/dist/make_dist_tarball
поставляемый
199
opal/mca/paffinity/linux/plpa/contrib/dist/make_dist_tarball
поставляемый
@ -1,199 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
||||||
# University Research and Technology
|
|
||||||
# Corporation. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
||||||
# of Tennessee Research Foundation. All rights
|
|
||||||
# reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Version of auto tools that we want
|
|
||||||
#
|
|
||||||
|
|
||||||
AM_TARGET_VERSION=1.9.6
|
|
||||||
AC_TARGET_VERSION=2.59
|
|
||||||
LT_TARGET_VERSION=1.5.22
|
|
||||||
|
|
||||||
#
|
|
||||||
# First things first -- check that the auto versions that we have are
|
|
||||||
# the ones that we want.
|
|
||||||
#
|
|
||||||
|
|
||||||
check_gnu_version() {
|
|
||||||
prog="$1"
|
|
||||||
target="$2"
|
|
||||||
|
|
||||||
ver="`$prog --version | head -n 1 | cut -d\ -f 4`"
|
|
||||||
if test "$ver" != "$target"; then
|
|
||||||
cat <<EOF
|
|
||||||
ERROR: Program "$prog" does not have the correct/expected version:
|
|
||||||
Found: $ver
|
|
||||||
|
|
||||||
Expected versions:
|
|
||||||
Automake: $AM_TARGET_VERSION
|
|
||||||
Autoconf: $AC_TARGET_VERSION
|
|
||||||
Libtool: $LT_TARGET_VERSION
|
|
||||||
|
|
||||||
Either change this script to match the found version, or install
|
|
||||||
the correct version of the tools.
|
|
||||||
EOF
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
|
||||||
# Subroutine to actually make a tarball
|
|
||||||
#
|
|
||||||
|
|
||||||
make_tarball() {
|
|
||||||
#
|
|
||||||
# Autogen
|
|
||||||
#
|
|
||||||
echo "*** Removing old configure..."
|
|
||||||
# Ensure that configure is re-generated -- sometimes it won't be
|
|
||||||
# (if it hasn't changed), and therefore VERSION could be newer
|
|
||||||
# than configure, and that leads to all kinds of problems
|
|
||||||
rm -f configure
|
|
||||||
echo "*** Running autogen.sh..."
|
|
||||||
./autogen.sh 2>&1 | tee auto.out
|
|
||||||
if test ! "$?" = "0"; then
|
|
||||||
echo "Autogen failed. Aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# Configure
|
|
||||||
#
|
|
||||||
echo "*** Running configure..."
|
|
||||||
./configure --enable-dist 2>&1 | tee config.out
|
|
||||||
if test ! "$?" = "0"; then
|
|
||||||
echo "Configure failed. Aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# Remove autogen.sh (just to ensure users don't try to run it)
|
|
||||||
#
|
|
||||||
echo "*** Removing autogen.sh from the tarball before make dist"
|
|
||||||
rm -rf autogen.sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# make tarball
|
|
||||||
#
|
|
||||||
echo "*** Running make distcheck..."
|
|
||||||
save_LD=$LD_LIBRARY_PATH
|
|
||||||
LD_LIBRARY_PATH=
|
|
||||||
make distcheck 2>&1 | tee dist.out
|
|
||||||
if test ! "$?" = "0"; then
|
|
||||||
echo "Make dist failed. Aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
LD_LIBRARY_PATH=$save_LD
|
|
||||||
|
|
||||||
#
|
|
||||||
# move
|
|
||||||
#
|
|
||||||
echo "*** Moving tarballs..."
|
|
||||||
mv plpa-* ..
|
|
||||||
|
|
||||||
echo "*** All done"
|
|
||||||
|
|
||||||
#
|
|
||||||
# bring back autogen.sh
|
|
||||||
#
|
|
||||||
svn up autogen.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
# main
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
echo "*** Checking GNU tools versions..."
|
|
||||||
check_gnu_version automake $AM_TARGET_VERSION
|
|
||||||
check_gnu_version autoconf $AC_TARGET_VERSION
|
|
||||||
check_gnu_version libtool $LT_TARGET_VERSION
|
|
||||||
|
|
||||||
#
|
|
||||||
# Verify that we're in a top PLPA dir
|
|
||||||
#
|
|
||||||
echo "*** Checking to ensure in top-level PLPA directory..."
|
|
||||||
if test -f VERSION -a -f configure.ac -a -f config/plpa.m4; then
|
|
||||||
happy=1
|
|
||||||
else
|
|
||||||
echo "Do not appear to be in a PLPA top directory. Abort!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# Do svn up and all that
|
|
||||||
#
|
|
||||||
echo "*** Removing old VERSION files..."
|
|
||||||
find . -name VERSION -exec rm -f {} \; -print
|
|
||||||
|
|
||||||
echo "*** Running svn up..."
|
|
||||||
svn up
|
|
||||||
if test ! "$?" = "0"; then
|
|
||||||
echo "SVN update failed. Aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# Ditch "svn" from all version numbers
|
|
||||||
#
|
|
||||||
echo "*** Removing svn version numbers..."
|
|
||||||
svn_r="r`svnversion .`"
|
|
||||||
version_files="`find . -name VERSION`"
|
|
||||||
for file in $version_files; do
|
|
||||||
echo " - $file"
|
|
||||||
sed -e 's/^want_svn=.*/want_svn=0/' \
|
|
||||||
-e 's/^svn_r=.*/'svn_r=$svn_r/ $file > $file.new
|
|
||||||
cp -f $file.new $file
|
|
||||||
rm $file.new
|
|
||||||
done
|
|
||||||
|
|
||||||
#
|
|
||||||
# Make 2 tarballs:
|
|
||||||
#
|
|
||||||
# - one with the greek
|
|
||||||
# - one without the greek
|
|
||||||
#
|
|
||||||
# unless the user specifically said --greekonly, then only make the
|
|
||||||
# greek tarball. Making both tarballs at once allows us to guarantee
|
|
||||||
# to have two tarballs -- one greek and one not -- that have exactly
|
|
||||||
# the same SVN r number (as opposed to, for example, running this
|
|
||||||
# script to make a greek tarball, then running it again to make a
|
|
||||||
# non-greek tarball -- there is a race condition that someone could
|
|
||||||
# commit in the meantime and change the SVN r number in the 2nd
|
|
||||||
# tarball)
|
|
||||||
#
|
|
||||||
|
|
||||||
# First, make greek tarball
|
|
||||||
|
|
||||||
echo "*** Making greek tarball"
|
|
||||||
make_tarball
|
|
||||||
|
|
||||||
# Now if ! --greekonly, make the non-greek tarball
|
|
||||||
|
|
||||||
if test "$1" != "-greekonly" -a "$1" != "--greekonly"; then
|
|
||||||
echo "*** REMOVING ALL GREEK FROM VERSION NUMBERS!!"
|
|
||||||
for file in $version_files; do
|
|
||||||
echo " - $file"
|
|
||||||
sed -e 's/^greek=.*/greek=/' $file > $file.new
|
|
||||||
cp -f $file.new $file
|
|
||||||
rm $file.new
|
|
||||||
done
|
|
||||||
echo "Making non-greek tarball"
|
|
||||||
make_tarball
|
|
||||||
fi
|
|
||||||
|
|
@ -20,30 +20,26 @@
|
|||||||
# Defaults
|
# Defaults
|
||||||
lib_LTLIBRARIES =
|
lib_LTLIBRARIES =
|
||||||
noinst_LTLIBRARIES =
|
noinst_LTLIBRARIES =
|
||||||
include_HEADERS =
|
|
||||||
nodist_include_HEADERS =
|
nodist_include_HEADERS =
|
||||||
noinst_HEADERS = plpa_internal.h
|
|
||||||
nodist_noinst_HEADERS =
|
nodist_noinst_HEADERS =
|
||||||
|
|
||||||
nodist_public_headers = \
|
# Note that this file is generated by configure, so we don't want to
|
||||||
plpa.h
|
# ship it in the tarball. Hence the "nodist_" prefixes to the HEADERS
|
||||||
|
# macros, below.
|
||||||
public_headers = \
|
public_headers = plpa.h
|
||||||
plpa_bottom.h
|
|
||||||
|
|
||||||
# See which mode we're building in
|
# See which mode we're building in
|
||||||
if PLPA_BUILD_STANDALONE
|
if PLPA_BUILD_STANDALONE
|
||||||
lib_LTLIBRARIES += libplpa.la
|
lib_LTLIBRARIES += libplpa.la
|
||||||
include_HEADERS += $(public_headers)
|
nodist_include_HEADERS += $(public_headers)
|
||||||
nodist_include_HEADERS += $(nodist_public_headers)
|
|
||||||
else
|
else
|
||||||
noinst_LTLIBRARIES += libplpa_included.la
|
noinst_LTLIBRARIES += libplpa_included.la
|
||||||
noinst_HEADERS += $(public_headers)
|
nodist_noinst_HEADERS += $(public_headers)
|
||||||
nodist_noinst_HEADERS += $(nodist_public_headers)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# The sources
|
# The sources
|
||||||
plpa_sources = \
|
plpa_sources = \
|
||||||
|
plpa_internal.h \
|
||||||
plpa_api_probe.c \
|
plpa_api_probe.c \
|
||||||
plpa_dispatch.c \
|
plpa_dispatch.c \
|
||||||
plpa_runtime.c \
|
plpa_runtime.c \
|
||||||
|
@ -1,119 +1,214 @@
|
|||||||
/* ./src/libplpa/plpa.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* -*- c -*-
|
/* -*- c -*-
|
||||||
*
|
*
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2006-2008 Cisco, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some notes about the declarations and definitions in this file:
|
||||||
|
*
|
||||||
|
* This file is a mix of internal and public declarations.
|
||||||
|
* Applications are warned against using the internal types; they are
|
||||||
|
* subject to change with no warning.
|
||||||
|
*
|
||||||
|
* The PLPA_NAME() and PLPA_NAME_CAPS() macros are used for prefixing
|
||||||
|
* the PLPA type names, enum names, and symbol names when embedding
|
||||||
|
* PLPA. When not embedding, the default prefix is "plpa_" (or
|
||||||
|
* "PLPA_" when using PLPA_NAME_CAPS()). Hence, if you see a
|
||||||
|
* declaration like this:
|
||||||
|
*
|
||||||
|
* int PLPA_NAME(foo)(void);
|
||||||
|
*
|
||||||
|
* It's a function named plpa_foo() that returns an int and takes no
|
||||||
|
* arguments when building PLPA as a standalone library. It's a
|
||||||
|
* function with a different prefix than "plpa_" when the
|
||||||
|
* --enable-included-mode and --with-plpa-symbol-prefix options are
|
||||||
|
* supplied to PLPA's configure script.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef PLPA_H
|
#ifndef PLPA_H
|
||||||
#define PLPA_H
|
#define PLPA_H
|
||||||
|
|
||||||
|
/* Absolutely must not include <sched.h> here or it will generate
|
||||||
|
conflicts. */
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
/* For memset() */
|
||||||
#undef HAVE_DLFCN_H
|
#include <string.h>
|
||||||
|
/* For pid_t and size_t */
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/***************************************************************************
|
||||||
#undef HAVE_INTTYPES_H
|
* Internal types
|
||||||
|
***************************************************************************/
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
|
||||||
*/
|
|
||||||
#undef LT_OBJDIR
|
|
||||||
|
|
||||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
|
||||||
#undef NO_MINUS_C_MINUS_O
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Whether we're in debugging mode or not */
|
|
||||||
#undef PLPA_DEBUG
|
|
||||||
|
|
||||||
/* Major version of PLPA */
|
|
||||||
#undef PLPA_MAJOR_VERSION
|
|
||||||
|
|
||||||
/* Minor version of PLPA */
|
|
||||||
#undef PLPA_MINOR_VERSION
|
|
||||||
|
|
||||||
/* Release version of PLPA */
|
|
||||||
#undef PLPA_RELEASE_VERSION
|
|
||||||
|
|
||||||
|
/* If we're building PLPA itself, <plpa_config.h> will have already
|
||||||
|
been included. But <plpa_config.h> is a private header file; it is
|
||||||
|
not installed into $includedir. Hence, applications including
|
||||||
|
<plpa.h> will not have included <plpa_config.h> (this is by
|
||||||
|
design). So include just enough information here to allow us to
|
||||||
|
continue. */
|
||||||
|
#ifndef PLPA_CONFIG_H
|
||||||
/* The PLPA symbol prefix */
|
/* The PLPA symbol prefix */
|
||||||
#undef PLPA_SYM_PREFIX
|
#define PLPA_SYM_PREFIX plpa_
|
||||||
|
|
||||||
/* The PLPA symbol prefix in all caps */
|
/* The PLPA symbol prefix in all caps */
|
||||||
#undef PLPA_SYM_PREFIX_CAPS
|
#define PLPA_SYM_PREFIX_CAPS PLPA_
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
|
||||||
`char[]'. */
|
|
||||||
#undef YYTEXT_POINTER
|
|
||||||
|
|
||||||
/* Emulated value */
|
|
||||||
#undef __NR_sched_getaffinity
|
|
||||||
|
|
||||||
/* Emulated value */
|
|
||||||
#undef __NR_sched_setaffinity
|
|
||||||
|
|
||||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
|
||||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
|
||||||
#ifndef __cplusplus
|
|
||||||
#undef inline
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Preprocessors are fun -- the double inderection is unfortunately
|
||||||
|
necessary. */
|
||||||
|
#define PLPA_MUNGE_NAME(a, b) PLPA_MUNGE_NAME2(a, b)
|
||||||
|
#define PLPA_MUNGE_NAME2(a, b) a ## b
|
||||||
|
#define PLPA_NAME(name) PLPA_MUNGE_NAME(PLPA_SYM_PREFIX, name)
|
||||||
|
#define PLPA_NAME_CAPS(name) PLPA_MUNGE_NAME(PLPA_SYM_PREFIX_CAPS, name)
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Public type
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/* Values that can be returned from plpa_api_probe() */
|
||||||
|
typedef enum {
|
||||||
|
/* Sentinel value */
|
||||||
|
PLPA_NAME_CAPS(PROBE_UNSET),
|
||||||
|
/* sched_setaffinity syscall available */
|
||||||
|
PLPA_NAME_CAPS(PROBE_OK),
|
||||||
|
/* syscall unavailable/unimplemented */
|
||||||
|
PLPA_NAME_CAPS(PROBE_NOT_SUPPORTED),
|
||||||
|
/* we experienced some strange failure that the user should report */
|
||||||
|
PLPA_NAME_CAPS(PROBE_UNKNOWN)
|
||||||
|
} PLPA_NAME(api_type_t);
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Internal types
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/* Internal PLPA bitmask type. This type should not be used by
|
||||||
|
external applications! */
|
||||||
|
typedef unsigned long int PLPA_NAME(bitmask_t);
|
||||||
|
#define PLPA_BITMASK_T_NUM_BITS (sizeof(PLPA_NAME(bitmask_t)) * 8)
|
||||||
|
#define PLPA_BITMASK_CPU_MAX 1024
|
||||||
|
#define PLPA_BITMASK_NUM_ELEMENTS (PLPA_BITMASK_CPU_MAX / PLPA_BITMASK_T_NUM_BITS)
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Public type
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/* Public type for the PLPA cpu set. */
|
||||||
|
typedef struct { PLPA_NAME(bitmask_t) bitmask[PLPA_BITMASK_NUM_ELEMENTS]; } PLPA_NAME(cpu_set_t);
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Internal macros
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/* Internal macro for identifying the byte in a bitmask array. This
|
||||||
|
macro should not be used by external applications! */
|
||||||
|
#define PLPA_CPU_BYTE(num) ((num) / PLPA_BITMASK_T_NUM_BITS)
|
||||||
|
|
||||||
|
/* Internal macro for identifying the bit in a bitmask array. This
|
||||||
|
macro should not be used by external applications! */
|
||||||
|
#define PLPA_CPU_BIT(num) ((num) % PLPA_BITMASK_T_NUM_BITS)
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Public macros
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/* Public macro to zero out a PLPA cpu set (analogous to the FD_ZERO()
|
||||||
|
macro; see select(2)). */
|
||||||
|
#define PLPA_CPU_ZERO(cpuset) \
|
||||||
|
memset((cpuset), 0, sizeof(PLPA_NAME(cpu_set_t)))
|
||||||
|
|
||||||
|
/* Public macro to set a bit in a PLPA cpu set (analogous to the
|
||||||
|
FD_SET() macro; see select(2)). */
|
||||||
|
#define PLPA_CPU_SET(num, cpuset) \
|
||||||
|
(cpuset)->bitmask[PLPA_CPU_BYTE(num)] |= ((PLPA_NAME(bitmask_t))1 << PLPA_CPU_BIT(num))
|
||||||
|
|
||||||
|
/* Public macro to clear a bit in a PLPA cpu set (analogous to the
|
||||||
|
FD_CLR() macro; see select(2)). */
|
||||||
|
#define PLPA_CPU_CLR(num, cpuset) \
|
||||||
|
(cpuset)->bitmask[PLPA_CPU_BYTE(num)] &= ~((PLPA_NAME(bitmask_t))1 << PLPA_CPU_BIT(num))
|
||||||
|
|
||||||
|
/* Public macro to test if a bit is set in a PLPA cpu set (analogous
|
||||||
|
to the FD_ISSET() macro; see select(2)). */
|
||||||
|
#define PLPA_CPU_ISSET(num, cpuset) \
|
||||||
|
(0 != (((cpuset)->bitmask[PLPA_CPU_BYTE(num)]) & ((PLPA_NAME(bitmask_t))1 << PLPA_CPU_BIT(num))))
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Public functions
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/* Setup PLPA internals. This function is optional; it will be
|
||||||
|
automatically invoked by all the other API functions if you do not
|
||||||
|
invoke it explicitly. Returns 0 upon success. */
|
||||||
|
int PLPA_NAME(init)(void);
|
||||||
|
|
||||||
|
/* Check what API is on this machine. If api_type returns
|
||||||
|
PLPA_PROBE_OK, then PLPA can function properly on this machine.
|
||||||
|
Returns 0 upon success. */
|
||||||
|
int PLPA_NAME(api_probe)(PLPA_NAME(api_type_t) *api_type);
|
||||||
|
|
||||||
|
/* Set processor affinity. Use the PLPA_CPU_* macros to set the
|
||||||
|
cpuset value. The same rules and restrictions about pid apply as
|
||||||
|
they do for the sched_setaffinity(2) system call. Returns 0 upon
|
||||||
|
success. */
|
||||||
|
int PLPA_NAME(sched_setaffinity)(pid_t pid, size_t cpusetsize,
|
||||||
|
const PLPA_NAME(cpu_set_t) *cpuset);
|
||||||
|
|
||||||
|
/* Get processor affinity. Use the PLPA_CPU_* macros to analyze the
|
||||||
|
returned value of cpuset. The same rules and restrictions about
|
||||||
|
pid apply as they do for the sched_getaffinity(2) system call.
|
||||||
|
Returns 0 upon success. */
|
||||||
|
int PLPA_NAME(sched_getaffinity)(pid_t pid, size_t cpusetsize,
|
||||||
|
PLPA_NAME(cpu_set_t) *cpuset);
|
||||||
|
|
||||||
|
/* Return whether topology information is available (i.e.,
|
||||||
|
plpa_map_to_*, plpa_max_*). The topology functions will be
|
||||||
|
available if supported == 1 and the function returns 0. */
|
||||||
|
int PLPA_NAME(have_topology_information)(int *supported);
|
||||||
|
|
||||||
|
/* Map (socket,core) tuple to virtual processor ID. processor_id is
|
||||||
|
then suitable for use with the PLPA_CPU_* macros, probably leading
|
||||||
|
to a call to plpa_sched_setaffinity(). Returns 0 upon success. */
|
||||||
|
int PLPA_NAME(map_to_processor_id)(int socket, int core, int *processor_id);
|
||||||
|
|
||||||
|
/* Map processor_id to (socket,core) tuple. The processor_id input is
|
||||||
|
usually obtained from the return from the plpa_sched_getaffinity()
|
||||||
|
call, using PLPA_CPU_ISSET to find individual bits in the map that
|
||||||
|
were set/unset. plpa_map_to_socket_core() can map the bit indexes
|
||||||
|
to a socket/core tuple. Returns 0 upon success. */
|
||||||
|
int PLPA_NAME(map_to_socket_core)(int processor_id, int *socket, int *core);
|
||||||
|
|
||||||
|
/* Return the max processor ID. Returns both the number of processors
|
||||||
|
(cores) in a system and the maximum Linux virtual processor ID
|
||||||
|
(because it may be higher than the number of processors if there
|
||||||
|
are "holes" in the available Linux virtual processor IDs). Returns
|
||||||
|
0 upon success. */
|
||||||
|
int PLPA_NAME(get_processor_info)(int *num_processors, int *max_processor_id);
|
||||||
|
|
||||||
|
/* Returns both the number of sockets in the system and the maximum
|
||||||
|
socket ID number (in case there are "holes" in the list of available
|
||||||
|
socket IDs). Returns 0 upon sucess. */
|
||||||
|
int PLPA_NAME(get_socket_info)(int *num_sockets, int *max_socket_id);
|
||||||
|
|
||||||
|
/* Return both the number of cores and the max code ID for a given
|
||||||
|
socket (in case there are "holes" in the list of available core
|
||||||
|
IDs). Returns 0 upon success. */
|
||||||
|
int PLPA_NAME(get_core_info)(int socket, int *num_cores, int *max_core_id);
|
||||||
|
|
||||||
|
/* Shut down PLPA. This function releases resources used by the PLPA.
|
||||||
|
It should be the last PLPA function invoked, or can be used to
|
||||||
|
forcibly cause PLPA to dump its topology cache and re-analyze the
|
||||||
|
underlying system the next time another PLPA function is called.
|
||||||
|
Specifically: it is safe to call plpa_init() (or any other PLPA
|
||||||
|
function) again after plpa_finalized(). Returns 0 upon success. */
|
||||||
|
int PLPA_NAME(finalize)(void);
|
||||||
|
|
||||||
#if defined(__cplusplus) || defined(c_plusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
#include "plpa_bottom.h"
|
|
||||||
#if defined(__cplusplus) || defined(c_plusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif /* PLPA_H */
|
#endif /* PLPA_H */
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2007 Cisco, Inc. All rights reserved.
|
* Copyright (c) 2007-2008 Cisco, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -12,6 +12,7 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "plpa_config.h"
|
||||||
#include "plpa.h"
|
#include "plpa.h"
|
||||||
#include "plpa_internal.h"
|
#include "plpa_internal.h"
|
||||||
|
|
||||||
|
@ -1,134 +0,0 @@
|
|||||||
/* -*- c -*-
|
|
||||||
*
|
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PLPA_BOTTOM_H
|
|
||||||
#define PLPA_BOTTOM_H
|
|
||||||
|
|
||||||
/* Absolutely must not include <sched.h> here or it will generate
|
|
||||||
conflicts. */
|
|
||||||
|
|
||||||
/* For memset() */
|
|
||||||
#include <string.h>
|
|
||||||
/* For pid_t and size_t */
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
/* Internal macro to munge names */
|
|
||||||
|
|
||||||
/* Preprocessors are fun -- the double indirection is necessary.
|
|
||||||
Extra bonus points if you can figure out why! :p */
|
|
||||||
#define PLPA_MUNGE_NAME(a, b) PLPA_MUNGE_NAME2(a, b)
|
|
||||||
#define PLPA_MUNGE_NAME2(a, b) a ## b
|
|
||||||
#define PLPA_NAME(name) PLPA_MUNGE_NAME(PLPA_SYM_PREFIX, name)
|
|
||||||
#define PLPA_NAME_CAPS(name) PLPA_MUNGE_NAME(PLPA_SYM_PREFIX_CAPS, name)
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
/* Values that can be returned from plpa_api_probe() */
|
|
||||||
typedef enum {
|
|
||||||
/* Sentinel value */
|
|
||||||
PLPA_NAME_CAPS(PROBE_UNSET),
|
|
||||||
/* sched_setaffinity syscall available */
|
|
||||||
PLPA_NAME_CAPS(PROBE_OK),
|
|
||||||
/* syscall unavailable/unimplemented */
|
|
||||||
PLPA_NAME_CAPS(PROBE_NOT_SUPPORTED),
|
|
||||||
/* we experienced some strange failure that the user should report */
|
|
||||||
PLPA_NAME_CAPS(PROBE_UNKNOWN)
|
|
||||||
} PLPA_NAME(api_type_t);
|
|
||||||
|
|
||||||
/* Values that can be used in plpa_max_id() */
|
|
||||||
typedef enum {
|
|
||||||
/* Linux virtual processor */
|
|
||||||
PLPA_NAME_CAPS(ID_TYPE_PROCESSOR),
|
|
||||||
/* CPU sockets */
|
|
||||||
PLPA_NAME_CAPS(ID_TYPE_SOCKET),
|
|
||||||
/* CPU cores */
|
|
||||||
PLPA_NAME_CAPS(ID_TYPE_CORE),
|
|
||||||
/* Sentinel value */
|
|
||||||
PLPA_NAME_CAPS(ID_TYPE_MAX)
|
|
||||||
} PLPA_NAME(plpa_id_type_t);
|
|
||||||
|
|
||||||
/* PLPA bitmask type */
|
|
||||||
typedef unsigned long int PLPA_NAME(bitmask_t);
|
|
||||||
#define PLPA_BITMASK_T_NUM_BITS (sizeof(PLPA_NAME(bitmask_t)) * 8)
|
|
||||||
#define PLPA_BITMASK_CPU_MAX 1024
|
|
||||||
#define PLPA_BITMASK_NUM_ELEMENTS (PLPA_BITMASK_CPU_MAX / PLPA_BITMASK_T_NUM_BITS)
|
|
||||||
typedef struct { PLPA_NAME(bitmask_t) bitmask[PLPA_BITMASK_NUM_ELEMENTS]; } PLPA_NAME(cpu_set_t);
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
/* Internal macro for identifying the byte in a bitmask array */
|
|
||||||
#define PLPA_CPU_BYTE(num) ((num) / PLPA_BITMASK_T_NUM_BITS)
|
|
||||||
|
|
||||||
/* Internal macro for identifying the bit in a bitmask array */
|
|
||||||
#define PLPA_CPU_BIT(num) ((num) % PLPA_BITMASK_T_NUM_BITS)
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
/* Public macro to zero out a PLPA cpu set */
|
|
||||||
#define PLPA_CPU_ZERO(cpuset) \
|
|
||||||
memset((cpuset), 0, sizeof(PLPA_NAME(cpu_set_t)))
|
|
||||||
|
|
||||||
/* Public macro to set a bit in a PLPA cpu set */
|
|
||||||
#define PLPA_CPU_SET(num, cpuset) \
|
|
||||||
(cpuset)->bitmask[PLPA_CPU_BYTE(num)] |= ((PLPA_NAME(bitmask_t))1 << PLPA_CPU_BIT(num))
|
|
||||||
|
|
||||||
/* Public macro to clear a bit in a PLPA cpu set */
|
|
||||||
#define PLPA_CPU_CLR(num, cpuset) \
|
|
||||||
(cpuset)->bitmask[PLPA_CPU_BYTE(num)] &= ~((PLPA_NAME(bitmask_t))1 << PLPA_CPU_BIT(num))
|
|
||||||
|
|
||||||
/* Public macro to test if a bit is set in a PLPA cpu set */
|
|
||||||
#define PLPA_CPU_ISSET(num, cpuset) \
|
|
||||||
(0 != (((cpuset)->bitmask[PLPA_CPU_BYTE(num)]) & ((PLPA_NAME(bitmask_t))1 << PLPA_CPU_BIT(num))))
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
/* Setup PLPA internals */
|
|
||||||
int PLPA_NAME(init)(void);
|
|
||||||
|
|
||||||
/* Check what API is on this machine */
|
|
||||||
int PLPA_NAME(api_probe)(PLPA_NAME(api_type_t) *api_type);
|
|
||||||
|
|
||||||
/* Set processor affinity */
|
|
||||||
int PLPA_NAME(sched_setaffinity)(pid_t pid, size_t cpusetsize,
|
|
||||||
const PLPA_NAME(cpu_set_t) *cpuset);
|
|
||||||
|
|
||||||
/* Get processor affinity */
|
|
||||||
int PLPA_NAME(sched_getaffinity)(pid_t pid, size_t cpusetsize,
|
|
||||||
PLPA_NAME(cpu_set_t) *cpuset);
|
|
||||||
|
|
||||||
/* Return whether topology information is available (i.e.,
|
|
||||||
plpa_map_to_*, plpa_max_*) */
|
|
||||||
int PLPA_NAME(have_topology_information)(int *supported);
|
|
||||||
|
|
||||||
/* Map (socket,core) tuple to virtual processor ID */
|
|
||||||
int PLPA_NAME(map_to_processor_id)(int socket, int core, int *processor_id);
|
|
||||||
|
|
||||||
/* Map processor_id to (socket,core) tuple */
|
|
||||||
int PLPA_NAME(map_to_socket_core)(int processor_id, int *socket, int *core);
|
|
||||||
|
|
||||||
/* Return the max processor ID */
|
|
||||||
int PLPA_NAME(max_processor_id)(int *max_processor_id);
|
|
||||||
|
|
||||||
/* Return the max socket number */
|
|
||||||
int PLPA_NAME(max_socket)(int *max_socket);
|
|
||||||
|
|
||||||
/* Return the max core number for a given socket */
|
|
||||||
int PLPA_NAME(max_core)(int socket, int *max_core);
|
|
||||||
|
|
||||||
/* Shut down PLPA */
|
|
||||||
int PLPA_NAME(finalize)(void);
|
|
||||||
|
|
||||||
#endif /* PLPA_BOTTOM_H */
|
|
||||||
|
|
112
opal/mca/paffinity/linux/plpa/src/libplpa/plpa_config.h.in
Обычный файл
112
opal/mca/paffinity/linux/plpa/src/libplpa/plpa_config.h.in
Обычный файл
@ -0,0 +1,112 @@
|
|||||||
|
/* ./src/libplpa/plpa_config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
/* -*- c -*-
|
||||||
|
*
|
||||||
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
|
* $COPYRIGHT$
|
||||||
|
*
|
||||||
|
* Additional copyrights may follow
|
||||||
|
*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PLPA_CONFIG_H
|
||||||
|
#define PLPA_CONFIG_H
|
||||||
|
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
|
#undef HAVE_SYS_STAT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||||
|
*/
|
||||||
|
#undef LT_OBJDIR
|
||||||
|
|
||||||
|
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||||
|
#undef NO_MINUS_C_MINUS_O
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#undef PACKAGE_BUGREPORT
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#undef PACKAGE_NAME
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#undef PACKAGE_STRING
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
|
/* Whether we're in debugging mode or not */
|
||||||
|
#undef PLPA_DEBUG
|
||||||
|
|
||||||
|
/* Major version of PLPA */
|
||||||
|
#undef PLPA_MAJOR_VERSION
|
||||||
|
|
||||||
|
/* Minor version of PLPA */
|
||||||
|
#undef PLPA_MINOR_VERSION
|
||||||
|
|
||||||
|
/* Release version of PLPA */
|
||||||
|
#undef PLPA_RELEASE_VERSION
|
||||||
|
|
||||||
|
/* The PLPA symbol prefix */
|
||||||
|
#undef PLPA_SYM_PREFIX
|
||||||
|
|
||||||
|
/* The PLPA symbol prefix in all caps */
|
||||||
|
#undef PLPA_SYM_PREFIX_CAPS
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||||
|
`char[]'. */
|
||||||
|
#undef YYTEXT_POINTER
|
||||||
|
|
||||||
|
/* Emulated value */
|
||||||
|
#undef __NR_sched_getaffinity
|
||||||
|
|
||||||
|
/* Emulated value */
|
||||||
|
#undef __NR_sched_setaffinity
|
||||||
|
|
||||||
|
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||||
|
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||||
|
#ifndef __cplusplus
|
||||||
|
#undef inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* PLPA_CONFIG_H */
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -12,6 +12,7 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "plpa_config.h"
|
||||||
#include "plpa.h"
|
#include "plpa.h"
|
||||||
#include "plpa_internal.h"
|
#include "plpa_internal.h"
|
||||||
|
|
||||||
@ -19,7 +20,7 @@
|
|||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Call the kernel's setaffinity, massaging the user's input
|
* Call the kernel's setaffinity, massaging the user's input
|
||||||
* parameters as necessary
|
* parameters as necessary
|
||||||
*/
|
*/
|
||||||
@ -53,9 +54,6 @@ int PLPA_NAME(sched_setaffinity)(pid_t pid, size_t cpusetsize,
|
|||||||
if (cpusetsize > sizeof(*cpuset)) {
|
if (cpusetsize > sizeof(*cpuset)) {
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
if (NULL == cpuset) {
|
|
||||||
return EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the user-supplied bitmask is smaller than what the
|
/* If the user-supplied bitmask is smaller than what the
|
||||||
kernel wants, zero out a temporary buffer of the size that
|
kernel wants, zero out a temporary buffer of the size that
|
||||||
@ -130,7 +128,7 @@ int PLPA_NAME(sched_setaffinity)(pid_t pid, size_t cpusetsize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Call the kernel's getaffinity, massaging the user's input
|
* Call the kernel's getaffinity, massaging the user's input
|
||||||
* parameters as necessary
|
* parameters as necessary
|
||||||
*/
|
*/
|
||||||
@ -161,9 +159,6 @@ int PLPA_NAME(sched_getaffinity)(pid_t pid, size_t cpusetsize,
|
|||||||
if (PLPA_NAME(len) > sizeof(*cpuset)) {
|
if (PLPA_NAME(len) > sizeof(*cpuset)) {
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
if (NULL == cpuset) {
|
|
||||||
return EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the user supplied a buffer that is too small, then don't
|
/* If the user supplied a buffer that is too small, then don't
|
||||||
even bother */
|
even bother */
|
||||||
|
@ -113,6 +113,7 @@
|
|||||||
personal jurisdiction and venue of these courts.
|
personal jurisdiction and venue of these courts.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
|
#include "plpa_config.h"
|
||||||
#include "plpa.h"
|
#include "plpa.h"
|
||||||
#include "plpa_internal.h"
|
#include "plpa_internal.h"
|
||||||
|
|
||||||
@ -130,18 +131,25 @@ typedef struct tuple_t_ {
|
|||||||
} tuple_t;
|
} tuple_t;
|
||||||
|
|
||||||
static int supported = 0;
|
static int supported = 0;
|
||||||
static int max_processor = -1;
|
static int num_processors = -1;
|
||||||
static int max_socket = -1;
|
static int max_processor_num = -1;
|
||||||
static int *max_core = NULL;
|
static int num_sockets = -1;
|
||||||
static int max_core_overall = -1;
|
static int max_socket_id = -1;
|
||||||
|
static int *max_core_id = NULL;
|
||||||
|
static int *num_cores = NULL;
|
||||||
|
static int max_core_id_overall = -1;
|
||||||
static tuple_t *map_processor_id_to_tuple = NULL;
|
static tuple_t *map_processor_id_to_tuple = NULL;
|
||||||
static tuple_t ***map_tuple_to_processor_id = NULL;
|
static tuple_t ***map_tuple_to_processor_id = NULL;
|
||||||
|
|
||||||
static void clear_cache(void)
|
static void clear_cache(void)
|
||||||
{
|
{
|
||||||
if (NULL != max_core) {
|
if (NULL != max_core_id) {
|
||||||
free(max_core);
|
free(max_core_id);
|
||||||
max_core = NULL;
|
max_core_id = NULL;
|
||||||
|
}
|
||||||
|
if (NULL != num_cores) {
|
||||||
|
free(num_cores);
|
||||||
|
num_cores = NULL;
|
||||||
}
|
}
|
||||||
if (NULL != map_processor_id_to_tuple) {
|
if (NULL != map_processor_id_to_tuple) {
|
||||||
free(map_processor_id_to_tuple);
|
free(map_processor_id_to_tuple);
|
||||||
@ -156,15 +164,17 @@ static void clear_cache(void)
|
|||||||
map_tuple_to_processor_id = NULL;
|
map_tuple_to_processor_id = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
max_processor = -1;
|
num_processors = max_processor_num = -1;
|
||||||
max_socket = -1;
|
num_sockets = max_socket_id = -1;
|
||||||
max_core_overall = -1;
|
max_core_id_overall = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void load_cache(const char *sysfs_mount)
|
static void load_cache(const char *sysfs_mount)
|
||||||
{
|
{
|
||||||
int i, j, k, invalid_entry, fd;
|
int i, j, k, invalid_entry, fd;
|
||||||
char path[PATH_MAX], buf[8];
|
char path[PATH_MAX], buf[8];
|
||||||
|
PLPA_NAME(cpu_set_t) *cores_on_sockets;
|
||||||
|
int found;
|
||||||
|
|
||||||
/* Check for the parent directory */
|
/* Check for the parent directory */
|
||||||
sprintf(path, "%s/devices/system/cpu", sysfs_mount);
|
sprintf(path, "%s/devices/system/cpu", sysfs_mount);
|
||||||
@ -173,23 +183,30 @@ static void load_cache(const char *sysfs_mount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Go through and find the max processor ID */
|
/* Go through and find the max processor ID */
|
||||||
for (max_processor = 0; max_processor < PLPA_BITMASK_CPU_MAX;
|
for (num_processors = max_processor_num = i = 0;
|
||||||
++max_processor) {
|
i < PLPA_BITMASK_CPU_MAX; ++i) {
|
||||||
sprintf(path, "%s/devices/system/cpu/cpu%d", sysfs_mount,
|
sprintf(path, "%s/devices/system/cpu/cpu%d", sysfs_mount, i);
|
||||||
max_processor);
|
if (0 != access(path, (R_OK | X_OK))) {
|
||||||
if ( access(path, R_OK|X_OK) ) {
|
max_processor_num = i - 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
++num_processors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we found no processors, then we have no topology info */
|
||||||
|
if (0 == num_processors) {
|
||||||
|
clear_cache();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
--max_processor;
|
|
||||||
|
|
||||||
/* Malloc space for the first map (processor ID -> tuple).
|
/* Malloc space for the first map (processor ID -> tuple).
|
||||||
Include enough space for one invalid entry. */
|
Include enough space for one invalid entry. */
|
||||||
map_processor_id_to_tuple = malloc(sizeof(tuple_t) * (max_processor + 2));
|
map_processor_id_to_tuple = malloc(sizeof(tuple_t) *
|
||||||
|
(max_processor_num + 2));
|
||||||
if (NULL == map_processor_id_to_tuple) {
|
if (NULL == map_processor_id_to_tuple) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (i = 0; i <= max_processor; ++i) {
|
for (i = 0; i <= max_processor_num; ++i) {
|
||||||
map_processor_id_to_tuple[i].processor_id = i;
|
map_processor_id_to_tuple[i].processor_id = i;
|
||||||
map_processor_id_to_tuple[i].socket = -1;
|
map_processor_id_to_tuple[i].socket = -1;
|
||||||
map_processor_id_to_tuple[i].core = -1;
|
map_processor_id_to_tuple[i].core = -1;
|
||||||
@ -200,57 +217,119 @@ static void load_cache(const char *sysfs_mount)
|
|||||||
map_processor_id_to_tuple[invalid_entry].socket = -1;
|
map_processor_id_to_tuple[invalid_entry].socket = -1;
|
||||||
map_processor_id_to_tuple[invalid_entry].core = -1;
|
map_processor_id_to_tuple[invalid_entry].core = -1;
|
||||||
|
|
||||||
/* Malloc space for the max number of cores on each socket */
|
|
||||||
max_core = malloc(sizeof(int) * (max_processor + 1));
|
|
||||||
if (NULL == max_core) {
|
|
||||||
clear_cache();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (i = 0; i <= max_processor; ++i) {
|
|
||||||
max_core[i] = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Build a cached map of (socket,core) tuples */
|
/* Build a cached map of (socket,core) tuples */
|
||||||
for ( i = 0; i <= max_processor; i++ ) {
|
for (found = 0, i = 0; i <= max_processor_num; ++i) {
|
||||||
sprintf(path, "%s/devices/system/cpu/cpu%d/topology/core_id",
|
sprintf(path, "%s/devices/system/cpu/cpu%d/topology/core_id",
|
||||||
sysfs_mount, i);
|
sysfs_mount, i);
|
||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
if ( fd < 0 ) {
|
if ( fd < 0 ) {
|
||||||
clear_cache();
|
continue;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if ( read(fd, buf, 7) <= 0 ) {
|
if ( read(fd, buf, 7) <= 0 ) {
|
||||||
clear_cache();
|
continue;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
sscanf(buf, "%d", &(map_processor_id_to_tuple[i].core));
|
sscanf(buf, "%d", &(map_processor_id_to_tuple[i].core));
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
sprintf(path, "%s/devices/system/cpu/cpu%d/topology/physical_package_id",
|
sprintf(path,
|
||||||
|
"%s/devices/system/cpu/cpu%d/topology/physical_package_id",
|
||||||
sysfs_mount, i);
|
sysfs_mount, i);
|
||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
if ( fd < 0 ) {
|
if ( fd < 0 ) {
|
||||||
clear_cache();
|
continue;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if ( read(fd, buf, 7) <= 0 ) {
|
if ( read(fd, buf, 7) <= 0 ) {
|
||||||
clear_cache();
|
continue;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
sscanf(buf, "%d", &(map_processor_id_to_tuple[i].socket));
|
sscanf(buf, "%d", &(map_processor_id_to_tuple[i].socket));
|
||||||
close(fd);
|
close(fd);
|
||||||
|
found = 1;
|
||||||
|
|
||||||
/* Compute some globals */
|
/* Keep a running tab on the max socket number */
|
||||||
if (map_processor_id_to_tuple[i].socket > max_socket) {
|
if (map_processor_id_to_tuple[i].socket > max_socket_id) {
|
||||||
max_socket = map_processor_id_to_tuple[i].socket;
|
max_socket_id = map_processor_id_to_tuple[i].socket;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Now that we know the max number of sockets, allocate some
|
||||||
|
arrays */
|
||||||
|
max_core_id = malloc(sizeof(int) * (max_socket_id + 1));
|
||||||
|
if (NULL == max_core_id) {
|
||||||
|
clear_cache();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
num_cores = malloc(sizeof(int) * (max_socket_id + 1));
|
||||||
|
if (NULL == num_cores) {
|
||||||
|
clear_cache();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (i = 0; i <= max_socket_id; ++i) {
|
||||||
|
num_cores[i] = -1;
|
||||||
|
max_core_id[i] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Find the max core number on each socket */
|
||||||
|
for (i = 0; i <= max_processor_num; ++i) {
|
||||||
if (map_processor_id_to_tuple[i].core >
|
if (map_processor_id_to_tuple[i].core >
|
||||||
max_core[map_processor_id_to_tuple[i].socket]) {
|
max_core_id[map_processor_id_to_tuple[i].socket]) {
|
||||||
max_core[map_processor_id_to_tuple[i].socket] =
|
max_core_id[map_processor_id_to_tuple[i].socket] =
|
||||||
map_processor_id_to_tuple[i].core;
|
map_processor_id_to_tuple[i].core;
|
||||||
}
|
}
|
||||||
if (max_core[map_processor_id_to_tuple[i].socket] > max_core_overall) {
|
if (max_core_id[map_processor_id_to_tuple[i].socket] >
|
||||||
max_core_overall = max_core[map_processor_id_to_tuple[i].socket];
|
max_core_id_overall) {
|
||||||
|
max_core_id_overall =
|
||||||
|
max_core_id[map_processor_id_to_tuple[i].socket];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we didn't find any core_id/physical_package_id's, then we
|
||||||
|
don't have the topology info */
|
||||||
|
if (!found) {
|
||||||
|
clear_cache();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Go through and count the number of unique sockets found. It
|
||||||
|
may not be the same as max_socket_id because there may be
|
||||||
|
"holes" -- e.g., sockets 0 and 3 are used, but sockets 1 and 2
|
||||||
|
are empty. */
|
||||||
|
for (j = i = 0; i <= max_socket_id; ++i) {
|
||||||
|
if (max_core_id[i] >= 0) {
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j > 0) {
|
||||||
|
num_sockets = j;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Count how many cores are available on each socket. This may
|
||||||
|
not be the same as max_core_id[socket_num] if there are
|
||||||
|
"holes". I don't know if holes can happen (i.e., if specific
|
||||||
|
cores can be taken offline), but what the heck... */
|
||||||
|
cores_on_sockets = malloc(sizeof(PLPA_NAME(cpu_set_t)) *
|
||||||
|
(max_socket_id + 1));
|
||||||
|
if (NULL == cores_on_sockets) {
|
||||||
|
clear_cache();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (i = 0; i <= max_socket_id; ++i) {
|
||||||
|
PLPA_CPU_ZERO(&(cores_on_sockets[i]));
|
||||||
|
}
|
||||||
|
for (i = 0; i <= max_processor_num; ++i) {
|
||||||
|
if (map_processor_id_to_tuple[i].socket >= 0) {
|
||||||
|
PLPA_CPU_SET(map_processor_id_to_tuple[i].core,
|
||||||
|
&(cores_on_sockets[map_processor_id_to_tuple[i].socket]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = 0; i <= max_socket_id; ++i) {
|
||||||
|
int count = 0;
|
||||||
|
for (j = 0; j < PLPA_BITMASK_CPU_MAX; ++j) {
|
||||||
|
if (PLPA_CPU_ISSET(j, &(cores_on_sockets[i]))) {
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count > 0) {
|
||||||
|
num_cores[i] = count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,26 +337,27 @@ static void load_cache(const char *sysfs_mount)
|
|||||||
(socket,core) => processor_id. This map simply points to
|
(socket,core) => processor_id. This map simply points to
|
||||||
entries in the other map (i.e., it's by reference instead of by
|
entries in the other map (i.e., it's by reference instead of by
|
||||||
value). */
|
value). */
|
||||||
map_tuple_to_processor_id = malloc(sizeof(tuple_t **) * (max_socket + 1));
|
map_tuple_to_processor_id = malloc(sizeof(tuple_t **) *
|
||||||
|
(max_socket_id + 1));
|
||||||
if (NULL == map_tuple_to_processor_id) {
|
if (NULL == map_tuple_to_processor_id) {
|
||||||
clear_cache();
|
clear_cache();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
map_tuple_to_processor_id[0] = malloc(sizeof(tuple_t *) *
|
map_tuple_to_processor_id[0] = malloc(sizeof(tuple_t *) *
|
||||||
((max_socket + 1) *
|
((max_socket_id + 1) *
|
||||||
(max_core_overall + 1)));
|
(max_core_id_overall + 1)));
|
||||||
if (NULL == map_tuple_to_processor_id[0]) {
|
if (NULL == map_tuple_to_processor_id[0]) {
|
||||||
clear_cache();
|
clear_cache();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Set pointers for 2nd dimension */
|
/* Set pointers for 2nd dimension */
|
||||||
for (i = 1; i <= max_socket; ++i) {
|
for (i = 1; i <= max_socket_id; ++i) {
|
||||||
map_tuple_to_processor_id[i] =
|
map_tuple_to_processor_id[i] =
|
||||||
map_tuple_to_processor_id[i - 1] + max_core_overall;
|
map_tuple_to_processor_id[i - 1] + max_core_id_overall + 1;
|
||||||
}
|
}
|
||||||
/* Compute map */
|
/* Compute map */
|
||||||
for (i = 0; i <= max_socket; ++i) {
|
for (i = 0; i <= max_socket_id; ++i) {
|
||||||
for (j = 0; j <= max_core_overall; ++j) {
|
for (j = 0; j <= max_core_id_overall; ++j) {
|
||||||
/* Default to the invalid entry in the other map, meaning
|
/* Default to the invalid entry in the other map, meaning
|
||||||
that this (socket,core) combination doesn't exist
|
that this (socket,core) combination doesn't exist
|
||||||
(e.g., the core number does not exist in this socket,
|
(e.g., the core number does not exist in this socket,
|
||||||
@ -288,11 +368,15 @@ static void load_cache(const char *sysfs_mount)
|
|||||||
/* See if this (socket,core) tuple exists in the other
|
/* See if this (socket,core) tuple exists in the other
|
||||||
map. If so, set this entry to point to it (overriding
|
map. If so, set this entry to point to it (overriding
|
||||||
the invalid entry default). */
|
the invalid entry default). */
|
||||||
for (k = 0; k <= max_processor; ++k) {
|
for (k = 0; k <= max_processor_num; ++k) {
|
||||||
if (map_processor_id_to_tuple[k].socket == i &&
|
if (map_processor_id_to_tuple[k].socket == i &&
|
||||||
map_processor_id_to_tuple[k].core == j) {
|
map_processor_id_to_tuple[k].core == j) {
|
||||||
map_tuple_to_processor_id[i][j] =
|
map_tuple_to_processor_id[i][j] =
|
||||||
&map_processor_id_to_tuple[k];
|
&map_processor_id_to_tuple[k];
|
||||||
|
#if defined(PLPA_DEBUG) && PLPA_DEBUG
|
||||||
|
printf("Creating map: (socket %d, core %d) -> ID %d\n",
|
||||||
|
i, j, k);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,18 +450,24 @@ int PLPA_NAME(map_to_processor_id)(int socket, int core, int *processor_id)
|
|||||||
|
|
||||||
/* If this system doesn't support mapping, sorry Charlie */
|
/* If this system doesn't support mapping, sorry Charlie */
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
return ENOENT;
|
return ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for some invalid entries */
|
/* Check for some invalid entries */
|
||||||
if (socket < 0 || socket > max_socket ||
|
if (socket < 0 || socket > max_socket_id ||
|
||||||
core < 0 || core > max_core_overall ||
|
core < 0 || core > max_core_id_overall) {
|
||||||
NULL == processor_id) {
|
return ENOENT;
|
||||||
return EINVAL;
|
}
|
||||||
|
/* If the mapping returns -1, then this is a non-existent
|
||||||
|
socket/core combo (even though they fall within the max socket
|
||||||
|
/ max core overall values) */
|
||||||
|
ret = map_tuple_to_processor_id[socket][core]->processor_id;
|
||||||
|
if (-1 == ret) {
|
||||||
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, all should be good -- return the mapping */
|
/* Ok, all should be good -- return the mapping */
|
||||||
*processor_id = map_tuple_to_processor_id[socket][core]->processor_id;
|
*processor_id = ret;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,23 +489,26 @@ int PLPA_NAME(map_to_socket_core)(int processor_id, int *socket, int *core)
|
|||||||
|
|
||||||
/* If this system doesn't support mapping, sorry Charlie */
|
/* If this system doesn't support mapping, sorry Charlie */
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
return ENOENT;
|
return ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for some invalid entries */
|
/* Check for some invalid entries */
|
||||||
if (processor_id < 0 || processor_id > max_processor ||
|
if (processor_id < 0 || processor_id > max_processor_num) {
|
||||||
NULL == socket ||
|
return ENOENT;
|
||||||
NULL == core) {
|
}
|
||||||
return EINVAL;
|
ret = map_processor_id_to_tuple[processor_id].socket;
|
||||||
|
if (-1 == ret) {
|
||||||
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ok, all should be good -- return the mapping */
|
/* Ok, all should be good -- return the mapping */
|
||||||
*socket = map_processor_id_to_tuple[processor_id].socket;
|
*socket = ret;
|
||||||
*core = map_processor_id_to_tuple[processor_id].core;
|
*core = map_processor_id_to_tuple[processor_id].core;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PLPA_NAME(max_processor_id)(int *max_processor_id_arg)
|
int PLPA_NAME(get_processor_info)(int *num_processors_arg,
|
||||||
|
int *max_processor_num_arg)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -427,22 +520,23 @@ int PLPA_NAME(max_processor_id)(int *max_processor_id_arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for bozo arguments */
|
/* Check for bozo arguments */
|
||||||
if (NULL == max_processor_id_arg) {
|
if (NULL == max_processor_num_arg || NULL == num_processors_arg) {
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this system doesn't support mapping, sorry Charlie */
|
/* If this system doesn't support mapping, sorry Charlie */
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
return ENOENT;
|
return ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All done */
|
/* All done */
|
||||||
*max_processor_id_arg = max_processor;
|
*num_processors_arg = num_processors;
|
||||||
|
*max_processor_num_arg = max_processor_num;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the max socket number */
|
/* Return the max socket number */
|
||||||
int PLPA_NAME(max_socket)(int *max_socket_arg)
|
int PLPA_NAME(get_socket_info)(int *num_sockets_arg, int *max_socket_id_arg)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -454,22 +548,24 @@ int PLPA_NAME(max_socket)(int *max_socket_arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for bozo arguments */
|
/* Check for bozo arguments */
|
||||||
if (NULL == max_socket_arg) {
|
if (NULL == max_socket_id_arg || NULL == num_sockets_arg) {
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this system doesn't support mapping, sorry Charlie */
|
/* If this system doesn't support mapping, sorry Charlie */
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
return ENOENT;
|
return ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All done */
|
/* All done */
|
||||||
*max_socket_arg = max_socket;
|
*num_sockets_arg = num_sockets;
|
||||||
|
*max_socket_id_arg = max_socket_id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the max core number for a given socket */
|
/* Return the number of cores in a socket and the max core ID number */
|
||||||
int PLPA_NAME(max_core)(int socket, int *max_core_arg)
|
int PLPA_NAME(get_core_info)(int socket, int *num_cores_arg,
|
||||||
|
int *max_core_id_arg)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -481,21 +577,26 @@ int PLPA_NAME(max_core)(int socket, int *max_core_arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for bozo arguments */
|
/* Check for bozo arguments */
|
||||||
if (NULL == max_core_arg) {
|
if (NULL == max_core_id_arg || NULL == num_cores_arg) {
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this system doesn't support mapping, sorry Charlie */
|
/* If this system doesn't support mapping, sorry Charlie */
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
return ENOENT;
|
return ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for some invalid entries */
|
/* Check for some invalid entries */
|
||||||
if (socket < 0 || socket > max_socket) {
|
if (socket < 0 || socket > max_socket_id || -1 == max_core_id[socket]) {
|
||||||
return EINVAL;
|
return ENOENT;
|
||||||
|
}
|
||||||
|
ret = num_cores[socket];
|
||||||
|
if (-1 == ret) {
|
||||||
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All done */
|
/* All done */
|
||||||
*max_core_arg = max_core[socket];
|
*num_cores_arg = ret;
|
||||||
|
*max_core_id_arg = max_core_id[socket];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "plpa_config.h"
|
||||||
#include "plpa.h"
|
#include "plpa.h"
|
||||||
#include "plpa_internal.h"
|
#include "plpa_internal.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -11,10 +11,13 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "plpa_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <plpa.h>
|
|
||||||
|
#include "plpa.h"
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -23,7 +26,7 @@ int main(int argc, char *argv[])
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
int need_help = 0;
|
int need_help = 0;
|
||||||
int show_topo = 0;
|
int show_topo = 0;
|
||||||
int have_topo, max_socket, max_core;
|
int have_topo, num_sockets, max_socket_num, num_cores, max_core_num;
|
||||||
PLPA_NAME(api_type_t) api_probe;
|
PLPA_NAME(api_type_t) api_probe;
|
||||||
|
|
||||||
for (i = 1; i < argc; ++i) {
|
for (i = 1; i < argc; ++i) {
|
||||||
@ -73,10 +76,15 @@ int main(int argc, char *argv[])
|
|||||||
have_topo = 0;
|
have_topo = 0;
|
||||||
}
|
}
|
||||||
printf("Kernel topology support: %s\n", have_topo ? "yes" : "no");
|
printf("Kernel topology support: %s\n", have_topo ? "yes" : "no");
|
||||||
if (0 != PLPA_NAME(max_socket)(&max_socket)) {
|
if (0 != PLPA_NAME(get_socket_info)(&num_sockets, &max_socket_num)) {
|
||||||
max_socket = -1;
|
num_sockets = max_socket_num = -1;
|
||||||
|
}
|
||||||
|
printf("Number of processor sockets: ");
|
||||||
|
if (have_topo && num_sockets >= 0) {
|
||||||
|
printf("%d\n", num_sockets);
|
||||||
|
} else {
|
||||||
|
printf("unknown\n");
|
||||||
}
|
}
|
||||||
printf("Number of processor sockets: %d\n", have_topo ? max_socket : -1);
|
|
||||||
|
|
||||||
/* If asked, print the map */
|
/* If asked, print the map */
|
||||||
|
|
||||||
@ -84,13 +92,12 @@ int main(int argc, char *argv[])
|
|||||||
if (have_topo) {
|
if (have_topo) {
|
||||||
/* Remember that max_socket and max_core values are
|
/* Remember that max_socket and max_core values are
|
||||||
0-indexed */
|
0-indexed */
|
||||||
for (i = 0; i <= max_socket; ++i) {
|
for (i = 0; i <= max_socket_num; ++i) {
|
||||||
ret = PLPA_NAME(max_core)(i, &max_core);
|
ret = PLPA_NAME(get_core_info)(i, &num_cores, &max_core_num);
|
||||||
if (0 == ret) {
|
if (0 == ret) {
|
||||||
printf("Socket %d: %d core%s\n", i, max_core + 1,
|
printf("Socket %d: %d core%s (max core ID: %d)\n",
|
||||||
(0 == max_core) ? "" : "s");
|
i, num_cores, (1 == num_cores) ? "" : "s",
|
||||||
} else {
|
max_core_num);
|
||||||
printf("Socket %d: unknown cores\n", i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,53 +0,0 @@
|
|||||||
The requirements are:
|
|
||||||
|
|
||||||
1. devise a relatively simple command line syntax to bind a single
|
|
||||||
process to a set of (socket,core) tuples
|
|
||||||
|
|
||||||
2. be compatible with the "taskset" precedent, meaning:
|
|
||||||
- specify the sets of tuples in a single command line token (e.g.,
|
|
||||||
comma delimited?)
|
|
||||||
- be able to clearly differentiate this notation from the
|
|
||||||
"taskset" processor mask and list specifications (so that it's
|
|
||||||
clear when to treat a command line token as a processor mask, a
|
|
||||||
processor list, and a set of (socket,core) tuples)
|
|
||||||
|
|
||||||
3. be able to specify a single tuple with a some kind of "stride" for
|
|
||||||
repeating simple patterns (analogous to taskset's "x-y:step" range
|
|
||||||
notation)
|
|
||||||
|
|
||||||
4. include ability to wildcard sockets or cores. For example:
|
|
||||||
- bind to all cores on sockets x, y, z
|
|
||||||
- bind to cores x, y, z on all sockets
|
|
||||||
|
|
||||||
5. not force the user to use escapes in common shells (e.g., avoid the
|
|
||||||
use of *, !, and other shell-special characters)
|
|
||||||
|
|
||||||
Here's what I have figured out so far:
|
|
||||||
|
|
||||||
- use the general notation "<core>@<socket>"
|
|
||||||
- wildcard values:
|
|
||||||
- "all" -- all sockets/cores (depending on context)
|
|
||||||
- "even" -- even numbered sockets/cores
|
|
||||||
- "odd" -- odd numbered sockets/cores
|
|
||||||
- "not" -- negate the specified sockets and/or cores
|
|
||||||
- ...easy enough to add others
|
|
||||||
- sockets and cores are numbered starting with 0 (just like processor
|
|
||||||
IDs)
|
|
||||||
- multiple tuples can be specified as a comma delimited list
|
|
||||||
- core/socket ranges can be specified as "x-y", where x<=y
|
|
||||||
- {} can be used to specify lists of cores or sockets, and can be used
|
|
||||||
to make complex tuples
|
|
||||||
- examples:
|
|
||||||
- binding to core 3 on socket 1 is "3@1"
|
|
||||||
- binding to core 1 on all sockets is "1@all"
|
|
||||||
- binding to all cores on socket 2 is "all@2"
|
|
||||||
- binding to all cores on sockets 2 and 3 is "all@2,all@3" OR
|
|
||||||
"all@{2,3}"
|
|
||||||
- binding to cores 1 and 2 on sockets 0, 1, and 3 is
|
|
||||||
"{1,2}@{0,1,3}"
|
|
||||||
- binding to cores 0, 1, and 2 on sockets 0, 1, 2, and 5 is
|
|
||||||
"{0-2}@{0-2,5}"
|
|
||||||
- binding to all cores on all sockets (effectively disables PA) is
|
|
||||||
"all@all"
|
|
||||||
- binding to all cores on all sockets *except* all cores on socket
|
|
||||||
0 is "all@not0"
|
|
1592
opal/mca/paffinity/linux/plpa/src/plpa-taskset/parser.c
Обычный файл
1592
opal/mca/paffinity/linux/plpa/src/plpa-taskset/parser.c
Обычный файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -19,6 +19,8 @@
|
|||||||
/* Needed for getopt_long() */
|
/* Needed for getopt_long() */
|
||||||
#define GNU_SOURCE
|
#define GNU_SOURCE
|
||||||
|
|
||||||
|
#include "plpa_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -87,11 +89,11 @@ static void append(char *str, int val)
|
|||||||
|
|
||||||
static char *cpu_set_to_list(const PLPA_NAME(cpu_set_t) *cpu_set)
|
static char *cpu_set_to_list(const PLPA_NAME(cpu_set_t) *cpu_set)
|
||||||
{
|
{
|
||||||
size_t i, j, last_bit, size = PLPA_BITMASK_NUM_ELEMENTS;
|
size_t i, j, last_bit, size = PLPA_BITMASK_CPU_MAX;
|
||||||
unsigned long long mask_value = 0;
|
unsigned long long mask_value = 0;
|
||||||
/* Upper bound on string length: 4 digits per
|
/* Upper bound on string length: 4 digits per
|
||||||
PLPA_BITMASK_NUM_ELEMENTS + 1 comma for each */
|
PLPA_BITMASK_CPU_MAX + 1 comma for each */
|
||||||
static char str[PLPA_BITMASK_NUM_ELEMENTS * 5];
|
static char str[PLPA_BITMASK_CPU_MAX * 5];
|
||||||
char temp[8];
|
char temp[8];
|
||||||
|
|
||||||
if (sizeof(mask_value) * 8 < size) {
|
if (sizeof(mask_value) * 8 < size) {
|
||||||
@ -156,7 +158,7 @@ static char *cpu_set_to_list(const PLPA_NAME(cpu_set_t) *cpu_set)
|
|||||||
|
|
||||||
static unsigned long long cpu_set_to_ll(const PLPA_NAME(cpu_set_t) *cpu_set)
|
static unsigned long long cpu_set_to_ll(const PLPA_NAME(cpu_set_t) *cpu_set)
|
||||||
{
|
{
|
||||||
size_t i, size = PLPA_BITMASK_NUM_ELEMENTS;
|
size_t i, size = PLPA_BITMASK_CPU_MAX;
|
||||||
unsigned long long mask_value = 0;
|
unsigned long long mask_value = 0;
|
||||||
|
|
||||||
if (sizeof(mask_value) * 8 < size) {
|
if (sizeof(mask_value) * 8 < size) {
|
||||||
@ -164,7 +166,7 @@ static unsigned long long cpu_set_to_ll(const PLPA_NAME(cpu_set_t) *cpu_set)
|
|||||||
}
|
}
|
||||||
for (i = 0; i < size; ++i) {
|
for (i = 0; i < size; ++i) {
|
||||||
if (PLPA_CPU_ISSET(i, cpu_set)) {
|
if (PLPA_CPU_ISSET(i, cpu_set)) {
|
||||||
mask_value += 1 << i;
|
mask_value |= 1llu << i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mask_value;
|
return mask_value;
|
||||||
@ -184,7 +186,7 @@ static int cpu_list_to_cpu_set(char *str, PLPA_NAME(cpu_set_t) *cpu_set)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mask_to_cpu_set(char *mask_string, PLPA_NAME(cpu_set_t) *cpu_set)
|
static int mask_to_cpu_set(const char *mask_string, PLPA_NAME(cpu_set_t) *cpu_set)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
unsigned int mask_value;
|
unsigned int mask_value;
|
||||||
@ -192,7 +194,7 @@ static int mask_to_cpu_set(char *mask_string, PLPA_NAME(cpu_set_t) *cpu_set)
|
|||||||
PLPA_CPU_ZERO(cpu_set);
|
PLPA_CPU_ZERO(cpu_set);
|
||||||
sscanf(mask_string, "%x", &mask_value);
|
sscanf(mask_string, "%x", &mask_value);
|
||||||
for (i = 0; i < sizeof(mask_value) * 8; ++i) {
|
for (i = 0; i < sizeof(mask_value) * 8; ++i) {
|
||||||
if (0 != (mask_value & (1 << i))) {
|
if (0 != (mask_value & (1u << i))) {
|
||||||
PLPA_CPU_SET(i, cpu_set);
|
PLPA_CPU_SET(i, cpu_set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,6 +301,8 @@ static int set_pid_affinity(int use_cpu_list, char *mask_string,
|
|||||||
ret = PLPA_NAME(sched_setaffinity)((pid_t) pid, sizeof(cpu_set), &cpu_set);
|
ret = PLPA_NAME(sched_setaffinity)((pid_t) pid, sizeof(cpu_set), &cpu_set);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case 0:
|
case 0:
|
||||||
|
#if defined(PLPA_DEBUG) && PLPA_DEBUG
|
||||||
|
/* JMS For debugging */
|
||||||
if (use_cpu_list) {
|
if (use_cpu_list) {
|
||||||
printf("pid %d's new affinity list: %s\n",
|
printf("pid %d's new affinity list: %s\n",
|
||||||
pid, cpu_set_to_list(&cpu_set));
|
pid, cpu_set_to_list(&cpu_set));
|
||||||
@ -306,6 +310,7 @@ static int set_pid_affinity(int use_cpu_list, char *mask_string,
|
|||||||
printf("pid %d's new affinity mask: %llx\n",
|
printf("pid %d's new affinity mask: %llx\n",
|
||||||
pid, cpu_set_to_ll(&cpu_set));
|
pid, cpu_set_to_ll(&cpu_set));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ENOSYS:
|
case ENOSYS:
|
||||||
@ -344,6 +349,16 @@ static int launch_task(int use_cpu_list, char **argv)
|
|||||||
perror("sched_setaffinity");
|
perror("sched_setaffinity");
|
||||||
fprintf(stderr, "failed to set pid %d's affinity.\n", getpid());
|
fprintf(stderr, "failed to set pid %d's affinity.\n", getpid());
|
||||||
}
|
}
|
||||||
|
#if defined(PLPA_DEBUG) && PLPA_DEBUG
|
||||||
|
/* JMS For debugging */
|
||||||
|
if (use_cpu_list) {
|
||||||
|
printf("pid %d's new affinity list: %s\n",
|
||||||
|
getpid(), cpu_set_to_list(&cpu_set));
|
||||||
|
} else {
|
||||||
|
printf("pid %d's new affinity mask: %llx\n",
|
||||||
|
getpid(), cpu_set_to_ll(&cpu_set));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The next argument may be "--". If so, ignore it */
|
/* The next argument may be "--". If so, ignore it */
|
||||||
|
|
||||||
@ -371,7 +386,6 @@ int main(int argc, char *argv[])
|
|||||||
{ "cpu-list", 0, NULL, 'c' },
|
{ "cpu-list", 0, NULL, 'c' },
|
||||||
{ "help", 0, NULL, 'h' },
|
{ "help", 0, NULL, 'h' },
|
||||||
{ "version", 0, NULL, 'V' },
|
{ "version", 0, NULL, 'V' },
|
||||||
{ "testing", 0, NULL, 't' },
|
|
||||||
/* Undocumented testing function */
|
/* Undocumented testing function */
|
||||||
{ "testing", 0, NULL, 't' },
|
{ "testing", 0, NULL, 't' },
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
@ -412,6 +426,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Undocumented testing function */
|
/* Undocumented testing function */
|
||||||
if (testing) {
|
if (testing) {
|
||||||
|
if (NULL == argv[optind]) {
|
||||||
|
fprintf(stderr, "Nothing to test\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
run_test(use_cpu_list, argv[optind]);
|
run_test(use_cpu_list, argv[optind]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
#!/usr/bin/env perl
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
open(FILE, "test_cases.txt") or die "Can't open test_cases.txt file";
|
|
||||||
my $test_num = 1;
|
|
||||||
while (<FILE>) {
|
|
||||||
chomp;
|
|
||||||
/(\S+)\s+(\S+)/m;
|
|
||||||
my $in = $1;
|
|
||||||
my $expected_out = $2;
|
|
||||||
if ($in ne "") {
|
|
||||||
my $stdout = `./plpa_taskset -tc $in`;
|
|
||||||
chomp $stdout;
|
|
||||||
$stdout =~ /(.+?)\n(.+)/;
|
|
||||||
my $real_out = $2;
|
|
||||||
print "Test $test_num: ";
|
|
||||||
if ($real_out ne $expected_out) {
|
|
||||||
print "FAILED\n In: $in\n Out: $real_out\n Expected: $expected_out\n";
|
|
||||||
} else {
|
|
||||||
print "PASSED\n";
|
|
||||||
}
|
|
||||||
++$test_num;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(FILE);
|
|
@ -1,14 +0,0 @@
|
|||||||
3@1
|
|
||||||
1@all
|
|
||||||
all@1
|
|
||||||
all@2,all@3
|
|
||||||
all@{2,3}
|
|
||||||
{1,2}@{3,4,5}
|
|
||||||
{0-2}@{0-2,5}
|
|
||||||
all@all
|
|
||||||
## not{0@0}
|
|
||||||
not0@0
|
|
||||||
0@not0
|
|
||||||
{0-2}@not{1,2}
|
|
||||||
##not{0@even,1@odd}
|
|
||||||
not0@even,not1@odd
|
|
@ -1,39 +0,0 @@
|
|||||||
0 0
|
|
||||||
2 2
|
|
||||||
0-2 0-2
|
|
||||||
0,2 0,2
|
|
||||||
0-2,4 0-2,4
|
|
||||||
0,2-4 0,2-4
|
|
||||||
0,2,4 0,2,4
|
|
||||||
0-2,4,6 0-2,4,6
|
|
||||||
0-2,4-6 0-2,4-6
|
|
||||||
0,2-4,6 0,2-4,6
|
|
||||||
0,2,4-6 0,2,4-6
|
|
||||||
0,2,4,6,8 0,2,4,6,8
|
|
||||||
0-2,4,6,8 0-2,4,6,8
|
|
||||||
0-2,4-6,8 0-2,4-6,8
|
|
||||||
0-2,4,6-8 0-2,4,6-8
|
|
||||||
0,2-4,6,8 0,2-4,6,8
|
|
||||||
0,2-4,6-8 0,2-4,6-8
|
|
||||||
0,2,4-6,8 0,2,4-6,8
|
|
||||||
0,2,4,6-8 0,2,4,6-8
|
|
||||||
0,1,2 0-2
|
|
||||||
0-2,3 0-3
|
|
||||||
0-2,3,4-5 0-5
|
|
||||||
0-2,3,4-6 0-6
|
|
||||||
0-4:1 0-4
|
|
||||||
0-4:2 0,2,4
|
|
||||||
0-4:3 0,3
|
|
||||||
0-4:2,6 0,2,4,6
|
|
||||||
0-4:1,5 0-5
|
|
||||||
0-4:1,5,6 0-6
|
|
||||||
0-4:2,6,8 0,2,4,6,8
|
|
||||||
0-4:2,6,7,8 0,2,4,6-8
|
|
||||||
0-4:2,6-8 0,2,4,6-8
|
|
||||||
0-4:2,6-8:2 0,2,4,6,8
|
|
||||||
0-4:2,6-10:2 0,2,4,6,8,10
|
|
||||||
0-4:2,6-10:2,8 0,2,4,6,8,10
|
|
||||||
0-4:2,6-10:2,9 0,2,4,6,8-10
|
|
||||||
0-4:2,6-10:2,13 0,2,4,6,8,10,13
|
|
||||||
0-4:2,6-10:2,13,15 0,2,4,6,8,10,13,15
|
|
||||||
0-31 0-31
|
|
1656
opal/mca/paffinity/linux/plpa/src/plpa-taskset/tokens.c
Обычный файл
1656
opal/mca/paffinity/linux/plpa/src/plpa-taskset/tokens.c
Обычный файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
64
opal/mca/paffinity/linux/plpa/src/plpa-taskset/tokens.h
Обычный файл
64
opal/mca/paffinity/linux/plpa/src/plpa-taskset/tokens.h
Обычный файл
@ -0,0 +1,64 @@
|
|||||||
|
/* A Bison parser, made by GNU Bison 1.875c. */
|
||||||
|
|
||||||
|
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||||
|
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, 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 General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU 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. */
|
||||||
|
|
||||||
|
/* As a special exception, when this file is copied by Bison into a
|
||||||
|
Bison output file, you may use that output file without restriction.
|
||||||
|
This special exception was added by the Free Software Foundation
|
||||||
|
in version 1.24 of Bison. */
|
||||||
|
|
||||||
|
/* Tokens. */
|
||||||
|
#ifndef YYTOKENTYPE
|
||||||
|
# define YYTOKENTYPE
|
||||||
|
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||||
|
know about them. */
|
||||||
|
enum yytokentype {
|
||||||
|
TOKENS_STRING_ALL = 258,
|
||||||
|
TOKENS_STRING_EVEN = 259,
|
||||||
|
TOKENS_STRING_ODD = 260,
|
||||||
|
TOKENS_STRING_NOT = 261,
|
||||||
|
TOKENS_NUMBER = 262
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
#define TOKENS_STRING_ALL 258
|
||||||
|
#define TOKENS_STRING_EVEN 259
|
||||||
|
#define TOKENS_STRING_ODD 260
|
||||||
|
#define TOKENS_STRING_NOT 261
|
||||||
|
#define TOKENS_NUMBER 262
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||||
|
#line 59 "tokens.y"
|
||||||
|
typedef union YYSTYPE {
|
||||||
|
PLPA_NAME(cpu_set_t) cpu_set;
|
||||||
|
int number;
|
||||||
|
} YYSTYPE;
|
||||||
|
/* Line 1275 of yacc.c. */
|
||||||
|
#line 56 "tokens.h"
|
||||||
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern YYSTYPE yylval;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
|||||||
%{
|
%{
|
||||||
|
|
||||||
#include "plpa.h"
|
/* Copyright 2007-2008 Cisco Systems, Inc. All rights reserved. */
|
||||||
|
|
||||||
|
#include "plpa_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "plpa.h"
|
||||||
#include "plpa-taskset.h"
|
#include "plpa-taskset.h"
|
||||||
|
|
||||||
|
|
||||||
@ -14,6 +19,14 @@
|
|||||||
* Performance is not an issue here.
|
* Performance is not an issue here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Typedefs
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
ALL,
|
||||||
|
PROCESSOR
|
||||||
|
} id_type_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global functions
|
* Global functions
|
||||||
*/
|
*/
|
||||||
@ -23,17 +36,18 @@ void yyerror(char const *s);
|
|||||||
/*
|
/*
|
||||||
* Local functions
|
* Local functions
|
||||||
*/
|
*/
|
||||||
static void set_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *a,
|
static void set_union(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *a,
|
||||||
PLPA_NAME(cpu_set_t) *b);
|
PLPA_NAME(cpu_set_t) *b);
|
||||||
static void set_copy(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *in);
|
static void set_copy(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *in);
|
||||||
static void cpu_set(PLPA_NAME(cpu_set_t) *out, int pos);
|
static void cpu_set(PLPA_NAME(cpu_set_t) *out, int pos);
|
||||||
static void cpu_set_all(PLPA_NAME(cpu_set_t) *out);
|
static void cpu_set_all(PLPA_NAME(cpu_set_t) *out, id_type_t type);
|
||||||
static void cpu_set_even(PLPA_NAME(cpu_set_t) *out);
|
static void cpu_set_even(PLPA_NAME(cpu_set_t) *out, id_type_t type);
|
||||||
static void cpu_set_odd(PLPA_NAME(cpu_set_t) *out);
|
static void cpu_set_odd(PLPA_NAME(cpu_set_t) *out, id_type_t type);
|
||||||
static void cpu_set_range(PLPA_NAME(cpu_set_t) *out, int min, int max);
|
static void cpu_set_range(PLPA_NAME(cpu_set_t) *out, int min, int max);
|
||||||
static void cpu_compliment(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *in);
|
static void cpu_compliment(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *in);
|
||||||
static void sc_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *cores,
|
static void sc_merge(PLPA_NAME(cpu_set_t) *out,
|
||||||
PLPA_NAME(cpu_set_t) *sockets);
|
PLPA_NAME(cpu_set_t) *cores, int cores_are_valid,
|
||||||
|
PLPA_NAME(cpu_set_t) *sockets, int sockets_are_valid);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables
|
* Local variables
|
||||||
@ -80,28 +94,32 @@ cpu_numbers: TOKENS_NUMBER
|
|||||||
| TOKENS_NUMBER '-' TOKENS_NUMBER
|
| TOKENS_NUMBER '-' TOKENS_NUMBER
|
||||||
{ cpu_set_range(&$$, $1, $3); }
|
{ cpu_set_range(&$$, $1, $3); }
|
||||||
| cpu_list ',' TOKENS_NUMBER
|
| cpu_list ',' TOKENS_NUMBER
|
||||||
{ PLPA_NAME(cpu_set_t) temp; cpu_set(&temp, $3); set_merge(&$$, &$1, &temp); }
|
{ PLPA_NAME(cpu_set_t) temp; cpu_set(&temp, $3); set_union(&$$, &$1, &temp); }
|
||||||
| cpu_list ',' TOKENS_NUMBER '-' TOKENS_NUMBER
|
| cpu_list ',' TOKENS_NUMBER '-' TOKENS_NUMBER
|
||||||
{ PLPA_NAME(cpu_set_t) temp; cpu_set_range(&temp, $3, $5); set_merge(&$$, &$1, &temp); }
|
{ PLPA_NAME(cpu_set_t) temp; cpu_set_range(&temp, $3, $5); set_union(&$$, &$1, &temp); }
|
||||||
|
|
||||||
cpu_strings: TOKENS_STRING_ALL
|
cpu_strings: TOKENS_STRING_ALL
|
||||||
{ cpu_set_all(&$$); }
|
{ cpu_set_all(&$$, PROCESSOR); }
|
||||||
| TOKENS_STRING_EVEN
|
| TOKENS_STRING_EVEN
|
||||||
{ cpu_set_even(&$$); }
|
{ cpu_set_even(&$$, PROCESSOR); }
|
||||||
| TOKENS_STRING_ODD
|
| TOKENS_STRING_ODD
|
||||||
{ cpu_set_odd(&$$); }
|
{ cpu_set_odd(&$$, PROCESSOR); }
|
||||||
|
|
||||||
sc_list: sc_expr
|
sc_list: sc_expr
|
||||||
{ set_copy(&$$, &$1); }
|
{ set_copy(&$$, &$1); }
|
||||||
| sc_list ',' sc_expr
|
| sc_list ',' sc_expr
|
||||||
{ set_merge(&$$, &$1, &$3); }
|
{ set_union(&$$, &$1, &$3); }
|
||||||
|
|
||||||
sc_expr: sc_item '@' sc_item
|
sc_expr: sc_item '@' sc_item
|
||||||
{ sc_merge(&$$, &$1, &$3); }
|
{ sc_merge(&$$, &$1, 1, &$3, 1); }
|
||||||
|
| sc_item '@' sc_strings
|
||||||
|
{ sc_merge(&$$, &$1, 1, &$3, 0); }
|
||||||
|
| sc_strings '@' sc_item
|
||||||
|
{ sc_merge(&$$, &$1, 0, &$3, 1); }
|
||||||
|
| sc_strings '@' sc_strings
|
||||||
|
{ sc_merge(&$$, &$1, 0, &$3, 0); }
|
||||||
|
|
||||||
sc_item: sc_strings
|
sc_item: TOKENS_NUMBER
|
||||||
{ set_copy(&$$, &$1); }
|
|
||||||
| TOKENS_NUMBER
|
|
||||||
{ cpu_set(&$$, $1); }
|
{ cpu_set(&$$, $1); }
|
||||||
| TOKENS_STRING_NOT TOKENS_NUMBER
|
| TOKENS_STRING_NOT TOKENS_NUMBER
|
||||||
{ PLPA_NAME(cpu_set_t) temp; cpu_set(&temp, $2); cpu_compliment(&$$, &temp); }
|
{ PLPA_NAME(cpu_set_t) temp; cpu_set(&temp, $2); cpu_compliment(&$$, &temp); }
|
||||||
@ -109,24 +127,22 @@ sc_item: sc_strings
|
|||||||
{ cpu_compliment(&$$, &$3); }
|
{ cpu_compliment(&$$, &$3); }
|
||||||
| '{' sc_item_list '}'
|
| '{' sc_item_list '}'
|
||||||
{ set_copy(&$$, &$2); }
|
{ set_copy(&$$, &$2); }
|
||||||
| '{' sc_strings '}'
|
|
||||||
{ set_copy(&$$, &$2); }
|
|
||||||
|
|
||||||
sc_item_list: TOKENS_NUMBER
|
sc_item_list: TOKENS_NUMBER
|
||||||
{ cpu_set(&$$, $1); }
|
{ cpu_set(&$$, $1); }
|
||||||
| TOKENS_NUMBER '-' TOKENS_NUMBER
|
| TOKENS_NUMBER '-' TOKENS_NUMBER
|
||||||
{ cpu_set_range(&$$, $1, $3); }
|
{ cpu_set_range(&$$, $1, $3); }
|
||||||
| sc_item_list ',' TOKENS_NUMBER
|
| sc_item_list ',' TOKENS_NUMBER
|
||||||
{ PLPA_NAME(cpu_set_t) temp; cpu_set(&temp, $3); set_merge(&$$, &$1, &temp); }
|
{ PLPA_NAME(cpu_set_t) temp; cpu_set(&temp, $3); set_union(&$$, &$1, &temp); }
|
||||||
| sc_item_list ',' TOKENS_NUMBER '-' TOKENS_NUMBER
|
| sc_item_list ',' TOKENS_NUMBER '-' TOKENS_NUMBER
|
||||||
{ PLPA_NAME(cpu_set_t) temp; cpu_set_range(&temp, $3, $5); set_merge(&$$, &$1, &temp); }
|
{ PLPA_NAME(cpu_set_t) temp; cpu_set_range(&temp, $3, $5); set_union(&$$, &$1, &temp); }
|
||||||
|
|
||||||
sc_strings: TOKENS_STRING_ALL
|
sc_strings: TOKENS_STRING_ALL
|
||||||
{ cpu_set_all(&$$); }
|
{ cpu_set_all(&$$, ALL); }
|
||||||
| TOKENS_STRING_EVEN
|
| TOKENS_STRING_EVEN
|
||||||
{ cpu_set_even(&$$); }
|
{ cpu_set_even(&$$, ALL); }
|
||||||
| TOKENS_STRING_ODD
|
| TOKENS_STRING_ODD
|
||||||
{ cpu_set_odd(&$$); }
|
{ cpu_set_odd(&$$, ALL); }
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
@ -148,7 +164,7 @@ void yyerror (char const *s)
|
|||||||
fprintf(stderr, "ERROR: %s\n", s);
|
fprintf(stderr, "ERROR: %s\n", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *a,
|
static void set_union(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *a,
|
||||||
PLPA_NAME(cpu_set_t) *b)
|
PLPA_NAME(cpu_set_t) *b)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -178,30 +194,63 @@ static void cpu_set(PLPA_NAME(cpu_set_t) *out, int pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_set_all(PLPA_NAME(cpu_set_t) *out)
|
static void cpu_set_all(PLPA_NAME(cpu_set_t) *out, id_type_t type)
|
||||||
{
|
{
|
||||||
int i;
|
int i, max_id, max_id_num, s, c;
|
||||||
PLPA_CPU_ZERO(out);
|
PLPA_CPU_ZERO(out);
|
||||||
for (i = 0; i < PLPA_BITMASK_CPU_MAX; ++i) {
|
|
||||||
PLPA_CPU_SET(i, out);
|
/* Only set processor ID's that exist */
|
||||||
|
if (ALL == type) {
|
||||||
|
max_id_num = PLPA_BITMASK_CPU_MAX;
|
||||||
|
} else if (PROCESSOR == type) {
|
||||||
|
plpa_get_processor_info(&max_id, &max_id_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i <= max_id_num; ++i) {
|
||||||
|
if (ALL == type ||
|
||||||
|
(PROCESSOR == type && 0 == plpa_map_to_socket_core(i, &s, &c))) {
|
||||||
|
PLPA_CPU_SET(i, out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_set_even(PLPA_NAME(cpu_set_t) *out)
|
static void cpu_set_even(PLPA_NAME(cpu_set_t) *out, id_type_t type)
|
||||||
{
|
{
|
||||||
int i;
|
int i, max_id, max_id_num, s, c;
|
||||||
PLPA_CPU_ZERO(out);
|
PLPA_CPU_ZERO(out);
|
||||||
for (i = 0; i < PLPA_BITMASK_CPU_MAX; i += 2) {
|
|
||||||
PLPA_CPU_SET(i, out);
|
/* Only set processor ID's that exist */
|
||||||
|
if (ALL == type) {
|
||||||
|
max_id_num = PLPA_BITMASK_CPU_MAX;
|
||||||
|
} else if (PROCESSOR == type) {
|
||||||
|
plpa_get_processor_info(&max_id, &max_id_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i <= max_id_num; i += 2) {
|
||||||
|
if (ALL == type ||
|
||||||
|
(PROCESSOR == type && 0 == plpa_map_to_socket_core(i, &s, &c))) {
|
||||||
|
PLPA_CPU_SET(i, out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_set_odd(PLPA_NAME(cpu_set_t) *out)
|
static void cpu_set_odd(PLPA_NAME(cpu_set_t) *out, id_type_t type)
|
||||||
{
|
{
|
||||||
int i;
|
int i, max_id, max_id_num, s, c;
|
||||||
PLPA_CPU_ZERO(out);
|
PLPA_CPU_ZERO(out);
|
||||||
for (i = 1; i < PLPA_BITMASK_CPU_MAX; i += 2) {
|
|
||||||
PLPA_CPU_SET(i, out);
|
/* Only set processor ID's that exist */
|
||||||
|
if (ALL == type) {
|
||||||
|
max_id_num = PLPA_BITMASK_CPU_MAX;
|
||||||
|
} else if (PROCESSOR == type) {
|
||||||
|
plpa_get_processor_info(&max_id, &max_id_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 1; i <= max_id_num; i += 2) {
|
||||||
|
if (ALL == type ||
|
||||||
|
(PROCESSOR == type && 0 == plpa_map_to_socket_core(i, &s, &c))) {
|
||||||
|
PLPA_CPU_SET(i, out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,10 +274,13 @@ static void cpu_compliment(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *in)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sc_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *cores,
|
static void sc_merge(PLPA_NAME(cpu_set_t) *out,
|
||||||
PLPA_NAME(cpu_set_t) *sockets)
|
PLPA_NAME(cpu_set_t) *cores, int cores_are_valid,
|
||||||
|
PLPA_NAME(cpu_set_t) *sockets, int sockets_are_valid)
|
||||||
{
|
{
|
||||||
int i, core, socket, id, have_topo;
|
int ret, i, core, socket, id, have_topo;
|
||||||
|
int num_sockets, max_socket_id;
|
||||||
|
int num_cores, max_core_id;
|
||||||
|
|
||||||
/* This is just about the only function that's tricky. Take a
|
/* This is just about the only function that's tricky. Take a
|
||||||
bitmask representing all the cores and a bitmask representing
|
bitmask representing all the cores and a bitmask representing
|
||||||
@ -236,8 +288,7 @@ static void sc_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *cores,
|
|||||||
representing real CPU id's using the plpa_map_to_processor_id()
|
representing real CPU id's using the plpa_map_to_processor_id()
|
||||||
function. But error out if this system doesn't support the
|
function. But error out if this system doesn't support the
|
||||||
topology information (because we won't be able to do the
|
topology information (because we won't be able to do the
|
||||||
mapping).
|
mapping). */
|
||||||
*/
|
|
||||||
|
|
||||||
PLPA_CPU_ZERO(out);
|
PLPA_CPU_ZERO(out);
|
||||||
if (0 != PLPA_NAME(have_topology_information)(&have_topo) ||
|
if (0 != PLPA_NAME(have_topology_information)(&have_topo) ||
|
||||||
@ -246,6 +297,11 @@ static void sc_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *cores,
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (0 != plpa_get_socket_info(&num_sockets, &max_socket_id)) {
|
||||||
|
fprintf(stderr, "ERROR: Unable to retrieve socket information\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Even though I officially don't care about performance here,
|
/* Even though I officially don't care about performance here,
|
||||||
intentionally putting in a loop that is
|
intentionally putting in a loop that is
|
||||||
O(PLPA_BITMASK_CPU_MAX^2) gives me pause. :-) So scan through
|
O(PLPA_BITMASK_CPU_MAX^2) gives me pause. :-) So scan through
|
||||||
@ -253,7 +309,19 @@ static void sc_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *cores,
|
|||||||
much shorter array. */
|
much shorter array. */
|
||||||
|
|
||||||
for (i = socket = 0; socket < PLPA_BITMASK_CPU_MAX; ++socket) {
|
for (i = socket = 0; socket < PLPA_BITMASK_CPU_MAX; ++socket) {
|
||||||
if (PLPA_CPU_ISSET(socket, sockets)) {
|
if (sockets_are_valid && socket > max_socket_id &&
|
||||||
|
PLPA_CPU_ISSET(socket, sockets)) {
|
||||||
|
fprintf(stderr, "ERROR: Invalid socket ID specified (%d; max socket ID is %d)\n",
|
||||||
|
socket, max_socket_id);
|
||||||
|
exit(1);
|
||||||
|
} else if (sockets_are_valid &&
|
||||||
|
ENOENT == plpa_get_core_info(socket, &num_cores,
|
||||||
|
&max_core_id) &&
|
||||||
|
PLPA_CPU_ISSET(socket, sockets)) {
|
||||||
|
fprintf(stderr, "ERROR: Invalid socket ID specified (%d does not exist)\n",
|
||||||
|
socket);
|
||||||
|
exit(1);
|
||||||
|
} else if (PLPA_CPU_ISSET(socket, sockets)) {
|
||||||
socket_list[i++] = socket;
|
socket_list[i++] = socket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,13 +340,21 @@ static void sc_merge(PLPA_NAME(cpu_set_t) *out, PLPA_NAME(cpu_set_t) *cores,
|
|||||||
for (core = 0; core < PLPA_BITMASK_CPU_MAX; ++core) {
|
for (core = 0; core < PLPA_BITMASK_CPU_MAX; ++core) {
|
||||||
if (PLPA_CPU_ISSET(core, cores)) {
|
if (PLPA_CPU_ISSET(core, cores)) {
|
||||||
for (socket = 0; socket < i; ++socket) {
|
for (socket = 0; socket < i; ++socket) {
|
||||||
if (0 != PLPA_NAME(map_to_processor_id)(socket_list[socket],
|
ret = PLPA_NAME(map_to_processor_id)(socket_list[socket],
|
||||||
core, &id)) {
|
core, &id);
|
||||||
|
if (ENOENT == ret) {
|
||||||
|
if (cores_are_valid) {
|
||||||
|
fprintf(stderr, "ERROR: Invalid core@socket tuple (%d@%d does not exist)\n",
|
||||||
|
core, socket_list[socket]);
|
||||||
|
exit(1);
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} else if (0 != ret) {
|
||||||
fprintf(stderr, "ERROR: Failed to map %d@%d to processor ID\n",
|
fprintf(stderr, "ERROR: Failed to map %d@%d to processor ID\n",
|
||||||
core, socket);
|
core, socket);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
printf("Setting id: %d\n", id);
|
|
||||||
PLPA_CPU_SET(id, out);
|
PLPA_CPU_SET(id, out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ typedef int (*opal_paffinity_base_module_map_to_socket_core_fn_t)(int processor_
|
|||||||
* return OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
* return OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
||||||
* supporeted (solaris, windows, etc...)
|
* supporeted (solaris, windows, etc...)
|
||||||
*/
|
*/
|
||||||
typedef int (*opal_paffinity_base_module_max_processor_id_fn_t)(int *max_processor_id);
|
typedef int (*opal_paffinity_base_module_get_processor_info_fn_t)(int *num_processors, int *max_processor_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the number of sockets in a host. currently supported
|
* Provides the number of sockets in a host. currently supported
|
||||||
@ -203,7 +203,7 @@ typedef int (*opal_paffinity_base_module_max_processor_id_fn_t)(int *max_process
|
|||||||
* return OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
* return OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
||||||
* supporeted (solaris, windows, etc...)
|
* supporeted (solaris, windows, etc...)
|
||||||
*/
|
*/
|
||||||
typedef int (*opal_paffinity_base_module_max_socket_fn_t)(int *max_socket);
|
typedef int (*opal_paffinity_base_module_get_socket_info_fn_t)(int *num_sockets, int *max_socket_num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the number of cores in a socket. currently supported
|
* Provides the number of cores in a socket. currently supported
|
||||||
@ -212,7 +212,7 @@ typedef int (*opal_paffinity_base_module_max_socket_fn_t)(int *max_socket);
|
|||||||
* return OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
* return OPAL_SUCCESS or OPAL_ERR_NOT_SUPPORTED if not
|
||||||
* supporeted (solaris, windows, etc...)
|
* supporeted (solaris, windows, etc...)
|
||||||
*/
|
*/
|
||||||
typedef int (*opal_paffinity_base_module_max_core)(int socket, int *max_core);
|
typedef int (*opal_paffinity_base_module_get_core_info_fn_t)(int socket, int *num_cores, int *max_core_num);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -262,13 +262,13 @@ struct opal_paffinity_base_module_1_1_0_t {
|
|||||||
opal_paffinity_base_module_map_to_socket_core_fn_t paff_map_to_socket_core;
|
opal_paffinity_base_module_map_to_socket_core_fn_t paff_map_to_socket_core;
|
||||||
|
|
||||||
/** Return the max processor ID */
|
/** Return the max processor ID */
|
||||||
opal_paffinity_base_module_max_processor_id_fn_t paff_max_processor_id;
|
opal_paffinity_base_module_get_processor_info_fn_t paff_get_processor_info;
|
||||||
|
|
||||||
/** Return the max socket number */
|
/** Return the max socket number */
|
||||||
opal_paffinity_base_module_max_socket_fn_t paff_max_socket;
|
opal_paffinity_base_module_get_socket_info_fn_t paff_get_socket_info;
|
||||||
|
|
||||||
/** Return the max core number */
|
/** Return the max core number */
|
||||||
opal_paffinity_base_module_max_core paff_max_core;
|
opal_paffinity_base_module_get_core_info_fn_t paff_get_core_info;
|
||||||
|
|
||||||
/** Shut down this module */
|
/** Shut down this module */
|
||||||
opal_paffinity_base_module_finalize_fn_t paff_module_finalize;
|
opal_paffinity_base_module_finalize_fn_t paff_module_finalize;
|
||||||
|
@ -45,9 +45,9 @@ static int solaris_module_finalize(void);
|
|||||||
static int cpumask_to_id(opal_paffinity_base_cpu_set_t cpumask);
|
static int cpumask_to_id(opal_paffinity_base_cpu_set_t cpumask);
|
||||||
static int solaris_module_map_to_processor_id(int socket, int core, int *processor_id);
|
static int solaris_module_map_to_processor_id(int socket, int core, int *processor_id);
|
||||||
static int solaris_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
static int solaris_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
||||||
static int solaris_module_max_processor_id(int *max_processor_id);
|
static int solaris_module_get_processor_info(int *num_processors, int *max_processor_id);
|
||||||
static int solaris_module_max_socket(int *max_socket);
|
static int solaris_module_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||||
static int solaris_module_max_core(int socket, int *max_core);
|
static int solaris_module_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Solaris paffinity module
|
* Solaris paffinity module
|
||||||
@ -64,9 +64,9 @@ static const opal_paffinity_base_module_1_1_0_t module = {
|
|||||||
solaris_module_get,
|
solaris_module_get,
|
||||||
solaris_module_map_to_processor_id,
|
solaris_module_map_to_processor_id,
|
||||||
solaris_module_map_to_socket_core,
|
solaris_module_map_to_socket_core,
|
||||||
solaris_module_max_processor_id,
|
solaris_module_get_processor_info,
|
||||||
solaris_module_max_socket,
|
solaris_module_get_socket_info,
|
||||||
solaris_module_max_core,
|
solaris_module_get_core_info,
|
||||||
solaris_module_finalize
|
solaris_module_finalize
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -173,17 +173,17 @@ static int solaris_module_map_to_socket_core(int processor_id, int *socket, int
|
|||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int solaris_module_max_processor_id(int *max_processor_id)
|
static int solaris_module_get_processor_info(int *num_processors, int *max_processor_id);
|
||||||
{
|
{
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int solaris_module_max_socket(int *max_socket)
|
static int solaris_module_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||||
{
|
{
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int solaris_module_max_core(int socket, int *max_core)
|
static int solaris_module_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||||
{
|
{
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,9 @@ static int windows_module_set(opal_paffinity_base_cpu_set_t cpumask);
|
|||||||
static int windows_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
static int windows_module_get(opal_paffinity_base_cpu_set_t *cpumask);
|
||||||
static int windows_module_map_to_processor_id(int socket, int core, int *processor_id);
|
static int windows_module_map_to_processor_id(int socket, int core, int *processor_id);
|
||||||
static int windows_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
static int windows_module_map_to_socket_core(int processor_id, int *socket, int *core);
|
||||||
static int windows_module_max_processor_id(int *max_processor_id);
|
static int windows_module_get_processor_info(int *num_processors, int *max_processor_id);
|
||||||
static int windows_module_max_socket(int *max_socket);
|
static int windows_module_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||||
static int windows_module_max_core(int socket, int *max_core);
|
static int windows_module_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||||
|
|
||||||
static SYSTEM_INFO sys_info;
|
static SYSTEM_INFO sys_info;
|
||||||
|
|
||||||
@ -54,9 +54,9 @@ static const opal_paffinity_base_module_1_1_0_t module = {
|
|||||||
windows_module_get,
|
windows_module_get,
|
||||||
windows_module_map_to_processor_id,
|
windows_module_map_to_processor_id,
|
||||||
windows_module_map_to_socket_core,
|
windows_module_map_to_socket_core,
|
||||||
windows_module_max_processor_id,
|
windows_module_get_processor_info,
|
||||||
windows_module_max_socket,
|
windows_module_get_socket_info,
|
||||||
windows_module_max_core,
|
windows_module_get_core_info,
|
||||||
windows_module_finalize
|
windows_module_finalize
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -134,17 +134,17 @@ static int windows_module_map_to_socket_core(int processor_id, int *socket, int
|
|||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int windows_module_max_processor_id(int *max_processor_id)
|
static int windows_module_get_processor_info(int *num_processors, int *max_processor_id);
|
||||||
{
|
{
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int windows_module_max_socket(int *max_socket)
|
static int windows_module_get_socket_info(int *num_sockets, int *max_socket_num);
|
||||||
{
|
{
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int windows_module_max_core(int socket, int *max_core)
|
static int windows_module_get_core_info(int socket, int *num_cores, int *max_core_num);
|
||||||
{
|
{
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user