223 { \
224 if( ( (srcproc_) >= 0 ) && ( (nprocs_) > 1 ) ) \
225 { \
226 Int inb__, mydist__, n__, nblk__, quot__, src__; \
227 if( ( inb__ = (inb_) - (i_) ) <= 0 ) \
228 { \
229 src__ = (srcproc_) + ( nblk__ = (-inb__) / (nb_) + 1 ); \
230 src__ -= ( src__ / (nprocs_) ) * (nprocs_); \
231 inb__ += nblk__*(nb_); \
232 if( ( n__ = (n_) - inb__ ) <= 0 ) \
233 { if( (proc_) == src__ ) np_ = (n_); else np_ = 0; } \
234 else \
235 { \
236 if( ( mydist__ = (proc_) - src__ ) < 0 ) \
237 mydist__ += (nprocs_); \
238 nblk__ = n__ / (nb_) + 1; \
239 mydist__ -= nblk__ - \
240 ( quot__ = ( nblk__ / (nprocs_) ) ) * (nprocs_); \
241 if( mydist__ < 0 ) \
242 { \
243 if( (proc_) != src__ ) \
244 np_ = (nb_) + (nb_) * quot__; \
245 else \
246 np_ = inb__ + (nb_) * quot__; \
247 } \
248 else if( mydist__ > 0 ) \
249 { \
250 np_ = (nb_) * quot__; \
251 } \
252 else \
253 { \
254 if( (proc_) != src__ ) \
255 np_ = n__ + (nb_) + (nb_) * ( quot__ - nblk__ ); \
256 else \
257 np_ = (n_) + (nb_) * ( quot__ - nblk__ ); \
258 } \
259 } \
260 } \
261 else \
262 { \
263 if( ( n__ = (n_) - inb__ ) <= 0 ) \
264 { if( (proc_) == (srcproc_) ) np_ = (n_); else np_ = 0; } \
265 else \
266 { \
267 if( ( mydist__ = (proc_) - (srcproc_) ) < 0 ) \
268 mydist__ += (nprocs_); \
269 nblk__ = n__ / (nb_) + 1; \
270 mydist__ -= nblk__ - \
271 ( quot__ = ( nblk__ / (nprocs_) ) ) * (nprocs_); \
272 if( mydist__ < 0 ) \
273 { \
274 if( (proc_) != (srcproc_) ) \
275 np_ = (nb_) + (nb_) * quot__; \
276 else \
277 np_ = inb__ + (nb_) * quot__; \
278 } \
279 else if( mydist__ > 0 ) \
280 { \
281 np_ = (nb_) * quot__; \
282 } \
283 else \
284 { \
285 if( (proc_) != (srcproc_) ) \
286 np_ = n__ + (nb_) + (nb_) * ( quot__ - nblk__ ); \
287 else \
288 np_ = (n_) + (nb_) * ( quot__ - nblk__ ); \
289 } \
290 } \
291 } \
292 } \
293 else \
294 { \
295 np_ = (n_); \
296 } \
297 }