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

env_mach_specific.xsd not general enough to handle my Mac's config_machines #1505

Closed
billsacks opened this issue May 10, 2017 · 5 comments
Closed
Assignees

Comments

@billsacks
Copy link
Member

@jedwards4b (or someone else) - can you please help with this?

With recent versions of cime, I am no longer able to build the unit tests or set up a case on my Mac. I get this error:

ERROR: Command: '/usr/bin/xmllint --noout --schema /Users/sacks/cime/config/xml_schemas/env_mach_specific.xsd /Users/sacks/cime/unit_test_temp.bjkaBn/env_mach_specific.xml' failed with error '/Users/sacks/cime/unit_test_temp.bjkaBn/env_mach_specific.xml:8: element module_system: Schemas validity error : Element 'module_system': Missing child element(s). Expected is ( init_path ).
/Users/sacks/cime/unit_test_temp.bjkaBn/env_mach_specific.xml:9: element mpirun: Schemas validity error : Element 'mpirun': This element is not expected. Expected is ( environment_variables ).
/Users/sacks/cime/unit_test_temp.bjkaBn/env_mach_specific.xml fails to validate'

I am using the following config_machines.xml, which worked until recently:

<?xml version="1.0"?>
<!-- This is an ordered list, not all fields are required, optional fields are noted below. -->
<config_machines version="2.0">
<!-- MACH is the name that you will use in machine options -->
  <machine MACH="roo2">

    <!-- DESC: a text description of the machine, this field is current not used in code-->
    <DESC>roo2</DESC>

	<!-- NODENAME_REGEX: a regular expression used to identify this machine
	  it must work on compute nodes as well as login nodes, use machine option
	  to create_test or create_newcase if this flag is not available -->
    <NODENAME_REGEX>roo2</NODENAME_REGEX>

    <!-- OS: the operating system of this machine. Passed to cppflags for
	 compiled programs as -DVALUE  recognized are LINUX, AIX, Darwin, CNL -->
    <OS>Darwin</OS>

	<!-- COMPILERS: compilers supported on this machine, comma seperated list, first is default -->

    <COMPILERS>gnu</COMPILERS>

	<!-- MPILIBS: mpilibs supported on this machine, comma seperated list,
	     first is default, mpi-serial is assumed and not required in this list-->
    <MPILIBS>mpich</MPILIBS>

    <!-- CIME_OUTPUT_ROOT: Base directory for case output,
	 the case/bld and case/run directories are written below here -->
    <CIME_OUTPUT_ROOT>/Users/sacks/cime_output_root</CIME_OUTPUT_ROOT>

    <!-- DIN_LOC_ROOT: location of the inputdata data directory
	 inputdata is downloaded automatically on a case by case basis as
	 long as the user has write access to this directory.   We recommend that
	 all cime model users on a system share an inputdata directory
	 as it can be quite large -->
    <DIN_LOC_ROOT>/Users/sacks/cesm_inputdata</DIN_LOC_ROOT>

    <!-- DOUT_S_ROOT: root directory of short term archive files, short term
      archiving moves model output data out of the run directory, but
      keeps it on disk-->
    <DOUT_S_ROOT>$CIME_OUTPUT_ROOT/archive/$CASE</DOUT_S_ROOT>

    <!-- BASELINE_ROOT:  Root directory for system test baseline files -->
    <BASELINE_ROOT>/Users/sacks/cesm_baselines</BASELINE_ROOT>

    <!-- CCSM_CPRNC: location of the cprnc tool, compares model output in testing-->
    <CCSM_CPRNC>/Users/sacks/cime/tools/cprnc/cprnc</CCSM_CPRNC>

    <!-- GMAKE: gnu compatible make tool, default is 'gmake' -->
    <GMAKE>make</GMAKE>

    <!-- GMAKE_J: optional number of threads to pass to the gmake flag -->
    <GMAKE_J>8</GMAKE_J>

    <!-- BATCH_SYSTEM: batch system used on this machine,
      supported values are: none, cobalt, lsf, pbs, slurm -->
    <BATCH_SYSTEM>none</BATCH_SYSTEM>

    <!-- SUPPORTED_BY: contact information for support for this system
      this field is not used in code -->
    <SUPPORTED_BY>Bill Sacks</SUPPORTED_BY>

    <!-- MAX_TASKS_PER_NODE: maximum number of threads*tasks per
	 shared memory node on this machine,
	 should always be >= PES_PER_NODE -->
    <MAX_TASKS_PER_NODE>4</MAX_TASKS_PER_NODE>

    <!-- PES_PER_NODE: number of physical PES per shared node on
	 this machine, in practice the MPI tasks per node will not exceed this value -->
    <PES_PER_NODE>4</PES_PER_NODE>

    <!-- mpirun: The mpi exec to start a job on this machine, supported values
	 are values listed in MPILIBS above, default and mpi-serial -->
    <mpirun mpilib="default">
      <!-- name of the exectuable used to launch mpi jobs -->
      <executable>mpirun</executable>
    </mpirun>
    <mpirun mpilib="mpi-serial">
      <executable></executable>
    </mpirun>
    <module_system type="none"/>
  </machine>
</config_machines>

If I'm reading the error properly, it seems there are two problems:

  1. It doesn't like that I haven't listed anything under "module_system" (which I don't need, because I'm using module_system 'none')

  2. It doesn't like that I'm not setting any environment variables (which I don't need)

Can you please advise on what changes are needed to either my config_machines.xml or to env_mach_specific.xsd so that this validates?

It looks like config/cesm/machines/userdefined_laptop_template/config_machines.xml would probably give the same errors as my file, since it is also missing the now-needed pieces.

@jedwards4b
Copy link
Contributor

I just tried your file and it works fine - maybe its an xmllint version issue?

 cat config_machines.xml 
<?xml version="1.0"?>
<!-- This is an ordered list, not all fields are required, optional fields are noted below. -->
<config_machines version="2.0">
<!-- MACH is the name that you will use in machine options -->
  <machine MACH="roo2">

    <!-- DESC: a text description of the machine, this field is current not used in code-->
    <DESC>roo2</DESC>

	<!-- NODENAME_REGEX: a regular expression used to identify this machine
	  it must work on compute nodes as well as login nodes, use machine option
	  to create_test or create_newcase if this flag is not available -->
    <NODENAME_REGEX>roo2</NODENAME_REGEX>

    <!-- OS: the operating system of this machine. Passed to cppflags for
	 compiled programs as -DVALUE  recognized are LINUX, AIX, Darwin, CNL -->
    <OS>Darwin</OS>

	<!-- COMPILERS: compilers supported on this machine, comma seperated list, first is default -->

    <COMPILERS>gnu</COMPILERS>

	<!-- MPILIBS: mpilibs supported on this machine, comma seperated list,
	     first is default, mpi-serial is assumed and not required in this list-->
    <MPILIBS>mpich</MPILIBS>

    <!-- CIME_OUTPUT_ROOT: Base directory for case output,
	 the case/bld and case/run directories are written below here -->
    <CIME_OUTPUT_ROOT>/Users/sacks/cime_output_root</CIME_OUTPUT_ROOT>

    <!-- DIN_LOC_ROOT: location of the inputdata data directory
	 inputdata is downloaded automatically on a case by case basis as
	 long as the user has write access to this directory.   We recommend that
	 all cime model users on a system share an inputdata directory
	 as it can be quite large -->
    <DIN_LOC_ROOT>/Users/sacks/cesm_inputdata</DIN_LOC_ROOT>

    <!-- DOUT_S_ROOT: root directory of short term archive files, short term
      archiving moves model output data out of the run directory, but
      keeps it on disk-->
    <DOUT_S_ROOT>$CIME_OUTPUT_ROOT/archive/$CASE</DOUT_S_ROOT>

    <!-- BASELINE_ROOT:  Root directory for system test baseline files -->
    <BASELINE_ROOT>/Users/sacks/cesm_baselines</BASELINE_ROOT>

    <!-- CCSM_CPRNC: location of the cprnc tool, compares model output in testing-->
    <CCSM_CPRNC>/Users/sacks/cime/tools/cprnc/cprnc</CCSM_CPRNC>

    <!-- GMAKE: gnu compatible make tool, default is 'gmake' -->
    <GMAKE>make</GMAKE>

    <!-- GMAKE_J: optional number of threads to pass to the gmake flag -->
    <GMAKE_J>8</GMAKE_J>

    <!-- BATCH_SYSTEM: batch system used on this machine,
      supported values are: none, cobalt, lsf, pbs, slurm -->
    <BATCH_SYSTEM>none</BATCH_SYSTEM>

    <!-- SUPPORTED_BY: contact information for support for this system
      this field is not used in code -->
    <SUPPORTED_BY>Bill Sacks</SUPPORTED_BY>

    <!-- MAX_TASKS_PER_NODE: maximum number of threads*tasks per
	 shared memory node on this machine,
	 should always be >= PES_PER_NODE -->
    <MAX_TASKS_PER_NODE>4</MAX_TASKS_PER_NODE>

    <!-- PES_PER_NODE: number of physical PES per shared node on
	 this machine, in practice the MPI tasks per node will not exceed this value -->
    <PES_PER_NODE>4</PES_PER_NODE>

    <!-- mpirun: The mpi exec to start a job on this machine, supported values
	 are values listed in MPILIBS above, default and mpi-serial -->
    <mpirun mpilib="default">
      <!-- name of the exectuable used to launch mpi jobs -->
      <executable>mpirun</executable>
    </mpirun>
    <mpirun mpilib="mpi-serial">
      <executable></executable>
    </mpirun>
    <module_system type="none"/>
  </machine>
</config_machines>

elm:cime jedwards$ xmllint --noout --schema config/xml_schemas/config_machines.xsd config_machines.xml 
config_machines.xml validates

@billsacks
Copy link
Member Author

@jedwards4b - config_machines.xml itself validates for me. The problem comes with validating the env_mach_specific.xml file that it produces. Sorry, I should have sent that before:

<?xml version="1.0"?>
<file id="env_mach_specific.xml" version="2.0">
  <header>
    These variables control the machine dependent environment including
    the paths to compilers and libraries external to cime such as netcdf,
    environment variables for use in the running job should also be set	here.
    </header>
  <module_system type="none"/>
  <mpirun mpilib="default">
    <executable>mpirun</executable>
  </mpirun>
  <mpirun mpilib="mpi-serial">
    <executable/>
  </mpirun>
  <entry id="run_exe" value="${EXEROOT}/cesm.exe ">
    <type>char</type>
    <desc>executable name</desc>
  </entry>
  <entry id="run_misc_suffix" value=" &gt;&gt; cesm.log.$LID 2&gt;&amp;1 ">
    <type>char</type>
    <desc>redirect for job output</desc>
  </entry>
</file>
[roo2:~/cime]$ xmllint --noout --schema config/xml_schemas/env_mach_specific.xsd unit_test_temp.bjkaBn/env_mach_specific.xml
unit_test_temp.bjkaBn/env_mach_specific.xml:8: element module_system: Schemas validity error : Element 'module_system': Missing child element(s). Expected is ( init_path ).
unit_test_temp.bjkaBn/env_mach_specific.xml:9: element mpirun: Schemas validity error : Element 'mpirun': This element is not expected. Expected is ( environment_variables ).
unit_test_temp.bjkaBn/env_mach_specific.xml fails to validate

@billsacks
Copy link
Member Author

Temporary workaround for others experiencing this problem:

--- a/scripts/lib/CIME/XML/env_mach_specific.py
+++ b/scripts/lib/CIME/XML/env_mach_specific.py
@@ -20,7 +20,7 @@ def __init__(self, caseroot=None, infile="env_mach_specific.xml",
         """
         fullpath = infile if os.path.isabs(infile) else os.path.join(caseroot, infile)
         schema = os.path.join(get_cime_root(), "config", "xml_schemas", "env_mach_specific.xsd")
-        EnvBase.__init__(self, caseroot, fullpath,schema=schema)
+        EnvBase.__init__(self, caseroot, fullpath,schema=None)

         self._unit_testing = unit_testing

@jedwards4b
Copy link
Contributor

I have a fix PR soon.

@rljacob
Copy link
Member

rljacob commented May 10, 2017

should env_mach_specific.xml validate?

@billsacks billsacks changed the title Please help: How to change my Mac's config_machines for new schema definition env_mach_specific.xsd not general enough to handle my Mac's config_machines May 10, 2017
@jedwards4b jedwards4b self-assigned this May 10, 2017
jgfouca added a commit that referenced this issue May 10, 2017
Fix env_mach_specific validation

Allow the user the option of skipping the xmllint validation of cime xml files.

Test suite: scripts_regression_tests.py
Test baseline:
Test namelist changes:
Test status: bit for bit

Addresses #1505

User interface changes?: Adds --skip-xml-validation flag to all user interface scripts

Code review:
@ghost ghost removed the ready label May 10, 2017
jgfouca added a commit that referenced this issue Jun 2, 2017
Changes ERS to SMS_D test for cosplite

[BFB] - Bit-For-Bit

* origin/singhbalwinder/atm/change-cosplite-from-ERS-to-SMS:
  Modifies SMS_D_Ln5_P8x4 to SMS_Ln5 to avoid cetus and melvin issues
  Adds a special instruction for cetus machines regarding cosplite test
  Changes ERS to SMS_D test for cosplite
jgfouca added a commit that referenced this issue Feb 23, 2018
Changes ERS to SMS_D test for cosplite

[BFB] - Bit-For-Bit

* origin/singhbalwinder/atm/change-cosplite-from-ERS-to-SMS:
  Modifies SMS_D_Ln5_P8x4 to SMS_Ln5 to avoid cetus and melvin issues
  Adds a special instruction for cetus machines regarding cosplite test
  Changes ERS to SMS_D test for cosplite
jgfouca added a commit that referenced this issue Mar 13, 2018
Changes ERS to SMS_D test for cosplite

[BFB] - Bit-For-Bit

* origin/singhbalwinder/atm/change-cosplite-from-ERS-to-SMS:
  Modifies SMS_D_Ln5_P8x4 to SMS_Ln5 to avoid cetus and melvin issues
  Adds a special instruction for cetus machines regarding cosplite test
  Changes ERS to SMS_D test for cosplite
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

4 participants