-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There is now only one executable being built: either cable-mpi or cable, depending if MPI support is available or not. When MPI support is available, the code will now automatically run the serial driver if using only one MPI process, instead of stopping with an error like before.
- Loading branch information
1 parent
823cc89
commit 1249c60
Showing
21 changed files
with
107 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
! twice per timestep in the ACCESS case. Not all parts of cbm | ||
! are executed in each of the ACCESS calls. | ||
! | ||
! Called from: cable_driver for offline version | ||
! Called from: cable_serial for offline version | ||
! cable_explicit_driver, cable_implicit_driver for ACCESS | ||
! | ||
! Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
! CSIRO Open Source Software License Agreement (variation of the BSD / MIT License) | ||
! Copyright (c) 2015, Commonwealth Scientific and Industrial Research Organisation | ||
! (CSIRO) ABN 41 687 119 230. | ||
|
||
MODULE cable_mpimaster | ||
!! Stub for the master driver when MPI is not available. | ||
IMPLICIT NONE | ||
|
||
PRIVATE | ||
PUBLIC :: mpidrv_master | ||
|
||
CONTAINS | ||
|
||
SUBROUTINE mpidrv_master(comm) | ||
!! Stub for when MPI is not available | ||
INTEGER, INTENT(IN) :: comm | ||
|
||
! This should never be called! | ||
STOP | ||
|
||
END SUBROUTINE mpidrv_master | ||
|
||
END MODULE cable_mpimaster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
! CSIRO Open Source Software License Agreement (variation of the BSD / MIT License) | ||
! Copyright (c) 2015, Commonwealth Scientific and Industrial Research Organisation | ||
! (CSIRO) ABN 41 687 119 230. | ||
|
||
MODULE cable_mpiworker | ||
!! Stub for the worker driver when MPI is not available. | ||
IMPLICIT NONE | ||
|
||
PRIVATE | ||
PUBLIC :: mpidrv_worker | ||
|
||
CONTAINS | ||
|
||
SUBROUTINE mpidrv_worker(comm) | ||
!! Stub for when MPI is not available | ||
INTEGER, INTENT(IN) :: comm | ||
|
||
! This should never be called! | ||
STOP | ||
|
||
END SUBROUTINE mpidrv_worker | ||
|
||
END MODULE cable_mpiworker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,10 @@ | |
! A copy of the License (CSIRO_BSD_MIT_License_v2.0_CABLE.txt) is located | ||
! in each directory containing CABLE code. | ||
! | ||
! ============================================================================== | ||
! Purpose: Bare bones MPI driver for CABLE | ||
! | ||
! Contact: [email protected] | ||
! | ||
! History: MPI wrapper developed by Maciej Golebiewski (2012) | ||
! | ||
! ============================================================================== | ||
! | ||
PROGRAM mpi_driver | ||
USE mpi | ||
USE cable_mpi_mod, ONLY : mpi_grp_t, mpi_mod_init, mpi_mod_end, mpi_check_error | ||
PROGRAM cable_offline_driver | ||
USE cable_mpi_mod, ONLY : mpi_grp_t, mpi_mod_init, mpi_mod_end | ||
USE cable_driver_init_mod | ||
|
||
USE cable_serial | ||
USE cable_mpimaster | ||
USE cable_mpiworker | ||
|
||
|
@@ -35,20 +25,19 @@ PROGRAM mpi_driver | |
|
||
CALL cable_driver_init(mpi_grp) | ||
|
||
IF (mpi_grp%size < 2) THEN | ||
WRITE(*,*) 'This program needs at least 2 processes to run!' | ||
CALL mpi_grp%abort() | ||
END IF | ||
|
||
IF (mpi_grp%rank == 0) THEN | ||
CALL mpidrv_master (mpi_grp%comm) | ||
IF (mpi_grp%size == 1) THEN | ||
CALL serialdrv() | ||
ELSE | ||
CALL mpidrv_worker (mpi_grp%comm) | ||
IF (mpi_grp%rank == 0) THEN | ||
CALL mpidrv_master(mpi_grp%comm) | ||
ELSE | ||
CALL mpidrv_worker(mpi_grp%comm) | ||
END IF | ||
END IF | ||
|
||
CALL mpi_mod_end() | ||
|
||
CALL CPU_TIME(etime) | ||
PRINT *, 'Finished. ', etime, ' seconds needed for ' | ||
|
||
END PROGRAM mpi_driver | ||
END PROGRAM cable_offline_driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
! Purpose: | ||
! sumcflux - accumulating carbon fluxes (not required for UM) | ||
! | ||
! Called from: cable_driver for offline version | ||
! Called from: cable_serial for offline version | ||
! Not currently called/available for ACCESS version | ||
! | ||
! Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
! twice per timestep in the ACCESS case. Not all parts of cbm | ||
! are executed in each of the ACCESS calls. | ||
! | ||
! Called from: cable_driver for offline version | ||
! Called from: cable_serial for offline version | ||
! cable_explicit_driver, cable_implicit_driver for ACCESS | ||
! | ||
! Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
! Purpose: bgcdriver - interface between casacnp and cable | ||
! sumcflux - accumulating carbon fluxes (not required for UM) | ||
! | ||
! Called from: cable_driver for offline version | ||
! Called from: cable_serial for offline version | ||
! Not currently called/available for ACCESS version | ||
! | ||
! Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
! Purpose: bgcdriver - interface between casacnp and cable | ||
! sumcflux - accumulating carbon fluxes (not required for UM) | ||
! | ||
! Called from: cable_driver for offline version | ||
! Called from: cable_serial for offline version | ||
! Not currently called/available for ACCESS version | ||
! | ||
! Contact: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters