Skip to content

Commit

Permalink
Merge pull request #9 from xylar/add_web_portals
Browse files Browse the repository at this point in the history
Add web portal info to machines that have one
  • Loading branch information
xylar authored Oct 14, 2021
2 parents 33b1446 + fe2b151 commit c70a3c0
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 3 deletions.
36 changes: 33 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,40 @@ This loads machine info for Anvil and prints it:
.. code-block:: none
Machine: anvil
E3SM Supported Machine? True
E3SM Supported Machine: True
Compilers: intel, gnu
MPI libraries: mvapich, impi
MPI libraries: impi, openmpi, mvapich
OS: LINUX
E3SM-Unified:
Base path: /lcrc/soft/climate/e3sm-unified
E3SM-Unified is not currently loaded
Base path: /lcrc/soft/climate/e3sm-unified
Diagnostics:
Base path: /lcrc/group/e3sm/diagnostics
Config options:
[e3sm_unified]
group = cels
compiler = intel
mpi = impi
base_path = /lcrc/soft/climate/e3sm-unified
[diagnostics]
base_path = /lcrc/group/e3sm/diagnostics
[web_portal]
base_path = /lcrc/group/e3sm/public_html
base_url = https://web.lcrc.anl.gov/public/e3sm/
[parallel]
system = slurm
parallel_executable = srun
cores_per_node = 36
account = condo
partitions = acme-small, acme-medium, acme-large
qos = regular, acme_high
If you are on the login node of one of the following E3SM supported machines,
you don't need to provide the machine name. It will be recognized from the
host name:
Expand Down Expand Up @@ -94,6 +118,12 @@ e3sm_unified_activation : str
diagnostics_base : str
The base directory for diagnostics data

web_portal_base : str
The base directory for the web portal

web_portal_url : str
The base URL for the web portal

License
-------

Expand Down
18 changes: 18 additions & 0 deletions mache/machine_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from importlib.resources import path
import configparser
import os
import pwd

from mache.discover import discover_machine

Expand Down Expand Up @@ -45,6 +46,17 @@ class MachineInfo:
diagnostics_base : str
The base directory for diagnostics data
web_portal_base : str
The base directory for the web portal
web_portal_url : str
The base URL for the web portal
username : str
The name of the current user, for use in web-portal directories. This
value is also added to the ``web_portal`` and ``username`` option of
the ``config`` attribute.
"""

def __init__(self, machine=None):
Expand Down Expand Up @@ -79,6 +91,12 @@ def __init__(self, machine=None):
self.diagnostics_base = None
self._get_diagnostics_info()

self.web_portal_base = None
self.web_portal_url = None

self.username = pwd.getpwuid(os.getuid()).pw_name
self.config.set('web_portal', 'username', self.username)

def __str__(self):
"""
Convert the info to a format that is good for printing
Expand Down
10 changes: 10 additions & 0 deletions mache/machines/anvil.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ base_path = /lcrc/soft/climate/e3sm-unified
base_path = /lcrc/group/e3sm/diagnostics


# config options associated with web portals
[web_portal]

# The path to the base of the web portals
base_path = /lcrc/group/e3sm/public_html

# The base URL that corresponds to the base path
base_url = https://web.lcrc.anl.gov/public/e3sm/


# The parallel section describes options related to running jobs in parallel
[parallel]

Expand Down
10 changes: 10 additions & 0 deletions mache/machines/chrysalis.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ base_path = /lcrc/soft/climate/e3sm-unified
base_path = /lcrc/group/e3sm/diagnostics


# config options associated with web portals
[web_portal]

# The path to the base of the web portals
base_path = /lcrc/group/e3sm/public_html

# The base URL that corresponds to the base path
base_url = https://web.lcrc.anl.gov/public/e3sm/


# The parallel section describes options related to running jobs in parallel
[parallel]

Expand Down
10 changes: 10 additions & 0 deletions mache/machines/compy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ base_path = /share/apps/E3SM/conda_envs
base_path = /compyfs/diagnostics


# config options associated with web portals
[web_portal]

# The path to the base of the web portals
base_path = /compyfs/www/

# The base URL that corresponds to the base path
base_url = https://compy-dtn.pnl.gov/


# The parallel section describes options related to running jobs in parallel
[parallel]

Expand Down
10 changes: 10 additions & 0 deletions mache/machines/cori-haswell.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ base_path = /global/common/software/e3sm/anaconda_envs
base_path = /global/cfs/cdirs/e3sm/diagnostics


# config options associated with web portals
[web_portal]

# The path to the base of the web portals
base_path = /global/cfs/cdirs/e3sm/www

# The base URL that corresponds to the base path
base_url = https://portal.nersc.gov/project/e3sm/


# The parallel section describes options related to running jobs in parallel
[parallel]

Expand Down
10 changes: 10 additions & 0 deletions mache/machines/cori-knl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ base_path = /global/common/software/e3sm/anaconda_envs
base_path = /global/cfs/cdirs/e3sm/diagnostics


# config options associated with web portals
[web_portal]

# The path to the base of the web portals
base_path = /global/cfs/cdirs/e3sm/www

# The base URL that corresponds to the base path
base_url = https://portal.nersc.gov/project/e3sm/


# The parallel section describes options related to running jobs in parallel
[parallel]

Expand Down

0 comments on commit c70a3c0

Please sign in to comment.