Changes

Jump to: navigation, search

GPU621/Group 6

1,143 bytes added, 10:51, 28 November 2018
Deadlocks
#TBB (Thread Build Blocks)
#MPI (Message Passing Interface)
 
= Testing Intel Inspector =
You can find some online tutorials for [https://software.intel.com/en-us/articles/inspector-tutorials Intel Inspector here].
 
'''Levels of Analysis'''
#The first level of analysis has little overhead. Use it during development because it is fast.
#The second level (shown below) takes more time and detects more issues. It is often used before checking in a new feature.
#The third level is great for regression testing and finding bugs.
[[File:03-Choose-Level.png]]
== Memory Errors ==
=== Memory leaks ===
These are a resource leak leaks that occurs when a computer program incorrectly manages to release memory when it is no longer needed.
This may lead to extensive response times due to excessive paging, leading to slower applications.
===Mismatched allocation/deallocation===
this is when attempting to delete memory already deleted or allocate already allocated memory
 
[[File:Invalid_mem_access.JPG]]
===Race Conditions===
Race conditions are defined as a A race condition where occurs when multiple threads access the output same memory location without proper synchronization and at least one access is dependent on uncontrollable events sequence or timinga write.  There are multiple types of race conditions, such asa data race is a type of race condition that occurs #Data Race: Occurs when multiple threads attempt to perform an operation on shared data, a heap race that performs #Heap Race: Performs operations on a shared heap, or #Stack Race: Performs operations on a shared stack race. [[File:racecondition_chart.png|400px]] '''Solutions''' Privatize memory shared by multiple threads so each thread has its own copy.#For Microsoft Windows* threading, consider using TlsAlloc() and TlsFree() to allocate thread local storage.#For OpenMP* threading, which performs on consider declaring the variable in a private, firstprivate, or lastprivate clause, or making it threadprivate. Consider using thread stack memory.Synchronize access to the shared stackmemory using synchronization objects.#For Microsoft Windows* threading, consider using mutexes or critical sections.#For OpenMP* threading, consider using atomic or critical sections or OpenMP* locks
[[File:Race-Condition.png|800px]]
A deadlock is when a multiple processes attempt to access the same resource at the same time, and the waiting process is holding a resource that the first process needs to finish.
[[File:deadlockdeadlock_chart.png|800px400px]]
= Testing '''Solutions''' #Create a global lock hierarchy#Use recursive synchronization objects such as recursive mutexes if a thread must acquire the same object more than once.#Avoid the case where two threads wait for each other to terminate. Instead, use a third thread to wait for both threads to terminate. '''Intel Inspector = cannot detect a Deadlock problem involving more than four threads.'''You can find some online tutorials for [[httpsFile://softwaredead_lock.intel.com/en-us/articles/inspector-tutorials Intel Inspector herepng|800px]].
'''Levels of Analysis'''#The first level of analysis has little overhead. Use it during development because it is fast. #The second level (shown below) takes more time and detects more issues. It is often used before checking in a new featurehttps://github.#The third level is great for regression testing and finding bugs.[[File:03-Choose-Levelcom/JTardif1/gpu_project/blob/master/Deadlock.png]]cpp
46
edits

Navigation menu