Rosetta
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
utility
options
mpi_stderr.cc
Go to the documentation of this file.
1
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2
// vi: set ts=2 noet:
3
//
4
// (c) Copyright Rosetta Commons Member Institutions.
5
// (c) This file is part of the Rosetta software suite and is made available under license.
6
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9
10
/// @file utility/options/ScalarOption_T_.hh
11
/// @brief Program scalar-valued option abstract base class
12
/// @author Stuart G. Mentzer (Stuart_Mentzer@objexx.com)
13
/// @author Modified by Sergey Lyskov
14
15
#ifdef USEMPI
16
#include <mpi.h>
// Must go first
17
#endif
18
// Unit headers
19
#include <
utility/options/mpi_stderr.hh
>
20
21
// C++ headers
22
#include <iostream>
23
#include <set>
24
25
namespace
utility {
26
namespace
options
{
27
28
29
void
mpi_safe_std_err
( std::string msg ) {
30
#ifdef __native_client__
31
throw
( std::string( msg ) );
// exceptions provide a good mechanism to get the rror message back to where the browser can display it. stdout/stderr are useless here.
32
#endif
33
34
int
mpi_rank
( 0 );
35
#ifdef USEMPI
36
/// Give a different RNG to each processor
37
38
MPI_Comm_rank( MPI_COMM_WORLD, &mpi_rank );
39
#endif
40
if
( mpi_rank == 0 ) {
41
std::cerr
<< msg << std::endl;
std::cerr
.
flush
();
42
}
43
}
44
45
}
46
}
47
utility::io::oc::cerr
ocstream cerr(std::cerr)
Wrapper around std::cerr.
Definition:
ocstream.hh:290
mpi_stderr.hh
utility::options::mpi_safe_std_err
void mpi_safe_std_err(std::string msg)
Definition:
mpi_stderr.cc:29
options
rule< Scanner, options_closure::context_t > options
Definition:
Tag.cc:377
utility::mpi_rank
int mpi_rank()
Definition:
mpi_util.cc:254
utility::io::ocstream::flush
ocstream & flush()
Flush the stream.
Definition:
ocstream.hh:143
Generated on Sun Jan 17 2016 15:22:22 for Rosetta by
1.8.7