static void * LeafThread (void *_thread) { portal_t *portal; int thread = (int) (intptr_t) _thread; do { portal = GetNextPortal (); if (!portal) break; if (working) working[thread] = (int) (portal - portals); PortalFlow (portal); if (options.verbosity > 0) printf ("portal:%4i mightsee:%4i cansee:%4i\n", (int) (portal - portals), portal->nummightsee, portal->numcansee); } while (1); printf ("thread %d done\n", thread); if (working) working[thread] = -1; return NULL; }
/* ============== LeafThread ============== */ void *LeafThread (int thread) { time_t oldtime, newtime; portal_t *p; //printf ("Begining LeafThread: %i\n",(int)thread); oldtime = time(NULL); do { p = GetNextPortal (); if (!p) break; PortalFlow (p); portalschecked++; if (verbose) printf ("portal %4i of %4i mightsee:%4i cansee:%4i\n", (int) portalschecked, (int) numportals * 2, (int) p->nummightsee, (int) p->numcansee); else { newtime = time(NULL); if (newtime != oldtime) { printf("\rportal %4i of %4i (%3i%%), estimated time left: %4i seconds \b\b\b\b", (int) portalschecked, (int) numportals * 2, (int) (portalschecked*100/(numportals*2)), (int) ((numportals*2-portalschecked)*(newtime-portalizestarttime)/portalschecked)); fflush(stdout); oldtime = newtime; } } } while (1); printf("\n"); //printf ("Completed LeafThread: %i\n",(int)thread); return NULL; }
/* ============== LeafThread ============== */ void * LeafThread(void *arg) { double now; portal_t *p; do { ThreadLock(); /* Save state if sufficient time has elapsed */ now = I_FloatTime(); if (now > statetime + stateinterval) { statetime = now; SaveVisState(); } ThreadUnlock(); p = GetNextPortal(); if (!p) break; PortalFlow(p); PortalCompleted(p); if (verbose > 1) { logprint("portal:%4i mightsee:%4i cansee:%4i\n", (int)(p - portals), p->nummightsee, p->numcansee); } } while (1); return NULL; }
/* ============== LeafThread ============== */ void LeafThread (int thread) { portal_t *p; do { p = GetNextPortal (); if (!p) break; PortalFlow (p); qprintf ("portal:%4i mightsee:%4i cansee:%4i\n", (int)(p - portals), p->nummightsee, p->numcansee); } while (1); }
void ProcessPortalFlow( int iThread, uint64 iPortal, MessageBuffer *pBuf ) { // Process Portal and distribute results CTimeAdder adder( &g_CPUTime ); PortalFlow( iThread, iPortal ); // Send my result to root and potentially the other slaves // The slave results are read in RecursiveLeafFlow // if ( pBuf ) { portal_t * p = sorted_portals[iPortal]; pBuf->write( p->portalvis, portalbytes ); } }
void *LeafThread (int thread) #endif { portal_t *p; //printf ("Begining LeafThread: %i\n",(int)thread); do { p = GetNextPortal (); if (!p) break; PortalFlow (p); if (verbose) printf ("portal:%4i mightsee:%4i cansee:%4i\n", (int)(p - portals), p->nummightsee, p->numcansee); } while (1); //printf ("Completed LeafThread: %i\n",(int)thread); return NULL; }
void *LeafThread (int thread) #endif { portal_t *p; //printf ("Beginning LeafThread: %i\n",(int)thread); do { //Get the portal with the least number of leafs that might be visible. p = GetNextPortal (); if (!p) break; PortalFlow (p); if (verbose) printf ("portal:%4i mightsee:%4i cansee:%4i\n", (int)(p - portals), p->nummightsee, p->numcansee); } while (1); //printf ("Completed LeafThread: %i\n",(int)thread); return NULL; }