Xmipp  v3.23.11-Nereus
Classes | Macros | Functions
ml_align2d.h File Reference
#include "ml2d.h"
Include dependency graph for ml_align2d.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  structThreadTasks
 
class  ProgML2D
 

Macros

#define FOR_ALL_THREAD_REFNO()
 
#define FOR_ALL_THREAD_REFNO_NODECL()
 Same macro as before, but without declaring refno and load. More...
 
#define SPECIAL_ITER   0
 

Functions

void * doThreadsTasks (void *data)
 Function for threads do different tasks. More...
 

Macro Definition Documentation

◆ FOR_ALL_THREAD_REFNO

#define FOR_ALL_THREAD_REFNO ( )
Value:
int refno, load; \
while ((load = getThreadRefnoJob(refno)) > 0) \
for (int i = 0; i < load; i++, refno = (refno + 1) % model.n_ref)
#define i

Definition at line 33 of file ml_align2d.h.

◆ FOR_ALL_THREAD_REFNO_NODECL

#define FOR_ALL_THREAD_REFNO_NODECL ( )
Value:
while ((load = getThreadRefnoJob(refno)) > 0) \
for (int i = 0; i < load; i++, refno = (refno + 1) % model.n_ref)
#define i

Same macro as before, but without declaring refno and load.

Definition at line 38 of file ml_align2d.h.

◆ SPECIAL_ITER

#define SPECIAL_ITER   0

Definition at line 51 of file ml_align2d.h.

Function Documentation

◆ doThreadsTasks()

void* doThreadsTasks ( void *  data)

Function for threads do different tasks.

Definition at line 967 of file ml_align2d.cpp.

968 {
969  auto * thread_data = (structThreadTasks *) data;
970 
971  ProgML2D * prm = thread_data->prm;
972 
973  barrier_t & barrier = prm->barrier;
974  barrier_t & barrier2 = prm->barrier2;
975 
976  //Loop until the threadTask become TH_EXIT
977 
978  do
979  {
980  //Wait until main threads order to start
981  //debug_print("Waiting on barrier, th ", thread_id);
982  barrier_wait(&barrier);
983 
984  //Check task to do
985 
986  switch (prm->threadTask)
987  {
988 
989  case TH_PFS_REFNO:
991  break;
992 
993  case TH_ESI_REFNO:
995  break;
996 
997  case TH_ESI_UPDATE_REFNO:
998  prm->doThreadESIUpdateRefno();
999  break;
1000 
1001  case TH_RR_REFNO:
1003  break;
1004 
1005  case TH_RRR_REFNO:
1007  break;
1008 
1009  case TH_EXIT:
1010  pthread_exit(nullptr);
1011  break;
1012 
1013  }
1014 
1015  barrier_wait(&barrier2);
1016 
1017  }
1018  while (1);
1019 
1020 }//close function doThreadsTasks
int threadTask
Definition: ml_align2d.h:67
barrier_t barrier2
Definition: ml_align2d.h:68
void doThreadExpectationSingleImageRefno()
Thread code to parallelize refno loop in expectationSingleImage.
barrier_t barrier
Definition: ml_align2d.h:68
Barrier * barrier
void doThreadRotateReferenceRefno()
Thread code to parallelize refno loop in rotateReference.
void doThreadReverseRotateReferenceRefno()
Thread code to parallelize refno loop in reverseRotateReference.
void doThreadPreselectFastSignificantRefno()
Thread code to parallelize refno loop in preselectFastSignificant.
Definition: ml2d.h:74
void doThreadESIUpdateRefno()
Thread code to parallelize update loop in ESI.
ProgClassifyCL2D * prm
int barrier_wait(barrier_t *barrier)