Multiprocessing and coupling

Discussion about coupled ecosystem models

Moderators: arango, robertson

Post Reply
Message
Author
pduarte
Posts: 10
Joined: Wed Sep 24, 2014 4:13 pm
Location: Norwegian Polar Institute

Multiprocessing and coupling

#1 Post by pduarte » Thu Sep 25, 2014 7:37 am

Hi,

I am just starting with ROMS and I am mostly interested in coupled physical-biogeochemical models. When running ROMS, is it only the main program that cycles through all grid cells and different tiles, when multiprocessing is used? Do the subroutines that calculate biological processes need to "know" the way the grid is divided and "care" about paralelization, or is this handled by the main program that launches several threads and in each of these each subroutine is concerned only with a specific part of the grid?
I am sorry for this confusing questions but I would like to couple some of my biological code with ROMS and I need to understand the implications on multiprocessing.

Pedro

User avatar
kate
Posts: 3695
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Multiprocessing and coupling

#2 Post by kate » Thu Sep 25, 2014 5:22 pm

ROMS supports both MPI and OpenMP for multi-processing. The main program loops over tiles only in the OpenMP world. In the MPI world, each process loops only on its own tile (i.e. a loop length of one). The best way to understand what's going on is to look at the code, especially the structure of calling say step3d_t, which in turn calls step3d_t_tile.

There are plenty of examples of ecosystem models in the ROMS/Nonlinear/Biology directory. I would copy one set in there and modify it according to your needs. For a full BGC model, my branch also has the CoSiNE model. Plus, Enrique Curchitser's lab is working to incorporate Cobalt - please contact them if you are interested. They spent some time on having the biology affect the light levels - something not in the standard ROMS.

cae
Posts: 29
Joined: Mon Jun 30, 2003 5:29 pm
Location: UC Santa Cruz

Re: Multiprocessing and coupling

#3 Post by cae » Fri Sep 26, 2014 3:19 am

Hi. Just to add to Kate's good advice:

In cases that I'm familiar with, the terms governing biological dynamics involve only local fields (e.g., uptake in a grid cell depends on nutrients and phytoplankton in that grid cell and not in a grid cell from somewhere across the ocean). If this is the case in your model, then you don't have to worry about the tiling and parallelization. Within the biological model subroutine, loops extend horizontally and vertically, but almost all the operations are local. Calculating light levels and sinking are exceptions that require information from above, but that's all right because each column of the model is on the same tile. Horizontal advection and diffusion, which do depend on horizontally separated information are carried out in other subroutines, so you don't have to worry about them.

Post Reply