Skip to content

Commit

Permalink
Updating logging (fixed).
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxfan committed Jul 1, 2018
1 parent 3a5f49c commit d836500
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 32 deletions.
66 changes: 36 additions & 30 deletions flecsi/execution/mpi/runtime_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ int main(int argc, char ** argv) {

// Initialize tags to output all tag groups from CLOG
std::string tags("all");
bool help = false;

//--------------------------------------------------------------------------//
// Use BOOST Program Options

#if defined(FLECSI_ENABLE_BOOST_PROGRAM_OPTIONS)
options_description desc("Cinch test options");
Expand All @@ -70,23 +66,39 @@ int main(int argc, char ** argv) {

notify(vm);

// was help requested
help = vm.count("help");
if(help) {
// Gather the unregistered options, if there are any, print a help message
// and die nicely.
std::vector<std::string> unrecog_options =
collect_unrecognized(parsed.options, include_positional);

if(unrecog_options.size()) {
if(rank == 0) {
std::cout << desc << std::endl;
std::cout << std::endl << "Unrecognized options: ";
for ( int i=0; i<unrecog_options.size(); ++i ) {
std::cout << unrecog_options[i] << " ";
}
std::cout << std::endl << std::endl << desc << std::endl;
} // if
// don't exit, because the user application
// may want to print a usage message too

MPI_Finalize();

return 1;
} // if


#endif // FLECSI_ENABLE_BOOST_PROGRAM_OPTIONS
if(vm.count("help")) {
if(rank == 0) {
std::cout << desc << std::endl;
} // if

// End BOOST Program Options
//--------------------------------------------------------------------------//
MPI_Finalize();

return 1;
} // if
#endif // FLECSI_ENABLE_BOOST_PROGRAM_OPTIONS

int result(0);

if(tags == "0" && !help) {
if(tags == "0") {
// Output the available tags
if(rank == 0) {
std::cout << "Available tags (CLOG):" << std::endl;
Expand All @@ -95,24 +107,18 @@ int main(int argc, char ** argv) {
std::cout << " " << t.first << std::endl;
} // for
} // if
// die nicely
MPI_Finalize();
return 0;
}

// Initialize the cinchlog runtime
clog_init(tags);

//-------------------------------------------------------------------------//
// DONE CLOG INIT
//-------------------------------------------------------------------------//


// Execute the flecsi runtime.
auto retval = flecsi::execution::context_t::instance().initialize(argc, argv);
else {
// Initialize the cinchlog runtime
clog_init(tags);

// Execute the flecsi runtime.
result = flecsi::execution::context_t::instance().initialize(
argc, argv);
} // if

// Shutdown the MPI runtime
MPI_Finalize();

return retval;
return result;
} // main
2 changes: 2 additions & 0 deletions flecsi/supplemental/coloring/add_colorings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,14 @@ void add_colorings(coloring_map_t map) {
cell_color_info.shared = cells.shared.size();
cell_color_info.ghost = cells.ghost.size();

#if 0
{
clog_tag_guard(coloring_output);
clog_container_one(info, "exclusive cells ", cells.exclusive, clog::newline);
clog_container_one(info, "shared cells ", cells.shared, clog::newline);
clog_container_one(info, "ghost cells ", cells.ghost, clog::newline);
} // guard
#endif

// Create a map version for lookups below.
std::unordered_map<size_t, flecsi::coloring::entity_info_t>
Expand Down
3 changes: 2 additions & 1 deletion flecsi/supplemental/coloring/coloring_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ void color_entity(
} // for
} // scope

#if 0
{
clog_tag_guard(coloring_functions);
clog_container_one(
Expand All @@ -183,7 +184,7 @@ void color_entity(
info, "ghost entities("<<ENTITY_DIM<<")" , entities.ghost, clog::newline
);
} // guard

#endif

entity_color_info.exclusive = entities.exclusive.size();
entity_color_info.shared = entities.shared.size();
Expand Down
6 changes: 5 additions & 1 deletion tools/flecsit/flecsit/services/compile_driver/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def execute(verbose, debug, build):
# Setup compiler and flags
cxx_compiler = '-DCMAKE_CXX_COMPILER=' + build['compiler']
cxx_flags = '-DCMAKE_CXX_FLAGS=' + build['flags']
cxx_debug_flags = '-DCMAKE_CXX_FLAGS_DEBUG=' + build['debug_flags']

if debug:
cxx_debug_flags = '-DCMAKE_BUILD_TYPE=Debug'
else:
cxx_debug_flags = '-DCMAKE_BUILD_TYPE=Release'

# Echo the subprocess call
if verbose:
Expand Down

0 comments on commit d836500

Please sign in to comment.