You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
psblas3/base/modules
Salvatore Filippone c3813ad217 psblas3:
base/modules/Makefile
 base/modules/aux
 base/modules/aux/psb_c_sort_mod.f90
 base/modules/aux/psb_d_sort_mod.f90
 base/modules/aux/psb_hash_mod.f90
 base/modules/aux/psb_i_sort_mod.f90
 base/modules/aux/psb_ip_reord_mod.f90
 base/modules/aux/psb_s_sort_mod.f90
 base/modules/aux/psb_sort_mod.f90
 base/modules/aux/psb_string_mod.f90
 base/modules/aux/psb_z_sort_mod.f90
 base/modules/aux/psi_c_serial_mod.f90
 base/modules/aux/psi_d_serial_mod.f90
 base/modules/aux/psi_i_serial_mod.f90
 base/modules/aux/psi_s_serial_mod.f90
 base/modules/aux/psi_serial_mod.f90
 base/modules/aux/psi_z_serial_mod.f90
 base/modules/comm
 base/modules/comm/psb_base_linmap_mod.f90
 base/modules/comm/psb_c_comm_mod.f90
 base/modules/comm/psb_c_linmap_mod.f90
 base/modules/comm/psb_comm_mod.f90
 base/modules/comm/psb_d_comm_mod.f90
 base/modules/comm/psb_d_linmap_mod.f90
 base/modules/comm/psb_i_comm_mod.f90
 base/modules/comm/psb_linmap_mod.f90
 base/modules/comm/psb_s_comm_mod.f90
 base/modules/comm/psb_s_linmap_mod.f90
 base/modules/comm/psb_z_comm_mod.f90
 base/modules/comm/psb_z_linmap_mod.f90
 base/modules/desc
 base/modules/desc/psb_desc_const_mod.f90
 base/modules/desc/psb_desc_mod.F90
 base/modules/desc/psb_gen_block_map_mod.f90
 base/modules/desc/psb_glist_map_mod.f90
 base/modules/desc/psb_hash_map_mod.f90
 base/modules/desc/psb_indx_map_mod.f90
 base/modules/desc/psb_list_map_mod.f90
 base/modules/desc/psb_repl_map_mod.f90
 base/modules/psb_base_linmap_mod.f90
 base/modules/psb_base_mat_mod.f90
 base/modules/psb_c_base_mat_mod.f90
 base/modules/psb_c_base_vect_mod.f90
 base/modules/psb_c_comm_mod.f90
 base/modules/psb_c_csc_mat_mod.f90
 base/modules/psb_c_csr_mat_mod.f90
 base/modules/psb_c_linmap_mod.f90
 base/modules/psb_c_mat_mod.f90
 base/modules/psb_c_psblas_mod.F90
 base/modules/psb_c_serial_mod.f90
 base/modules/psb_c_sort_mod.f90
 base/modules/psb_c_tools_mod.f90
 base/modules/psb_c_vect_mod.F90
 base/modules/psb_cd_tools_mod.f90
 base/modules/psb_comm_mod.f90
 base/modules/psb_d_base_mat_mod.f90
 base/modules/psb_d_base_vect_mod.f90
 base/modules/psb_d_comm_mod.f90
 base/modules/psb_d_csc_mat_mod.f90
 base/modules/psb_d_csr_mat_mod.f90
 base/modules/psb_d_linmap_mod.f90
 base/modules/psb_d_mat_mod.f90
 base/modules/psb_d_psblas_mod.F90
 base/modules/psb_d_serial_mod.f90
 base/modules/psb_d_sort_mod.f90
 base/modules/psb_d_tools_mod.f90
 base/modules/psb_d_vect_mod.F90
 base/modules/psb_desc_const_mod.f90
 base/modules/psb_desc_mod.F90
 base/modules/psb_gen_block_map_mod.f90
 base/modules/psb_glist_map_mod.f90
 base/modules/psb_hash_map_mod.f90
 base/modules/psb_hash_mod.f90
 base/modules/psb_i_base_vect_mod.f90
 base/modules/psb_i_comm_mod.f90
 base/modules/psb_i_sort_mod.f90
 base/modules/psb_i_tools_mod.f90
 base/modules/psb_i_vect_mod.F90
 base/modules/psb_indx_map_mod.f90
 base/modules/psb_ip_reord_mod.f90
 base/modules/psb_linmap_mod.f90
 base/modules/psb_list_map_mod.f90
 base/modules/psb_mat_mod.f90
 base/modules/psb_psblas_mod.f90
 base/modules/psb_repl_map_mod.f90
 base/modules/psb_s_base_mat_mod.f90
 base/modules/psb_s_base_vect_mod.f90
 base/modules/psb_s_comm_mod.f90
 base/modules/psb_s_csc_mat_mod.f90
 base/modules/psb_s_csr_mat_mod.f90
 base/modules/psb_s_linmap_mod.f90
 base/modules/psb_s_mat_mod.f90
 base/modules/psb_s_psblas_mod.F90
 base/modules/psb_s_serial_mod.f90
 base/modules/psb_s_sort_mod.f90
 base/modules/psb_s_tools_mod.f90
 base/modules/psb_s_vect_mod.F90
 base/modules/psb_serial_mod.f90
 base/modules/psb_sort_mod.f90
 base/modules/psb_sort_mod_save.f90
 base/modules/psb_string_mod.f90
 base/modules/psb_tools_mod.f90
 base/modules/psb_vect_mod.f90
 base/modules/psb_z_base_mat_mod.f90
 base/modules/psb_z_base_vect_mod.f90
 base/modules/psb_z_comm_mod.f90
 base/modules/psb_z_csc_mat_mod.f90
 base/modules/psb_z_csr_mat_mod.f90
 base/modules/psb_z_linmap_mod.f90
 base/modules/psb_z_mat_mod.f90
 base/modules/psb_z_psblas_mod.F90
 base/modules/psb_z_serial_mod.f90
 base/modules/psb_z_sort_mod.f90
 base/modules/psb_z_tools_mod.f90
 base/modules/psb_z_vect_mod.F90
 base/modules/psblas
 base/modules/psblas/psb_c_psblas_mod.F90
 base/modules/psblas/psb_d_psblas_mod.F90
 base/modules/psblas/psb_psblas_mod.f90
 base/modules/psblas/psb_s_psblas_mod.F90
 base/modules/psblas/psb_z_psblas_mod.F90
 base/modules/psi_c_serial_mod.f90
 base/modules/psi_d_serial_mod.f90
 base/modules/psi_i_serial_mod.f90
 base/modules/psi_s_serial_mod.f90
 base/modules/psi_serial_mod.f90
 base/modules/psi_z_serial_mod.f90
 base/modules/serial
 base/modules/serial/psb_base_mat_mod.f90
 base/modules/serial/psb_c_base_mat_mod.f90
 base/modules/serial/psb_c_base_vect_mod.f90
 base/modules/serial/psb_c_csc_mat_mod.f90
 base/modules/serial/psb_c_csr_mat_mod.f90
 base/modules/serial/psb_c_mat_mod.f90
 base/modules/serial/psb_c_serial_mod.f90
 base/modules/serial/psb_c_vect_mod.F90
 base/modules/serial/psb_d_base_mat_mod.f90
 base/modules/serial/psb_d_base_vect_mod.f90
 base/modules/serial/psb_d_csc_mat_mod.f90
 base/modules/serial/psb_d_csr_mat_mod.f90
 base/modules/serial/psb_d_mat_mod.f90
 base/modules/serial/psb_d_serial_mod.f90
 base/modules/serial/psb_d_vect_mod.F90
 base/modules/serial/psb_i_base_vect_mod.f90
 base/modules/serial/psb_i_vect_mod.F90
 base/modules/serial/psb_mat_mod.f90
 base/modules/serial/psb_s_base_mat_mod.f90
 base/modules/serial/psb_s_base_vect_mod.f90
 base/modules/serial/psb_s_csc_mat_mod.f90
 base/modules/serial/psb_s_csr_mat_mod.f90
 base/modules/serial/psb_s_mat_mod.f90
 base/modules/serial/psb_s_serial_mod.f90
 base/modules/serial/psb_s_vect_mod.F90
 base/modules/serial/psb_serial_mod.f90
 base/modules/serial/psb_vect_mod.f90
 base/modules/serial/psb_z_base_mat_mod.f90
 base/modules/serial/psb_z_base_vect_mod.f90
 base/modules/serial/psb_z_csc_mat_mod.f90
 base/modules/serial/psb_z_csr_mat_mod.f90
 base/modules/serial/psb_z_mat_mod.f90
 base/modules/serial/psb_z_serial_mod.f90
 base/modules/serial/psb_z_vect_mod.F90
 base/modules/tools
 base/modules/tools/psb_c_tools_mod.f90
 base/modules/tools/psb_cd_tools_mod.f90
 base/modules/tools/psb_d_tools_mod.f90
 base/modules/tools/psb_i_tools_mod.f90
 base/modules/tools/psb_s_tools_mod.f90
 base/modules/tools/psb_tools_mod.f90
 base/modules/tools/psb_z_tools_mod.f90
 configure.ac
 configure

Mreged reorganization of the base/modules subdir from newdesc branch.
9 years ago
..
aux psblas3: 9 years ago
comm psblas3: 9 years ago
desc psblas3: 9 years ago
psblas psblas3: 9 years ago
serial psblas3: 9 years ago
tools psblas3: 9 years ago
Makefile psblas3: 9 years ago
README.F2003 Fixed README. 15 years ago
cutil.c psblas3: 14 years ago
error.f90 psblas3: 10 years ago
fakempi.c psblas3: 9 years ago
psb_base_mod.f90 psblas3: 10 years ago
psb_check_mod.f90 psblas3: 10 years ago
psb_const_mod.F90 psblas3: 9 years ago
psb_error_impl.F90 psblas3: 10 years ago
psb_error_mod.F90 psblas3: 9 years ago
psb_internals.h psblas3: 14 years ago
psb_penv_mod.F90 psblas3: 15 years ago
psb_realloc_mod.F90 psblas3: 10 years ago
psi_bcast_mod.F90 psblas3: 10 years ago
psi_c_mod.f90 New internals for ovrl on multivectors. 10 years ago
psi_comm_buffers_mod.F90 psblas3: 10 years ago
psi_d_mod.f90 New internals for ovrl on multivectors. 10 years ago
psi_i_mod.f90 New internals for ovrl on multivectors. 10 years ago
psi_mod.f90 psblas3: 10 years ago
psi_p2p_mod.F90 psblas3: 10 years ago
psi_penv_mod.F90 psblas3: 10 years ago
psi_reduce_mod.F90 psblas3: 10 years ago
psi_s_mod.f90 New internals for ovrl on multivectors. 10 years ago
psi_z_mod.f90 New internals for ovrl on multivectors. 10 years ago

README.F2003

Design principles for this directory.

1. What is a sparse matrix? 
   It is an object which does have some properties (number of rows,
   number of columns, whether it is a triangle, and in that case
   upper/lower, unit/nonunit), a state (null, build, assembled,
   update), a type (real/complex, single/double), and a storage
   format.  
   Thus we have a three-level inheritance chain: 
   i.   The  base object, defining the methods to set/query the various
        properties, and allocate and  free. Some of the property
        getters/setters, allocate and free depend on the storage
        format, so at this level they will just throw an error. 
   ii.  The X_base_object, where X=s,d,c,z  thus defining the
        type. At this level we define the computational interfaces to
	MV and SV, since they require the type of the vectors/scalars
   	involved (should also add NRMI here!!!!), but again they will
   	be empty shells. We also define the interface to CSPUT,
   	required to build the object, and TO_COO,FROM_COO (see
   	below). 
   iii. The X_YYY_object where the real implementation of the
      	MV/SV/NRMI/CSPUT/ALLOCATE/FREE/TO_COO/FROM_COO takes place.  

2. What is a sparse matrix (take 2)? 
   The above structure by itself does not allow a sparse matrix to
   switch among different storage formats during its life. To do this,
   we define all of the above to be INNER objects, encapsulated in an
   OUTER object which is what the rest of the library sees, as
   follows: 
     
   type :: psbn_d_sparse_mat

     class(psbn_d_base_sparse_mat), allocatable  :: a 
    
   end type psbn_d_sparse_mat
   type(psbn_d_sparse_mat) :: a

   In this way we can have an outer object whose type is stable
   both statically (at compile time) and at runtime, while at runtime
   the type of the inner object switches from COO to CSR to whatever as
   needed. All of the methods are simply thrown onto the corresponding
   methods of the (allocatable, polymorphic) component A%A as needed
   (provided the component is allocated, that is).
   This is what is called a STATE design pattern (different from the
   internal state we discussed above).

   As an example, consider the allocate/build/assembly cycle: 
   the outer code would do the following: 
   1.  Allocate(psbn_d_coo_sparse_mat ::  a%a) 

   2. During the build loop a call to A%CSINS() gets translated into
      CALL A%A%CSINS()
    
   3. At assembly time the code would do the following
      subroutine psb_spasb(a,....)
      type(psbn_d_sparse_mat), intent(inout)  :: a 

      class(psbn_d_base_sparse_mat), allocatable :: temp

      select case (TYPE)
      case('CSR')
         allocate(psbn_d_csr_sparse_mat :: temp, stat=info)
      end select				 
      call temp%from_coo(a%a)
      call a%a%free()
      call move_alloc(temp,a%a)
      

   4. Note in the above that to_coo, from_coo are defined so that every
      conceivable  storage representation provides just 2 conversion
      routines, avoiding quadratic explosion. But since all have to
      provide them, the to_coo/from_coo is defined in d_base_mat_mod
      together with d_coo_sparse_mat, which enjoys the "crown prince"
      status with respect to all the other types derived from
      d_base_sparse_mat (its "siblings"). 

   5. How does a user add a new storage format? Very simple. After
      deriving the class and implementing all the necessary methods,
      the user declares in the program a dummy variable of the new
      inner type 

      type(X_YYY_sparse_mat) :: reftype


      then calls 
        call psb_spasb(a,....,mold=reftype)

      In psb_spasb we have
      class(psbn_d_base_sparse_mat), intent(in), optional :: mold

      if (present(mold)) then 
        allocate(temp,source=mold,stat=info)
      end select				 
      call temp%from_coo(a%a)
      call a%a%free()
      call move_alloc(temp,a%a)
  
      AND IT'S DONE! Nothing else in the library requires the explicit
      knowledge of type of  MOLD.