Skip to content

Commit

Permalink
Remove be_verbose option from the process grid
Browse files Browse the repository at this point in the history
Since it was doing nothing
  • Loading branch information
william-dawson committed Aug 27, 2024
1 parent a963d8b commit e4abccf
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 67 deletions.
9 changes: 3 additions & 6 deletions Source/C/ProcessGrid_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
void ConstructGlobalProcessGrid_wrp(const int *world_comm,
const int *process_rows,
const int *process_columns,
const int *process_slices,
const bool *be_verbose);
const int *process_slices);
void ConstructGlobalProcessGrid_onlyslice_wrp(const int *world_comm,
const int *process_slices,
const bool *be_verbose);
void ConstructGlobalProcessGrid_default_wrp(const int *world_comm,
const bool *be_verbose);
const int *process_slices);
void ConstructGlobalProcessGrid_default_wrp(const int *world_comm);
void CopyProcessGrid_wrp(const int *ih_old_grid, int *ih_new_grid);
int GetGlobalMySlice_wrp();
int GetGlobalMyColumn_wrp();
Expand Down
24 changes: 10 additions & 14 deletions Source/CPlusPlus/ProcessGrid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,40 +73,36 @@ ProcessGrid::~ProcessGrid() { DestructProcessGrid_wrp(ih_this); }

////////////////////////////////////////////////////////////////////////////////
void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_rows,
int process_columns, int process_slices,
bool be_verbose) {
int process_columns, int process_slices) {
MPI_Fint temp_comm = MPI_Comm_c2f(world_comm);
ConstructGlobalProcessGrid_wrp(&temp_comm, &process_rows, &process_columns,
&process_slices, &be_verbose);
&process_slices);
}

////////////////////////////////////////////////////////////////////////////////
void ConstructGlobalProcessGrid(int process_rows, int process_columns,
int process_slices, bool be_verbose) {
int process_slices) {
MPI_Fint temp_comm = MPI_Comm_c2f(MPI_COMM_WORLD);
ConstructGlobalProcessGrid_wrp(&temp_comm, &process_rows, &process_columns,
&process_slices, &be_verbose);
&process_slices);
}

////////////////////////////////////////////////////////////////////////////////
void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices,
bool be_verbose) {
void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices) {
MPI_Fint temp_comm = MPI_Comm_c2f(world_comm);
ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices,
&be_verbose);
ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices);
}

////////////////////////////////////////////////////////////////////////////////
void ConstructGlobalProcessGrid(int process_slices, bool be_verbose) {
void ConstructGlobalProcessGrid(int process_slices) {
MPI_Fint temp_comm = MPI_Comm_c2f(MPI_COMM_WORLD);
ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices,
&be_verbose);
ConstructGlobalProcessGrid_onlyslice_wrp(&temp_comm, &process_slices);
}

////////////////////////////////////////////////////////////////////////////////
void ConstructGlobalProcessGrid(bool be_verbose) {
void ConstructGlobalProcessGrid() {
MPI_Fint temp_comm = MPI_Comm_c2f(MPI_COMM_WORLD);
ConstructGlobalProcessGrid_default_wrp(&temp_comm, &be_verbose);
ConstructGlobalProcessGrid_default_wrp(&temp_comm);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
17 changes: 5 additions & 12 deletions Source/CPlusPlus/ProcessGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,24 @@ class ProcessGrid {
//! \param[in] process_rows number of grid rows.
//! \param[in] process_columns number of grid columns.
//! \param[in] process_slices number of grid slices.
//! \param[in] be_verbose verbosity flag.
void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_rows,
int process_columns, int process_slices,
bool be_verbose = false);
int process_columns, int process_slices);
//! Construct the global process grid from comm world
//! \param[in] process_rows number of grid rows.
//! \param[in] process_columns number of grid columns.
//! \param[in] process_slices number of grid slices.
//! \param[in] be_verbose verbosity flag.
void ConstructGlobalProcessGrid(int process_rows, int process_columns,
int process_slices, bool be_verbose = false);
int process_slices);
//! Construct the global process grid.
//! \param[in] world_comm a communicator that every process in the grid is
//! a part of.
//! \param[in] process_slices number of grid slices.
//! \param[in] be_verbose verbosity flag.
void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices,
bool be_verbose = false);
void ConstructGlobalProcessGrid(MPI_Comm world_comm, int process_slices);
//! Construct the global process grid from comm world
//! \param[in] process_slices number of grid slices.
//! \param[in] be_verbose verbosity flag.
void ConstructGlobalProcessGrid(int process_slices, bool be_verbose = false);
void ConstructGlobalProcessGrid(int process_slices);
//! Construct the global process grid from comm world
//! \param[in] be_verbose verbosity flag.
void ConstructGlobalProcessGrid(bool be_verbose = false);
void ConstructGlobalProcessGrid();
//! Get the slice of the current process.
int GetGlobalMySlice();
//! Get the column of the current process.
Expand Down
27 changes: 3 additions & 24 deletions Source/Fortran/ProcessGridModule.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ MODULE ProcessGridModule
CONTAINS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Setup the default process grid.
SUBROUTINE ConstructProcessGrid_full(world_comm, process_rows, &
& process_columns, process_slices, be_verbose_in)
& process_columns, process_slices)
!> A communicator that every process in the grid is a part of.
INTEGER, INTENT(IN) :: world_comm
!> The number of grid rows.
Expand All @@ -91,33 +91,18 @@ SUBROUTINE ConstructProcessGrid_full(world_comm, process_rows, &
INTEGER, INTENT(IN) :: process_columns
!> The number of grid slices.
INTEGER, INTENT(IN) :: process_slices
!> Set true to print process grid info.
LOGICAL, INTENT(IN), OPTIONAL :: be_verbose_in
!! Local Data
LOGICAL :: be_verbose

!! Process Optional Parameters
IF (PRESENT(be_verbose_in)) THEN
be_verbose = be_verbose_in
ELSE
be_verbose = .FALSE.
END IF

CALL ConstructNewProcessGrid(global_grid, world_comm, process_rows, &
& process_columns, process_slices)
END SUBROUTINE ConstructProcessGrid_full
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Setup a process grid specifying only the slices
SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in, &
& be_verbose_in)
SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in)
!> A communicator that every process in the grid is a part of.
INTEGER, INTENT(IN) :: world_comm
!> The number of grid slices.
INTEGER, INTENT(IN), OPTIONAL :: process_slices_in
!> Set true to print process grid info.
LOGICAL, INTENT(IN), OPTIONAL :: be_verbose_in
!! Local Data
LOGICAL :: be_verbose
INTEGER :: process_rows, process_columns, process_slices
INTEGER :: total_processors
INTEGER :: ierr
Expand All @@ -126,12 +111,6 @@ SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in, &
CALL MPI_COMM_SIZE(world_comm, total_processors, ierr)

!! Process Optional Parameters
IF (PRESENT(be_verbose_in)) THEN
be_verbose = be_verbose_in
ELSE
be_verbose = .FALSE.
END IF

IF (PRESENT(process_slices_in)) THEN
process_slices = process_slices_in
ELSE
Expand All @@ -144,7 +123,7 @@ SUBROUTINE ConstructProcessGrid_onlyslice(world_comm, process_slices_in, &

!! Now call the full setup
CALL ConstructProcessGrid(world_comm, process_rows, process_columns, &
& process_slices, be_verbose)
& process_slices)
END SUBROUTINE ConstructProcessGrid_onlyslice
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Construct a process grid.
Expand Down
16 changes: 6 additions & 10 deletions Source/Wrapper/ProcessGridModule_wrp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,30 @@ MODULE ProcessGridModule_wrp
CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Wrap the process grid construction routine.
SUBROUTINE ConstructGlobalProcessGrid_wrp(world_comm_, process_rows_, &
& process_columns_, process_slices_, be_verbose) &
& process_columns_, process_slices_) &
& BIND(c,name="ConstructGlobalProcessGrid_wrp")
INTEGER(kind=c_int), INTENT(IN) :: world_comm_
INTEGER(kind=c_int), INTENT(IN) :: process_rows_
INTEGER(kind=c_int), INTENT(IN) :: process_columns_
INTEGER(kind=c_int), INTENT(IN) :: process_slices_
LOGICAL(kind=c_bool), INTENT(IN) :: be_verbose
CALL ConstructProcessGrid(world_comm_, process_rows_, process_columns_, &
& process_slices_, LOGICAL(be_verbose))
& process_slices_)
END SUBROUTINE ConstructGlobalProcessGrid_wrp
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Wrap the process grid construction routine.
SUBROUTINE ConstructGlobalProcessGrid_onlyslice_wrp(world_comm_, &
& process_slices_, be_verbose) &
& process_slices_) &
& BIND(c,name="ConstructGlobalProcessGrid_onlyslice_wrp")
INTEGER(kind=c_int), INTENT(IN) :: world_comm_
INTEGER(kind=c_int), INTENT(IN) :: process_slices_
LOGICAL(kind=c_bool), INTENT(IN) :: be_verbose
CALL ConstructProcessGrid(world_comm_, process_slices_in=process_slices_, &
& be_verbose_in=LOGICAL(be_verbose))
CALL ConstructProcessGrid(world_comm_, process_slices_in=process_slices_)
END SUBROUTINE ConstructGlobalProcessGrid_onlyslice_wrp
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Wrap the process grid construction routine.
SUBROUTINE ConstructGlobalProcessGrid_default_wrp(world_comm_, be_verbose) &
SUBROUTINE ConstructGlobalProcessGrid_default_wrp(world_comm_) &
& BIND(c,name="ConstructGlobalProcessGrid_default_wrp")
INTEGER(kind=c_int), INTENT(IN) :: world_comm_
LOGICAL(kind=c_bool), INTENT(IN) :: be_verbose
CALL ConstructProcessGrid(world_comm_, be_verbose_in=LOGICAL(be_verbose))
CALL ConstructProcessGrid(world_comm_)
END SUBROUTINE ConstructGlobalProcessGrid_default_wrp
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Get the slice of the current process.
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/test_chemistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def setUpClass(self):
rows = int(environ['PROCESS_ROWS'])
columns = int(environ['PROCESS_COLUMNS'])
slices = int(environ['PROCESS_SLICES'])
nt.ConstructGlobalProcessGrid(rows, columns, slices, True)
nt.ConstructGlobalProcessGrid(rows, columns, slices)

@classmethod
def tearDownClass(self):
Expand Down

0 comments on commit e4abccf

Please sign in to comment.