Skip to content
Snippets Groups Projects
Commit 02eb054f authored by John Biddiscombe's avatar John Biddiscombe
Browse files

More debug output to try to resolve container issues

parent a74fcfb4
Branches cpp-cdo
No related tags found
No related merge requests found
...@@ -22,11 +22,23 @@ ...@@ -22,11 +22,23 @@
#include <chrono> #include <chrono>
#define DEBUG_OUTPUT 1 #define DEBUG_OUTPUT 1
#define DEBUG_LOG(msg) { \ #define DEBUG_TOFILE 0
#if DEBUG_TOFILE
#define DEBUG_FILE(msg) \
{ \
std::filesystem::path home(getenv("HOME")); \ std::filesystem::path home(getenv("HOME")); \
std::ofstream commands(home /= "commands.txt", std::ios_base::app); \ std::ofstream l_commands(home /= "commands.txt", std::ios_base::app); \
commands << "component : " << component_ << std::endl << msg; \ l_commands << component_ << " : " << std::endl << msg; \
std::cout << "component : " << component_ << " : " << msg << std::endl; \ } \
#endif
#else
#define DEBUG_FILE(msg)
#endif
#define DEBUG_LOG(msg) { \
std::cout << component_ << " : " << msg << std::endl; \
DEBUG_FILE(msg) \
} }
struct cdo_wrapper : std::enable_shared_from_this<cdo_wrapper> struct cdo_wrapper : std::enable_shared_from_this<cdo_wrapper>
......
...@@ -68,7 +68,19 @@ void set_signal_handler() ...@@ -68,7 +68,19 @@ void set_signal_handler()
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
set_signal_handler(); std::ostringstream temp1;
for (int i = 0; i < argc; i++){
temp1 << argv[i] << " ";
}
std::cout << temp1.str() << std::endl;
{
std::string component_("unknown");
DEBUG_LOG(temp1.str());
}
//
//set_signal_handler();
// //
// Input Argument Handling // Input Argument Handling
// //
...@@ -145,7 +157,7 @@ int main(int argc, char *argv[]) ...@@ -145,7 +157,7 @@ int main(int argc, char *argv[])
// in stager mode, we copy input to output, ignore any outputs set // in stager mode, we copy input to output, ignore any outputs set
if (stagermode) { if (stagermode) {
if (produces.size()>0) { if (produces.size()>0) {
DEBUG_LOG("WARNING : Stager mode set, command-line outputs will be ignored"); DEBUG_LOG("Warning : Stager mode set, command-line outputs will be ignored");
} }
produces = consumes; produces = consumes;
for (auto &p : produces) { for (auto &p : produces) {
...@@ -162,6 +174,7 @@ int main(int argc, char *argv[]) ...@@ -162,6 +174,7 @@ int main(int argc, char *argv[])
#if DEBUG_OUTPUT #if DEBUG_OUTPUT
std::stringstream temp; std::stringstream temp;
temp << "\n";
temp << "------------- " << component_ << "\n"; temp << "------------- " << component_ << "\n";
temp << "component : " << component_ << "\n"; temp << "component : " << component_ << "\n";
...@@ -187,11 +200,7 @@ int main(int argc, char *argv[]) ...@@ -187,11 +200,7 @@ int main(int argc, char *argv[])
temp << "watcher : " << watchermode << "\n"; temp << "watcher : " << watchermode << "\n";
temp << "stager : " << stagermode << "\n"; temp << "stager : " << stagermode << "\n";
temp << "------------- " << component_ << "\n"; temp << "------------- " << component_ << "\n";
{ DEBUG_LOG(temp.str());
std::ofstream commands("/home/biddisco/commands.txt", std::ios_base::app);
commands << temp.str();
}
std::cout << temp.str();
#endif #endif
// stop file already present // stop file already present
...@@ -199,9 +208,10 @@ int main(int argc, char *argv[]) ...@@ -199,9 +208,10 @@ int main(int argc, char *argv[])
mocktage_read_pminfo_file(pminfo.c_str()); mocktage_read_pminfo_file(pminfo.c_str());
DEBUG_LOG("Calling mstro_init");
mstro_status result = mstro_init("mocktage", component_.c_str(), 0); mstro_status result = mstro_init("mocktage", component_.c_str(), 0);
if (result != MSTRO_OK) { if (result != MSTRO_OK) {
printf("Error \n"); DEBUG_LOG("Error mstro_init");
return EXIT_FAILURE; return EXIT_FAILURE;
} }
...@@ -225,6 +235,7 @@ int main(int argc, char *argv[]) ...@@ -225,6 +235,7 @@ int main(int argc, char *argv[])
// async wait on all of the consumed CDOs // async wait on all of the consumed CDOs
for (auto &t : threads) { for (auto &t : threads) {
DEBUG_LOG("getting future");
shared_cdo cdo = t.get(); shared_cdo cdo = t.get();
if (stagermode) { if (stagermode) {
cached_data_map.insert( std::make_pair(cdo->name_, cdo->deep_copy_data()) ); cached_data_map.insert( std::make_pair(cdo->name_, cdo->deep_copy_data()) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment