1
1
to make MPI_IN_PLACE (and other sentinel Fortran constants) work on OS
X, we need to use the following compiler (linker) flag:

    -Wl,-commons,use_dylibs 

So if we're compiling on OS X, test to see if that flag works with the
compiler.  If so, add it to the wrapper FFLAGS and FCFLAGS (note that
per a future update, we'll only have one Fortran compiler anyway).

Fixes trac:1982.  

This commit was SVN r25545.

The following Trac tickets were found above:
  Ticket 1982 --> https://svn.open-mpi.org/trac/ompi/ticket/1982
Этот коммит содержится в:
Jeff Squyres 2011-11-29 23:05:54 +00:00
родитель 7a238933b6
Коммит 7f9ae11faf
21 изменённых файлов: 111 добавлений и 48 удалений

Просмотреть файл

@ -143,6 +143,37 @@ else
AC_LANG_POP
fi
# Per #1982, on OS X, we may need some esoteric linker flags in the
# wrapper compilers. Assume that we need it for both F77 and FC flags
# (note that in an upcoming update where there will only be one
# Fortran compiler, anyway).
AC_MSG_CHECKING([to see if mpif77/mpif90 compilers need additional linker flags])
if test $OMPI_WANT_F77_BINDINGS -eq 0; then
AC_MSG_RESULT([none (no F77 bindings)])
else
case "$host" in
*apple-darwin*)
# Test whether -Wl,-commons,use_dylibs works; if it does, use it.
LDFLAGS_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-commons,use_dylibs"
AC_LANG_PUSH(Fortran 77)
AC_LINK_IFELSE([AC_LANG_SOURCE([[ program test
integer :: i
end program]])],
[OMPI_FORTRAN_WRAPPER_FLAGS="-Wl,-commons,use_dylibs"
WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"],
[OMPI_FORTRAN_WRAPPER_FLAGS=none])
AC_LANG_POP
LDFLAGS=$LDFLAGS_save
AC_MSG_RESULT([$OMPI_FORTRAN_WRAPPER_FLAGS])
;;
*)
AC_MSG_RESULT([none])
;;
esac
fi
AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS,
[Whether we want the MPI f77 bindings or not])
AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])

Просмотреть файл

@ -10,6 +10,7 @@
#include "ompi_config.h"
#include "opal/util/output.h"
#include "opal/util/gethostname.h"
#include "pml_v_output.h"
@ -42,7 +43,7 @@ int pml_v_output_open(char *output, int verbosity) {
lds.lds_file_suffix = output;
}
lds.lds_is_debugging = true;
gethostname(hostname, 32);
opal_gethostname(hostname, 32);
asprintf(&lds.lds_prefix, "[%s:%05d] pml_v: ", hostname, getpid());
lds.lds_verbose_level = verbosity;
mca_pml_v.output = opal_output_open(&lds);

Просмотреть файл

@ -9,20 +9,25 @@
* University of Stuttgart. 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 (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include "opal/util/gethostname.h"
#include "opal/util/opal_sos.h"
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
@ -41,6 +46,9 @@ static const char FUNC_NAME[] = "MPI_Get_processor_name";
int MPI_Get_processor_name(char *name, int *resultlen)
{
int rc;
char *tmp;
OPAL_CR_NOOP_PROGRESS();
if ( MPI_PARAM_CHECK) {
@ -65,9 +73,13 @@ int MPI_Get_processor_name(char *name, int *resultlen)
Guard against gethostname() returning a *really long* hostname
and not null-terminating the string. The Fortran API version
will pad to the right if necessary. */
gethostname(name, MPI_MAX_PROCESSOR_NAME - 1);
rc = opal_gethostname(&tmp);
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
strncpy(name, tmp, MPI_MAX_PROCESSOR_NAME - 1);
name[MPI_MAX_PROCESSOR_NAME - 1] = '\0';
*resultlen = (int) strlen(name);
free(tmp);
return MPI_SUCCESS;
}

Просмотреть файл

@ -35,6 +35,7 @@
#include "opal/mca/backtrace/backtrace.h"
#include "orte/util/proc_info.h"
#include "orte/util/gethostname.h"
#include "orte/runtime/runtime.h"
#include "orte/runtime/orte_globals.h"
#include "orte/util/name_fns.h"
@ -71,7 +72,7 @@ ompi_mpi_abort(struct ompi_communicator_t* comm,
if (orte_initialized) {
host = orte_process_info.nodename;
} else {
gethostname(hostname, sizeof(hostname));
opal_gethostname(hostname, sizeof(hostname));
host = hostname;
}
pid = getpid();

Просмотреть файл

@ -40,6 +40,7 @@
#include "opal/mca/event/event.h"
#include "opal/util/output.h"
#include "opal/util/gethostname.h"
#include "opal/runtime/opal_progress.h"
#include "opal/mca/maffinity/base/base.h"
#include "opal/mca/base/base.h"
@ -104,7 +105,7 @@ int ompi_mpi_finalize(void)
to stderr. */
char hostname[MAXHOSTNAMELEN];
pid_t pid = getpid();
gethostname(hostname, sizeof(hostname));
opal_gethostname(hostname, sizeof(hostname));
orte_show_help("help-mpi-runtime.txt",
"mpi_finalize:invoked_multiple_times",

Просмотреть файл

@ -57,6 +57,7 @@
#include "opal/util/output.h"
#include "opal/util/argv.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
@ -210,7 +211,7 @@ int mca_base_component_find(const char *directory, const char *type,
if (opal_list_get_end(found_components) == item) {
char h[MAXHOSTNAMELEN];
gethostname(h, sizeof(h));
opal_gethostname(h, sizeof(h));
opal_show_help("help-mca-base.txt",
"find-available:not-valid", true,
h, type, requested_component_names[i]);

Просмотреть файл

@ -31,6 +31,7 @@
#include "opal/mca/installdirs/installdirs.h"
#include "opal/util/output.h"
#include "opal/util/printf.h"
#include "opal/util/gethostname.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
@ -112,7 +113,7 @@ int mca_base_open(void)
} else {
set_defaults(&lds);
}
gethostname(hostname, 64);
opal_gethostname(hostname, 64);
asprintf(&lds.lds_prefix, "[%s:%05d] ", hostname, getpid());
opal_output_reopen(0, &lds);
opal_output_verbose(5, 0, "mca: base: opening components");

Просмотреть файл

@ -15,6 +15,7 @@
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_param.h"
@ -105,7 +106,7 @@ int opal_hwloc_base_open(void)
opal_hwloc_base_map = OPAL_HWLOC_BASE_MAP_LOCAL_ONLY;
} else {
char hostname[32];
gethostname(hostname, sizeof(hostname));
opal_gethostname(hostname, sizeof(hostname));
opal_show_help("help-opal-hwloc-base.txt", "invalid policy",
true, hostname, getpid(), str_value);
free(str_value);
@ -136,7 +137,7 @@ int opal_hwloc_base_open(void)
opal_hwloc_base_mbfa = OPAL_HWLOC_BASE_MBFA_ERROR;
} else {
char hostname[32];
gethostname(hostname, sizeof(hostname));
opal_gethostname(hostname, sizeof(hostname));
opal_show_help("help-opal-hwloc-base.txt", "invalid error action",
true, hostname, getpid(), str_value);
free(str_value);

Просмотреть файл

@ -37,6 +37,7 @@
#include "opal/constants.h"
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/mca/memory/memory.h"
#include "opal/memoryhooks/memory.h"
#include "opal/memoryhooks/memory_internal.h"
@ -87,7 +88,7 @@ int opal_memory_linux_ummunotify_open(void)
open(DEV_UMMUNOTIFY, O_RDONLY | O_NONBLOCK);
if (mca_memory_linux_component.ummunotify_fd < 0) {
char hostname[HOST_NAME_MAX];
gethostname(hostname, sizeof(hostname));
opal_gethostname(hostname, sizeof(hostname));
if (EACCES == errno) {
/* This will get a proper show_help when merged into the

Просмотреть файл

@ -32,6 +32,7 @@
#include <sys/time.h>
#endif
#include "opal/util/gethostname.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/pstat/pstat.h"
#include "opal/mca/pstat/base/base.h"
@ -86,7 +87,7 @@ static int query(pid_t pid,
}
if (NULL != stats) {
gethostname(hostname, 128);
opal_gethostname(hostname, 128);
strncpy(stats->node, hostname, OPAL_PSTAT_MAX_STRING_LEN);
stats->pid = pid;

Просмотреть файл

@ -53,6 +53,7 @@
#include "opal/util/output.h"
#include "opal/util/path.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/shmem/shmem.h"
#include "opal/mca/shmem/base/base.h"
@ -308,7 +309,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
*/
if (opal_path_nfs(real_file_name)) {
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "mmap on nfs", 1, hn,
real_file_name);
@ -316,7 +317,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
if (-1 == (ds_buf->seg_id = open(real_file_name, O_CREAT | O_RDWR, 0600))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"open(2)", "", strerror(err), err);
@ -327,7 +328,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
if (0 != ftruncate(ds_buf->seg_id, real_size)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"ftruncate(2)", "", strerror(err), err);
@ -340,7 +341,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
ds_buf->seg_id, 0))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"mmap(2)", "", strerror(err), err);
@ -390,7 +391,7 @@ out:
if (0 != close(ds_buf->seg_id)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"close(2)", "", strerror(err), err);
@ -425,7 +426,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
0600))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"open(2)", "", strerror(err), err);
@ -437,7 +438,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
ds_buf->seg_id, 0))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"mmap(2)", "", strerror(err), err);
@ -455,7 +456,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
if (0 != close(ds_buf->seg_id)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1,
hn, "close(2)", "", strerror(err), err);
@ -499,7 +500,7 @@ segment_detach(opal_shmem_ds_t *ds_buf)
if (0 != munmap((void *)ds_buf->seg_base_addr, ds_buf->seg_size)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"munmap(2)", "", strerror(err), err);
@ -530,7 +531,7 @@ segment_unlink(opal_shmem_ds_t *ds_buf)
if (-1 == unlink(ds_buf->seg_name)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"unlink(2)", ds_buf->seg_name, strerror(err), err);

Просмотреть файл

@ -46,6 +46,7 @@
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/mca/shmem/base/base.h"
#include "opal/mca/shmem/shmem.h"
@ -84,7 +85,7 @@ shmem_posix_shm_open(char *posix_file_name_buff, size_t size)
*/
else {
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_output_verbose(10, opal_shmem_base_output,
"shmem_posix_shm_open: disqualifying posix because "

Просмотреть файл

@ -46,6 +46,7 @@
#include "opal/constants.h"
#include "opal/util/show_help.h"
#include "opal/util/output.h"
#include "opal/util/gethostname.h"
#include "opal/mca/shmem/base/base.h"
#include "opal/mca/shmem/shmem.h"
#include "shmem_posix.h"
@ -173,7 +174,7 @@ posix_runtime_query(mca_base_module_t **module,
if (0 != shm_unlink(tmp_buff)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-posix.txt", "sys call fail", 1,
hn, "shm_unlink(2)", "", strerror(err), err);

Просмотреть файл

@ -48,6 +48,7 @@
#include "opal/util/output.h"
#include "opal/util/path.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/shmem/shmem.h"
#include "opal/mca/shmem/base/base.h"
@ -205,7 +206,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
else if (0 != ftruncate(ds_buf->seg_id, real_size)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-posix.txt", "sys call fail", 1, hn,
"ftruncate(2)", "", strerror(err), err);
@ -217,7 +218,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
ds_buf->seg_id, 0))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-posix.txt", "sys call fail", 1, hn,
"mmap(2)", "", strerror(err), err);
@ -271,7 +272,7 @@ out:
if (0 != close(ds_buf->seg_id)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1, hn,
"close(2)", "", strerror(err), err);
@ -311,7 +312,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
if (-1 == (ds_buf->seg_id = shm_open(ds_buf->seg_name, O_RDWR, 0600))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-posix.txt", "sys call fail", 1, hn,
"open(2)", "", strerror(err), err);
@ -323,7 +324,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
ds_buf->seg_id, 0))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-posix.txt", "sys call fail", 1, hn,
"mmap(2)", "", strerror(err), err);
@ -341,7 +342,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
if (0 != close(ds_buf->seg_id)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-mmap.txt", "sys call fail", 1,
hn, "close(2)", "", strerror(err), err);
@ -385,7 +386,7 @@ segment_detach(opal_shmem_ds_t *ds_buf)
if (0 != munmap(ds_buf->seg_base_addr, ds_buf->seg_size)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-posix.txt", "sys call fail", 1, hn,
"munmap(2)", "", strerror(err), err);
@ -415,7 +416,7 @@ segment_unlink(opal_shmem_ds_t *ds_buf)
if (-1 == shm_unlink(ds_buf->seg_name)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-posix.txt", "sys call fail", 1, hn,
"shm_unlink(2)", ds_buf->seg_name, strerror(err), err);

Просмотреть файл

@ -54,6 +54,7 @@
#include "opal/util/output.h"
#include "opal/util/path.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/shmem/shmem.h"
#include "opal/mca/shmem/base/base.h"
@ -200,7 +201,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
IPC_CREAT | IPC_EXCL | SHM_R | SHM_W))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-sysv.txt", "sys call fail", 1, hn,
"shmget(2)", "", strerror(err), err);
@ -211,7 +212,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
else if ((void *)-1 == (seg_hdrp = shmat(ds_buf->seg_id, NULL, 0))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-sysv.txt", "sys call fail", 1, hn,
"shmat(2)", "", strerror(err), err);
@ -226,7 +227,7 @@ segment_create(opal_shmem_ds_t *ds_buf,
else if (0 != shmctl(ds_buf->seg_id, IPC_RMID, NULL)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-sysv.txt", "sys call fail", 1, hn,
"shmctl(2)", "", strerror(err), err);
@ -301,7 +302,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
0))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-sysv.txt", "sys call fail", 1, hn,
"shmat(2)", "", strerror(err), err);
@ -346,7 +347,7 @@ segment_detach(opal_shmem_ds_t *ds_buf)
if (0 != shmdt(ds_buf->seg_base_addr)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-sysv.txt", "sys call fail", 1, hn,
"shmdt(2)", "", strerror(err), err);

Просмотреть файл

@ -45,6 +45,7 @@
#include "opal/util/output.h"
#include "opal/util/path.h"
#include "opal/util/show_help.h"
#include "opal/util/gethostname.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/shmem/shmem.h"
#include "opal/mca/shmem/base/base.h"
@ -362,7 +363,7 @@ out:
if (0 != close(ds_buf->seg_id)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-windows.txt", "sys call fail", 1, hn,
"close(2)", "", strerror(err), err);
@ -394,7 +395,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
0600))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-windows.txt", "sys call fail", 1, hn,
"open(2)", "", strerror(err), err);
@ -406,7 +407,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
ds_buf->seg_id, 0))) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-windows.txt", "sys call fail", 1, hn,
"mmap(2)", "", strerror(err), err);
@ -424,7 +425,7 @@ segment_attach(opal_shmem_ds_t *ds_buf)
if (0 != close(ds_buf->seg_id)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-windows.txt", "sys call fail", 1,
hn, "close(2)", "", strerror(err), err);
@ -468,7 +469,7 @@ segment_detach(opal_shmem_ds_t *ds_buf)
if (0 != UnmapViewOfFile(ds_buf->seg_base_addr)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-windows.txt", "sys call fail", 1, hn,
"munmap(2)", "", strerror(err), err);
@ -498,7 +499,7 @@ segment_unlink(opal_shmem_ds_t *ds_buf)
if (-1 == unlink(ds_buf->seg_name)) {
int err = errno;
char hn[MAXHOSTNAMELEN];
gethostname(hn, MAXHOSTNAMELEN - 1);
opal_gethostname(hn, MAXHOSTNAMELEN - 1);
hn[MAXHOSTNAMELEN - 1] = '\0';
opal_show_help("help-opal-shmem-windows.txt", "sys call fail", 1, hn,
"unlink(2)", ds_buf->seg_name, strerror(err), err);

Просмотреть файл

@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -41,6 +41,8 @@ headers = \
few.h \
fd.h \
fd.c \
gethostname.c \
gethostname.h \
if.h \
keyval_parse.h \
malloc.h \

Просмотреть файл

@ -36,6 +36,7 @@
#include "opal/util/opal_environ.h"
#include "opal/util/output.h"
#include "opal/util/gethostname.h"
#include "opal/threads/mutex.h"
#include "opal/constants.h"
@ -179,7 +180,7 @@ bool opal_output_init(void)
} else {
verbose.lds_want_stderr = true;
}
gethostname(hostname, sizeof(hostname));
opal_gethostname(hostname, sizeof(hostname));
asprintf(&verbose.lds_prefix, "[%s:%05d] ", hostname, getpid());
for (i = 0; i < OPAL_OUTPUT_MAX_STREAMS; ++i) {
@ -265,7 +266,7 @@ void opal_output_reopen_all(void)
default_stderr_fd = -1;
}
gethostname(hostname, sizeof(hostname));
opal_gethostname(hostname, sizeof(hostname));
if( NULL != verbose.lds_prefix ) {
free(verbose.lds_prefix);
verbose.lds_prefix = NULL;

Просмотреть файл

@ -34,6 +34,7 @@
#endif
#include "opal/util/stacktrace.h"
#include "opal/util/gethostname.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/backtrace/backtrace.h"
#include "opal/constants.h"
@ -461,7 +462,7 @@ int opal_util_register_stackhandlers (void)
int param, i;
bool complain, showed_help = false;
gethostname(stacktrace_hostname, sizeof(stacktrace_hostname));
opal_gethostname(stacktrace_hostname, sizeof(stacktrace_hostname));
stacktrace_hostname[sizeof(stacktrace_hostname) - 1] = '\0';
/* to keep these somewhat readable, only print the machine name */
for (i = 0 ; i < (int)sizeof(stacktrace_hostname) ; ++i) {

Просмотреть файл

@ -56,6 +56,7 @@
#include "opal/util/os_path.h"
#include "opal/util/printf.h"
#include "opal/util/argv.h"
#include "opal/util/gethostname.h"
#include "opal/runtime/opal.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/util/daemon_init.h"
@ -291,7 +292,7 @@ int orte_daemon(int argc, char *argv[])
* away just in case we have a problem along the way
*/
if (orted_globals.debug) {
gethostname(hostname, 100);
opal_gethostname(hostname, 100);
fprintf(stderr, "Daemon was launched on %s - beginning to initialize\n", hostname);
}

Просмотреть файл

@ -33,6 +33,7 @@
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/util/output.h"
#include "opal/util/gethostname.h"
#include "orte/util/proc_info.h"
@ -141,7 +142,7 @@ int orte_proc_info(void)
orte_process_info.pid = getpid();
/* get the nodename */
gethostname(hostname, ORTE_MAX_HOSTNAME_SIZE);
opal_gethostname(hostname, ORTE_MAX_HOSTNAME_SIZE);
orte_process_info.nodename = strdup(hostname);
/* get the number of nodes in the job */