noaa-ocs-modeling / CoastalApp

CoastalApp will be deprecated. Please switch to https://github.com/oceanmodeling/ufs-coastal . CoastalApp is a NUOPC application implemented following UFS best practices to couple coastal ocean models and other domains (Sea Ice, Atmosphere, Wave, Inland Hydrology, ...)
https://github.com/oceanmodeling/ufs-coastal
Creative Commons Zero v1.0 Universal
13 stars 30 forks source link

CoastalApp: ParMETIS #138

Closed pvelissariou1 closed 1 year ago

pvelissariou1 commented 1 year ago

This is for reference.

Using ParMETIS from GitHub: https://github.com/KarypisLab/ParMETIS.git

CoastalApp can use ParMETIS as a thirdparty_open library per user request. The application does not ship with ParMETIS due to licensing issues. This library does not compile out of the box (especially for Intel compilers) due to minor code issues (fixed) and required compiler flags.

1) Created a PR to ParMETIS (https://github.com/KarypisLab/ParMETIS/pull/18) that fixes the bug of missing braces in 'if' blocks. The fixed ParMETIS is pulled in CoastalApp from my fork: https://github.com/pvelissariou1/ParMETIS 2) Compiled the library using the flag: CFLAGS=-D_POSIX_C_SOURCE=199309L, this is required for Intel/GNU (latest) compilations.

Check the function compileMetis in scripts/functions_build

The latest versions of ParMETIS split the individual libraries parmetis/metis/GKlib so when linking the user should supply all these libraries as follows: ${METIS_PATH}/lib/libparmetis.a ${METIS_PATH}/lib/libmetis.a ${METIS_PATH}/lib/libGKlib.a

SCHISM: I have written the FindParMETIS.cmake module to either incorporate the internal parametis or to use an externally compiled ParMETIS. This is already incorporated in SCHISM.

WW3: If using the latest version of ParMETIS the following modifications are required:

NOTE1: The user can copy an older version of ParMETIS (say version 4.0.3) into the thirdparty_open and the CoastalApp build.sh script will build the library. If this version is used, then the above modifications for WW3 are not required. NOTE2: To download ParMETIS and its related libraries in CoastalApp the user should run the script: scripts/download_parmetis.sh. The library will be stored into the thirdparty_open folder.

platipodium commented 1 year ago

Tested on femto/intel and my ubuntu/gcc system successfully. Thx.