Tinkering with threadpool definitions and concurrency

This commit is contained in:
James E McClure 2015-11-14 10:45:23 -05:00
parent 5c998333ff
commit 2e685f8323

View File

@ -16,6 +16,8 @@ enum AnalysisType{ AnalyzeNone=0, IdentifyBlobs=0x01, CopyPhaseIndicator=0x02,
struct AnalysisWaitIdStruct { struct AnalysisWaitIdStruct {
ThreadPool::thread_id_t blobID; ThreadPool::thread_id_t blobID;
ThreadPool::thread_id_t analysis; ThreadPool::thread_id_t analysis;
ThreadPool::thread_id_t tminus;
ThreadPool::thread_id_t tplus;
ThreadPool::thread_id_t vis; ThreadPool::thread_id_t vis;
ThreadPool::thread_id_t restart; ThreadPool::thread_id_t restart;
}; };
@ -281,12 +283,12 @@ void run_analysis( int timestep, int restart_interval,
CopyToHost(phase->get(),Phi,N*sizeof(double)); CopyToHost(phase->get(),Phi,N*sizeof(double));
} }
if ( (type&CopyPhaseIndicator)!=0 ) { if ( (type&CopyPhaseIndicator)!=0 ) {
memcpy(Averages.Phase.get(),phase->get(),N*sizeof(double)); memcpy(Averages.Phase_tplus.get(),phase->get(),N*sizeof(double));
Averages.ColorToSignedDistance(beta,Averages.Phase,Averages.Phase_tplus); //Averages.ColorToSignedDistance(beta,Averages.Phase,Averages.Phase_tplus);
} }
if ( (type&CalcDist)!=0 ) { if ( (type&CalcDist)!=0 ) {
memcpy(Averages.Phase.get(),phase->get(),N*sizeof(double)); memcpy(Averages.Phase_tminus.get(),phase->get(),N*sizeof(double));
Averages.ColorToSignedDistance(beta,Averages.Phase,Averages.Phase_tminus); //Averages.ColorToSignedDistance(beta,Averages.Phase,Averages.Phase_tminus);
} }
if ( (type&CopyAverages) != 0 ) { if ( (type&CopyAverages) != 0 ) {
// Copy the members of Averages to the cpu (phase was copied above) // Copy the members of Averages to the cpu (phase was copied above)
@ -341,6 +343,8 @@ void run_analysis( int timestep, int restart_interval,
ThreadPool::WorkItem *work = new AnalysisWorkItem( ThreadPool::WorkItem *work = new AnalysisWorkItem(
type,timestep,Averages,last_index,last_id_map,beta); type,timestep,Averages,last_index,last_id_map,beta);
work->add_dependency(wait.blobID); work->add_dependency(wait.blobID);
work->add_dependency(wait.tminus);
work->add_dependency(wait.tplus);
work->add_dependency(wait.analysis); work->add_dependency(wait.analysis);
work->add_dependency(wait.vis); // Make sure we are done using analysis before modifying work->add_dependency(wait.vis); // Make sure we are done using analysis before modifying
wait.analysis = tpool.add_work(work); wait.analysis = tpool.add_work(work);