Parallelization of GIN V1.2

SP '97 CS267 Project Description:
Parallelization of GIN V1.2: Spatial Domain Decomposition
with Fine Meshing via Combinatorial Geometry
Anne Marie Suozzi


GIN V1.2, a combinatorial geometry pre-processing package, generates domains of a given geometry that employ spatial differencing approaches via fine meshing required for higher accuracy in subsequent neutron collision/ transfer probability calculations. Serial input of Monte Carlo (MC) type subdomain coordinates with subsequent generation of fine meshing through hexagonal, or square/rectangular geometries is projected, whereby the former is subdivided into equilateral triangles, and the latter is subdivided into squares/rectangles, respectively. Ideally, each subdomain is to be generalized to have a unique assembly geometry with fine meshing. Due to the mutual independence of all spatial subdomain characterizations, this system is inherently parallel in that each subdomain or subset of subdomains can be independently generated on a given processor, through an optimal master/ slave algorithm with virtually no interprocessor communications.

A nuclear reactor domain, a repeating unit of constant area, is characterized by a given assembly geometry, hexagonal or square/rectangular, with specific materials within each moderator zone, the former of which describes the geometry, and the latter of which includes material composition and specifics with respect to zone numbering. Zones represent subregions in a domain formed by boolean and/or logic, that is, intersections, unions, and differences between subareas the of the geometrical objects of the domain. A subdomain represents an equal division of the domain into an equal number of regions, usually a power of 2, for accuracy refinement purposes. Domain decomposition of the assembly geometry into subdomains is performed before fine meshing is imposed for reasons related to subdomain boundary interfaces. The domain assembly geometry is input from 'gin.dat' in the form of coordinate, volume and zone arrays, with the functions called by the main characterized by the first object's geometry ( WED = wedge, RPP = right parallelopiped, RHP = right hexagonal prism ). Domain decomposition into subdomains is then performed with appropriate coordinate translations/ generations for each subdomain assembly geometry. Fine background meshing is then imposed on each subdomain, such that as outlined above, a hexagonal assembly is subdivided into equilateral triangles, while a square/rectangular assembly is subdivided into squares/rectangles. For a hexagonal assembly geometry characterized by WED, 'hex_mesh' generates RHP's from triangular moderator meshing with 3 RHP's for one triangular zone. 3D Cartesian coordinates of the hexagon vertices are determined from the initial coordinate and axis length arrays input from 'gin.dat'. New coordinates for appropriate intersection points are calculated, and the entire assembly geometry is covered with hexagons. Similarly, 'rec_mesh' generates RPP's with square moderator meshing for a square assembly, such that an intersection of 2 RPP's is determined, and corresponding coordinate arrays output for each subdomain. In addition, 'sq_mesh' generates 1 RPP with square moderator meshing for a square assembly, with subsequent output of all coordinate arrays. All three of these functions involve specific distance calculations, minimum distance screens, and coordinate translations; while 'hex_mesh' also requires linear slope and coefficient determinations for finding intersection points. Moreover, all calculations in all three meshing functions are performed as a function of the meshing refinement, defined as the number of geometrical objects per face of assembly geometry. After all meshing refinement and generation of corresponding geometrical objects as described above, moderator zones for each subdomain are generated with corresponding volume array calculations. Combinatorial intersection areas for the volume determinations are based on boolean and/or logic, whereby specific zones are formed via the intersections, unions and differences. These volume arrays generated for the given assembly geometry are determined by combinatorial intersection areas of circles and regular triangles for the hexagonal, and circles and RPP's for the square/rectangular assembly geometries.

The present serial version of GIN has been generalized to include domain decomposition to subdomains with specific assembly geometries for the unsymmetric case, that is, all subdomains are completely independent of eachother with respect to their type of assembly geometry, meshing refinement and moderator zone. Domain decomposition into subdomains is performed first, with subsequent meshing refinement such that all boundary interfaces between subdomains have the proper fine meshing. Moreover, all calculations in all three meshing functions, 'sq_mesh', 'rec_mesh', and 'hex_mesh', are performed as a function of the meshing refinement, presently done serially through looping over the meshing refinement parameter, defined as the number of geometrical objects per face of assembly geometry.

The present parallel MPI version includes domain decomposition to subdomains, and employs a master/slave algorithm which serially inputs all 'gin.dat' arrays and interactive user parameter options on processor 0, then distributes all arrays and user-specified parameters, for a given subdomain to the appropriate slave processor. After all serial input including coordinate translations/transformations for each subdomain, subsequent meshing refinement through 'rec_mesh', 'sq_mesh' or 'hex_mesh' with appropriate output of coordinate arrays are performed in parallel on each slave processor. Although the looping over each meshing function is done serially as a function of the meshing refinement parameter as described above, all coordinate transformations, area and volume calculations for each individual subdomain are performed in parallel, with each subdomain or set of subdomains assigned to a given processor. Each slave processor, presently representing one subdomain, then computes all appropriate coordinate transformations, volumes and moderator zones assignments as described above, with output characteristic of that subdomain to a specific file. Output files for each subdomain are generated in parallel, while input is done serially, and synchronous blocking sends/receives are employed for these purposes. Contention studies may be included here for additional micro-scale optimization, in the synchronized, blocking mode. In generalizing for macro-scale load-balancing studies with a set of subdomains assigned to one slave processor, complex assembly geometries and highly refined meshing are the primary cpu-intensive factors governing the partioning of a set of subdomains to a given processor.

The pseudocode for this master/slave version is as follows:


     /* master processor inputs and distributes all data from 'gin.dat' */ 
     if ( rank == 0 ) {

        /* loop over all subdomains, presently 1 per processor */  
        for ( i = 1 ; i < nproc ; i++ ) {

           input_data( i ) ; 
           /* blocking synchronous mode:  all global arrays & scalars, ~100 total */
           send_data( i, request, rank ) ; }
        
        for ( i = 1 ; i < nproc ; i++ ) {
           /* ensure all computations are complete */  
           MPI_Wait( request, status, rank ) ; 
           /* receive data from each subdomain: blocking synchronous mode */
           receive_data( i, request, rank ) ; }  

     }

     /* slave processors */ 
     else {

        /* receive all subdomain data from master: blocking synchronous mode */ 
        receive_data( rank, request, rank ) ;  

        /* initial background meshing output */ 
        background_mesh( ) ;
       
        /* sq_mesh, rec_mesh, hex_mesh */
        create_mesh( x1, x2, x3, y1, y2, y3, y4 ) ;

        /* more output */
        outer_bound_mesh( x1, x2, x3, y1, y2, y3, y4 ) ;

        /* maximum radius of objects defining annular zones */ 
        maxrad_zones( ) ;
 
        /* zones output */
        zone_cards( ) ; 

        /* moderator zone cards: squares for 'sq_graphi', triangles for 'hex_graphi' */
        moderator_zone( ) ;

        /* send all global arrays and scalars back to the master processor */
        send_data( 0, request, rank ) ; 

     }     

     MPI_Barrier( MPI_COMM_WORLD ) ;

     .....

     MPI_Finalize( ) ;

Serial runs are presently on the order of minutes for a given assembly geometry with meshing refinement. Optimal configuration of all subdomains is projected, whereby A given subset of subdomains are assigned to one slave processor according to criteria imposed by load-balancing and/or synchronization for macro-scale optimization. Complex assembly geometries and highly refined meshing are the primary concerns involved in macro-scale load-balancing governing the prediction of partitioning of subdomains to processors. A typical example includes a subset of 4 or 8 subdomains per processor, with perhaps 64 subdomains total, with 8 to 16 processors.

Bibliographies:

(1) Vujic, Jasmina, "GIN V1.2: A Combinatorial Geometry Input Generation Code for GTRAN2", Neutronics/Reactor Physics, July 1993.

(2) Vujic, Jasmina, and Slater, Steve, "Coarse-Grained Parallel Solution of the Integral Transport Equation for Large-Scale Reactor Physics Computations", to be submitted for publication and thesis dissertation, March 1997.