Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set total number of parcels before parcel_communicate #567

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mpi-tests/benchmark_parcel_merging.f90
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ program benchmark_parcel_merging

call setup_parcels(xlen, ylen, zlen, l_shuffle, l_variable_nppc)

call parcel_communicate

call stop_timer(generate_timer)

n_total_parcels = 0
Expand All @@ -85,6 +83,10 @@ program benchmark_parcel_merging
world%comm, &
world%err)

call parcel_communicate

call stop_timer(allreduce_timer)

if (world%rank == world%root) then
print *, "Number of parcels before merging:", n_total_parcels
endif
Expand Down
2 changes: 1 addition & 1 deletion src/3d/parcels/parcel_container.f90
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ subroutine parcel_deserialize(n, buffer)
#ifndef ENABLE_DRY_MODE
parcels%humidity(n) = buffer(IDX_HUM)
#endif
#ifndef ENABLE_DRY_MODE
#ifdef ENABLE_LABELS
parcels%label(n) = nint(buffer(IDX_LABEL))
parcels%dilution(n) = buffer(IDX_DILUTION)
#endif
Expand Down
12 changes: 7 additions & 5 deletions src/3d/parcels/parcel_netcdf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ module parcel_netcdf

#ifndef ENABLE_DRY_MODE
integer, parameter :: NC_HUM = 19

#ifdef ENABLE_LABELS
integer, parameter :: NC_LABEL = 20 &
integer, parameter :: NC_LABEL = 20 &
, NC_DILUTION = 21

type(netcdf_info) :: nc_dset(NC_DILUTION)
#else
type(netcdf_info) :: nc_dset(NC_HUM)
Expand All @@ -75,9 +75,9 @@ module parcel_netcdf
#else

#ifdef ENABLE_LABELS
integer, parameter :: NC_LABEL = 19 &
integer, parameter :: NC_LABEL = 19 &
, NC_DILUTION = 20

type(netcdf_info) :: nc_dset(NC_DILUTION)
#else
type(netcdf_info) :: nc_dset(NC_B23)
Expand Down Expand Up @@ -340,6 +340,7 @@ subroutine write_parcel_attribute(id, pdata, start, cnt)
endif
end subroutine write_parcel_attribute

#ifdef ENABLE_LABELS
subroutine write_parcel_attribute_int(id, pdata, start, cnt)
integer, intent(in) :: id
integer(kind=8), intent(in) :: pdata(:)
Expand All @@ -351,6 +352,7 @@ subroutine write_parcel_attribute_int(id, pdata, start, cnt)
start, cnt)
endif
end subroutine write_parcel_attribute_int
#endif

!::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down