-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* demostration of imcalc issue * remove final product * Suggested fix for imcalc issue: a new function that makes a non-crow copy of crow objects in an entire object tree. The resulting python object tree can be written via to_yaml without any !tags * Bug fix in JobRankSpec: raise AttributeError in __getattr__ instead of KeyError * Add an !icalc type which is just a shortcut for !Immediate [ !calc "..." ] * remove some debugging junk * add yaml representers for dict_eval and list_eval * use !icalc in the imcalc test * adjust worktools.py for resource tuning
- Loading branch information
1 parent
f55588a
commit c85dfa5
Showing
13 changed files
with
256 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
platform_common: &global_platform_common | ||
Evaluate: False | ||
default_resources: {} | ||
|
||
partition_common: &global_partition_common | ||
Evaluate: False | ||
resources: !MergeMapping | ||
- !calc doc.default_resources | ||
- !calc doc.case.get('resources',{}) | ||
- !calc doc.resources_sum | ||
|
||
default_resources: {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
# This file configures the workflow to run on the cray parts of WCOSS | ||
|
||
platform: !Platform | ||
<<: *global_platform_common | ||
|
||
# Evaluate: this must be "false" to ensure disk space availability logic | ||
# is not run unless this file is for the current platform. | ||
Evaluate: false | ||
|
||
# name: the name of this platform; this must match what the underlying | ||
# scripts expect. | ||
name: sandbox | ||
|
||
# detect: this is a function that returns true iff the user is on GAEA | ||
# and false otherwise | ||
detect: True | ||
|
||
# skip_if_others_present: if this is true, and at least one other | ||
# platform is detected with this flag set to false, then skip this | ||
# platform | ||
skip_if_others_present: true | ||
|
||
# public_release_ics: location of input conditions that have been | ||
# prepared for the public release. | ||
public_release_ics: /gpfs/hps3/emc/global/noscrub/emc.glopara/FV3GFS_V1_RELEASE/ICs | ||
|
||
# CHGRP_RSTPROD_COMMAND - this specifies the command to use to | ||
# restrict access to NOAA "rstprod" data restriction class. | ||
# This only used for observation processing, data assimilation, and | ||
# data assimilation archiving, which are not in the public release. | ||
CHGRP_RSTPROD_COMMAND: "chgrp rstprod" | ||
|
||
# NWPROD - location of the NCEP operational "nwprod" directory, which | ||
# only has meaning on the NCEP WCOSS machines. It is used to get | ||
# the paths to certain programs and scripts. | ||
NWPROD: "/gpfs/hps/nco/ops/nwprod" | ||
|
||
# DMPDIR - location of the global dump data. This is used by the observation | ||
# processing scripts, which are not included in the public release. | ||
DMPDIR: !calc doc.user_places.PROJECT_DIR | ||
#"/Users/jiankuang/Documents/Eclipse_workspace/ecfutils_007" | ||
#DMPDIR: !FirstTrue | ||
# - do: "/gpfs/gp1/emc/globaldump" | ||
# when: !calc tools.isdir(do) | ||
# - do: "/gpfs/tp1/emc/globaldump" | ||
# when: !calc tools.isdir(do) | ||
# - otherwise: !error "Cannot find globaldump directory." | ||
|
||
# RTMFIX - location of the CRTM fixed data files used by the GSI data | ||
# assimilation. The data assimilation is not included in this public release | ||
# so this path is unused. | ||
RTMFIX: "$CRTM_FIX" | ||
|
||
# BASE_SVN - a directory maintained by emc global model developers | ||
# that contains recent versions of source code and executables for | ||
# various subversion repositories. This is used on some platforms | ||
# to find executables for this workflow. | ||
BASE_SVN: "/gpfs/hps3/emc/global/noscrub/emc.glopara/svn" | ||
|
||
# BASE_GIT - a directory maintained by emc global model developers | ||
# that contains recent versions of source code and executables for | ||
# various git repositories. This is used on some platforms to find | ||
# executables for this workflow. | ||
BASE_GIT: "/gpfs/hps3/emc/global/noscrub/emc.glopara/git" | ||
|
||
# config_base_extras - Additional configuration data to put in the | ||
# config.base file | ||
config_base_extras: "sandbox" | ||
#config_base_extras: | | ||
# if [ -d /gpfs/tp1 ]; then | ||
# export SITE="LUNA" | ||
# elif [ -d /gpfs/gp1 ]; then | ||
# export SITE="SURGE" | ||
# fi | ||
|
||
metasched_more: {} | ||
|
||
partitions: | ||
Evaluate: false | ||
default_exclusive: !calc doc.platform.partitions.sandbox | ||
default_service: !calc doc.platform.partitions.sandbox | ||
default_shared: !calc doc.platform.partitions.sandbox | ||
default_bigmem: !calc doc.platform.partitions.sandbox | ||
sandbox: | ||
<<: *global_partition_common | ||
|
||
# specification - string to specify to the batch system to | ||
# request this partition. Not relevant for WCOSS Cray | ||
specification: null | ||
|
||
# shared_accounting_ref - accounting settings for shared jobs | ||
shared_accounting_ref: | ||
project: !calc metasched.varref(doc.accounting.cpu_project) | ||
|
||
# service_accounting_ref - accounting settings for service jobs (jobs | ||
# that require tape or network access) | ||
service_accounting_ref: | ||
project: !calc metasched.varref(doc.accounting.cpu_project) | ||
|
||
# exclusive_accounting_ref - accounting settings for jobs that require | ||
# exclusive access to a node. | ||
exclusive_accounting_ref: | ||
project: !calc metasched.varref(doc.accounting.cpu_project) | ||
|
||
bigmem_accounting_ref: | ||
project: !calc metasched.varref(doc.accounting.cpu_project) | ||
|
||
# Queues to use for each job type. This logic automatically | ||
# switches between development queues on the backup machine and | ||
# development queues on the production machine based on whether the | ||
# /gpfs/hps2/ptmp is writable. | ||
shared_queue: dev | ||
service_queue: dev | ||
exclusive_queue: dev | ||
bigmem_queue: bigmem | ||
|
||
# Details about the scheduler on this cluster. | ||
scheduler_settings: | ||
scheduler_name: LSFAlps | ||
parallelism_name: LSFAlps | ||
node_type: generic | ||
physical_cores_per_node: 24 | ||
logical_cpus_per_core: 2 | ||
hyperthreading_allowed: true | ||
indent_text: " " | ||
memory_per_node: !calc (64*1024) | ||
|
||
scheduler: !calc | | ||
tools.get_scheduler(scheduler_settings.scheduler_name, scheduler_settings) | ||
parallelism: !calc | | ||
tools.get_parallelism(scheduler_settings.parallelism_name, scheduler_settings) | ||
nodes: !calc | | ||
tools.node_tool_for(scheduler_settings.node_type, scheduler_settings) | ||
long_term_temp: !calc doc.user_places.PROJECT_DIR | ||
short_term_temp: !calc doc.user_places.PROJECT_DIR | ||
EXP_PARENT_DIR: !calc doc.user_places.PROJECT_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
case: | ||
resources: | ||
run_job1: !JobRequest | ||
- mpi_ranks: 7 | ||
max_ppn: 7 | ||
OMP_NUM_THREADS: 4 | ||
walltime: !timedelta '01:15:00' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Sample default resource | ||
|
||
sample_resource_table: | ||
# ranks ppn wallclock threads MB | ||
job1: [ 200, 20, !timedelta "01:00:00", 12, "3072" ] | ||
job2: [ 12, 12, !timedelta "01:00:00", 1, "3072" ] | ||
|
||
default_resources: &default_resources | ||
|
||
run_nothing: !JobRequest # Special placeholder for "do nothing" | ||
- memory: "300M" | ||
mpi_ranks: 1 | ||
walltime: !timedelta "00:02:00" | ||
|
||
run_job1: !JobRequest | ||
- batch_memory: !icalc doc.sample_resource_table.job1[4] | ||
mpi_ranks: !icalc doc.sample_resource_table.job1[0] | ||
walltime: !icalc doc.sample_resource_table.job1[2] | ||
max_ppn: !icalc doc.sample_resource_table.job1[1] | ||
|
||
run_job2: !JobRequest | ||
- batch_memory: !icalc doc.sample_resource_table.job2[4] | ||
mpi_ranks: !icalc doc.sample_resource_table.job2[0] | ||
walltime: !icalc doc.sample_resource_table.job2[2] | ||
max_ppn: !icalc doc.sample_resource_table.job2[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#! /usr/bin/env python3.6 | ||
|
||
## Unit test program for crow.config module | ||
|
||
import sys, os, shutil, collections, copy | ||
|
||
sys.path.append(os.getcwd() + '/../../') | ||
|
||
import logging | ||
from datetime import timedelta | ||
from crow.config import from_dir, Suite, from_file, to_yaml, evaluate_immediates, from_string | ||
import crow.config.represent | ||
|
||
from crow.config.eval_tools import list_eval, dict_eval | ||
from crow.sysenv import JobResourceSpec | ||
|
||
platdoc=from_file('_common.yaml','_sandbox.yaml') | ||
platdoc.platform.Evaluate=True | ||
evaluate_immediates(platdoc.platform) | ||
|
||
shutil.copyfile('resources_sum_sample.yaml','resources_sum.yaml') | ||
doc=from_file('_common.yaml','_sandbox.yaml','case.yaml','default_resources.yaml','resources_sum.yaml') | ||
|
||
filename = 'resources_sum.yaml' | ||
|
||
doc.writeme = { 'resources_sum': doc.partition_common.resources } | ||
content = to_yaml({ 'resources_sum': doc.partition_common.resources }) | ||
with open(filename,'wt') as fd: | ||
fd.write(content) | ||
|
||
logging.basicConfig(stream=sys.stderr,level=logging.DEBUG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This example is the problem statement that I am experiencing: | ||
|
||
I am trying to set up some kind of central place where all | ||
information of resource settings (case, user, platform, default) | ||
being merged together. However, as shown in execution, the | ||
variables of resource_sum is still "!calc" string instead of | ||
actual values | ||
|
||
In this example, the dump of resource_sum comes from default and case. | ||
run_job1 is overriden by case settings and with clear | ||
final value, while run_job2 is still with the original | ||
!calc string. | ||
|
||
It will be much better if final values could be parsed into all | ||
the fields of resource_sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# place holder for resources panel | ||
|
||
resources_sum: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters