Skip to content
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

CoastalApp: ParMETIS #138

Closed
pvelissariou1 opened this issue Oct 5, 2022 · 2 comments
Closed

CoastalApp: ParMETIS #138

pvelissariou1 opened this issue Oct 5, 2022 · 2 comments
Assignees

Comments

@pvelissariou1
Copy link
Collaborator

No description provided.

@pvelissariou1 pvelissariou1 self-assigned this Oct 5, 2022
@pvelissariou1
Copy link
Collaborator Author

pvelissariou1 commented Oct 5, 2022

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 (fixed bug of missing braces in 'if' blocks KarypisLab/ParMETIS#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:

  • WW3/model/bin/w3_make: modify the line esmfpdlib=... as follows:
    from: esmfpdlib="$METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a"
    to: esmfpdlib="$METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a $METIS_PATH/lib/GKlib.a"
  • WW3/model/bin/link.tmpl: modify the line libs="$libs $METIS_PATH ... as follows:
    from: libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a"
    to: libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a $METIS_PATH/lib/GKlib.a"

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants