ggandda / simd-cxx

Automatically exported from code.google.com/p/simd-cxx
0 stars 0 forks source link

Problem when starting/stopping simd multiple times in an application #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
--------------------------------------
1. Use the simple source code below , call it 'hello-sub.cpp'
2. put it into directory ....simd-cxx/demo/hello
3. build with 'make' and/or 'make sub'
4. run

What is the expected output? What do you see instead?
-----------------------------------------------------
Expected counter, starting with 0 and incrementing. Instead:
.........start stop count=93 | start stop count=94 | terminate called after
throwing an instance of 'simd::PostconditionViolation'
  what():  Unable to get DomainParticipant
start stop count=95 | start stop count=96 | start stop count=97 | start
stop count=98 | start stop count=99 | start stop count=100 | start stop
count=101 | start stop count=102 | start stop count=103 | start stop
count=104 | start stop count=105 | start stop count=106 | start stop
count=107 | start stop count=108 | start stop count=109 | start stop
count=110 | start stop count=111 | start stop count=112 | start stop
count=113 | start stop count=114 | start stop count=115 | start stop
count=116 | start stop count=117 | start stop count=118 | start stop
count=119 | start stop count=120 | start stop count=121 | start stop
count=122 | start stop count=123 | start stop count=124 | start stop
count=125 | start stop count=126 | start stop count=127 | start stop
count=128 | start Aborted

What version of the product are you using? On what operating system?
--------------------------------------------------------------------
simd-cxx04
boost 1.40
Debian Linux Lenny 4.0
gcc (Debian 4.3.2-1.1) 4.3.2
=====================================================================

Please provide any additional information below.

// -- STD C++ Include
#include <iostream>
#include <sstream>
#include <iterator>

// -- BOOST Include
#include <boost/program_options.hpp>

// -- SIMD Include
#include <simd/runtime.hpp>
#include <simd/topic.hpp>
#include <simd/reader.hpp>
#include <simd/writer.hpp>
#include <simd/traits.hpp>

// -- Hello Include
#include "gen/ccpp_hello.h"
#include "hello-traits.hpp"

using namespace std;
namespace po = boost::program_options;

static int period = 1;
static int history_depth = 10;
static int N = 50;
static std::string message("Data to be sent");

bool parse_args(int argc, char* argv[])
{
 bool parse_ok=true;
 po::options_description desc("test-pub program options are:");
  desc.add_options()
    ("help", "produce help message")
    ("message", po::value<std::string>(), "message sent-across")
    ("samples", po::value<int>(), "number of samples published")
    ("writer-history-depth", po::value<int>(), "sets the writer history depth")
    ("period", po::value<int>(), "read polling period in milli-seconcs")
    ;

  po::variables_map vm;        
  po::store(po::parse_command_line(argc, argv, desc), vm);
  po::notify(vm);    

  if (vm.count("message")) 
    message = vm["message"].as<std::string>();
  else
    parse_ok=false;
  if (vm.count("samples")) 
    N = vm["samples"].as<int>();
  else
    parse_ok=false;
  if (vm.count("writer-history-depth")) 
    history_depth = vm["writer-history-depth"].as<int>();
  else
    parse_ok=false;
  if (vm.count("period")) 
    period = vm["period"].as<int>();
  else
    parse_ok=false;

  if (!parse_ok)
  {
    std::cout << desc << "\n";
    std::cout << "***********************************************";
    std::cout << "Warning: not all command line options specified" <<
std::endl;
    std::cout << "Using values:" << std::endl;
    std::cout << "  period=" << period<< std::endl;
    std::cout << "  writer-history-depth=" << history_depth << std::endl;
    std::cout << "  message sent-across=" << message << std::endl;
    std::cout << "  number of samples published=" << N << std::endl;
    std::cout << "***hit <ENTER> to continue***" << std::endl;
    while (!std::cin.get()){/* wait for input */}
  }
}  

int DDS_publisher(int argc, char* argv[]) {

  int ret=0; 

  // -- start the simd runtime
  cout << "start ";
  simd::Runtime::start();

  cout << "stop ";
  simd::Runtime::stop();

  return (ret);
}

int main(int argc, char* argv[])
{
  parse_args(argc, argv);
  static unsigned long count=0;
  while (1)
  {
    count++;
    std::cout << std::dec << "count=" << count << " | " ;
    DDS_publisher(argc,argv);
  }
}

Original issue reported on code.google.com by frans.br...@gmail.com on 19 Nov 2009 at 3:50

GoogleCodeExporter commented 8 years ago
Thanks for submitting the issue, could you see if the issue is still present in 
the
latest version of SIMD released on Dec 5th?

Original comment by angelo.corsaro@gmail.com on 5 Dec 2009 at 7:08

GoogleCodeExporter commented 8 years ago
Thanks for submitting the issue, could you see if the issue is still present in 
the
latest version of SIMD released on Dec 5th?

Original comment by angelo.corsaro@gmail.com on 5 Dec 2009 at 7:08

GoogleCodeExporter commented 8 years ago
The problem has been reproduced in the simplest possible test and the scope has 
been reduced to the 
DomainParticipant. The fix will be included in the next product release since 
most of the application are not 
affected by this issue. Thanks again for reporting it!

Original comment by angelo.corsaro@gmail.com on 23 Dec 2009 at 8:46

GoogleCodeExporter commented 8 years ago
After some analysis and tests it has been found that this issue is not tied to 
SIMD but to OpenSplice DDS. 

Original comment by angelo.corsaro@gmail.com on 21 Jan 2010 at 1:55