-
Notifications
You must be signed in to change notification settings - Fork 68
Branch of fesom2.6 including recom and tracer parallelisation #681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 40 commits
6eb2eef
3e84a88
434f0e6
0864237
a3dfd9f
911fd3c
358082d
0d3834a
74a5e59
e8117d8
604a88a
cb11456
dd22697
076bc71
9f3c6d6
9e17e15
4a053a9
45d7fd3
8283c1b
4f01ed8
6f37080
ade5fd9
132066d
17cc3b1
26957ba
9247ca4
4da69a2
fc517d5
6e73322
bbcb3fe
96532bf
ef3a7a5
b1e140b
283ba53
e2b7408
37d16f9
d305c3d
5b05ce6
732509a
f78e7fd
60a118c
35c815c
360d224
2804139
67475c1
9a03b2d
b42fbbd
a8b6eb5
7ec55f2
db9d64c
ed36284
f04fabf
e07391f
40431c5
0d44a2a
53fc830
b914046
206b4d9
0a5cb63
c78a72a
2dc8828
34e9e21
fb8f1dd
1dc0f84
53c45ed
760ebc7
aa514b1
a8cf488
15dd785
3737859
7e41192
7b119ff
d7654e5
fc84f04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,10 @@ module cpl_driver | |
| ! | ||
| use mod_oasis ! oasis module | ||
| use g_config, only : dt, use_icebergs, lwiso, compute_oasis_corners | ||
| #if defined(__recom) && defined(__usetp) | ||
| use g_config, only : num_fesom_groups | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this only relevant to tracer parallelization independent of recom? |
||
| #endif | ||
|
|
||
| use o_param, only : rad | ||
| USE MOD_PARTIT | ||
| use mpi | ||
|
|
@@ -60,11 +64,11 @@ module cpl_driver | |
| integer :: commRank | ||
| integer :: comp_id ! id returned by oasis_init_comp | ||
|
|
||
| logical, save :: oasis_was_initialized | ||
| logical, save :: oasis_was_terminated | ||
| integer, save :: write_grid | ||
| logical :: oasis_was_initialized | ||
| logical :: oasis_was_terminated | ||
| integer :: write_grid | ||
|
|
||
| integer, save :: seconds_til_now=0 | ||
| integer :: seconds_til_now=0 | ||
| integer :: ierror ! return error code | ||
| logical :: rootexchg =.true. ! logical switch | ||
|
|
||
|
|
@@ -311,7 +315,12 @@ subroutine node_contours(my_x_corners, my_y_corners, partit, mesh) | |
| my_y_corners=my_y_corners/rad | ||
| end subroutine node_contours | ||
|
|
||
| subroutine cpl_oasis3mct_init(partit, localCommunicator ) | ||
| #if defined(__recom) && defined(__usetp) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this for recom or tracer parallization or both need to be defined? |
||
| subroutine cpl_oasis3mct_init(partit, localCommunicator, num_fesom_groups) | ||
| #else | ||
| subroutine cpl_oasis3mct_init(partit, localCommunicator) | ||
| #endif | ||
|
|
||
| USE MOD_PARTIT | ||
| implicit none | ||
| save | ||
|
|
@@ -325,6 +334,9 @@ subroutine cpl_oasis3mct_init(partit, localCommunicator ) | |
| ! | ||
| integer, intent(OUT) :: localCommunicator | ||
| type(t_partit), intent(inout), target :: partit | ||
| #if defined(__recom) && defined(__usetp) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can it also be seperated recom and tracer parallelization? |
||
| integer, intent(inout) :: num_fesom_groups | ||
| #endif | ||
| ! | ||
| ! Local declarations | ||
| ! | ||
|
|
@@ -346,7 +358,11 @@ subroutine cpl_oasis3mct_init(partit, localCommunicator ) | |
| !------------------------------------------------------------------ | ||
| ! 1st Initialize the OASIS3-MCT coupling system for the application | ||
| !------------------------------------------------------------------ | ||
| #if defined(__recom) && defined(__usetp) | ||
| CALL oasis_init_comp(comp_id, comp_name, ierror, num_program_groups = num_fesom_groups) | ||
| #else | ||
| CALL oasis_init_comp(comp_id, comp_name, ierror ) | ||
| #endif | ||
| IF (ierror /= 0) THEN | ||
| CALL oasis_abort(comp_id, 'cpl_oasis3mct_init', 'Init_comp failed.') | ||
| ENDIF | ||
|
|
@@ -357,7 +373,11 @@ subroutine cpl_oasis3mct_init(partit, localCommunicator ) | |
| CALL oasis_abort(comp_id, 'cpl_oasis3mct_init', 'comm_rank failed.') | ||
| ENDIF | ||
|
|
||
| #if defined(__recom) && defined(__usetp) | ||
| CALL oasis_get_localcomm_all_groups( localCommunicator, ierror ) | ||
| #else | ||
| CALL oasis_get_localcomm( localCommunicator, ierror ) | ||
| #endif | ||
| IF (ierror /= 0) THEN | ||
| CALL oasis_abort(comp_id, 'cpl_oasis3mct_init', 'get_local_comm failed.') | ||
| ENDIF | ||
|
|
@@ -611,6 +631,10 @@ subroutine cpl_oasis3mct_define_unstr(partit, mesh) | |
| print *, 'FESOM after Barrier' | ||
| endif | ||
|
|
||
| #if defined(__recom) && defined(__usetp) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only for tp? |
||
| if(partit%my_fesom_group == 0) then | ||
| #endif | ||
|
|
||
| if (mype .eq. localroot) then | ||
| print *, 'FESOM before grid writing to oasis grid files' | ||
| CALL oasis_start_grids_writing(il_flag) | ||
|
|
@@ -639,6 +663,9 @@ subroutine cpl_oasis3mct_define_unstr(partit, mesh) | |
| print *, 'FESOM after terminate_grids_writing' | ||
| endif !localroot | ||
|
|
||
| #if defined(__recom) && defined(__usetp) | ||
| end if !(partit%my_fesom_group == 0) then | ||
| #endif | ||
|
|
||
|
|
||
| DEALLOCATE(all_x_coords, all_y_coords, my_x_coords, my_y_coords, displs_from_all_pes, counts_from_all_pes) | ||
|
|
@@ -893,7 +920,7 @@ subroutine cpl_oasis3mct_recv(ind, data_array, action, partit) | |
| ! | ||
| integer :: info | ||
| integer :: j | ||
| integer, save :: ncount = 0 | ||
| integer :: ncount = 0 | ||
| real (kind=WP) :: t1, t2, t3 | ||
| ! | ||
| !-------------------------------------------------------------------- | ||
|
|
@@ -909,15 +936,49 @@ subroutine cpl_oasis3mct_recv(ind, data_array, action, partit) | |
| endif | ||
| #endif | ||
|
|
||
| #if defined(__recom) && defined(__usetp) | ||
| ! the coupling is in principle as it was before, i.e. the fesom processes - in group 0 - receive their data from echam | ||
| if(partit%my_fesom_group == 0) then | ||
| #endif | ||
|
|
||
| call oasis_get(recv_id(ind), seconds_til_now, exfld,info) | ||
|
|
||
| #if defined(__recom) && defined(__usetp) | ||
| else | ||
|
|
||
| ! defensive: assignment statement "action=(info==3 ..." below is "don't care" in this case, because the actual value for action | ||
| ! is received via MPI_Bcast anyway | ||
| info = 0 | ||
|
|
||
| end if | ||
| #endif | ||
|
|
||
| t2=MPI_Wtime() | ||
| ! | ||
| ! FESOM's interpolation routine interpolates structured | ||
| ! VarStrLoc coming from OASIS3MCT to local unstructured data_array | ||
| ! and delivered back to FESOM. | ||
| action=(info==3 .OR. info==10 .OR. info==11 .OR. info==12 .OR. info==13) | ||
|
|
||
| #if defined(__recom) && defined(__usetp) | ||
| if(num_fesom_groups > 1) then | ||
| call MPI_Bcast(action, 1, MPI_LOGICAL, 0, partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, partit%MPIerr) | ||
| end if | ||
| #endif | ||
|
|
||
| if (action) then | ||
| #if defined(__recom) && defined(__usetp) | ||
| if(partit%my_fesom_group == 0) then | ||
| #endif | ||
| data_array(1:partit%myDim_nod2d) = exfld | ||
| #if defined(__recom) && defined(__usetp) | ||
| end if | ||
|
|
||
| if(num_fesom_groups > 1) then | ||
| call MPI_Bcast(data_array, partit%myDim_nod2d, MPI_DOUBLE_PRECISION, 0, partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, partit%MPIerr) | ||
| end if | ||
| #endif | ||
|
|
||
| call exchange_nod(data_array, partit) | ||
| end if | ||
| t3=MPI_Wtime() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be done before more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to clarify with Özgür
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ogurses ?