Skip to content
Snippets Groups Projects
Commit e04df0a2 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos
Browse files

Use dune-logging system

parent 68673a50
No related branches found
No related tags found
No related merge requests found
......@@ -3,18 +3,23 @@
variables:
OMP_NUM_THREADS: 1
before_script:
- ./duneci/bin/duneci-init-job
- duneci-install-module https://gitlab.dune-project.org/staging/dune-logging.git
debian:10--gcc:
image: registry.dune-project.org/docker/ci/dune-pdelab:2.6
script: duneci-standard-test
script:
- duneci-standard-test
- ctest -L system
tags:
- "cores:4"
- "mem:16G"
- "cores:2"
debian:10--clang:
image: registry.dune-project.org/docker/ci/dune-pdelab:2.6
script: duneci-standard-test
script:
- duneci-standard-test
- ctest -L system
variables: {DUNECI_OPTS: /duneci/opts.clang}
tags:
- "cores:4"
- "mem:16G"
\ No newline at end of file
- "cores:2"
\ No newline at end of file
......@@ -25,6 +25,7 @@ dune_enable_all_packages()
add_subdirectory(src)
add_subdirectory(dune)
add_subdirectory(doc)
add_subdirectory(test)
add_subdirectory(cmake/modules)
# finalize the dune project, e.g. generating config.h etc.
......
[logging.backend]
model = default
\ No newline at end of file
......@@ -7,4 +7,4 @@ Module: dune-copasi
Version: 0.0.0
Maintainer: santiago.ospina@iwr.uni-heidelberg.de
#depending on
Depends: dune-pdelab (>= 2.6)
Depends: dune-logging dune-pdelab (>= 2.6)
add_executable("dune-copasi" dune-copasi.cc)
target_link_dune_default_libraries("dune-copasi")
target_link_dune_default_libraries("dune-copasi")
\ No newline at end of file
......@@ -2,20 +2,41 @@
# include "config.h"
#endif
#include <iostream>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/logging/logging.hh>
#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>
#include <dune/common/parametertreeparser.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <iostream>
int main(int argc, char** argv)
{
try{
Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
std::cout << "Hello World! This is dune-copasi." << std::endl;
if(Dune::MPIHelper::isFake)
std::cout<< "This is a sequential program." << std::endl;
else
std::cout<<"I am rank "<<helper.rank()<<" of "<<helper.size()
<<" processes!"<<std::endl;
// initialize mpi
auto& mpi_helper = Dune::MPIHelper::instance(argc, argv);
auto comm = mpi_helper.getCollectiveCommunication();
// Read and parse ini file
if (argc!=2)
DUNE_THROW(Dune::IOError, "Wrong number of arguments");
const std::string inifilename = argv[1];
Dune::ParameterTree inifile;
Dune::ParameterTreeParser ptreeparser;
ptreeparser.readINITree(inifilename, inifile);
// initialize loggers
Dune::Logging::Logging::init(comm,inifile.sub("logging"));
using namespace Dune::Literals;
auto log = Dune::Logging::Logging::logger();
log.notice("Starting dune-copasi"_fmt);
return 0;
}
catch (Dune::Exception &e){
......
dune_add_test(NAME "test_run"
SOURCES ${CMAKE_SOURCE_DIR}/src/dune-copasi.cc # TODO: use target instead of source
CMD_ARGS ${CMAKE_SOURCE_DIR}/doc/config.ini
LABELS "system")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment