300 { \
301 if( ( (srcproc_) >= 0 ) && ( (nprocs_) > 1 ) ) \
302 { \
303 Int inb__, mydist__, n__, nblk__, quot__, rem__, src__; \
304 if( ( inb__ = (inb_) - (i_) ) <= 0 ) \
305 { \
306 src__ = (srcproc_) + ( nblk__ = (-inb__) / (nb_) + 1 ); \
307 src__ -= ( src__ / (nprocs_) ) * (nprocs_); \
308 if( (proc_) != src__ ) \
309 { \
310 inb__ += nblk__*(nb_); \
311 if( ( n__ = (n_) - inb__ ) <= 0 ) { np_ = (n_); } \
312 else \
313 { \
314 if( ( mydist__ = (proc_) - src__ ) < 0 ) \
315 mydist__ += (nprocs_); \
316 nblk__ = n__ / (nb_) + 1; \
317 rem__ = nblk__ - \
318 ( quot__ = ( nblk__ / (nprocs_) ) ) * (nprocs_); \
319 if( mydist__ <= rem__ ) \
320 { \
321 np_ = inb__ - (nb_) + \
322 ( quot__ + 1 ) * mydist__ * (nb_); \
323 } \
324 else \
325 { \
326 np_ = (n_) + \
327 ( mydist__ - (nprocs_) ) * quot__ * (nb_); \
328 } \
329 } \
330 } \
331 else \
332 { \
333 np_ = 0; \
334 } \
335 } \
336 else \
337 { \
338 if( (proc_) != (srcproc_) ) \
339 { \
340 if( ( n__ = (n_) - inb__ ) <= 0 ) { np_ = (n_); } \
341 else \
342 { \
343 if( ( mydist__ = (proc_) - (srcproc_) ) < 0 ) \
344 mydist__ += (nprocs_); \
345 nblk__ = n__ / (nb_) + 1; \
346 rem__ = nblk__ - \
347 ( quot__ = ( nblk__ / (nprocs_) ) ) * (nprocs_); \
348 if( mydist__ <= rem__ ) \
349 { \
350 np_ = inb__ - (nb_) + \
351 ( quot__ + 1 ) * mydist__ * (nb_); \
352 } \
353 else \
354 { \
355 np_ = (n_) + \
356 ( mydist__ - (nprocs_) ) * quot__ * (nb_); \
357 } \
358 } \
359 } \
360 else \
361 { \
362 np_ = 0; \
363 } \
364 } \
365 } \
366 else \
367 { \
368 np_ = 0; \
369 } \
370 }