Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scientific Software
Takin
core
Commits
ed801620
Commit
ed801620
authored
Apr 08, 2020
by
Tobias WEBER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further debugging
parent
6021a4eb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
19 deletions
+46
-19
CMakeLists.txt
CMakeLists.txt
+5
-5
dialogs/SettingsDlg.cpp
dialogs/SettingsDlg.cpp
+2
-0
tools/monteconvo/sqw_proc_impl.h
tools/monteconvo/sqw_proc_impl.h
+25
-11
tools/monteconvo/sqwfactory.cpp
tools/monteconvo/sqwfactory.cpp
+1
-2
tools/taz/taz_main.cpp
tools/taz/taz_main.cpp
+13
-1
No files found.
CMakeLists.txt
View file @
ed801620
...
...
@@ -50,7 +50,7 @@ endif()
set
(
CMAKE_POSITION_INDEPENDENT_CODE TRUE
)
set
(
CMAKE_CXX_STANDARD 11
)
add_definitions
(
-std=c++11 -D_GLIBCXX_USE_CXX11_ABI
)
#add_definitions(-
rdynamic -
fPIC)
#add_definitions(-fPIC)
if
(
BUILD_FOR_MINGW
)
...
...
@@ -276,7 +276,7 @@ if(USE_GENTAB)
target_link_libraries
(
gentab
${
Clipper_LIBRARIES
}
Qt5::Core Qt5::Gui Qt5::Widgets
Boost::
program_options Boost::iostreams Boost::filesystem Boost::system
Boost::
iostreams Boost::system Boost::filesystem Boost::program_options
${
ZLIB_LIBRARIES
}
${
BZIP2_LIBRARIES
}
)
...
...
@@ -353,7 +353,7 @@ target_link_libraries(takin
${
LIBS_3D
}
${
PNG_LIBRARIES
}
${
ZLIB_LIBRARIES
}
${
BZIP2_LIBRARIES
}
Boost::
program_options Boost::iostreams Boost::filesystem Boost::system
Boost::
iostreams Boost::system Boost::filesystem Boost::program_options
Threads::Threads
${
Mp_LIBRARIES
}
${
Rt_LIBRARIES
}
${
Dl_LIBRARIES
}
)
...
...
@@ -446,7 +446,7 @@ set_target_properties(convofit PROPERTIES COMPILE_FLAGS "-DNO_QT")
target_link_libraries
(
convofit
${
LIBS_FIT
}
${
SOCK2
}
Threads::Threads
${
Mp_LIBRARIES
}
${
Rt_LIBRARIES
}
${
Dl_LIBRARIES
}
Boost::
program_options Boost::iostreams Boost::filesystem Boost::system
Boost::
iostreams Boost::system Boost::filesystem Boost::program_options
${
ZLIB_LIBRARIES
}
${
BZIP2_LIBRARIES
}
)
...
...
@@ -469,7 +469,7 @@ add_executable(convoseries
set_target_properties
(
convoseries PROPERTIES COMPILE_FLAGS
"-DNO_QT"
)
target_link_libraries
(
convoseries
Boost::
program_options Boost::iostreams Boost::filesystem Boost::system
Boost::
iostreams Boost::system Boost::filesystem Boost::program_options
${
ZLIB_LIBRARIES
}
${
BZIP2_LIBRARIES
}
)
...
...
dialogs/SettingsDlg.cpp
View file @
ed801620
...
...
@@ -323,6 +323,8 @@ static inline std::string find_program_binary(const std::string& strExe)
g_strApp
+
"/"
+
strExe
+
".exe"
,
g_strApp
+
"/externals/"
+
strExe
+
".exe"
,
g_strApp
+
"/../externals/"
+
strExe
+
".exe"
,
"/usr/local/bin/"
+
strExe
,
"/usr/bin/"
+
strExe
,
};
for
(
const
std
::
string
&
strPath
:
vecPaths
)
...
...
tools/monteconvo/sqw_proc_impl.h
View file @
ed801620
...
...
@@ -13,6 +13,7 @@
#include "tlibs/log/log.h"
#include "tlibs/math/rand.h"
#include <signal.h>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/string.hpp>
...
...
@@ -221,8 +222,8 @@ static ProcMsg msg_recv(ipr::message_queue& msgqueue)
ProcMsg
msg
;
try
{
std
::
size_t
iSize
;
unsigned
int
iPrio
;
std
::
size_t
iSize
=
0
;
unsigned
int
iPrio
=
0
;
msgqueue
.
receive
(
&
msg
,
sizeof
(
msg
),
iSize
,
iPrio
);
if
(
iSize
!=
sizeof
(
msg
))
...
...
@@ -240,7 +241,6 @@ static ProcMsg msg_recv(ipr::message_queue& msgqueue)
// ----------------------------------------------------------------------------
// child process
// ----------------------------------------------------------------------------
template
<
class
t_sqw
>
...
...
@@ -302,9 +302,8 @@ static void child_proc(ipr::message_queue& msgToParent, ipr::message_queue& msgF
}
case
ProcMsgTypes
::
QUIT
:
{
tl
::
log_debug
(
"Exiting child process"
);
exit
(
0
);
break
;
tl
::
log_debug
(
"Child process "
,
getpid
(),
" received quit request."
);
return
;
}
default:
{
...
...
@@ -315,8 +314,10 @@ static void child_proc(ipr::message_queue& msgToParent, ipr::message_queue& msgF
}
// ----------------------------------------------------------------------------
// parent process
// ----------------------------------------------------------------------------
template
<
class
t_sqw
>
SqwProc
<
t_sqw
>::
SqwProc
()
...
...
@@ -360,14 +361,15 @@ SqwProc<t_sqw>::SqwProc(const char* pcCfg)
{
child_proc
<
t_sqw
>
(
*
m_pmsgIn
,
*
m_pmsgOut
,
pcCfg
);
exit
(
0
);
return
;
}
tl
::
log_debug
(
"Waiting for client to become ready..."
);
tl
::
log_debug
(
"Waiting for client
"
,
m_pidChild
,
"
to become ready..."
);
ProcMsg
msgReady
=
msg_recv
(
*
m_pmsgIn
);
if
(
!
msgReady
.
bRet
)
tl
::
log_err
(
"Client reports failure."
);
tl
::
log_err
(
"Client
"
,
m_pidChild
,
"
reports failure."
);
else
tl
::
log_debug
(
"Client is ready."
);
tl
::
log_debug
(
"Client
"
,
m_pidChild
,
"
is ready."
);
m_bOk
=
msgReady
.
bRet
;
}
...
...
@@ -390,6 +392,13 @@ SqwProc<t_sqw>::SqwProc(const std::string& strCfg) : SqwProc<t_sqw>::SqwProc(str
template
<
class
t_sqw
>
SqwProc
<
t_sqw
>::~
SqwProc
()
{
// we're in a child process
if
(
m_pidChild
==
0
)
{
tl
::
log_debug
(
"Child process "
,
getpid
(),
" ending."
);
return
;
}
// make sure that this instance is the last
if
(
m_pMem
.
use_count
()
>
1
)
return
;
...
...
@@ -401,22 +410,27 @@ SqwProc<t_sqw>::~SqwProc()
ProcMsg
msg
;
msg
.
ty
=
ProcMsgTypes
::
QUIT
;
msg_send
(
*
m_pmsgOut
,
msg
);
//kill(m_pidChild, SIGABRT);
}
if
(
--
m_iRefCnt
==
0
)
{
// give clients time to end before removing the shared memory
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
{
200
});
ipr
::
message_queue
::
remove
((
"takin_sqw_proc_in_"
+
m_strProcName
).
c_str
());
ipr
::
message_queue
::
remove
((
"takin_sqw_proc_out_"
+
m_strProcName
).
c_str
());
ipr
::
shared_memory_object
::
remove
((
"takin_sqw_proc_mem_"
+
m_strProcName
).
c_str
());
m_pMem
->
destroy
<
t_sh_str
>
((
"takin_sqw_proc_params_"
+
m_strProcName
).
c_str
());
tl
::
log_debug
(
"Removed process memory
\"
"
,
"takin_sqw_proc_*_"
,
m_strProcName
,
"
\"
."
);
tl
::
log_debug
(
"Removed process memory
\"
"
,
"takin_sqw_proc_*_"
,
m_strProcName
,
"
\"
for client "
,
m_pidChild
,
"
."
);
}
}
catch
(
const
std
::
exception
&
ex
)
{
tl
::
log_debug
(
"
Process
unloading exception: "
,
ex
.
what
());
tl
::
log_debug
(
"
Client process "
,
m_pidChild
,
"
unloading exception: "
,
ex
.
what
());
}
}
...
...
tools/monteconvo/sqwfactory.cpp
View file @
ed801620
...
...
@@ -189,7 +189,6 @@ void unload_sqw_plugins()
pMod
->
unload
();
pMod
.
reset
();
tl
::
log_debug
(
"Unloaded plugin."
);
}
g_vecMods
.
clear
();
...
...
@@ -215,7 +214,7 @@ void load_sqw_plugins()
// TODO: libjulia.so needs rtld_global, but cannot be used here as the takin_sqw_info functions are named the same in all so files...
std
::
shared_ptr
<
so
::
shared_library
>
pmod
=
std
::
make_shared
<
so
::
shared_library
>
(
strPlugin
,
so
::
load_mode
::
rtld_lazy
/*| so::load_mode::rtld_global*/
);
so
::
load_mode
::
rtld_lazy
|
so
::
load_mode
::
rtld_local
);
if
(
!
pmod
)
continue
;
...
...
tools/taz/taz_main.cpp
View file @
ed801620
...
...
@@ -39,6 +39,9 @@
#include <QSplashScreen>
#include <QStyleFactory>
#include <unistd.h>
namespace
chr
=
std
::
chrono
;
namespace
asio
=
boost
::
asio
;
namespace
sys
=
boost
::
system
;
...
...
@@ -154,6 +157,7 @@ int main(int argc, char** argv)
{
try
{
pid_t
pidMain
=
getpid
();
std
::
ios_base
::
sync_with_stdio
(
0
);
#ifdef NO_TERM_CMDS
...
...
@@ -163,8 +167,16 @@ int main(int argc, char** argv)
// install exit signal handlers
asio
::
io_service
ioSrv
;
asio
::
signal_set
sigInt
(
ioSrv
,
SIGABRT
,
SIGTERM
,
SIGINT
);
sigInt
.
async_wait
([
&
ioSrv
](
const
sys
::
error_code
&
err
,
int
iSig
)
sigInt
.
async_wait
([
&
ioSrv
,
pidMain
](
const
sys
::
error_code
&
err
,
int
iSig
)
{
pid_t
pid
=
getpid
();
if
(
pid
!=
pidMain
)
{
tl
::
log_warn
(
"Child process exit requested via signal."
,
pid
,
"."
);
ioSrv
.
stop
();
exit
(
-
1
);
}
tl
::
log_warn
(
"Hard exit requested via signal "
,
iSig
,
". This may cause a fault."
);
if
(
err
)
tl
::
log_err
(
"Error: "
,
err
.
message
(),
", error category: "
,
err
.
category
().
name
(),
"."
);
ioSrv
.
stop
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment