diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index a1b474f12f..59a0307533 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -23,6 +23,7 @@ cmfd_execute.o: cmfd_output.o cmfd_execute.o: cmfd_power_solver.o cmfd_execute.o: cmfd_slepc_solver.o cmfd_execute.o: cmfd_snes_solver.o +cmfd_execute.o: tally.o cmfd_execute.o: timing.o cmfd_input.o: datatypes.o diff --git a/src/cmfd_data.F90 b/src/cmfd_data.F90 index 8de22310f8..db439f716b 100644 --- a/src/cmfd_data.F90 +++ b/src/cmfd_data.F90 @@ -536,6 +536,7 @@ contains ! record dtilde in cmfd object cmfd%dhat(l,g,i,j,k) = dhat +! cmfd%dhat(l,g,i,j,k) = 0.0_8 end do LEAK diff --git a/src/cmfd_execute.F90 b/src/cmfd_execute.F90 index 384e118cf8..23476bb876 100644 --- a/src/cmfd_execute.F90 +++ b/src/cmfd_execute.F90 @@ -34,7 +34,7 @@ contains call petsc_init_mpi() ! filter procs - if (rank < 6) then + if (rank < 1) then ! initialize slepc/petsc (communicates to world) if(current_cycle == n_inactive + 1) call SlepcInitialize & @@ -59,6 +59,7 @@ contains ! execute snes solver call cmfd_snes_execute() +! call cmfd_slepc_execute() ! only run if master process if (master) then @@ -133,6 +134,44 @@ contains end subroutine cmfd_bcast +!=============================================================================== +! PETSC_INIT_MPI +!=============================================================================== +! +! subroutine petsc_init_mpi() +! +! integer :: new_comm ! new communicator +! integer :: orig_group ! original MPI group for MPI_COMM_WORLD +! integer :: new_group ! new MPI group subset of orig_group +! integer,allocatable :: ranks(:) ! ranks to include for petsc +! integer :: k ! iteration counter +! +! ! set ranks 0-6 or min +! if (n_procs >= 6) then +! if (.not. allocated(ranks)) allocate(ranks(0:5)) +! ranks = (/0,1,2,3,4,5/) +! else +! if (.not. allocated(ranks)) allocate(ranks(0:n_procs-1)) +! ranks = (/(k,k=0,n_procs-1)/) +! end if +! +! ! get the original mpi group +! call MPI_COMM_GROUP(MPI_COMM_WORLD,orig_group,mpi_err) +! +! ! new group init +! call MPI_GROUP_INCL(orig_group,size(ranks),ranks,new_group,mpi_err) +! +! ! create new communicator +! call MPI_COMM_CREATE(MPI_COMM_WORLD,new_group,new_comm,mpi_err) +! +! ! deallocate ranks +! if (allocated(ranks)) deallocate(ranks) +! +! ! set PETSC_COMM_WORLD to this subset +! PETSC_COMM_WORLD = new_comm +! +! end subroutine petsc_init_mpi + !=============================================================================== ! PETSC_INIT_MPI !=============================================================================== @@ -144,28 +183,31 @@ contains integer :: new_group ! new MPI group subset of orig_group integer,allocatable :: ranks(:) ! ranks to include for petsc integer :: k ! iteration counter + integer :: nprocs + + nprocs = 1 ! set ranks 0-6 or min - if (n_procs >= 6) then + if (nprocs >= 6) then if (.not. allocated(ranks)) allocate(ranks(0:5)) ranks = (/0,1,2,3,4,5/) else - if (.not. allocated(ranks)) allocate(ranks(0:n_procs-1)) - ranks = (/(k,k=0,n_procs-1)/) + if (.not. allocated(ranks)) allocate(ranks(0:nprocs-1)) + ranks = (/(k,k=0,nprocs-1)/) end if - + ! get the original mpi group call MPI_COMM_GROUP(MPI_COMM_WORLD,orig_group,mpi_err) - + ! new group init call MPI_GROUP_INCL(orig_group,size(ranks),ranks,new_group,mpi_err) - + ! create new communicator call MPI_COMM_CREATE(MPI_COMM_WORLD,new_group,new_comm,mpi_err) - + ! deallocate ranks if (allocated(ranks)) deallocate(ranks) - + ! set PETSC_COMM_WORLD to this subset PETSC_COMM_WORLD = new_comm diff --git a/src/cmfd_output.F90 b/src/cmfd_output.F90 index 3d67b9ed08..7f8eced2bf 100644 --- a/src/cmfd_output.F90 +++ b/src/cmfd_output.F90 @@ -339,11 +339,11 @@ contains end if ! write out cmfd eigenvector - dim1 = (/cmfd%mat_dim*cmfd%indices(4)/) - call h5screate_simple_f(1,dim1,dataspace_id,hdf5_err) + dim4 = (/ng,nx,ny,nz/) + call h5screate_simple_f(4,dim4,dataspace_id,hdf5_err) call h5dcreate_f(hdf5_output_file,trim(cycname)//"/cmfd_source", & & H5T_NATIVE_DOUBLE,dataspace_id,dataset_id,hdf5_err) - call h5dwrite_f(dataset_id,H5T_NATIVE_DOUBLE,cmfd%source,dim1,hdf5_err) + call h5dwrite_f(dataset_id,H5T_NATIVE_DOUBLE,cmfd%source,dim4,hdf5_err) call h5dclose_f(dataset_id,hdf5_err) ! write out openmc source vector diff --git a/src/cmfd_snes_solver.F90 b/src/cmfd_snes_solver.F90 index e55d1e40bf..d9e8d85609 100644 --- a/src/cmfd_snes_solver.F90 +++ b/src/cmfd_snes_solver.F90 @@ -138,7 +138,7 @@ contains call SNESSetLagPreconditioner(snes,-1,ierr) ! set convergence - call SNESSetTolerances(snes,1.0e-8_8,1.0e-8_8,1.0e-8_8,50,10000,ierr) +! call SNESSetTolerances(snes,1.0e-8_8,1.0e-8_8,1.0e-8_8,50,10000,ierr) ! set SNES options call SNESSetFromOptions(snes,ierr)