ELPA 2014.06.003: Allow redirect of MPI task output

If specified in the configure step, the test programs
redirect their stdout and stderr output of each MPI
task in a seperate file, which will be stored in a
subdirectory "mpi_stdout".

This will only be done if the environment variable
"REDIRECT_ELPA_TEST_OUTPUT" is set to "true"
parent bd93cec5
......@@ -111,31 +111,45 @@ noinst_PROGRAMS = \
build_lib = libelpa@SUFFIX@.la
elpa1_test_real@SUFFIX@_SOURCES = test/test_real.F90 test/util.F90
if HAVE_REDIRECT
redirect_sources = test/redir.c test/redirect.F90
else
redirect_sources =
endif
elpa1_test_real@SUFFIX@_SOURCES = test/test_real.F90 test/util.F90 $(redirect_sources)
elpa1_test_real@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real@SUFFIX@_SOURCES = test/test_real2.F90 test/util.F90
elpa2_test_real@SUFFIX@_SOURCES = test/test_real2.F90 test/util.F90 $(redirect_sources)
elpa2_test_real@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_default_kernel@SUFFIX@_SOURCES = test/test_real2_default_kernel.F90 test/util.F90
elpa2_test_real_default_kernel@SUFFIX@_SOURCES = test/test_real2_default_kernel.F90 test/util.F90 $(redirect_sources)
elpa2_test_real_default_kernel@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_choose_kernel_with_api@SUFFIX@_SOURCES = test/test_real2_choose_kernel_with_api.F90 test/util.F90
elpa2_test_real_choose_kernel_with_api@SUFFIX@_SOURCES = test/test_real2_choose_kernel_with_api.F90 test/util.F90 $(redirect_sources)
elpa2_test_real_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
elpa1_test_complex@SUFFIX@_SOURCES = test/test_complex.F90 test/util.F90
elpa1_test_complex@SUFFIX@_SOURCES = test/test_complex.F90 test/util.F90 $(redirect_sources)
elpa1_test_complex@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex@SUFFIX@_SOURCES = test/test_complex2.F90 test/util.F90
elpa2_test_complex@SUFFIX@_SOURCES = test/test_complex2.F90 test/util.F90 $(redirect_sources)
elpa2_test_complex@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex_default_kernel@SUFFIX@_SOURCES = test/test_complex2_default_kernel.F90 test/util.F90
elpa2_test_complex_default_kernel@SUFFIX@_SOURCES = test/test_complex2_default_kernel.F90 test/util.F90 $(redirect_sources)
elpa2_test_complex_default_kernel@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_SOURCES = test/test_complex2_choose_kernel_with_api.F90 test/util.F90
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_SOURCES = test/test_complex2_choose_kernel_with_api.F90 test/util.F90 $(redirect_sources)
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
elpa2_print_kernels@SUFFIX@_SOURCES = src/print_available_elpa2_kernels.F90 test/util.F90
elpa2_print_kernels@SUFFIX@_SOURCES = src/print_available_elpa2_kernels.F90 test/util.F90 $(redirect_sources)
elpa2_print_kernels@SUFFIX@_LDADD = $(build_lib)
check_SCRIPTS = \
......
This diff is collapsed.
......@@ -15,6 +15,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Redirect stdout and stderr of test programs per MPI tasks to a file */
#undef HAVE_REDIRECT
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for elpa 2014.06.002.
# Generated by GNU Autoconf 2.69 for elpa 2014.06.003.
#
# Report bugs to <elpa-library@rzg.mpg.de>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='elpa'
PACKAGE_TARNAME='elpa'
PACKAGE_VERSION='2014.06.002'
PACKAGE_STRING='elpa 2014.06.002'
PACKAGE_VERSION='2014.06.003'
PACKAGE_STRING='elpa 2014.06.003'
PACKAGE_BUGREPORT='elpa-library@rzg.mpg.de'
PACKAGE_URL=''
......@@ -710,6 +710,8 @@ FCFLAGS
ac_ct_FC
FC
MPIFC
HAVE_REDIRECT_FALSE
HAVE_REDIRECT_TRUE
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
......@@ -818,6 +820,7 @@ enable_option_checking
enable_silent_rules
enable_maintainer_mode
enable_dependency_tracking
with_redirect
with_avx_optimization
with_openmp
enable_openmp
......@@ -1404,7 +1407,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures elpa 2014.06.002 to adapt to many kinds of systems.
\`configure' configures elpa 2014.06.003 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1474,7 +1477,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of elpa 2014.06.002:";;
short | recursive ) echo "Configuration of elpa 2014.06.003:";;
esac
cat <<\_ACEOF
......@@ -1501,6 +1504,9 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-redirect for test programs, allow redirection of
stdout/stderr per MPI taks in a file (useful for
ftimings), default no.
--with-avx-optimization use AVX optimization, default no.
--with-openmp use OpenMP threading, default no.
--with-only-real-generic-kernel
......@@ -1630,7 +1636,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
elpa configure 2014.06.002
elpa configure 2014.06.003
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2113,7 +2119,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by elpa $as_me 2014.06.002, which was
It was created by elpa $as_me 2014.06.003, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2980,7 +2986,7 @@ fi
# Define the identity of the package.
PACKAGE='elpa'
VERSION='2014.06.002'
VERSION='2014.06.003'
cat >>confdefs.h <<_ACEOF
......@@ -5045,6 +5051,34 @@ install_complex_bgp=no
install_complex_bgq=no
install_complex_avx_block1=no
install_complex_avx_block2=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdout/stderr file redirect should be enabled" >&5
$as_echo_n "checking whether stdout/stderr file redirect should be enabled... " >&6; }
# Check whether --with-redirect was given.
if test "${with_redirect+set}" = set; then :
withval=$with_redirect; with_redirect=yes
else
with_redirect=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_redirect}" >&5
$as_echo "${with_redirect}" >&6; }
if test x"${with_redirect}" = x"yes"; then
$as_echo "#define HAVE_REDIRECT 1" >>confdefs.h
fi
if test x"$with_redirect" = x"yes"; then
HAVE_REDIRECT_TRUE=
HAVE_REDIRECT_FALSE='#'
else
HAVE_REDIRECT_TRUE='#'
HAVE_REDIRECT_FALSE=
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether SSE assembler kernel can be compiled" >&5
$as_echo_n "checking whether SSE assembler kernel can be compiled... " >&6; }
......@@ -21308,6 +21342,10 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_REDIRECT_TRUE}" && test -z "${HAVE_REDIRECT_FALSE}"; then
as_fn_error $? "conditional \"HAVE_REDIRECT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
case $FC_MODINC in #(
*\ ) FC_MODINC=$FC_MODINC'${ac_empty}' ;;
esac
......@@ -21767,7 +21805,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by elpa $as_me 2014.06.002, which was
This file was extended by elpa $as_me 2014.06.003, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -21833,7 +21871,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
elpa config.status 2014.06.002
elpa config.status 2014.06.003
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_PREREQ([2.69])
AC_INIT([elpa],[2014.06.002], [elpa-library@rzg.mpg.de])
AC_INIT([elpa],[2014.06.003], [elpa-library@rzg.mpg.de])
AC_SUBST([PACKAGE_VERSION])
AC_CONFIG_SRCDIR([src/elpa1.F90])
......@@ -99,6 +99,22 @@ install_complex_bgp=no
install_complex_bgq=no
install_complex_avx_block1=no
install_complex_avx_block2=no
dnl build with the possibilty to redirect stdout and stderr
dnl per MPI task in a file
AC_MSG_CHECKING(whether stdout/stderr file redirect should be enabled)
AC_ARG_WITH([redirect],
AS_HELP_STRING([--with-redirect],
[for test programs, allow redirection of stdout/stderr per MPI taks in a file (useful for ftimings), default no.]),
[with_redirect=yes],
[with_redirect=no])
AC_MSG_RESULT([${with_redirect}])
if test x"${with_redirect}" = x"yes"; then
AC_DEFINE([HAVE_REDIRECT], [1], [Redirect stdout and stderr of test programs per MPI tasks to a file])
fi
AM_CONDITIONAL([HAVE_REDIRECT],[test x"$with_redirect" = x"yes"])
AC_MSG_CHECKING(whether SSE assembler kernel can be compiled)
$CC -c $srcdir/src/elpa2_kernels/elpa2_kernels_asm_x86_64.s -o test.o 2>/dev/null
......
! This file is part of ELPA.
!
! The ELPA library was originally created by the ELPA consortium,
! The ELPA library was originally created by the ELPA consortium,
! consisting of the following organizations:
!
! - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
! - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
! Informatik,
! - Technische Universität München, Lehrstuhl für Informatik mit
! Schwerpunkt Wissenschaftliches Rechnen ,
! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
! - Max-Plack-Institut für Mathematik in den Naturwissenschaftrn,
! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
! and
! Schwerpunkt Wissenschaftliches Rechnen ,
! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
! and
! - IBM Deutschland GmbH
!
!
......@@ -19,8 +19,8 @@
! http://elpa.rzg.mpg.de/
!
! ELPA is free software: you can redistribute it and/or modify
! it under the terms of the version 3 of the license of the
! GNU Lesser General Public License as published by the Free
! it under the terms of the version 3 of the license of the
! GNU Lesser General Public License as published by the Free
! Software Foundation.
!
! ELPA is distributed in the hope that it will be useful,
......@@ -40,6 +40,17 @@
!
!
#include "config-f90.h"
!>
!> Fortran test programm to demonstrates the use of
!> ELPA 1 real case library.
!> This program can read a matrix from an ascii
!> file and computes then the Eigenvectors.
!> If "HAVE_REDIRECT" was defined at build time
!> the stdout and stderr output of each MPI task
!> can be redirected to files if the environment
!> variable "REDIRECT_ELPA_TEST_OUTPUT" is set
!> to "true".
!>
program read_real
!-------------------------------------------------------------------------------
......@@ -53,6 +64,12 @@ program read_real
#ifdef WITH_OPENMP
use test_util
#endif
#ifdef HAVE_ISO_FORTRAN_ENV
use iso_fortran_env, only : error_unit
#endif
#ifdef HAVE_REDIRECT
use redirect
#endif
implicit none
include 'mpif.h'
......@@ -82,6 +99,9 @@ program read_real
character*256 filename
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
#ifndef HAVE_ISO_FORTRAN_ENV
integer, parameter :: error_unit = 6
#endif
!-------------------------------------------------------------------------------
! MPI Initialization
......@@ -95,16 +115,32 @@ program read_real
provided_mpi_thread_level, mpierr)
if (required_mpi_thread_level .ne. provided_mpi_thread_level) then
print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system"
print *," ", mpi_thread_level_name(provided_mpi_thread_level), " is available"
call EXIT(1)
stop 1
write(error_unit,*) "MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system"
write(error_unit,*) " ", mpi_thread_level_name(provided_mpi_thread_level), " is available"
call EXIT(1)
stop 1
endif
#endif
call mpi_comm_rank(mpi_comm_world,myid,mpierr)
call mpi_comm_size(mpi_comm_world,nprocs,mpierr)
#ifdef HAVE_REDIRECT
if (check_redirect_environment_variable()) then
if (myid .eq. 0) then
print *," "
print *,"Redirection of mpi processes is used"
print *," "
if (create_directories() .ne. 1) then
write(error_unit,*) "Unable to create directory for stdout and stderr!"
stop
endif
endif
call MPI_BARRIER(MPI_COMM_WORLD, mpierr)
call redirect_stdout(myid)
endif
#endif
!-------------------------------------------------------------------------------
! Get the name of the input file containing the matrix and open input file
! Please note:
......@@ -114,12 +150,12 @@ program read_real
if(myid==0) then
call get_command_argument(1,filename,lenarg,info)
if(info/=0) then
print *,'Usage: test_real matrix_file'
write(error_unit,*) 'Usage: test_real matrix_file'
call mpi_abort(mpi_comm_world,0,mpierr)
endif
open(10,file=filename,action='READ',status='OLD',iostat=info)
if(info/=0) then
print *,'Error: Unable to open ',trim(filename)
write(error_unit,*) 'Error: Unable to open ',trim(filename)
call mpi_abort(mpi_comm_world,0,mpierr)
endif
endif
......@@ -172,7 +208,7 @@ program read_real
! Quick check for plausibility
if(na<=0 .or. na>10000000) then
if(myid==0) print *,'Illegal value for matrix size: ',na
if(myid==0) write(error_unit,*) 'Illegal value for matrix size: ',na
call mpi_finalize(mpierr)
stop
endif
......@@ -192,7 +228,7 @@ program read_real
call descinit( sc_desc, na, na, nblk, nblk, 0, 0, my_blacs_ctxt, na_rows, info )
!-------------------------------------------------------------------------------
! Allocate matrices
! Allocate matrices
allocate(a (na_rows,na_cols))
allocate(z (na_rows,na_cols))
......@@ -284,7 +320,7 @@ program read_real
err = maxval(abs(tmp1))
call mpi_allreduce(err,errmax,1,MPI_REAL8,MPI_MAX,MPI_COMM_WORLD,mpierr)
if(myid==0) print *,'Error Orthogonality:',errmax
deallocate(z)
deallocate(tmp1)
deallocate(tmp2)
......
! This file is part of ELPA.
!
! The ELPA library was originally created by the ELPA consortium,
! The ELPA library was originally created by the ELPA consortium,
! consisting of the following organizations:
!
! - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
! - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
! Informatik,
! - Technische Universität München, Lehrstuhl für Informatik mit
! Schwerpunkt Wissenschaftliches Rechnen ,
! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
! - Max-Plack-Institut für Mathematik in den Naturwissenschaftrn,
! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
! and
! Schwerpunkt Wissenschaftliches Rechnen ,
! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
! and
! - IBM Deutschland GmbH
!
!
......@@ -19,8 +19,8 @@
! http://elpa.rzg.mpg.de/
!
! ELPA is free software: you can redistribute it and/or modify
! it under the terms of the version 3 of the license of the
! GNU Lesser General Public License as published by the Free
! it under the terms of the version 3 of the license of the
! GNU Lesser General Public License as published by the Free
! Software Foundation.
!
! ELPA is distributed in the hope that it will be useful,
......@@ -40,6 +40,17 @@
!
!
#include "config-f90.h"
!>
!> Fortran test programm to demonstrates the use of
!> ELPA 1 real case library.
!> This program can read a matrix from an ascii
!> file and computes then the Eigenvectors.
!> If "HAVE_REDIRECT" was defined at build time
!> the stdout and stderr output of each MPI task
!> can be redirected to files if the environment
!> variable "REDIRECT_ELPA_TEST_OUTPUT" is set
!> to "true".
!>
program read_real_gen
!-------------------------------------------------------------------------------
......@@ -57,6 +68,9 @@ program read_real_gen
#ifdef HAVE_ISO_FORTRAN_ENV
use iso_fortran_env, only : error_unit
#endif
#ifdef HAVE_REDIRECT
use redirect
#endif
implicit none
include 'mpif.h'
......@@ -94,15 +108,15 @@ program read_real_gen
integer, parameter :: error_unit = 6
#endif
logical :: success
success = .true.
success = .true.
!-------------------------------------------------------------------------------
! MPI Initialization
#ifndef WITH_OPENMP
call mpi_init(mpierr)
#else
required_mpi_thread_level = MPI_THREAD_MULTIPLE
call mpi_init_thread(required_mpi_thread_level, &
provided_mpi_thread_level, mpierr)
......@@ -118,6 +132,21 @@ program read_real_gen
call mpi_comm_rank(mpi_comm_world,myid,mpierr)
call mpi_comm_size(mpi_comm_world,nprocs,mpierr)
#ifdef HAVE_REDIRECT
if (check_redirect_environment_variable()) then
if (myid .eq. 0) then
print *," "
print *,"Redirection of mpi processes is used"
print *," "
if (create_directories() .ne. 1) then
write(error_unit,*) "Unable to create directory for stdout and stderr!"
stop
endif
endif
call MPI_BARRIER(MPI_COMM_WORLD, mpierr)
call redirect_stdout(myid)
endif
#endif
!-------------------------------------------------------------------------------
! Get the name of the input files and open input files
......
// This file is part of ELPA.
//
// The ELPA library was originally created by the ELPA consortium,
// consisting of the following organizations:
//
// - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
// - Bergische Universität Wuppertal, Lehrstuhl für angewandte
// Informatik,
// - Technische Universität München, Lehrstuhl für Informatik mit
// Schwerpunkt Wissenschaftliches Rechnen ,
// - Fritz-Haber-Institut, Berlin, Abt. Theorie,
// - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
// Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
// and
// - IBM Deutschland GmbH
//
//
// More information can be found here:
// http://elpa.rzg.mpg.de/
//
// ELPA is free software: you can redistribute it and/or modify
// it under the terms of the version 3 of the license of the
// GNU Lesser General Public License as published by the Free
// Software Foundation.
//
// ELPA 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with ELPA. If not, see <http://www.gnu.org/licenses/>
//
// ELPA reflects a substantial effort on the part of the original
// ELPA consortium, and we ask you to respect the spirit of the
// license that we chose: i.e., please contribute any changes you
// may have back to the original ELPA library distribution, and keep
// any derivatives of ELPA under the same license that we chose for
// the original distribution, the GNU Lesser General Public License.
//
//
// --------------------------------------------------------------------------------------------------
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#define NAME_LENGTH 4096
#define FILENAME "./mpi_stdout/std%3s_rank%04d.txt"
FILE *tout, *terr;
void dup_filename(char *filename, int dupfd);
void dup_fd(int fd, int dupfd);
int _mkdirifnotexists(const char *dir) {
struct stat s;
if (stat(dir, &s) != 0) {
if (errno == ENOENT) {
if (mkdir(dir, 0755) != 0) {
perror("mkdir");
return 0;
} else {
return 1;
}
} else {
perror("stat()");
return 0;
}
} else if (!S_ISDIR(s.st_mode)) {
fprintf(stderr, "\"%s\" does exist and is not a directory\n", dir);
return 0;
} else {
return 1;
}
}
int create_directories(void) {
if (!_mkdirifnotexists("mpi_stdout")) return 0;
return 1;
}
void redirect_stdout(int *myproc) {
char buf[NAME_LENGTH];
if (*myproc == 0) {
snprintf(buf, NAME_LENGTH, "tee " FILENAME, "out", *myproc);
tout = popen(buf, "w");
dup_fd(fileno(tout), 1);
snprintf(buf, NAME_LENGTH, "tee " FILENAME, "err", *myproc);
terr = popen(buf, "w");
dup_fd(fileno(terr), 2);
} else {
snprintf(buf, NAME_LENGTH, FILENAME, "out", *myproc);
dup_filename(buf, 1);
snprintf(buf, NAME_LENGTH, FILENAME, "err", *myproc);
dup_filename(buf, 2);
}
return;
}
/* Redirect file descriptor dupfd to file filename */
void dup_filename(char *filename, int dupfd) {
int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if(fd < 0) {
perror("open()");
exit(1);
}
dup_fd(fd, dupfd);
}
/* Redirect file descriptor dupfd to file descriptor fd */
void dup_fd(int fd, int dupfd) {
if(dup2(fd,dupfd) < 0) {
perror("dup2()");
exit(1);
}
}
! This file is part of ELPA.
!
! The ELPA library was originally created by the ELPA consortium,
! consisting of the following organizations:
!
! - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
! Informatik,
! - Technische Universität München, Lehrstuhl für Informatik mit
! Schwerpunkt Wissenschaftliches Rechnen ,
! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
! and
! - IBM Deutschland GmbH
!
!
! More information can be found here:
! http://elpa.rzg.mpg.de/
!
! ELPA is free software: you can redistribute it and/or modify
! it under the terms of the version 3 of the license of the
! GNU Lesser General Public License as published by the Free
! Software Foundation.
!
! ELPA is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of