All greetings,
I run code blocks inside the loop, in separate OpenMP threads. Want to Did I define the correct OpenMP instructions in the following code snippet:
#ifdemp OPENMP_ENABLE #pragma omp for parallel (int i = 0; i & lt; numOfSlices; i ++) {// The entire block should be fun in the new OpenMP thread int id = 0 inside this loop; #ifdef OPENMP_ENABLE ID = omp_get_thread_num (); QDebug ("------- OPENMP thread% d", id); #endif qDebug ("- image slice% d", i); Int width = 0, height = 0; // Image buffer unsigned char * buff = planeViewer-> GetImageBuggerOfSlice (i, height, width); // Trunk RzTrunk * rztrnk = planeViewer-> GetTrunkOfSlice (i); // If empty trunk, add frame @ododod coded hard (rztrnk-> getCurveCount () == 0) {RzCurve * crv = rztrnk-> CreateFrameCurve (10, 10, width-10, height-10); Rztrnk-> AddCurve (CRV); } // TRANSPORT TRIP WITH CONVERTER RINZO TRANK! // Be sure to destroy the TODO memory QImage * qimg = new QImage (buff, width, height, QImage :: Format_RGB32); Trnk_t * trnkt = convertRzTrunkToCntyTrunk (rztrnk, qimg- & gt; width (), qimg-> height ()); // Convert QImage CNT image format image_t * imgt = Convert QImageToImaget (qimg); // This Extract Parts should first detect the outer boundary if (ATP == EXTRACT_DEFL_INOUT) {cnty_extract_contour (EXTRACT_DEFL_OUT, trnkt, imgt, NULL, NULL, settings2, NULL); Trnk_make_crvs_nodes_active (trnkt); } Cnty_extract_contour (etype, trnkt, imgt, null, null, settings, null); ConvertTraintrack truckstrack (trunatat, rztrank); Trnk_destruct (trnkt); DestroyImaget (imgt); Delete Qimg; Remove fondness; }
I have a problem for // end loop. The reason was that "Cnty_extract_contour ()" method is not thread-safe.
Comments
Post a Comment