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

Add support for traditional threading #2533

Closed
wants to merge 4 commits into from

Conversation

DusanJovic-NOAA
Copy link
Collaborator

Commit Queue Requirements:

  • Fill out all sections of this template.
  • All sub component pull requests have been reviewed by their code managers.
  • Run the full Intel+GNU RT suite (compared to current baselines) on either Hera/Derecho/Hercules
  • [] Commit 'test_changes.list' from previous step

Description:

This PR adds support for traditional (non esmf managed) threading. Currently, all '2threads' tests have been converted to traditional threading. ESMF managed threading is still the default.

To use tradition threading, set ESMF_THREADING=false in test's configuration file and set THRD to number of threads, for example:

$ cat tests/cpld_2threads_p8
. . . 
ESMF_THREADING=false
THRD=$THRD_cpl_thrd

Many tests had two versions of ufs.configure templates (_esmf.IN and the version without _esmf) with the only difference being the value of globalResourceControl:, true for esmf and false for non-esmf threading. Those are now unified in a single ufs.configure template.

Commit Message:

* UFSWM - This PR adds support for traditional (non esmf managed) threading. ESMF managed threading is still default.

Priority:

  • Normal

Git Tracking

UFSWM:

Sub component Pull Requests:

  • None

UFSWM Blocking Dependencies:

  • None

Changes

Regression Test Changes (Please commit test_changes.list):

  • No Baseline Changes.

Input data Changes:

  • None.

Library Changes/Upgrades:

  • No Updates

Testing Log:

  • RDHPCS
    • Hera
    • Orion
    • Hercules
    • Jet
    • Gaea
    • Derecho
  • WCOSS2
    • Dogwood/Cactus
    • Acorn
  • CI
  • opnReqTest (complete task if unnecessary)

Use this variable to turn on writing histaux files every MED_history_n.
By default it is .false.
Currently only cpld_control_nowave_noaero_p8 test has it turned on.
@NickSzapiro-NOAA
Copy link
Collaborator

Does traditional threading require one value of #threads per node?

If yes, I'm not sure these lines in rt.sh and run_test.sh work when components under-fill nodes

TPN=$(( TPN / THRD ))
NODES=$(( TASKS / TPN ))
if (( NODES * TPN < TASKS )); then
  NODES=$(( NODES + 1 ))
fi
PPN=$(( TASKS / NODES ))
if (( TASKS - ( PPN * NODES ) > 0 )); then
  PPN=$((PPN + 1))
fi

and maybe compute_petbounds_and_task functions could export NODES too

@DusanJovic-NOAA
Copy link
Collaborator Author

Does traditional threading require one value of #threads per node?

If yes, I'm not sure these lines in rt.sh and run_test.sh work when components under-fill nodes

TPN=$(( TPN / THRD ))
NODES=$(( TASKS / TPN ))
if (( NODES * TPN < TASKS )); then
  NODES=$(( NODES + 1 ))
fi
PPN=$(( TASKS / NODES ))
if (( TASKS - ( PPN * NODES ) > 0 )); then
  PPN=$((PPN + 1))
fi

and maybe compute_petbounds_and_task functions could export NODES too

I am not sure what you mean by '#threads per node'. Are you referring to TPN variable? TPN is a number of (MPI) tasks per node, which is initially set to be equal to the number of physical cores on a given platform, 80 on Hercules, 40 on Hera, 128 on WCOSS2 etc. Then it is divided by number of threads (THRD) to avoid having multiple threads running on the same physical core. Once we have tasks per node (TPN) and total number of tasks (TASKS), we compute the number of nodes (NODES). That is done in this block:

TPN=$(( TPN / THRD ))
NODES=$(( TASKS / TPN ))
if (( NODES * TPN < TASKS )); then
  NODES=$(( NODES + 1 ))
fi

the following block:

PPN=$(( TASKS / NODES ))
if (( TASKS - ( PPN * NODES ) > 0 )); then
  PPN=$((PPN + 1))
fi

has been added for 'derecho support', although I never fully understood why that was needed and what is special about Derecho to require it.

NickSzapiro-NOAA added a commit to NickSzapiro-NOAA/ufs-weather-model that referenced this pull request Dec 19, 2024
jkbk2004 pushed a commit that referenced this pull request Dec 23, 2024
…eading (#2533) (#2538)

* UFSWM - This PR adds support for traditional (non esmf managed) threading. ESMF managed threading is still default.
* UFSWM - Sync with ESCOMP/CDEPS (2024-12-16)
  * CDEPS - Sync with ESCOMP/CDEPS (2024-12-16)
---------

Co-authored-by: Dusan Jovic <dusan.jovic@noaa.gov>
@jkbk2004
Copy link
Collaborator

merged with #2538

@jkbk2004 jkbk2004 closed this Dec 23, 2024
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

Successfully merging this pull request may close these issues.

Set traditional threading as default
3 participants