SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ slcombine()

subroutine slcombine ( integer  ictxt,
character  scope,
character  op,
character  timetype,
integer  n,
integer  ibeg,
double precision, dimension( n )  times 
)

Definition at line 265 of file sltimer.f.

267*
268* -- ScaLAPACK tools routine (version 1.7) --
269* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
270* and University of California, Berkeley.
271* May 1, 1997
272*
273* .. Scalar Arguments ..
274 CHARACTER OP, SCOPE, TIMETYPE
275 INTEGER IBEG, ICTXT, N
276* ..
277* .. Array Arguments ..
278 DOUBLE PRECISION TIMES( N )
279* ..
280*
281* Purpose
282* =======
283*
284* SLCOMBINE takes the timing information stored on a scope of processes
285* and combines them into the user's TIMES array.
286*
287* Arguments
288* =========
289*
290* ICTXT (local input) INTEGER
291* The BLACS context handle.
292*
293* SCOPE (global input) CHARACTER
294* Controls what processes in grid participate in combine.
295* Options are 'Rowwise', 'Columnwise', or 'All'.
296*
297* OP (global input) CHARACTER
298* Controls what combine should be done:
299* = '>': get maximal time on any process (default),
300* = '<': get minimal time on any process,
301* = '+': get sum of times across processes.
302*
303* TIMETYPE (global input) CHARACTER
304* Controls what time will be returned in TIMES:
305* = 'W': wall clock time,
306* = 'C': CPU time (default).
307*
308* N (global input) INTEGER
309* The number of timers to combine.
310*
311* IBEG (global input) INTEGER
312* The first timer to be combined.
313*
314* TIMES (global output) DOUBLE PRECISION array, dimension (N)
315* The requested timing information is returned in this array.
316*
317* =====================================================================
318*
319* .. Parameters ..
320 INTEGER NTIMER
321 parameter( ntimer = 64 )
322 DOUBLE PRECISION ERRFLAG
323 parameter( errflag = -1.0d+0 )
324* ..
325* .. Local Scalars ..
326 LOGICAL TMPDIS
327 INTEGER I
328* ..
329* .. External Subroutines ..
330 EXTERNAL dgamx2d, dgamn2d, dgsum2d
331* ..
332* .. External Functions ..
333 LOGICAL LSAME
334 DOUBLE PRECISION DCPUTIME00, DWALLTIME00
335 EXTERNAL dcputime00, dwalltime00, lsame
336* ..
337* .. Common Blocks ..
338 LOGICAL DISABLED
339 DOUBLE PRECISION CPUSEC( NTIMER ), CPUSTART( NTIMER ),
340 $ WALLSEC( NTIMER ), WALLSTART( NTIMER )
341 COMMON /sltimer00/ cpusec, wallsec, cpustart, wallstart, disabled
342* ..
343* .. Executable Statements ..
344*
345* Disable timer for combine operation
346*
347 tmpdis = disabled
348 disabled = .true.
349*
350* Copy timer information into user's times array
351*
352 IF( lsame( timetype, 'W' ) ) THEN
353*
354* If walltime not available on this machine, fill in times
355* with -1 flag, and return
356*
357 IF( dwalltime00().EQ.errflag ) THEN
358 DO 10 i = 1, n
359 times( i ) = errflag
360 10 CONTINUE
361 RETURN
362 ELSE
363 DO 20 i = 1, n
364 times( i ) = wallsec( ibeg + i - 1 )
365 20 CONTINUE
366 END IF
367 ELSE
368 IF( dcputime00().EQ.errflag ) THEN
369 DO 30 i = 1, n
370 times( i ) = errflag
371 30 CONTINUE
372 RETURN
373 ELSE
374 DO 40 i = 1, n
375 times( i ) = cpusec( ibeg + i - 1 )
376 40 CONTINUE
377 END IF
378 ENDIF
379*
380* Combine all nodes' information, restore disabled, and return
381*
382 IF( op.EQ.'>' ) THEN
383 CALL dgamx2d( ictxt, scope, ' ', n, 1, times, n, -1, -1,
384 $ -1, -1, 0 )
385 ELSE IF( op.EQ.'<' ) THEN
386 CALL dgamn2d( ictxt, scope, ' ', n, 1, times, n, -1, -1,
387 $ -1, -1, 0 )
388 ELSE IF( op.EQ.'+' ) THEN
389 CALL dgsum2d( ictxt, scope, ' ', n, 1, times, n, -1, 0 )
390 ELSE
391 CALL dgamx2d( ictxt, scope, ' ', n, 1, times, n, -1, -1,
392 $ -1, -1, 0 )
393 END IF
394*
395 disabled = tmpdis
396*
397 RETURN
398*
399* End of SLCOMBINE
400*
logical function lsame(ca, cb)
Definition tools.f:1724