Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
particle_methods
hysop
Commits
cecff3df
Commit
cecff3df
authored
5 years ago
by
Jean-Baptiste Keck
Browse files
Options
Downloads
Patches
Plain Diff
init
parent
f515d732
No related branches found
No related tags found
1 merge request
!16
MPI operators
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hysop/__init__.py.in
+19
-2
19 additions, 2 deletions
hysop/__init__.py.in
with
19 additions
and
2 deletions
hysop/__init__.py.in
+
19
−
2
View file @
cecff3df
...
...
@@ -2,9 +2,26 @@
Python package dedicated to flow simulation using particular methods
on hybrid architectures (MPI-GPU)
"""
import psutil
import psutil
, signal, traceback, threading, sys, os, warnings
from functools import wraps
from hysop.deps import __builtin__, print_function, os, sys, warnings, traceback
from hysop.deps import __builtin__, print_function
# Register debug signals (SIGUSR1(10)=print the main stack, SIGUSR2(12)=print the stack of all threads)
def dumpstack(signal, frame):
traceback.print_stack()
def dumpstacks(signal, frame):
#https://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application
id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
code = []
for threadId, stack in sys._current_frames().items():
code.append("\n# Thread: %s(%d)" % (id2name.get(threadId,""), threadId))
for filename, lineno, name, line in traceback.extract_stack(stack):
code.append('File: "%s", line %d, in %s' % (filename, lineno, name))
if line:
code.append(" %s" % (line.strip()))
print("\n".join(code))
signal.signal(signal.SIGUSR1, dumpstack)
signal.signal(signal.SIGUSR2, dumpstacks)
def get_env(target, default_value):
target = 'HYSOP_{}'.format(target)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment