Changes between Version 6 and Version 7 of 2011WP/2011Stream2/DynamicMemory
- Timestamp:
- 2010-12-14T09:38:44+01:00 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
2011WP/2011Stream2/DynamicMemory
v6 v7 437 437 438 438 439 == S2-4 : Italo E. comments == 440 441 442 Hi all, I have just a couple of comments. 443 444 Re the opa_partition routine and the policy for choosing the "best" partition, I suggest to set jpni and jpnj such that the local subdomain is as much "square" as possible. Indeed the "best" performance, with the current domain decomposition, is reached when the local subdomain has a square shape. 445 I suggest to modify the opa_patition as follows 446 {{{ 447 ... 448 449 CALL factorise(ifact, nfactmax, nfact, mppsize, ierr) 450 451 452 IF(nfact <= 1)THEN 453 WRITE (numout, *) 'WARNING: factorisation of number of PEs failed' 454 WRITE (numout, *) ' : using grid of ',mppsize,' x 1' 455 jpnj = 1 456 jpni = mppsize 457 ELSE 458 459 ! Search through factors for the pair that are closest in value 460 mindiff = 1000000 461 imin = 1 462 DO i=1,nfact-1,2 463 idiff = ABS(jpjglo/ifact(i) - jpiglo/ifact(i+1)) 464 IF(idiff < mindiff)THEN 465 mindiff = idiff 466 imin = i 467 END IF 468 END DO 469 jpnj = ifact(imin) 470 jpni = ifact(imin + 1) 471 ENDIF 472 ... 473 }}} 474 475 Re the allocation of work arrays. 476 The sharing of work arrays among different routines gives us the possibility to save relevant memory space; so the idea to have a module such as wrk_nemo could be useful. However the usage of those arrays could introduce several contraindications: 1. the code could be less readable; 2. when I write a new routine that calls some other already available, I must be sure that I will not use the same work arrays. 477 478 Some actions can be adopted in order to reduce the dangerously of such work arrays, but I would avoid to use routine arguments for passing work arrays. Typically the usage of work arrays is strictly related to the kind of implementation of the routine; on the other hand, the routine prototype should be as stable as possible during the refinement/optimization/modification of the routine implementation. The maintenance of the code becomes very heavy if updating the implementation of one routine implies also the modification of its prototype. 479 480 For those routines, at lower level, I suggest to declare locally their work allocatable arrays with the SAVE attribute 481 482 ---- 483 484 439 485 == S2-x : XXX' comments == 440 486