├── .docs_static
├── .nojekyll
├── CNAME
└── index.html
├── .github
├── ISSUE_TEMPLATE
│ ├── bug.md
│ └── feature.md
├── release.yml
└── workflows
│ ├── build_docs.yml
│ ├── changelog.yml
│ ├── release.yml
│ └── run_tests.yml
├── .gitignore
├── .pylintrc
├── .readthedocs.yaml
├── .wci.yml
├── CITATION.cff
├── CONTRIBUTING.rst
├── LICENSE.md
├── MANIFEST.in
├── Makefile
├── README.md
├── codecov.yml
├── conftest.py
├── doc
├── Makefile
├── _static
│ ├── .nojekyll
│ ├── custom_tab_style.css
│ └── version_names.json
├── _templates
│ └── versions.html
├── api
│ ├── smartredis_api.rst
│ └── smartsim_api.rst
├── batch_settings.rst
├── changelog.md
├── code_of_conduct.rst
├── conf.py
├── contributing.rst
├── developer.rst
├── dragon.rst
├── ensemble.rst
├── experiment.rst
├── images
│ ├── Experiment.png
│ ├── Orchestrator.png
│ ├── SmartSim-Logo-Final-tb.png
│ ├── SmartSim-Logo-final-white.png
│ ├── SmartSim-orchestrator.png
│ ├── SmartSim_Architecture.png
│ ├── SmartSim_Large.png
│ ├── SmartSim_Large_Inv.png
│ ├── clustered-orc-diagram.png
│ ├── clustered_orchestrator-1.png
│ ├── co-located-orc-diagram.png
│ ├── colocated_orchestrator-1.png
│ ├── latticeboltzmann.png
│ ├── smartsim-arch.png
│ └── ss-arch-overview.png
├── index.rst
├── installation_instructions
│ ├── basic.rst
│ ├── platform.rst
│ ├── platform
│ │ ├── cray.rst
│ │ ├── frontier.rst
│ │ ├── generic.rst
│ │ ├── ncar-cheyenne.rst
│ │ ├── nonroot-linux.rst
│ │ ├── perlmutter.rst
│ │ └── pml-scylla.rst
│ └── site-install.rst
├── make.bat
├── ml_features.rst
├── model.rst
├── orchestrator.rst
├── overview.rst
├── run_settings.rst
├── smartdashboard.rst
├── smartredis.rst
├── smartsim_zoo.rst
├── sr_advanced_topics.rst
├── sr_cpp_walkthrough.rst
├── sr_data_structures.rst
├── sr_dataset_conversions.rst
├── sr_fortran_walkthrough.rst
├── sr_integration.rst
├── sr_python_walkthrough.rst
├── sr_runtime.rst
├── ss_logger.rst
├── testing.rst
├── tutorials
│ ├── doc_examples
│ │ ├── ensemble_doc_examples
│ │ │ ├── application_consumer_script.py
│ │ │ ├── application_producer_script.py
│ │ │ ├── ensemble_ml_model_file.py
│ │ │ ├── ensemble_ml_model_mem.py
│ │ │ ├── ensemble_torchscript_file.py
│ │ │ ├── ensemble_torchscript_mem.py
│ │ │ ├── ensemble_torchscript_string.py
│ │ │ ├── experiment_driver.py
│ │ │ ├── file_attach.py
│ │ │ ├── manual_append_ensemble.py
│ │ │ ├── param_expansion_1.py
│ │ │ ├── param_expansion_2.py
│ │ │ ├── replicas_1.py
│ │ │ └── replicas_2.py
│ │ ├── experiment_doc_examples
│ │ │ └── exp.py
│ │ ├── model_doc_examples
│ │ │ ├── from_file_ml_model.py
│ │ │ ├── from_file_script.py
│ │ │ ├── in_mem_ml_model.py
│ │ │ ├── in_mem_script.py
│ │ │ ├── model_file.py
│ │ │ ├── model_init.py
│ │ │ ├── prefix_data.py
│ │ │ └── string_script.py
│ │ └── orch_examples
│ │ │ ├── colo_app.py
│ │ │ ├── colo_driver.py
│ │ │ ├── std_app.py
│ │ │ └── std_driver.py
│ ├── getting_started
│ │ ├── consumer.py
│ │ ├── getting_started.ipynb
│ │ ├── multi_db_example
│ │ │ ├── application_script.py
│ │ │ └── multidb_driver.py
│ │ ├── output_my_parameter.py
│ │ ├── output_my_parameter_new_tag.py
│ │ └── producer.py
│ ├── ml_inference
│ │ ├── Inference-in-SmartSim.ipynb
│ │ └── colo-db-torch-example.py
│ ├── ml_training
│ │ └── surrogate
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── fd_sim.py
│ │ │ ├── steady_state.py
│ │ │ ├── tf_model.py
│ │ │ ├── tf_training.py
│ │ │ ├── train_surrogate.ipynb
│ │ │ └── vishelpers.py
│ └── online_analysis
│ │ └── lattice
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── driver.py
│ │ ├── fv_sim.py
│ │ ├── online_analysis.ipynb
│ │ ├── probe.script
│ │ └── vishelpers.py
└── versions.rst
├── docker-compose.yml
├── docker
├── dev
│ └── Dockerfile
├── docs
│ └── dev
│ │ └── Dockerfile
├── prod-cuda11
│ └── Dockerfile
├── prod-cuda12
│ └── Dockerfile
├── prod
│ └── Dockerfile
└── testing
│ ├── Dockerfile
│ └── README.md
├── pyproject.toml
├── setup.cfg
├── setup.py
├── smartsim
├── __init__.py
├── _core
│ ├── __init__.py
│ ├── _cli
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── build.py
│ │ ├── clean.py
│ │ ├── cli.py
│ │ ├── dbcli.py
│ │ ├── info.py
│ │ ├── plugin.py
│ │ ├── scripts
│ │ │ └── dragon_install.py
│ │ ├── site.py
│ │ ├── teardown.py
│ │ ├── utils.py
│ │ └── validate.py
│ ├── _install
│ │ ├── __init__.py
│ │ ├── buildenv.py
│ │ ├── builder.py
│ │ ├── configs
│ │ │ └── mlpackages
│ │ │ │ ├── DarwinARM64CPU.json
│ │ │ │ ├── DarwinX64CPU.json
│ │ │ │ ├── LinuxX64CPU.json
│ │ │ │ ├── LinuxX64CUDA11.json
│ │ │ │ ├── LinuxX64CUDA12.json
│ │ │ │ └── LinuxX64ROCM6.json
│ │ ├── mlpackages.py
│ │ ├── platform.py
│ │ ├── redisaiBuilder.py
│ │ ├── types.py
│ │ └── utils
│ │ │ ├── __init__.py
│ │ │ └── retrieve.py
│ ├── config
│ │ ├── __init__.py
│ │ ├── config.py
│ │ ├── keydb.conf
│ │ └── redis.conf
│ ├── control
│ │ ├── __init__.py
│ │ ├── controller.py
│ │ ├── controller_utils.py
│ │ ├── job.py
│ │ ├── jobmanager.py
│ │ ├── manifest.py
│ │ └── previewrenderer.py
│ ├── entrypoints
│ │ ├── __init__.py
│ │ ├── colocated.py
│ │ ├── dragon.py
│ │ ├── dragon_client.py
│ │ ├── indirect.py
│ │ ├── redis.py
│ │ └── telemetrymonitor.py
│ ├── generation
│ │ ├── __init__.py
│ │ ├── generator.py
│ │ └── modelwriter.py
│ ├── launcher
│ │ ├── __init__.py
│ │ ├── colocated.py
│ │ ├── dragon
│ │ │ ├── __init__.py
│ │ │ ├── dragonBackend.py
│ │ │ ├── dragonConnector.py
│ │ │ ├── dragonLauncher.py
│ │ │ └── dragonSockets.py
│ │ ├── launcher.py
│ │ ├── local
│ │ │ ├── __init__.py
│ │ │ └── local.py
│ │ ├── pbs
│ │ │ ├── __init__.py
│ │ │ ├── pbsCommands.py
│ │ │ ├── pbsLauncher.py
│ │ │ └── pbsParser.py
│ │ ├── sge
│ │ │ ├── __init__.py
│ │ │ ├── sgeCommands.py
│ │ │ ├── sgeLauncher.py
│ │ │ └── sgeParser.py
│ │ ├── slurm
│ │ │ ├── __init__.py
│ │ │ ├── slurmCommands.py
│ │ │ ├── slurmLauncher.py
│ │ │ └── slurmParser.py
│ │ ├── step
│ │ │ ├── __init__.py
│ │ │ ├── alpsStep.py
│ │ │ ├── dragonStep.py
│ │ │ ├── localStep.py
│ │ │ ├── mpiStep.py
│ │ │ ├── pbsStep.py
│ │ │ ├── sgeStep.py
│ │ │ ├── slurmStep.py
│ │ │ └── step.py
│ │ ├── stepInfo.py
│ │ ├── stepMapping.py
│ │ ├── taskManager.py
│ │ └── util
│ │ │ ├── __init__.py
│ │ │ └── launcherUtil.py
│ ├── schemas
│ │ ├── __init__.py
│ │ ├── dragonRequests.py
│ │ ├── dragonResponses.py
│ │ └── utils.py
│ ├── types.py
│ └── utils
│ │ ├── __init__.py
│ │ ├── helpers.py
│ │ ├── network.py
│ │ ├── redis.py
│ │ ├── security.py
│ │ ├── serialize.py
│ │ ├── shell.py
│ │ └── telemetry
│ │ ├── __init__.py
│ │ ├── collector.py
│ │ ├── manifest.py
│ │ ├── sink.py
│ │ ├── telemetry.py
│ │ └── util.py
├── database
│ ├── __init__.py
│ └── orchestrator.py
├── entity
│ ├── __init__.py
│ ├── dbnode.py
│ ├── dbobject.py
│ ├── ensemble.py
│ ├── entity.py
│ ├── entityList.py
│ ├── files.py
│ ├── model.py
│ └── strategies.py
├── error
│ ├── __init__.py
│ └── errors.py
├── experiment.py
├── log.py
├── ml
│ ├── __init__.py
│ ├── data.py
│ ├── tf
│ │ ├── __init__.py
│ │ ├── data.py
│ │ └── utils.py
│ └── torch
│ │ ├── __init__.py
│ │ └── data.py
├── py.typed
├── servertype.py
├── settings
│ ├── __init__.py
│ ├── alpsSettings.py
│ ├── base.py
│ ├── containers.py
│ ├── dragonRunSettings.py
│ ├── mpiSettings.py
│ ├── palsSettings.py
│ ├── pbsSettings.py
│ ├── settings.py
│ ├── sgeSettings.py
│ └── slurmSettings.py
├── status.py
├── templates
│ └── templates
│ │ └── preview
│ │ └── plain_text
│ │ ├── activeinfra.template
│ │ ├── base.template
│ │ ├── clientconfig.template
│ │ ├── clientconfig_debug.template
│ │ ├── clientconfig_info.template
│ │ ├── clientconfigcolo.template
│ │ ├── clientconfigcolo_debug.template
│ │ ├── clientconfigcolo_info.template
│ │ ├── ensemble.template
│ │ ├── ensemble_debug.template
│ │ ├── ensemble_info.template
│ │ ├── experiment.template
│ │ ├── model.template
│ │ ├── model_debug.template
│ │ ├── model_info.template
│ │ ├── orchestrator.template
│ │ ├── orchestrator_debug.template
│ │ └── orchestrator_info.template
└── wlm
│ ├── __init__.py
│ ├── pbs.py
│ └── slurm.py
└── tests
├── __init__.py
├── backends
├── run_sklearn_onnx.py
├── run_tf.py
├── run_torch.py
├── test_cli_mini_exp.py
├── test_dataloader.py
├── test_dbmodel.py
├── test_dbscript.py
├── test_onnx.py
├── test_tf.py
└── test_torch.py
├── full_wlm
├── test_generic_batch_launch.py
├── test_generic_orc_launch_batch.py
├── test_mpmd.py
├── test_slurm_allocation.py
├── test_symlinking.py
└── test_wlm_helper_functions.py
├── install
├── test_build.py
├── test_buildenv.py
├── test_mlpackage.py
├── test_package_retriever.py
├── test_platform.py
└── test_redisai_builder.py
├── on_wlm
├── test_base_settings_on_wlm.py
├── test_colocated_model.py
├── test_containers_wlm.py
├── test_dragon.py
├── test_dragon_entrypoint.py
├── test_generic_orc_launch.py
├── test_het_job.py
├── test_launch_errors.py
├── test_local_step.py
├── test_preview_wlm.py
├── test_restart.py
├── test_simple_base_settings_on_wlm.py
├── test_simple_entity_launch.py
├── test_slurm_commands.py
├── test_stop.py
└── test_wlm_orc_config_settings.py
├── test_alps_settings.py
├── test_batch_settings.py
├── test_cli.py
├── test_collector_manager.py
├── test_collector_sink.py
├── test_collectors.py
├── test_colo_model_local.py
├── test_config.py
├── test_configs
├── alloc_spec_sheet_examples
│ ├── blank_alloc_specs.json
│ ├── pbs_alloc_specs.example.json
│ └── slurm_alloc_specs.example.json
├── bad.py
├── check_dirs.py
├── check_env.py
├── cov
│ ├── cobalt_cov.cfg
│ ├── local_cov.cfg
│ ├── lsf_cov.cfg
│ ├── pbs_cov.cfg
│ └── slurm_cov.cfg
├── echo.py
├── generator_files
│ ├── circular_config
│ │ ├── h2o.inp
│ │ └── sub_dir
│ │ │ ├── circle
│ │ │ └── hello.sh
│ ├── easy
│ │ ├── correct
│ │ │ ├── MOM_input
│ │ │ ├── example_input.i
│ │ │ ├── in.airebo
│ │ │ ├── in.atm
│ │ │ ├── in.crack
│ │ │ ├── in.ellipse.gayberne
│ │ │ ├── input-file.inp
│ │ │ ├── input.nml
│ │ │ └── simple-H20.xml
│ │ └── marked
│ │ │ ├── MOM_input
│ │ │ ├── example_input.i
│ │ │ ├── in.airebo
│ │ │ ├── in.atm
│ │ │ ├── in.crack
│ │ │ ├── in.ellipse.gayberne
│ │ │ ├── input-file.inp
│ │ │ ├── input.nml
│ │ │ └── simple-H20.xml
│ ├── in.atm
│ ├── log_params
│ │ ├── dir_test
│ │ │ ├── dir_test_0
│ │ │ │ └── smartsim_params.txt
│ │ │ ├── dir_test_1
│ │ │ │ └── smartsim_params.txt
│ │ │ ├── dir_test_2
│ │ │ │ └── smartsim_params.txt
│ │ │ └── dir_test_3
│ │ │ │ └── smartsim_params.txt
│ │ └── smartsim_params.txt
│ ├── med
│ │ ├── correct
│ │ │ ├── MOM_input
│ │ │ ├── diag_table
│ │ │ ├── example_input.i
│ │ │ ├── in.airebo
│ │ │ ├── in.atm
│ │ │ ├── in.crack
│ │ │ ├── in.ellipse.gayberne
│ │ │ ├── input-file.inp
│ │ │ ├── input.nml
│ │ │ └── simple-H20.xml
│ │ └── marked
│ │ │ ├── MOM_input
│ │ │ ├── diag_table
│ │ │ ├── example_input.i
│ │ │ ├── in.airebo
│ │ │ ├── in.atm
│ │ │ ├── in.crack
│ │ │ ├── in.ellipse.gayberne
│ │ │ ├── input-file.inp
│ │ │ ├── input.nml
│ │ │ └── simple-H20.xml
│ ├── multi_tags_template.sh
│ ├── new-tag
│ │ ├── correct
│ │ │ ├── MOM_input
│ │ │ ├── diag_table
│ │ │ ├── example_input.i
│ │ │ ├── in.airebo
│ │ │ ├── in.atm
│ │ │ ├── in.crack
│ │ │ ├── in.ellipse.gayberne
│ │ │ ├── input-file.inp
│ │ │ ├── input.nml
│ │ │ └── simple-H20.xml
│ │ └── marked
│ │ │ ├── MOM_input
│ │ │ ├── diag_table
│ │ │ ├── example_input.i
│ │ │ ├── in.airebo
│ │ │ ├── in.atm
│ │ │ ├── in.crack
│ │ │ ├── in.ellipse.gayberne
│ │ │ ├── input-file.inp
│ │ │ ├── input.nml
│ │ │ └── simple-H20.xml
│ ├── tag_dir_template
│ │ ├── nested_0
│ │ │ └── tagged_0.sh
│ │ └── nested_1
│ │ │ └── tagged_1.sh
│ ├── test_dir
│ │ ├── test.in
│ │ └── test_dir_1
│ │ │ └── config.txt
│ ├── to_copy_dir
│ │ └── mock.txt
│ └── to_symlink_dir
│ │ └── mock2.txt
├── hw_mpi.c
├── incoming_entities_reader.py
├── ml
│ └── training_service_torch.py
├── mpi
│ └── mpi_hello.c
├── mpi_impl_stubs
│ ├── openmpi4
│ │ ├── mpiexec
│ │ ├── mpirun
│ │ └── orterun
│ ├── pals
│ │ └── mpiexec
│ └── slurm
│ │ └── mpiexec
├── printing_model.py
├── qstat.json
├── reconnect_node.py
├── reconnect_sim.py
├── run_dbscript_smartredis.py
├── run_pt_dbmodel_smartredis.py
├── run_tf_dbmodel_smartredis.py
├── sample.json
├── send_data.py
├── send_data_local_smartredis.py
├── sleep.py
├── smartredis
│ ├── consumer.py
│ ├── dbid.py
│ ├── multidbid.py
│ ├── multidbid_colo_env_vars_only.py
│ └── producer.py
├── telemetry
│ ├── colocatedmodel.json
│ ├── db_and_model.json
│ ├── db_and_model_1run.json
│ ├── ensembles.json
│ ├── serialmodels.json
│ └── telemetry.json
└── torchscript.py
├── test_containers.py
├── test_controller.py
├── test_controller_errors.py
├── test_dbnode.py
├── test_dragon_client.py
├── test_dragon_installer.py
├── test_dragon_launcher.py
├── test_dragon_run_policy.py
├── test_dragon_run_request.py
├── test_dragon_run_request_nowlm.py
├── test_dragon_runsettings.py
├── test_dragon_step.py
├── test_ensemble.py
├── test_entitylist.py
├── test_experiment.py
├── test_fixtures.py
├── test_generator.py
├── test_helpers.py
├── test_indirect.py
├── test_init.py
├── test_interrupt.py
├── test_launch_errors.py
├── test_local_launch.py
├── test_local_multi_run.py
├── test_local_restart.py
├── test_logs.py
├── test_manifest.py
├── test_model.py
├── test_modelwriter.py
├── test_mpi_settings.py
├── test_multidb.py
├── test_orc_config_settings.py
├── test_orchestrator.py
├── test_output_files.py
├── test_pals_settings.py
├── test_pbs_parser.py
├── test_pbs_settings.py
├── test_preview.py
├── test_reconnect_orchestrator.py
├── test_run_settings.py
├── test_schema_utils.py
├── test_serialize.py
├── test_sge_batch_settings.py
├── test_shell_util.py
├── test_slurm_get_alloc.py
├── test_slurm_parser.py
├── test_slurm_settings.py
├── test_slurm_validation.py
├── test_smartredis.py
├── test_step_info.py
├── test_symlinking.py
├── test_telemetry_monitor.py
└── utils
├── test_network.py
└── test_security.py
/.docs_static/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/.docs_static/.nojekyll
--------------------------------------------------------------------------------
/.docs_static/CNAME:
--------------------------------------------------------------------------------
1 | www.craylabs.org
--------------------------------------------------------------------------------
/.docs_static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug
3 | about: Bug report
4 | title: ''
5 | labels: 'type: bug'
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Description
11 | A clear and concise description of what the bug is.
12 |
13 | # How to reproduce
14 | steps to reproduce the bug
15 |
16 | # Expected behavior
17 | A clear and concise description of what you expected to happen.
18 |
19 | # System
20 | - OS:
21 | - OS version:
22 | - Commit/version of library:
23 | - Workload manager (e.g. PBS, Slurm):
24 | - Workload manager version:
25 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature
3 | about: Feature suggestion or idea
4 | title: ''
5 | labels: 'type: feature'
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Description
11 | What is the point of this feature? Why include it?
12 |
13 | # Justification
14 | Who will benefit from this feature?
15 |
16 | # Implementation Strategy
17 | How should this feature be implemented? What will need to be done/included?
18 |
--------------------------------------------------------------------------------
/.github/workflows/changelog.yml:
--------------------------------------------------------------------------------
1 | #
2 | # BSD 2-Clause License
3 | #
4 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
5 | # All rights reserved.
6 | #
7 | # Redistribution and use in source and binary forms, with or without
8 | # modification, are permitted provided that the following conditions are met:
9 | #
10 | # 1. Redistributions of source code must retain the above copyright notice, this
11 | # list of conditions and the following disclaimer.
12 | #
13 | # 2. Redistributions in binary form must reproduce the above copyright notice,
14 | # this list of conditions and the following disclaimer in the documentation
15 | # and/or other materials provided with the distribution.
16 | #
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | name: enforce_changelog
30 |
31 | on:
32 | pull_request:
33 | push:
34 | branches:
35 | - develop
36 |
37 | jobs:
38 | changelog:
39 | name: check_changelog
40 | runs-on: ubuntu-latest
41 |
42 | steps:
43 | - uses: actions/checkout@v4
44 |
45 | - name: Changelog Enforcer
46 | uses: dangoslen/changelog-enforcer@v3.6.0
47 | with:
48 | changeLogPath: './doc/changelog.md'
49 | missingUpdateErrorMessage: 'changelog.md has not been updated'
50 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | **/*.swp
3 | __pycache__
4 | .ipynb_checkpoints
5 | .pytest_cache/
6 | .coverage*
7 | htmlcov
8 | smartsim.egg-info
9 | tests/test_output
10 | .DS_Store
11 |
12 | # Dependencies
13 | smartsim/_core/.third-party
14 | smartsim/_core/.dragon
15 | smartsim/_core/build
16 |
17 | # Docs
18 | _build
19 |
20 | smartredis
21 |
22 | # Envs
23 | venv/
24 | .venv/
25 | env/
26 | .env/
27 | **/.env
28 |
29 | # written upon install
30 | smartsim/version.py
31 |
32 | # created upon install
33 | smartsim/_core/bin
34 | smartsim/_core/lib
35 |
36 | # optional dev tools
37 | .pre-commit-config.yaml
38 |
--------------------------------------------------------------------------------
/.readthedocs.yaml:
--------------------------------------------------------------------------------
1 | # Required
2 | version: 2
3 |
4 | # Set the OS, Python version and other tools you might need
5 | build:
6 | os: ubuntu-22.04
7 | tools:
8 | python: "3.10"
9 | jobs:
10 | post_checkout:
11 | # Cancel building pull requests when there aren't changed in the docs directory or YAML file.
12 | # You can add any other files or directories that you'd like here as well,
13 | # like your docs requirements file, or other files that will change your docs build.
14 | #
15 | # If there are no changes (git diff exits with 0) we force the command to return with 183.
16 | # This is a special exit code on Read the Docs that will cancel the build immediately.
17 | - |
18 | if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- doc/ .readthedocs.yaml;
19 | then
20 | exit 183;
21 | fi
22 | pre_create_environment:
23 | - git clone --depth 1 https://github.com/CrayLabs/SmartRedis.git smartredis
24 | - git clone --depth 1 https://github.com/CrayLabs/SmartDashboard.git smartdashboard
25 | post_create_environment:
26 | - python -m pip install .[dev,docs]
27 | - cd smartredis; python -m pip install .
28 | - cd smartredis/doc; doxygen Doxyfile_c; doxygen Doxyfile_cpp; doxygen Doxyfile_fortran
29 | - ln -s smartredis/examples ./examples
30 | - cd smartdashboard; python -m pip install .
31 | pre_build:
32 | - pip install typing_extensions==4.8.0
33 | - pip install pydantic==1.10.13
34 | - python -m sphinx -b linkcheck doc/ $READTHEDOCS_OUTPUT/linkcheck
35 |
36 | # Build documentation in the "docs/" directory with Sphinx
37 | sphinx:
38 | configuration: doc/conf.py
39 | fail_on_warning: true
40 |
--------------------------------------------------------------------------------
/CITATION.cff:
--------------------------------------------------------------------------------
1 | cff-version: 1.1.0
2 | authors:
3 | - family-names: Partee
4 | given-names: Sam
5 | orcid: https://orcid.org/0000-0001-6005-5116
6 | email: spartee@hpe.com
7 | - family-names: Ellis
8 | given-names: Matthew
9 | orcid: https://orcid.org/0000-0002-5782-5447
10 | - family-names: Rigazzi
11 | given-names: Alessandro
12 | orcid: https://orcid.org/0000-0003-2132-7726
13 | - family-names: Bachman
14 | given-names: Scott
15 | orcid: https://orcid.org/0000-0002-6479-4300
16 | - family-names: Marques
17 | given-names: Gustavo
18 | orcid: https://orcid.org/0000-0001-7238-0290
19 | - family-names: Shao
20 | given-names: Andrew
21 | orcid: https://orcid.org/0000-0003-3658-512X
22 | - family-names: Benjamin
23 | given-names: Robbins
24 | orcid: https://orcid.org/0000-0003-3658-512X
25 |
26 | title: "Using Machine Learning at Scale in HPC Simulations with SmartSim: An Application to Ocean Climate Modeling"
27 | doi: 10.5281/zenodo.4682270
28 | date-released: 2021-4-12
29 | license: "BSD-2-Clause"
30 |
--------------------------------------------------------------------------------
/CONTRIBUTING.rst:
--------------------------------------------------------------------------------
1 | doc/contributing.rst
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | BSD 2-Clause License
2 |
3 | Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include Makefile
2 | graft smartsim/
3 | global-exclude __pycache__
4 | global-exclude *.py[co]
5 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | codecov:
2 | require_ci_to_pass: yes
3 |
4 | coverage:
5 | precision: 2
6 | round: down
7 | range: "70...100"
8 |
9 | status:
10 | patch:
11 | default:
12 | # Account for some variability in codecov
13 | target: 0%
14 | project:
15 | default:
16 | # Account for some variability in codecov
17 | target: 0%
18 |
19 | parsers:
20 | gcov:
21 | branch_detection:
22 | conditional: yes
23 | loop: yes
24 | method: no
25 | macro: no
26 |
27 | comment:
28 | layout: "reach,diff,flags,files"
29 | behavior: default # update comment if already exists, otherwise post new
30 | require_changes: no
31 | require_base: no
32 | require_head: yes
33 |
--------------------------------------------------------------------------------
/doc/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line, and also
5 | # from the environment for the first two.
6 | SPHINXOPTS ?=
7 | SPHINXBUILD ?= sphinx-build
8 | SOURCEDIR = .
9 | BUILDDIR = _build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 |
21 | # build the doxygen files for Clients
22 | (cd ../smartredis/doc; doxygen Doxyfile_c; doxygen Doxyfile_cpp; doxygen Doxyfile_fortran)
23 |
24 | # Symlink SmartRedis examples
25 | (cd ../; ln -s ./smartredis/examples ./examples)
26 |
27 |
28 | # build docs
29 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
30 |
31 | # remove SmartRedis examples symlink
32 | rm -rf ../examples
33 |
--------------------------------------------------------------------------------
/doc/_static/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/_static/.nojekyll
--------------------------------------------------------------------------------
/doc/_static/custom_tab_style.css:
--------------------------------------------------------------------------------
1 | .sphinx-tabs-panel {
2 | background-color: inherit;
3 | }
4 |
5 | .sphinx-tabs-tab[aria-selected="true"] {
6 | background-color: inherit;
7 | }
--------------------------------------------------------------------------------
/doc/_static/version_names.json:
--------------------------------------------------------------------------------
1 | {
2 | "version_names":[
3 | "develop (unstable)",
4 | "0.8.0 (stable)",
5 | "0.7.0",
6 | "0.6.2",
7 | "0.6.1",
8 | "0.6.0",
9 | "0.5.1",
10 | "0.5.0",
11 | "0.4.2",
12 | "0.4.1",
13 | "0.4.0",
14 | "0.3.2"
15 | ],
16 | "version_urls": [
17 | "https://www.craylabs.org/develop/overview.html",
18 | "https://www.craylabs.org/docs/overview.html",
19 | "https://www.craylabs.org/docs/versions/0.7.0/overview.html",
20 | "https://www.craylabs.org/docs/versions/0.6.2/overview.html",
21 | "https://www.craylabs.org/docs/versions/0.6.1/overview.html",
22 | "https://www.craylabs.org/docs/versions/0.6.0/overview.html",
23 | "https://www.craylabs.org/docs/versions/0.5.1/overview.html",
24 | "https://www.craylabs.org/docs/versions/0.5.0/overview.html",
25 | "https://www.craylabs.org/docs/versions/0.4.2/overview.html",
26 | "https://www.craylabs.org/docs/versions/0.4.1/overview.html",
27 | "https://www.craylabs.org/docs/versions/0.4.0/overview.html",
28 | "https://www.craylabs.org/docs/versions/0.3.2/overview.html"
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/doc/_templates/versions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SmartSim Documentation Versions
5 | The following versions of the SmartSim docs are currently available:
6 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/doc/api/smartredis_api.rst:
--------------------------------------------------------------------------------
1 | .. _smartredis-api:
2 |
3 | **************
4 | SmartRedis API
5 | **************
6 |
7 |
8 | Python
9 | ******
10 |
11 | .. include:: ../../smartredis/doc/clients/python.rst
12 | :start-line: 4
13 |
14 | C++
15 | ***
16 |
17 | .. include:: ../../smartredis/doc/clients/c-plus.rst
18 | :start-line: 4
19 |
20 |
21 | C
22 | ***
23 |
24 | .. include:: ../../smartredis/doc/clients/c.rst
25 | :start-line: 4
26 |
27 |
28 | Fortran
29 | *******
30 |
31 | .. include:: ../../smartredis/doc/clients/fortran.rst
32 | :start-line: 4
33 |
--------------------------------------------------------------------------------
/doc/images/Experiment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/Experiment.png
--------------------------------------------------------------------------------
/doc/images/Orchestrator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/Orchestrator.png
--------------------------------------------------------------------------------
/doc/images/SmartSim-Logo-Final-tb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/SmartSim-Logo-Final-tb.png
--------------------------------------------------------------------------------
/doc/images/SmartSim-Logo-final-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/SmartSim-Logo-final-white.png
--------------------------------------------------------------------------------
/doc/images/SmartSim-orchestrator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/SmartSim-orchestrator.png
--------------------------------------------------------------------------------
/doc/images/SmartSim_Architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/SmartSim_Architecture.png
--------------------------------------------------------------------------------
/doc/images/SmartSim_Large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/SmartSim_Large.png
--------------------------------------------------------------------------------
/doc/images/SmartSim_Large_Inv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/SmartSim_Large_Inv.png
--------------------------------------------------------------------------------
/doc/images/clustered-orc-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/clustered-orc-diagram.png
--------------------------------------------------------------------------------
/doc/images/clustered_orchestrator-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/clustered_orchestrator-1.png
--------------------------------------------------------------------------------
/doc/images/co-located-orc-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/co-located-orc-diagram.png
--------------------------------------------------------------------------------
/doc/images/colocated_orchestrator-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/colocated_orchestrator-1.png
--------------------------------------------------------------------------------
/doc/images/latticeboltzmann.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/latticeboltzmann.png
--------------------------------------------------------------------------------
/doc/images/smartsim-arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/smartsim-arch.png
--------------------------------------------------------------------------------
/doc/images/ss-arch-overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/doc/images/ss-arch-overview.png
--------------------------------------------------------------------------------
/doc/index.rst:
--------------------------------------------------------------------------------
1 | .. SmartSim documentation master file, created by
2 | sphinx-quickstart on Sat Sep 14 15:07:14 2019.
3 |
4 | .. toctree::
5 | :maxdepth: 1
6 |
7 | versions
8 |
9 | .. toctree::
10 | :maxdepth: 3
11 | :caption: Getting Started
12 |
13 | overview
14 | installation_instructions/basic
15 | installation_instructions/platform
16 | contributing
17 | smartsim_zoo
18 |
19 | .. toctree::
20 | :maxdepth: 2
21 | :caption: Tutorials
22 |
23 | tutorials/getting_started/getting_started
24 | tutorials/online_analysis/lattice/online_analysis
25 | tutorials/ml_inference/Inference-in-SmartSim
26 | tutorials/ml_training/surrogate/train_surrogate
27 |
28 | .. toctree::
29 | :maxdepth: 2
30 | :caption: SmartSim
31 |
32 | experiment
33 | run_settings
34 | batch_settings
35 | model
36 | ensemble
37 | orchestrator
38 | ss_logger
39 | ml_features
40 | dragon
41 | api/smartsim_api
42 |
43 | .. toctree::
44 | :maxdepth: 2
45 | :caption: SmartRedis
46 |
47 | smartredis
48 | sr_integration
49 | sr_python_walkthrough
50 | sr_cpp_walkthrough
51 | sr_fortran_walkthrough
52 | sr_data_structures
53 | sr_dataset_conversions
54 | sr_runtime
55 | sr_advanced_topics
56 | api/smartredis_api
57 |
58 | .. toctree::
59 | :maxdepth: 2
60 | :caption: SmartDashboard
61 |
62 | smartdashboard
63 |
64 | .. toctree::
65 | :maxdepth: 2
66 | :caption: Reference
67 |
68 | changelog
69 | code_of_conduct
70 | developer
71 | testing
72 |
73 |
74 | Indices and tables
75 | ==================
76 |
77 | * :ref:`search`
78 |
--------------------------------------------------------------------------------
/doc/installation_instructions/platform.rst:
--------------------------------------------------------------------------------
1 | .. _install-notes:
2 |
3 | Installation on specific platforms
4 | ==================================
5 |
6 | The following describes installation details for various systems and platforms
7 | that SmartSim may be used on.
8 |
9 | .. include:: platform/generic.rst
10 |
11 | .. include:: platform/nonroot-linux.rst
12 |
13 | .. include:: platform/frontier.rst
14 |
15 | .. include:: platform/perlmutter.rst
16 |
17 | .. include:: platform/cray.rst
18 |
19 | .. include:: platform/ncar-cheyenne.rst
20 |
21 | .. include:: platform/pml-scylla.rst
22 |
23 | .. _site_installation:
24 |
25 | .. include:: site-install.rst
26 |
--------------------------------------------------------------------------------
/doc/installation_instructions/platform/cray.rst:
--------------------------------------------------------------------------------
1 | HPE Cray supercomputers
2 | =======================
3 |
4 | On certain HPE Cray machines, the SmartSim dependencies have been installed
5 | system-wide though specific paths and names might vary (please contact the team
6 | if these instructions do not work).
7 |
8 | .. code-block:: bash
9 |
10 | module use -a /lus/scratch/smartsim/local/modulefiles
11 | module load cudatoolkit/11.8 cudnn git-lfs
12 |
13 | module unload PrgEnv-cray PrgEnv-intel PrgEnv-gcc
14 | module load PrgEnv-gnu
15 | module switch gcc/11.2.0
16 |
17 | export CRAYPE_LINK_TYPE=dynamic
18 |
19 | This should provide all the dependencies needed to build the GPU backends for
20 | the ML bakcends. Users can thus proceed with their preferred way of installing
21 | SmartSim either :ref:`from PyPI ` or :ref:`from source
22 | `.
23 |
24 |
--------------------------------------------------------------------------------
/doc/installation_instructions/platform/ncar-cheyenne.rst:
--------------------------------------------------------------------------------
1 |
2 | Cheyenne at NCAR
3 | ================
4 |
5 | Since SmartSim does not currently support the Message Passing Toolkit (MPT),
6 | Cheyenne users of SmartSim will need to utilize OpenMPI.
7 |
8 | The following module commands were utilized to run the examples:
9 |
10 | .. code-block:: bash
11 |
12 | $ module purge
13 | $ module load ncarenv/1.3 gnu/8.3.0 ncarcompilers/0.5.0 netcdf/4.7.4 openmpi/4.0.5
14 |
15 | With this environment loaded, users will need to build and install both SmartSim
16 | and SmartRedis through pip. Usually we recommend users installing or loading
17 | miniconda and using the pip that comes with that installation.
18 |
19 | .. code-block:: bash
20 |
21 | $ pip install smartsim
22 | $ smart build --device cpu #(Since Cheyenne does not have GPUs)
23 |
24 | To make the SmartRedis library (C, C++, Fortran clients), follow these steps
25 | with the same environment loaded.
26 |
27 | .. code-block:: bash
28 |
29 | # clone SmartRedis and build
30 | $ git clone https://github.com/SmartRedis.git smartredis
31 | $ cd smartredis
32 | $ make lib
33 |
34 |
--------------------------------------------------------------------------------
/doc/installation_instructions/platform/nonroot-linux.rst:
--------------------------------------------------------------------------------
1 | GPU dependencies (non-root)
2 | ===========================
3 |
4 | The Nvidia installation instructions for CUDA Toolkit and cuDNN tend to be
5 | tailored for users with root access. For those on HPC platforms where root
6 | access is rare, manually downloading and installing these dependencies as
7 | a user is possible.
8 |
9 | .. code-block:: bash
10 |
11 | wget https://developer.download.nvidia.com/compute/cuda/11.4.4/local_installers/cuda_11.4.4_470.82.01_linux.run
12 | chmod +x cuda_11.4.4_470.82.01_linux.run
13 | ./cuda_11.4.4_470.82.01_linux.run --toolkit --silent --toolkitpath=/path/to/install/location/
14 |
15 | For cuDNN, follow `Nvidia's instructions
16 | `_,
17 | and copy the cuDNN libraries to the `lib64` directory at the CUDA Toolkit
18 | location specified above.
--------------------------------------------------------------------------------
/doc/installation_instructions/platform/perlmutter.rst:
--------------------------------------------------------------------------------
1 | NERSC Perlmutter
2 | ================
3 |
4 | One-time Setup
5 | --------------
6 |
7 | To install SmartSim on Perlmutter, follow these steps:
8 |
9 | **Step 1:** Create and activate a conda environment for SmartSim:
10 |
11 | .. code:: bash
12 |
13 | module load conda cudatoolkit/12.2 cudnn/8.9.3_cuda12 PrgEnv-gnu
14 | conda create -n smartsim python=3.11
15 | conda activate smartsim
16 |
17 | **Step 2:** Build the SmartRedis C++ and Fortran libraries:
18 |
19 | .. code:: bash
20 |
21 | git clone https://github.com/CrayLabs/SmartRedis.git
22 | cd SmartRedis
23 | make lib-with-fortran
24 | pip install .
25 | cd ..
26 |
27 | **Step 3:** Install SmartSim in the conda environment:
28 |
29 | .. code:: bash
30 |
31 | pip install git+https://github.com/CrayLabs/SmartSim.git
32 |
33 | **Step 4:** Build Redis, RedisAI, the backends, and all the Python packages:
34 |
35 | .. code:: bash
36 |
37 | smart build --device=cuda-12
38 |
39 | **Step 5:** Check that SmartSim has been installed and built correctly:
40 |
41 | .. code:: bash
42 |
43 | smart validate --device gpu
44 |
45 | The following output indicates a successful install:
46 |
47 | .. code:: bash
48 |
49 | [SmartSim] INFO Verifying Tensor Transfer
50 | [SmartSim] INFO Verifying Torch Backend
51 | [SmartSim] INFO Verifying ONNX Backend
52 | [SmartSim] INFO Verifying TensorFlow Backend
53 | 16:26:35 login SmartSim[557020:MainThread] INFO Success!
54 |
55 | Post-installation
56 | -----------------
57 |
58 | After completing the above steps to install SmartSim in a conda environment, you
59 | can reload the conda environment by running the following commands:
60 |
61 | .. code:: bash
62 |
63 | module load conda cudatoolkit/12.2 cudnn/8.9.3_cuda12 PrgEnv-gnu
64 | conda activate smartsim
65 |
--------------------------------------------------------------------------------
/doc/installation_instructions/site-install.rst:
--------------------------------------------------------------------------------
1 | Site Installation
2 | =================
3 |
4 | Certain HPE customer machines have a site installation of SmartSim. This means
5 | that users can bypass the ``smart build`` step that builds the ML backends and
6 | the Redis binaries. Users on these platforms can install SmartSim from PyPI or
7 | from source with the following steps replacing ``COMPILER_VERSION`` and
8 | ``SMARTSIM_VERSION`` with the desired entries.
9 |
10 | .. code:: bash
11 |
12 | module use -a /lus/scratch/smartsim/local/modulefiles
13 | module load cudatoolkit/11.8 cudnn smartsim-deps/COMPILER_VERSION/SMARTSIM_VERSION
14 | pip install smartsim
15 | smart build --skip-backends --device gpu [--onnx]
16 |
--------------------------------------------------------------------------------
/doc/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | pushd %~dp0
4 |
5 | REM Command file for Sphinx documentation
6 |
7 | if "%SPHINXBUILD%" == "" (
8 | set SPHINXBUILD=sphinx-build
9 | )
10 | set SOURCEDIR=.
11 | set BUILDDIR=_build
12 |
13 | if "%1" == "" goto help
14 |
15 | %SPHINXBUILD% >NUL 2>NUL
16 | if errorlevel 9009 (
17 | echo.
18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19 | echo.installed, then set the SPHINXBUILD environment variable to point
20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
21 | echo.may add the Sphinx directory to PATH.
22 | echo.
23 | echo.If you don't have Sphinx installed, grab it from
24 | echo.http://sphinx-doc.org/
25 | exit /b 1
26 | )
27 |
28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29 | goto end
30 |
31 | :help
32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33 |
34 | :end
35 | popd
36 |
--------------------------------------------------------------------------------
/doc/smartdashboard.rst:
--------------------------------------------------------------------------------
1 |
2 | **************
3 | SmartDashboard
4 | **************
5 |
6 | .. include:: ../smartdashboard/doc/overview.rst
7 | :start-line: 4
--------------------------------------------------------------------------------
/doc/smartredis.rst:
--------------------------------------------------------------------------------
1 |
2 | **********
3 | SmartRedis
4 | **********
5 |
6 | .. include:: ../smartredis/doc/overview.rst
7 | :start-line: 4
--------------------------------------------------------------------------------
/doc/sr_advanced_topics.rst:
--------------------------------------------------------------------------------
1 | .. _config_options_explain:
2 | .. include:: ../smartredis/doc/advanced_topics.rst
--------------------------------------------------------------------------------
/doc/sr_data_structures.rst:
--------------------------------------------------------------------------------
1 |
2 | .. include:: ../smartredis/doc/data_structures.rst
3 |
--------------------------------------------------------------------------------
/doc/sr_dataset_conversions.rst:
--------------------------------------------------------------------------------
1 |
2 | .. include:: ../smartredis/doc/dataset_conversions.rst
--------------------------------------------------------------------------------
/doc/sr_runtime.rst:
--------------------------------------------------------------------------------
1 |
2 | .. include:: ../smartredis/doc/runtime.rst
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/application_consumer_script.py:
--------------------------------------------------------------------------------
1 | from smartredis import Client, LLInfo
2 |
3 | # Initialize a Client
4 | client = Client(cluster=False)
5 |
6 | # Set the data source
7 | client.set_data_source("producer_0")
8 | # Check if the tensor exists
9 | tensor_1 = client.poll_tensor("tensor", 100, 100)
10 |
11 | # Set the data source
12 | client.set_data_source("producer_1")
13 | # Check if the tensor exists
14 | tensor_2 = client.poll_tensor("tensor", 100, 100)
15 |
16 | client.log_data(LLInfo, f"producer_0.tensor was found: {tensor_1}")
17 | client.log_data(LLInfo, f"producer_1.tensor was found: {tensor_2}")
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/application_producer_script.py:
--------------------------------------------------------------------------------
1 | from smartredis import Client
2 | import numpy as np
3 |
4 | # Initialize a Client
5 | client = Client(cluster=False)
6 |
7 | # Create NumPy array
8 | array = np.array([1, 2, 3, 4])
9 | # Use SmartRedis Client to place tensor in standalone Orchestrator
10 | client.put_tensor("tensor", array)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/ensemble_ml_model_file.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 | from tensorflow import keras
3 | from tensorflow.keras.layers import Conv2D, Input
4 |
5 | class Net(keras.Model):
6 | def __init__(self):
7 | super(Net, self).__init__(name="cnn")
8 | self.conv = Conv2D(1, 3, 1)
9 |
10 | def call(self, x):
11 | y = self.conv(x)
12 | return y
13 |
14 | def save_tf_cnn(path, file_name):
15 | """Create a Keras CNN and save to file for example purposes"""
16 | from smartsim.ml.tf import freeze_model
17 |
18 | n = Net()
19 | input_shape = (3, 3, 1)
20 | n.build(input_shape=(None, *input_shape))
21 | inputs = Input(input_shape)
22 | outputs = n(inputs)
23 | model = keras.Model(inputs=inputs, outputs=outputs, name=n.name)
24 |
25 | return freeze_model(model, path, file_name)
26 |
27 | # Initialize the Experiment and set the launcher to auto
28 | exp = Experiment("getting-started", launcher="auto")
29 |
30 | # Initialize a RunSettings object
31 | ensemble_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
32 |
33 | # Initialize a Model object
34 | ensemble_instance = exp.create_ensemble("ensemble_name", ensemble_settings)
35 |
36 | # Serialize and save TF model to file
37 | model_file, inputs, outputs = save_tf_cnn(ensemble_instance.path, "model.pb")
38 |
39 | # Attach ML model file to Ensemble
40 | ensemble_instance.add_ml_model(name="cnn", backend="TF", model_path=model_file, device="GPU", devices_per_node=2, first_device=0, inputs=inputs, outputs=outputs)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/ensemble_ml_model_mem.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 | from tensorflow import keras
3 | from tensorflow.keras.layers import Conv2D, Input
4 |
5 | class Net(keras.Model):
6 | def __init__(self):
7 | super(Net, self).__init__(name="cnn")
8 | self.conv = Conv2D(1, 3, 1)
9 |
10 | def call(self, x):
11 | y = self.conv(x)
12 | return y
13 |
14 | def create_tf_cnn():
15 | """Create an in-memory Keras CNN for example purposes
16 |
17 | """
18 | from smartsim.ml.tf import serialize_model
19 | n = Net()
20 | input_shape = (3,3,1)
21 | inputs = Input(input_shape)
22 | outputs = n(inputs)
23 | model = keras.Model(inputs=inputs, outputs=outputs, name=n.name)
24 |
25 | return serialize_model(model)
26 |
27 | # Serialize and save TF model
28 | model, inputs, outputs = create_tf_cnn()
29 |
30 | # Initialize the Experiment and set the launcher to auto
31 | exp = Experiment("getting-started", launcher="auto")
32 |
33 | # Initialize a RunSettings object
34 | ensemble_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
35 |
36 | # Initialize a Model object
37 | ensemble_instance = exp.create_ensemble("ensemble_name", ensemble_settings)
38 |
39 | # Attach the in-memory ML model to the SmartSim Ensemble
40 | ensemble_instance.add_ml_model(name="cnn", backend="TF", model=model, device="GPU", devices_per_node=2, first_device=0, inputs=inputs, outputs=outputs)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/ensemble_torchscript_file.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a RunSettings object
7 | ensemble_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
8 |
9 | # Initialize a Model object
10 | ensemble_instance = exp.create_ensemble("ensemble_name", ensemble_settings)
11 |
12 | # Attach TorchScript to Ensemble
13 | ensemble_instance.add_script(name="example_script", script_path="path/to/torchscript.py", device="GPU", devices_per_node=2, first_device=0)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/ensemble_torchscript_mem.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | def timestwo(x):
4 | return 2*x
5 |
6 | # Initialize the Experiment and set the launcher to auto
7 | exp = Experiment("getting-started", launcher="auto")
8 |
9 | # Initialize a RunSettings object
10 | ensemble_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
11 |
12 | # Initialize a Ensemble object
13 | ensemble_instance = exp.create_ensemble("ensemble_name", ensemble_settings)
14 |
15 | # Attach TorchScript to Ensemble
16 | ensemble_instance.add_function(name="example_func", function=timestwo, device="GPU", devices_per_node=2, first_device=0)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/ensemble_torchscript_string.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a RunSettings object
7 | ensemble_settings = exp.create_run_settings(exe="path/to/executable/simulation")
8 |
9 | # Initialize a Model object
10 | ensemble_instance = exp.create_ensemble("ensemble_name", ensemble_settings)
11 |
12 | # TorchScript string
13 | torch_script_str = "def negate(x):\n\treturn torch.neg(x)\n"
14 |
15 | # Attach TorchScript to Ensemble
16 | ensemble_instance.add_script(name="example_script", script=torch_script_str, device="GPU", devices_per_node=2, first_device=0)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/experiment_driver.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 | from smartsim.log import get_logger
3 |
4 | logger = get_logger("Experiment Log")
5 | # Initialize the Experiment
6 | exp = Experiment("getting-started", launcher="auto")
7 |
8 | # Initialize a standalone Orchestrator
9 | standalone_orch = exp.create_database(db_nodes=1)
10 |
11 | # Initialize a RunSettings object for Ensemble
12 | ensemble_settings = exp.create_run_settings(exe="/path/to/executable_producer_simulation")
13 |
14 | # Initialize Ensemble
15 | producer_ensemble = exp.create_ensemble("producer", run_settings=ensemble_settings, replicas=2)
16 |
17 | # Enable key prefixing for Ensemble members
18 | producer_ensemble.enable_key_prefixing()
19 |
20 | # Initialize a RunSettings object for Model
21 | model_settings = exp.create_run_settings(exe="/path/to/executable_consumer_simulation")
22 | # Initialize Model
23 | consumer_model = exp.create_model("consumer", model_settings)
24 |
25 | # Generate SmartSim entity folder tree
26 | exp.generate(standalone_orch, producer_ensemble, consumer_model, overwrite=True)
27 |
28 | # Launch Orchestrator
29 | exp.start(standalone_orch, summary=True)
30 |
31 | # Launch Ensemble
32 | exp.start(producer_ensemble, block=True, summary=True)
33 |
34 | # Register Ensemble members on consumer Model
35 | for model in producer_ensemble:
36 | consumer_model.register_incoming_entity(model)
37 |
38 | # Launch consumer Model
39 | exp.start(consumer_model, block=True, summary=True)
40 |
41 | # Clobber Orchestrator
42 | exp.stop(standalone_orch)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/file_attach.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a RunSettings object
7 | ensemble_settings = exp.create_run_settings(exe="python", exe_args="/path/to/application.py")
8 |
9 | # Initialize an Ensemble object via replicas strategy
10 | example_ensemble = exp.create_ensemble("ensemble", ensemble_settings, replicas=2, params={"THERMO":1})
11 |
12 | # Attach the file to the Ensemble instance
13 | example_ensemble.attach_generator_files(to_configure="path/to/params_inputs.txt")
14 |
15 | # Generate the Ensemble directory
16 | exp.generate(example_ensemble)
17 |
18 | # Launch the Ensemble
19 | exp.start(example_ensemble)
20 |
21 |
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/manual_append_ensemble.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize BatchSettings
7 | bs = exp.create_batch_settings(nodes=10,
8 | time="01:00:00")
9 |
10 | # Initialize Ensemble
11 | ensemble = exp.create_ensemble("ensemble-append", batch_settings=bs)
12 |
13 | # Initialize RunSettings for Model 1
14 | srun_settings_1 = exp.create_run_settings(exe=exe, exe_args="path/to/application_script_1.py")
15 | # Initialize RunSettings for Model 2
16 | srun_settings_2 = exp.create_run_settings(exe=exe, exe_args="path/to/application_script_2.py")
17 | # Initialize Model 1 with RunSettings 1
18 | model_1 = exp.create_model(name="model_1", run_settings=srun_settings_1)
19 | # Initialize Model 2 with RunSettings 2
20 | model_2 = exp.create_model(name="model_2", run_settings=srun_settings_2)
21 |
22 | # Add Model member to Ensemble
23 | ensemble.add_model(model_1)
24 | # Add Model member to Ensemble
25 | ensemble.add_model(model_2)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/param_expansion_1.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a RunSettings
7 | rs = exp.create_run_settings(exe="path/to/example_simulation_program")
8 |
9 | #Create the parameters to expand to the Ensemble members
10 | params = {
11 | "name": ["Ellie", "John"],
12 | "parameter": [2, 11]
13 | }
14 |
15 | # Initialize the Ensemble by specifying RunSettings, the params and "all_perm"
16 | ensemble = exp.create_ensemble("model_member", run_settings=rs, params=params, perm_strategy="all_perm")
17 |
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/param_expansion_2.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a BatchSettings
7 | bs = exp.create_batch_settings(nodes=2,
8 | time="10:00:00")
9 |
10 | # Initialize and configure RunSettings
11 | rs = exp.create_run_settings(exe="python", exe_args="path/to/application_script.py")
12 | rs.set_nodes(1)
13 |
14 | #Create the parameters to expand to the Ensemble members
15 | params = {
16 | "name": ["Ellie", "John"],
17 | "parameter": [2, 11]
18 | }
19 |
20 | # Initialize the Ensemble by specifying RunSettings, BatchSettings, the params and "step"
21 | ensemble = exp.create_ensemble("ensemble", run_settings=rs, batch_settings=bs, params=params, perm_strategy="step")
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/replicas_1.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a RunSettings object
7 | rs = exp.create_run_settings(exe="python", exe_args="path/to/application_script.py")
8 |
9 | # Initialize the Ensemble by specifying the number of replicas and RunSettings
10 | ensemble = exp.create_ensemble("ensemble-replica", replicas=4, run_settings=rs)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/ensemble_doc_examples/replicas_2.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a BatchSettings object
7 | bs = exp.create_batch_settings(nodes=4,
8 | time="10:00:00")
9 |
10 | # Initialize and configure a RunSettings object
11 | rs = exp.create_run_settings(exe="python", exe_args="path/to/application_script.py")
12 | rs.set_nodes(4)
13 |
14 | # Initialize an Ensemble
15 | ensemble = exp.create_ensemble("ensemble-replica", replicas=4, run_settings=rs, batch_settings=bs)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/experiment_doc_examples/exp.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 | from smartsim._core.control.previewrenderer import Verbosity
3 | from smartsim.log import get_logger
4 |
5 | # Initialize an Experiment
6 | exp = Experiment("example-experiment", launcher="auto")
7 | # Initialize a SmartSim logger
8 | smartsim_logger = get_logger("logger")
9 |
10 | # Initialize an Orchestrator
11 | standalone_database = exp.create_database(db_nodes=3, port=6379, interface="ib0")
12 |
13 | # Initialize the Model RunSettings
14 | settings = exp.create_run_settings("echo", exe_args="Hello World")
15 | # Initialize the Model
16 | model = exp.create_model("hello_world", settings)
17 |
18 | # Generate the output directory
19 | exp.generate(standalone_database, model, overwrite=True)
20 |
21 | # Preview the experiment
22 | exp.preview(standalone_database, model, verbosity_level=Verbosity.DEBUG)
23 |
24 | # Launch the Orchestrator then Model instance
25 | exp.start(standalone_database, model)
26 |
27 | # Clobber the Orchestrator
28 | exp.stop(standalone_database)
29 | # Log the summary of the Experiment
30 | smartsim_logger.info(exp.summary())
31 |
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/from_file_ml_model.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 | from tensorflow import keras
3 | from tensorflow.keras.layers import Conv2D, Input
4 |
5 | class Net(keras.Model):
6 | def __init__(self):
7 | super(Net, self).__init__(name="cnn")
8 | self.conv = Conv2D(1, 3, 1)
9 |
10 | def call(self, x):
11 | y = self.conv(x)
12 | return y
13 |
14 | def save_tf_cnn(path, file_name):
15 | """Create a Keras CNN and save to file for example purposes"""
16 | from smartsim.ml.tf import freeze_model
17 |
18 | n = Net()
19 | input_shape = (3, 3, 1)
20 | n.build(input_shape=(None, *input_shape))
21 | inputs = Input(input_shape)
22 | outputs = n(inputs)
23 | model = keras.Model(inputs=inputs, outputs=outputs, name=n.name)
24 |
25 | return freeze_model(model, path, file_name)
26 |
27 | # Initialize the Experiment and set the launcher to auto
28 | exp = Experiment("getting-started", launcher="auto")
29 |
30 | # Initialize a RunSettings object
31 | model_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
32 |
33 | # Initialize a Model object
34 | model_instance = exp.create_model("model_name", model_settings)
35 |
36 | # Get and save TF model
37 | model_file, inputs, outputs = save_tf_cnn(model_instance.path, "model.pb")
38 |
39 | # Attach the from file ML model to the SmartSim Model
40 | model_instance.add_ml_model(name="cnn", backend="TF", model_path=model_file, device="GPU", devices_per_node=2, first_device=0, inputs=inputs, outputs=outputs)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/from_file_script.py:
--------------------------------------------------------------------------------
1 |
2 | from smartsim import Experiment
3 |
4 | # Initialize the Experiment and set the launcher to auto
5 | exp = Experiment("getting-started", launcher="auto")
6 |
7 | # Initialize a RunSettings object
8 | model_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
9 |
10 | # Initialize a Model object
11 | model_instance = exp.create_model("model_name", model_settings)
12 |
13 | # Attach TorchScript to Model
14 | model_instance.add_script(name="example_script", script_path="path/to/torchscript.py", device="GPU", devices_per_node=2, first_device=0)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/in_mem_ml_model.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 | from tensorflow import keras
3 | from tensorflow.keras.layers import Conv2D, Input
4 |
5 | class Net(keras.Model):
6 | def __init__(self):
7 | super(Net, self).__init__(name="cnn")
8 | self.conv = Conv2D(1, 3, 1)
9 |
10 | def call(self, x):
11 | y = self.conv(x)
12 | return y
13 |
14 | def create_tf_cnn():
15 | """Create an in-memory Keras CNN for example purposes
16 |
17 | """
18 | from smartsim.ml.tf import serialize_model
19 | n = Net()
20 | input_shape = (3,3,1)
21 | inputs = Input(input_shape)
22 | outputs = n(inputs)
23 | model = keras.Model(inputs=inputs, outputs=outputs, name=n.name)
24 |
25 | return serialize_model(model)
26 |
27 | # Serialize and save TF model
28 | model, inputs, outputs = create_tf_cnn()
29 |
30 | # Initialize the Experiment and set the launcher to auto
31 | exp = Experiment("getting-started", launcher="auto")
32 |
33 | # Initialize a RunSettings object
34 | model_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
35 |
36 | # Initialize a Model object
37 | model_instance = exp.create_model("model_name", model_settings)
38 |
39 | # Attach the in-memory ML model to the SmartSim Model
40 | model_instance.add_ml_model(name="cnn", backend="TF", model=model, device="GPU", devices_per_node=2, first_device=0, inputs=inputs, outputs=outputs)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/in_mem_script.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | def timestwo(x):
4 | return 2*x
5 |
6 | # Initialize the Experiment and set the launcher to auto
7 | exp = Experiment("getting-started", launcher="auto")
8 |
9 | # Initialize a RunSettings object
10 | model_settings = exp.create_run_settings(exe="path/to/example_simulation_program")
11 |
12 | # Initialize a Model object
13 | model_instance = exp.create_model("model_name", model_settings)
14 |
15 | # Append TorchScript function to Model
16 | model_instance.add_function(name="example_func", function=timestwo, device="GPU", devices_per_node=2, first_device=0)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/model_file.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a RunSettings object
7 | model_settings = exp.create_run_settings(exe="path/to/executable/simulation")
8 |
9 | # Initialize a Model object
10 | model_instance = exp.create_model("model_name", model_settings, params={"THERMO":1})
11 |
12 | # Attach the file to the Model instance
13 | model_instance.attach_generator_files(to_configure="path/to/params_inputs.txt")
14 |
15 | # Store model_instance outputs within the Experiment directory named getting-started
16 | exp.generate(model_instance)
17 |
18 | # Launch the Model
19 | exp.start(model_instance)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/model_init.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Init Experiment and specify to launch locally in this example
4 | exp = Experiment(name="getting-started", launcher="local")
5 |
6 | # Initialize RunSettings
7 | model_settings = exp.create_run_settings(exe="echo", exe_args="Hello World")
8 |
9 | # Initialize Model instance
10 | model_instance = exp.create_model(name="example-model", run_settings=model_settings)
11 |
12 | # Generate Model directory
13 | exp.generate(model_instance)
14 |
15 | # Launch Model
16 | exp.start(model_instance)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/prefix_data.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Create the run settings for the Model
7 | model_settings = exp.create_run_settings(exe="path/to/executable/simulation")
8 |
9 | # Create a Model instance named 'model'
10 | model = exp.create_model("model_name", model_settings)
11 | # Enable tensor, Dataset and list prefixing on the 'model' instance
12 | model.enable_key_prefixing()
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/model_doc_examples/string_script.py:
--------------------------------------------------------------------------------
1 | from smartsim import Experiment
2 |
3 | # Initialize the Experiment and set the launcher to auto
4 | exp = Experiment("getting-started", launcher="auto")
5 |
6 | # Initialize a RunSettings object
7 | model_settings = exp.create_run_settings(exe="path/to/executable/simulation")
8 |
9 | # Initialize a Model object
10 | model_instance = exp.create_model("model_name", model_settings)
11 |
12 | # TorchScript string
13 | torch_script_str = "def negate(x):\n\treturn torch.neg(x)\n"
14 |
15 | # Attach TorchScript to Model
16 | model_instance.add_script(name="example_script", script=torch_script_str, device="GPU", devices_per_node=2, first_device=0)
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/orch_examples/colo_app.py:
--------------------------------------------------------------------------------
1 | from smartredis import Client, LLInfo
2 | import numpy as np
3 |
4 | # Initialize a Client
5 | colo_client = Client(cluster=False)
6 |
7 | # Create NumPy array
8 | local_array = np.array([1, 2, 3, 4])
9 | # Store the NumPy tensor
10 | colo_client.put_tensor("tensor_1", local_array)
11 |
12 | # Retrieve tensor from driver script
13 | local_tensor = colo_client.get_tensor("tensor_1")
14 | # Log tensor
15 | colo_client.log_data(LLInfo, f"The colocated db tensor is: {local_tensor}")
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/orch_examples/colo_driver.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from smartredis import Client
3 | from smartsim import Experiment
4 | from smartsim.log import get_logger
5 |
6 | # Initialize a logger object
7 | logger = get_logger("Example Experiment Log")
8 | # Initialize the Experiment
9 | exp = Experiment("getting-started", launcher="auto")
10 |
11 | # Initialize a RunSettings object
12 | model_settings = exp.create_run_settings(exe="path/to/executable_simulation")
13 | # Configure RunSettings object
14 | model_settings.set_nodes(1)
15 |
16 | # Initialize a SmartSim Model
17 | model = exp.create_model("colo_model", model_settings)
18 |
19 | # Colocate the Model
20 | model.colocate_db_uds()
21 |
22 | # Generate output files
23 | exp.generate(model)
24 |
25 | # Launch the colocated Model
26 | exp.start(model, block=True, summary=True)
27 |
28 | # Log the Experiment summary
29 | logger.info(exp.summary())
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/orch_examples/std_app.py:
--------------------------------------------------------------------------------
1 | from smartredis import Client, LLInfo
2 | import numpy as np
3 |
4 | # Initialize a SmartRedis Client
5 | application_client = Client(cluster=True)
6 |
7 | # Retrieve the driver script tensor from Orchestrator
8 | driver_script_tensor = application_client.get_tensor("tensor_1")
9 | # Log the tensor
10 | application_client.log_data(LLInfo, f"The multi-sharded db tensor is: {driver_script_tensor}")
11 |
12 | # Create a NumPy array
13 | local_array = np.array([5, 6, 7, 8])
14 | # Use SmartRedis client to place tensor in multi-sharded db
15 | application_client.put_tensor("tensor_2", local_array)
16 |
--------------------------------------------------------------------------------
/doc/tutorials/doc_examples/orch_examples/std_driver.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from smartredis import Client
3 | from smartsim import Experiment
4 | from smartsim.log import get_logger
5 |
6 | # Initialize the logger
7 | logger = get_logger("Example Experiment Log")
8 | # Initialize the Experiment
9 | exp = Experiment("getting-started", launcher="auto")
10 |
11 | # Initialize a multi-sharded Orchestrator
12 | standalone_orchestrator = exp.create_database(db_nodes=3)
13 |
14 | # Initialize a SmartRedis client for multi-sharded Orchestrator
15 | driver_client = Client(cluster=True, address=standalone_orchestrator.get_address()[0])
16 |
17 | # Create NumPy array
18 | local_array = np.array([1, 2, 3, 4])
19 | # Use the SmartRedis client to place tensor in the standalone Orchestrator
20 | driver_client.put_tensor("tensor_1", local_array)
21 |
22 | # Initialize a RunSettings object
23 | model_settings = exp.create_run_settings(exe="/path/to/executable_simulation")
24 | model_settings.set_nodes(1)
25 |
26 | # Initialize the Model
27 | model = exp.create_model("model", model_settings)
28 |
29 | # Create the output directory
30 | exp.generate(standalone_orchestrator, model)
31 |
32 | # Launch the multi-sharded Orchestrator
33 | exp.start(standalone_orchestrator)
34 |
35 | # Launch the Model
36 | exp.start(model, block=True, summary=True)
37 |
38 | # Poll the tensors placed by the Model
39 | app_tensor = driver_client.poll_key("tensor_2", 100, 10)
40 | # Validate that the tensor exists
41 | logger.info(f"The tensor exists: {app_tensor}")
42 |
43 | # Cleanup the Orchestrator
44 | exp.stop(standalone_orchestrator)
45 | # Print the Experiment summary
46 | logger.info(exp.summary())
--------------------------------------------------------------------------------
/doc/tutorials/getting_started/consumer.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | import os
3 | from smartredis import Client, ConfigOptions
4 |
5 | parser = argparse.ArgumentParser(description="SmartRedis ensemble consumer process.")
6 | parser.add_argument("--redis-port")
7 | args = parser.parse_args()
8 |
9 | # get model and set into database
10 | address = "127.0.0.1:" + str(args.redis_port)
11 | os.environ["SSDB"] = address
12 | c = Client(None, logger_name="SmartSim")
13 |
14 |
15 | # Incoming entity prefixes are stored as a comma-separated list
16 | # in the env variable SSKEYIN
17 | keyin = os.getenv("SSKEYIN")
18 | data_sources = keyin.split(",")
19 | data_sources.sort()
20 |
21 | for key in data_sources:
22 | c.set_data_source(key)
23 | input_exists = c.poll_tensor("product", 100, 100)
24 | db_tensor = c.get_tensor("product")
25 | print(f"Tensor for {key} is:", db_tensor)
--------------------------------------------------------------------------------
/doc/tutorials/getting_started/multi_db_example/application_script.py:
--------------------------------------------------------------------------------
1 | from smartredis import ConfigOptions, Client
2 | from smartredis import *
3 | from smartredis.error import *
4 |
5 | # Initialize a ConfigOptions object
6 | single_shard_config = ConfigOptions.create_from_environment("single_shard_db_identifier")
7 | # Initialize a SmartRedis client for the single sharded database
8 | app_single_shard_client = Client(single_shard_config, logger_name="Model: single shard logger")
9 |
10 | # Initialize a ConfigOptions object
11 | multi_shard_config = ConfigOptions.create_from_environment("multi_shard_db_identifier")
12 | # Initialize a SmartRedis client for the multi sharded database
13 | app_multi_shard_client = Client(multi_shard_config, logger_name="Model: multi shard logger")
14 |
15 | # Initialize a ConfigOptions object
16 | colo_config = ConfigOptions.create_from_environment("colo_db_identifier")
17 | # Initialize a SmartRedis client for the colocated database
18 | colo_client = Client(colo_config, logger_name="Model: colo logger")
19 |
20 | # Retrieve the tensor placed in driver script using the associated client
21 | val1 = app_single_shard_client.get_tensor("tensor_1")
22 | val2 = app_multi_shard_client.get_tensor("tensor_2")
23 |
24 | # Print message to stdout using SmartRedis Client logger
25 | app_single_shard_client.log_data(LLInfo, f"The single sharded db tensor is: {val1}")
26 | app_multi_shard_client.log_data(LLInfo, f"The multi sharded db tensor is: {val2}")
27 |
28 | # Place retrieved tensors in colocated database
29 | colo_client.put_tensor("tensor_1", val1)
30 | colo_client.put_tensor("tensor_2", val2)
31 |
32 | # Check that tensors are in colocated database
33 | colo_val1 = colo_client.poll_tensor("tensor_1", 10, 10)
34 | colo_val2 = colo_client.poll_tensor("tensor_2", 10, 10)
35 | # Print message to stdout using SmartRedis Client logger
36 | colo_client.log_data(LLInfo, f"The colocated db has tensor_1: {colo_val1}")
37 | colo_client.log_data(LLInfo, f"The colocated db has tensor_2: {colo_val2}")
--------------------------------------------------------------------------------
/doc/tutorials/getting_started/output_my_parameter.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 |
4 | time.sleep(2)
5 | print("Hello, my name is ;tutorial_name; " +
6 | "and my parameter is ;tutorial_parameter;")
--------------------------------------------------------------------------------
/doc/tutorials/getting_started/output_my_parameter_new_tag.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 |
4 | time.sleep(2)
5 | print("Hello, my name is @tutorial_name@ " +
6 | "and my parameter is @tutorial_parameter@")
--------------------------------------------------------------------------------
/doc/tutorials/getting_started/producer.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import argparse
3 | import time
4 | import os
5 |
6 | from smartredis import Client, ConfigOptions
7 |
8 | parser = argparse.ArgumentParser(description="SmartRedis ensemble producer process.")
9 | parser.add_argument("--redis-port")
10 | args = parser.parse_args()
11 |
12 | time.sleep(2)
13 | address = "127.0.0.1:" + str(args.redis_port)
14 | os.environ["SSDB"] = address
15 | c = Client(None, logger_name="SmartSim")
16 |
17 | data = np.random.rand(1, 1, 3, 3)
18 | c.put_tensor("product", data)
--------------------------------------------------------------------------------
/doc/tutorials/ml_inference/colo-db-torch-example.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from smartredis import Client
3 |
4 | def calc_svd(input_tensor):
5 | # svd function from TorchScript API
6 | # torch isn't imported since we don't need that dependency
7 | # in the client code to call this function in the database.
8 | return input_tensor.svd()
9 |
10 |
11 | # connect a client to the database
12 | # no address required since this `Model` was launched through SmartSim
13 | # Cluster=False since colocated databases are never clustered.
14 | client = Client(cluster=False)
15 |
16 | tensor = np.random.randint(0, 100, size=(5, 3, 2)).astype(np.float32)
17 | client.put_tensor("input", tensor)
18 | client.set_function("svd", calc_svd)
19 | client.run_script("svd", "calc_svd", ["input"], ["U", "S", "V"])
20 |
21 | U = client.get_tensor("U")
22 | S = client.get_tensor("S")
23 | V = client.get_tensor("V")
24 |
25 | print(f"U: {U}\n\n, S: {S}\n\n, V: {V}\n")
--------------------------------------------------------------------------------
/doc/tutorials/ml_training/surrogate/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Training a surrogate model
3 |
4 | In this example, a neural network is trained to act like a surrogate model and to solve a
5 | well-known physical problem, i.e. computing the steady state of heat diffusion. The training
6 | dataset is constructed by running simulations *while* the model is being trained.
7 |
8 | The notebook also displays how the surrogate model prediction improves during training.
9 |
--------------------------------------------------------------------------------
/doc/tutorials/ml_training/surrogate/vishelpers.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import matplotlib.pyplot as plt
3 | from matplotlib import cm
4 |
5 |
6 | def pcolor_list(list_of_images, title=""):
7 | try:
8 | fig, axes = plt.subplots(1, len(list_of_images))
9 |
10 | fig.set_size_inches(4*len(list_of_images),4)
11 | for (ax, mat) in zip(axes, list_of_images):
12 | ax.pcolor(mat, cmap=cm.coolwarm, clim=[0,1])
13 | ax.get_xaxis().set_visible(False)
14 | ax.get_yaxis().set_visible(False)
15 | ax.set_aspect('equal')
16 | except:
17 | fig = plt.figure(figsize=(4,4))
18 | plt.pcolor(list_of_images)
19 | plt.axis("off", cmap=cm.coolwarm, clim=[0,1])
20 | ax = plt.gca()
21 | ax.get_xaxis().set_visible(False)
22 | ax.get_yaxis().set_visible(False)
23 | ax.set_aspect('equal')
24 |
25 | plt.suptitle(title, y=0.92, fontsize=14)
26 | plt.show()
27 |
28 | fig = plt.figure(figsize=(0.00001, 0.00001))
29 | dummy = plt.plot(0,0)
30 | gca = plt.gca()
31 | gca.set_visible(False)
32 | plt.show(dummy)
--------------------------------------------------------------------------------
/doc/tutorials/online_analysis/lattice/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Online Analysis of Lattice Botzmann Simulations
3 |
4 | This example was adapted from [Philip Mocz's implementation](https://github.com/pmocz/latticeboltzmann-python)
5 | of the lattice Boltzmann method in Python. Since that example is licensed under GPL, so is this example.
6 |
7 | A great medium article explaining the simulation can be found
8 | [here](https://medium.com/swlh/create-your-own-lattice-boltzmann-simulation-with-python-8759e8b53b1c)
9 |
10 | The full documentation for this example can be found in the
11 | [SmartSim documentation](https://www.craylabs.org/docs/) under the tutorials section.
--------------------------------------------------------------------------------
/doc/tutorials/online_analysis/lattice/probe.script:
--------------------------------------------------------------------------------
1 | def multi_unsqueeze(tensor, axes: List[int]):
2 | for axis in axes:
3 | tensor = torch.unsqueeze(tensor, axis)
4 |
5 | return tensor
6 |
7 | def probe_points(ux, uy, probe_x, probe_y, cylinder):
8 | ux[cylinder>0] = 0.0
9 | uy[cylinder>0] = 0.0
10 | ux = multi_unsqueeze(ux, [0, 0])
11 | uy = multi_unsqueeze(uy, [0, 0])
12 | probe_xy = multi_unsqueeze(torch.stack((probe_x/200 - 1, probe_y/50 - 1), 2), [0])
13 | u_probex = torch.grid_sampler(ux.double(), probe_xy.double(), 0, 0, False).squeeze()
14 | u_probey = torch.grid_sampler(uy.double(), probe_xy.double(), 0, 0, False).squeeze()
15 |
16 | return torch.stack((u_probex, u_probey), 2)
17 |
--------------------------------------------------------------------------------
/doc/versions.rst:
--------------------------------------------------------------------------------
1 | ********
2 | Versions
3 | ********
4 |
5 | .. raw:: html
6 | :file: _templates/versions.html
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | docs-dev:
3 | image: smartsim-docs:dev-latest
4 | build:
5 | context: .
6 | dockerfile: ./docker/docs/dev/Dockerfile
7 |
8 | tutorials-dev:
9 | image: smartsim-tutorials:dev-latest
10 | build:
11 | context: .
12 | dockerfile: ./docker/dev/Dockerfile
13 | ports:
14 | - "8888:8888"
15 |
16 | tutorials-prod:
17 | image: smartsim-tutorials:v0.8.0
18 | build:
19 | context: .
20 | dockerfile: ./docker/prod/Dockerfile
21 | ports:
22 | - "8888:8888"
23 |
--------------------------------------------------------------------------------
/docker/testing/Dockerfile:
--------------------------------------------------------------------------------
1 | # syntax=docker/dockerfile:1
2 |
3 | # BSD 2-Clause License
4 | #
5 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
6 | # All rights reserved.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions are met:
10 | #
11 | # 1. Redistributions of source code must retain the above copyright notice, this
12 | # list of conditions and the following disclaimer.
13 | #
14 | # 2. Redistributions in binary form must reproduce the above copyright notice,
15 | # this list of conditions and the following disclaimer in the documentation
16 | # and/or other materials provided with the distribution.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | FROM ubuntu:22.04
30 | ENV DEBIAN_FRONTEND noninteractive
31 | RUN apt update && apt install -y python3 python3-pip python-is-python3 cmake git
32 | RUN pip install torch==1.9.1
33 | RUN git clone https://github.com/CrayLabs/SmartRedis.git
34 | RUN cd SmartRedis && pip install . && make lib; cd ..
35 |
36 |
--------------------------------------------------------------------------------
/docker/testing/README.md:
--------------------------------------------------------------------------------
1 | # container-testing
2 |
3 | This container is hosted on dockerhub to be used for SmartSim container
4 | integration testing. Below are the commands to push an updated version of
5 | the container.
6 |
7 | ## Building and interacting with container locally
8 |
9 | ```sh
10 | # Build container
11 | docker build -t container-testing .
12 |
13 | # Start a shell on container to try things out
14 | docker run -it container-testing bash
15 | ```
16 |
17 | Within the container, you can verify that you can import packages like
18 | smartredis or pytorch locally.
19 |
20 | ## Pushing container updates to DockerHub repository
21 |
22 | Note: is bumped each time an update is pushed.
23 | Versions have no relation to SmartSim versions.
24 |
25 | ```sh
26 | # See current versions to determine next version
27 | docker image inspect --format '{{.RepoTags}}' alrigazzi/smartsim-testing
28 |
29 | docker login
30 |
31 | # Create tags for current build of container
32 | docker image tag container-testing alrigazzi/smartsim-testing:latest
33 | docker image tag container-testing alrigazzi/smartsim-testing:
34 |
35 | # Push current build of container with all tags created
36 | docker image push --all-tags alrigazzi/smartsim-testing
37 | ```
38 |
39 |
--------------------------------------------------------------------------------
/smartsim/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import sys
28 |
29 | # -*- coding: utf-8 -*-
30 | # pylint: disable-next=useless-import-alias
31 | from .version import __version__ as __version__
32 |
33 | if sys.version_info < (3, 10): # pragma: no cover
34 | sys.exit("Python 3.10 or greater must be used with SmartSim.")
35 |
36 | # Main API module
37 | # pylint: disable=wrong-import-position
38 | from .experiment import Experiment
39 |
--------------------------------------------------------------------------------
/smartsim/_core/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .control import Controller, Manifest, previewrenderer
28 | from .generation import Generator
29 |
30 | __all__ = ["Controller", "Manifest", "Generator", "previewrenderer"]
31 |
--------------------------------------------------------------------------------
/smartsim/_core/_cli/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/_cli/dbcli.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import argparse
28 | import os
29 | import typing as t
30 |
31 | from smartsim._core._cli.utils import get_db_path
32 |
33 |
34 | def execute(
35 | _args: argparse.Namespace, _unparsed_args: t.Optional[t.List[str]] = None, /
36 | ) -> int:
37 | if db_path := get_db_path():
38 | print(db_path)
39 | return os.EX_OK
40 | print("Database (Redis or KeyDB) dependencies not found")
41 | return os.EX_SOFTWARE
42 |
--------------------------------------------------------------------------------
/smartsim/_core/_cli/plugin.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | import importlib.util
3 | import os
4 | import subprocess as sp
5 | import sys
6 | import typing as t
7 |
8 | import smartsim.log
9 | from smartsim._core._cli.utils import SMART_LOGGER_FORMAT, MenuItemConfig
10 | from smartsim.error.errors import SmartSimCLIActionCancelled
11 |
12 | _LOGGER = smartsim.log.get_logger("Smart", fmt=SMART_LOGGER_FORMAT)
13 |
14 |
15 | def dynamic_execute(
16 | cmd: str, plugin_name: str
17 | ) -> t.Callable[[argparse.Namespace, t.List[str]], int]:
18 | def process_execute(
19 | _args: argparse.Namespace, unparsed_args: t.List[str], /
20 | ) -> int:
21 | try:
22 | spec = importlib.util.find_spec(cmd)
23 | if spec is None:
24 | raise AttributeError
25 | except (ModuleNotFoundError, AttributeError):
26 | _LOGGER.error(f"{cmd} plugin not found. Please ensure it is installed")
27 | return os.EX_CONFIG
28 |
29 | combined_cmd = [sys.executable, "-m", cmd] + unparsed_args
30 |
31 | try:
32 | completed_proc = sp.run(combined_cmd, check=False)
33 | except KeyboardInterrupt as ex:
34 | msg = f"{plugin_name} terminated by user"
35 | raise SmartSimCLIActionCancelled(msg) from ex
36 | return completed_proc.returncode
37 |
38 | return process_execute
39 |
40 |
41 | def dashboard() -> MenuItemConfig:
42 | return MenuItemConfig(
43 | "dashboard",
44 | (
45 | "Start the SmartSim dashboard to monitor experiment output from a "
46 | "graphical user interface. This requires that the SmartSim Dashboard "
47 | "Package be installed. For more infromation please visit "
48 | "https://github.com/CrayLabs/SmartDashboard"
49 | ),
50 | dynamic_execute("smartdashboard", "Dashboard"),
51 | is_plugin=True,
52 | )
53 |
54 |
55 | plugins = (dashboard,)
56 |
--------------------------------------------------------------------------------
/smartsim/_core/_cli/site.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import argparse
28 | import os
29 | import typing as t
30 |
31 | from smartsim._core._cli.utils import get_install_path
32 |
33 |
34 | def execute(_args: argparse.Namespace, _unparsed_args: t.List[str], /) -> int:
35 | print(get_install_path())
36 | return os.EX_OK
37 |
--------------------------------------------------------------------------------
/smartsim/_core/_install/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/_install/types.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import pathlib
28 | import typing as t
29 |
30 | PathLike = t.Union[str, pathlib.Path]
31 |
--------------------------------------------------------------------------------
/smartsim/_core/_install/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .retrieve import retrieve
28 |
--------------------------------------------------------------------------------
/smartsim/_core/config/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .config import get_config
28 |
29 | CONFIG = get_config()
30 |
--------------------------------------------------------------------------------
/smartsim/_core/control/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .controller import Controller
28 | from .manifest import Manifest
29 |
--------------------------------------------------------------------------------
/smartsim/_core/entrypoints/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/generation/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .generator import Generator
28 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .dragon.dragonLauncher import DragonLauncher
28 | from .launcher import Launcher
29 | from .local.local import LocalLauncher
30 | from .pbs.pbsLauncher import PBSLauncher
31 | from .sge.sgeLauncher import SGELauncher
32 | from .slurm.slurmLauncher import SlurmLauncher
33 |
34 | __all__ = [
35 | "Launcher",
36 | "DragonLauncher",
37 | "LocalLauncher",
38 | "PBSLauncher",
39 | "SGELauncher",
40 | "SlurmLauncher",
41 | ]
42 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/dragon/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/local/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/pbs/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/sge/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/slurm/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/step/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .alpsStep import AprunStep
28 | from .dragonStep import DragonBatchStep, DragonStep
29 | from .localStep import LocalStep
30 | from .mpiStep import MpiexecStep, MpirunStep, OrterunStep
31 | from .pbsStep import QsubBatchStep
32 | from .sgeStep import SgeQsubBatchStep
33 | from .slurmStep import SbatchStep, SrunStep
34 | from .step import Step
35 |
--------------------------------------------------------------------------------
/smartsim/_core/launcher/util/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/_core/schemas/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .dragonRequests import *
28 | from .dragonResponses import *
29 |
30 | __all__ = [
31 | "DragonRequest",
32 | "DragonRunRequest",
33 | "DragonHandshakeRequest",
34 | "DragonUpdateStatusRequest",
35 | "DragonStopRequest",
36 | "DragonResponse",
37 | "DragonRunResponse",
38 | "DragonHandshakeResponse",
39 | "DragonUpdateStatusResponse",
40 | "DragonStopResponse",
41 | ]
42 |
--------------------------------------------------------------------------------
/smartsim/_core/types.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import enum
28 |
29 |
30 | class Device(enum.Enum):
31 | CPU = "cpu"
32 | GPU = "gpu"
33 |
--------------------------------------------------------------------------------
/smartsim/_core/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .helpers import (
28 | check_for_utility,
29 | colorize,
30 | delete_elements,
31 | execute_platform_cmd,
32 | expand_exe_path,
33 | installed_redisai_backends,
34 | is_crayex_platform,
35 | )
36 | from .redis import check_cluster_status, create_cluster, db_is_active
37 |
--------------------------------------------------------------------------------
/smartsim/_core/utils/telemetry/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/smartsim/database/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .orchestrator import Orchestrator
28 |
--------------------------------------------------------------------------------
/smartsim/entity/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .dbnode import DBNode
28 | from .dbobject import *
29 | from .ensemble import Ensemble
30 | from .entity import SmartSimEntity, TelemetryConfiguration
31 | from .entityList import EntityList, EntitySequence
32 | from .files import TaggedFilesHierarchy
33 | from .model import Model
34 |
--------------------------------------------------------------------------------
/smartsim/error/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .errors import (
28 | AllocationError,
29 | EntityExistsError,
30 | LauncherError,
31 | LauncherUnsupportedFeature,
32 | ParameterWriterError,
33 | ShellError,
34 | SmartSimError,
35 | SSConfigError,
36 | SSDBFilesNotParseable,
37 | SSDBIDConflictError,
38 | SSInternalError,
39 | SSReservedKeywordError,
40 | SSUnsupportedError,
41 | UserStrategyError,
42 | )
43 |
--------------------------------------------------------------------------------
/smartsim/ml/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .data import DataDownloader, DataInfo, TrainingDataUploader, form_name
28 |
--------------------------------------------------------------------------------
/smartsim/ml/tf/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from ..._core._install.buildenv import Version_, Versioner
28 | from ...error import SmartSimError
29 | from ...log import get_logger
30 |
31 | logger = get_logger(__name__)
32 |
33 | vers = Versioner()
34 |
35 | try:
36 | import tensorflow as tf
37 | except ImportError: # pragma: no cover
38 | raise ModuleNotFoundError(
39 | f"TensorFlow is not installed. Please install it to use smartsim.ml.tf"
40 | ) from None
41 |
42 |
43 | # pylint: disable=wrong-import-position
44 | from .data import DynamicDataGenerator, StaticDataGenerator
45 | from .utils import freeze_model, serialize_model
46 |
--------------------------------------------------------------------------------
/smartsim/ml/torch/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from .data import DataLoader, DynamicDataGenerator, StaticDataGenerator
28 |
--------------------------------------------------------------------------------
/smartsim/py.typed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/smartsim/py.typed
--------------------------------------------------------------------------------
/smartsim/servertype.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 |
28 | # Server Types
29 | CLUSTERED = "Clustered"
30 | STANDALONE = "Standalone"
31 |
--------------------------------------------------------------------------------
/smartsim/status.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | from enum import Enum
28 |
29 |
30 | class SmartSimStatus(Enum):
31 | STATUS_RUNNING = "Running"
32 | STATUS_COMPLETED = "Completed"
33 | STATUS_CANCELLED = "Cancelled"
34 | STATUS_FAILED = "Failed"
35 | STATUS_NEW = "New"
36 | STATUS_PAUSED = "Paused"
37 | STATUS_NEVER_STARTED = "NeverStarted"
38 | STATUS_QUEUED = "Queued"
39 |
40 |
41 | TERMINAL_STATUSES = {
42 | SmartSimStatus.STATUS_CANCELLED,
43 | SmartSimStatus.STATUS_COMPLETED,
44 | SmartSimStatus.STATUS_FAILED,
45 | }
46 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/activeinfra.template:
--------------------------------------------------------------------------------
1 |
2 | = Database Identifier: {{ db.entity.db_identifier }} =
3 | Shards: {{ db.entity.num_shards }}
4 | TCP/IP Port(s):
5 | {%- for port in db.entity.ports %}
6 | {{ port }}
7 | {%- endfor %}
8 | Network Interface: {{ db.entity.run_settings.exe_args | get_ifname }}
9 | Type: {{ config.database_cli | get_dbtype }}
10 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/base.template:
--------------------------------------------------------------------------------
1 |
2 | {% include "experiment.template" %}
3 | {%- if manifest.has_deployable or active_dbjobs %}
4 |
5 | === Entity Preview ===
6 |
7 | {%- if active_dbjobs %}
8 |
9 | == Active Infrastructure ==
10 | {%- for name, db in active_dbjobs.items() %}
11 | {% include "activeinfra.template" %}
12 | {%- endfor %}
13 | {%- endif %}
14 | {%- if manifest.dbs %}
15 |
16 | == Orchestrators ==
17 | {%- for db in manifest.dbs %}
18 | {%- if db.is_active() %}
19 | WARNING: Cannot preview {{ db.name }}, because it is already started.
20 | {%- else %}
21 | {% include "orchestrator.template" %}
22 | {%- endif %}
23 | {%- endfor %}
24 | {%- endif %}
25 | {%- if manifest.models %}
26 |
27 | == Models ==
28 | {%- for model in manifest.models %}
29 |
30 | = Model Name: {{ model.name }} =
31 | {%- include "model.template" %}
32 | {%- if model.run_settings.colocated_db_settings or manifest.dbs %}
33 | Client Configuration:
34 | {%- if model.run_settings.colocated_db_settings %}
35 | {%- include "clientconfigcolo.template" %}
36 | {%- endif %}
37 | {%- if manifest.dbs %}
38 | {%- include "clientconfig.template" %}
39 | {%- endif %}
40 | {%- endif %}
41 | {%- endfor %}
42 | {%- endif %}
43 |
44 | {%- if manifest.ensembles %}
45 |
46 | == Ensembles ==
47 | {%- for ensemble in manifest.ensembles %}
48 | {%- include "ensemble.template" %}
49 | {%- endfor %}
50 | {%- endif %}
51 |
52 | {%- endif %}
53 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/clientconfig.template:
--------------------------------------------------------------------------------
1 |
2 | {%- if verbosity_level == Verbosity.INFO %}
3 | {%- include "clientconfig_info.template" -%}
4 | {%- endif %}
5 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
6 | {%- include "clientconfig_debug.template" -%}
7 | {%- endif %}
8 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/clientconfig_debug.template:
--------------------------------------------------------------------------------
1 |
2 | {%- for db in manifest.dbs %}
3 | {%- if db.name %}
4 | Database Identifier: {{ db.name }}
5 | {%- endif %}
6 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
7 | Database Backend: {{ config.database_cli | get_dbtype }}
8 | TCP/IP Port(s):
9 | {%- for port in db.ports %}
10 | {{ port }}
11 | {%- endfor %}
12 | Type: Standalone
13 | {%- endif %}
14 | {%- endfor %}
15 | {%- if model.incoming_entities %}
16 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
17 | Incoming Entities (Available Data Sources):
18 | {%- for incoming in model.incoming_entities %}
19 | {{ incoming.name }}
20 | {%- endfor %}
21 | {%- endif %}
22 | {%- endif %}
23 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
24 | Outgoing Key Collision Prevention (Key Prefixing):
25 | Tensors: {{ model.query_key_prefixing() | as_toggle }}
26 | Datasets: {{ model.query_key_prefixing() | as_toggle }}
27 | ML Models/Torch Scripts: {{ False | as_toggle }}
28 | Aggregation Lists: {{ model.query_key_prefixing() | as_toggle }}
29 | {%- endif %}
30 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/clientconfig_info.template:
--------------------------------------------------------------------------------
1 |
2 | {%- for db in manifest.dbs %}
3 | {%- if db.name %}
4 | Database Identifier: {{ db.name }}
5 | {%- endif %}
6 | Database Backend: {{ config.database_cli | get_dbtype }}
7 | TCP/IP Port(s):
8 | {%- for port in db.ports %}
9 | {{ port }}
10 | {%- endfor %}
11 | Type: Standalone
12 | {%- endfor %}
13 | {%- if model.query_key_prefixing() %}
14 | Outgoing Key Collision Prevention (Key Prefixing):
15 | Tensors: {{ model.query_key_prefixing() | as_toggle }}
16 | Datasets: {{ model.query_key_prefixing() | as_toggle }}
17 | ML Models/Torch Scripts: {{ False | as_toggle }}
18 | Aggregation Lists: {{ model.query_key_prefixing() | as_toggle }}
19 | {%- endif %}
20 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/clientconfigcolo.template:
--------------------------------------------------------------------------------
1 |
2 | {%- if verbosity_level == Verbosity.INFO %}
3 | {%- include "clientconfigcolo_info.template" %}
4 | {% endif %}
5 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
6 | {%- include "clientconfigcolo_debug.template" %}
7 | {%- endif %}
8 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/clientconfigcolo_debug.template:
--------------------------------------------------------------------------------
1 |
2 | {%- if model.run_settings.colocated_db_settings.db_identifier %}
3 | Database Identifier: {{ model.run_settings.colocated_db_settings.db_identifier }}
4 | {%- else %}
5 | Database Identifier: N/A
6 | {%- endif %}
7 | Database Backend: {{ config.database_cli | get_dbtype }}
8 | {%- if model.run_settings.colocated_db_settings %}
9 | {%- if model.run_settings.colocated_db_settings.port %}
10 | Connection Type: TCP
11 | TCP/IP Port(s):
12 | {{ model.run_settings.colocated_db_settings.port }}
13 | {%- endif %}
14 | {%- if model.run_settings.colocated_db_settings.unix_socket %}
15 | Connection Type: UDS
16 | Unix Socket: {{ model.run_settings.colocated_db_settings.unix_socket }}
17 | {%- endif %}
18 | {%- if model.run_settings.colocated_db_settings.ifname %}
19 | {%- if model.run_settings.colocated_db_settings.ifname | is_list %}
20 | Network Interface Name: {{ model.run_settings.colocated_db_settings.ifname[0] }}
21 | {%- else %}
22 | Network Interface Name: {{ model.run_settings.colocated_db_settings.ifname }}
23 | {%- endif %}
24 | {%- endif %}
25 | Type: Colocated
26 | {%- if model.incoming_entities %}
27 | Incoming Entities (Available Data Sources):
28 | {%- for incoming in model.incoming_entities %}
29 | {{ incoming.name }}
30 | {%- endfor %}
31 | {%- endif %}
32 | {%- endif %}
33 | Outgoing Key Collision Prevention (Key Prefixing):
34 | Tensors: {{ model.query_key_prefixing() | as_toggle }}
35 | Datasets: {{ model.query_key_prefixing() | as_toggle }}
36 | ML Models/Torch Scripts: {{ False | as_toggle }}
37 | Aggregation Lists: {{ model.query_key_prefixing() | as_toggle }}
38 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/clientconfigcolo_info.template:
--------------------------------------------------------------------------------
1 |
2 | {%- if model.run_settings.colocated_db_settings.db_identifier %}
3 | Database Identifier: {{ model.run_settings.colocated_db_settings.db_identifier }}
4 | {%- endif %}
5 | Database Backend: {{ config.database_cli | get_dbtype }}
6 | {%- if model.run_settings.colocated_db_settings.port %}
7 | Connection Type: TCP
8 | TCP/IP Port(s):
9 | {{ model.run_settings.colocated_db_settings.port }}
10 | {%- endif %}
11 | {%- if model.run_settings.colocated_db_settings.unix_socket %}
12 | Connection Type: UDS
13 | Unix Socket: {{ model.run_settings.colocated_db_settings.unix_socket }}
14 | {%- endif %}
15 | Type: Colocated
16 | {%- if model.query_key_prefixing() %}
17 | Outgoing Key Collision Prevention (Key Prefixing):
18 | Tensors: {{ model.query_key_prefixing() | as_toggle }}
19 | Datasets: {{ model.query_key_prefixing() | as_toggle }}
20 | ML Models/Torch Scripts: {{ False | as_toggle }}
21 | Aggregation Lists: {{ model.query_key_prefixing() | as_toggle }}
22 | {%- endif %}
23 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/ensemble.template:
--------------------------------------------------------------------------------
1 |
2 | {%- if verbosity_level == Verbosity.INFO %}
3 | {%- include "ensemble_info.template" -%}
4 | {%- endif %}
5 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
6 | {%- include "ensemble_debug.template" -%}
7 | {%- endif %}
8 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/experiment.template:
--------------------------------------------------------------------------------
1 | === Experiment Overview ===
2 |
3 | Experiment Name: {{ exp_entity.name }}
4 | Experiment Path: {{ exp_entity.exp_path }}
5 | Launcher: {{ exp_entity.launcher }}
6 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/model.template:
--------------------------------------------------------------------------------
1 |
2 | {%- if verbosity_level == Verbosity.INFO %}
3 | {%- include "model_info.template" -%}
4 | {%- endif %}
5 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
6 | {%- include "model_debug.template" -%}
7 | {%- endif -%}
8 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/orchestrator.template:
--------------------------------------------------------------------------------
1 |
2 | {%- if verbosity_level == Verbosity.INFO %}
3 | {%- include "orchestrator_info.template" -%}
4 | {%- endif %}
5 | {%- if verbosity_level == Verbosity.DEBUG or verbosity_level == Verbosity.DEVELOPER %}
6 | {%- include "orchestrator_debug.template" -%}
7 | {%- endif %}
8 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/orchestrator_debug.template:
--------------------------------------------------------------------------------
1 |
2 | = Database Identifier: {{ db.name }} =
3 | {%- if db.path %}
4 | Path: {{ db.path }}
5 | {%- endif %}
6 | Shards: {{ db.num_shards }}
7 | TCP/IP Port(s):
8 | {%- for port in db.ports %}
9 | {{ port }}
10 | {%- endfor %}
11 | Network Interface: {{ db._interfaces[0] }}
12 | Type: {{ config.database_cli | get_dbtype }}
13 | Executable: {{ config.database_exe }}
14 | {%- if db.run_settings %}
15 | Run Command: {{ db.run_settings.run_command }}
16 | {%- if db.run_settings.run_args %}
17 | Run Arguments:
18 | {%- for key, value in db.run_settings.run_args.items() %}
19 | {{ key }}: {{ value }}
20 | {%- endfor %}
21 | {%- endif %}
22 | {%- endif %}
23 | {%- if db.run_command %}
24 | Run Command: {{ db.run_command }}
25 | {%- endif %}
26 | {%- if db.batch_settings %}
27 | Batch Launch: True
28 | Batch Command: {{ db.batch_settings.batch_cmd }}
29 | Batch Arguments:
30 | {%- for key, value in db.batch_settings.batch_args.items() %}
31 | {{ key }}: {{ value }}
32 | {%- endfor %}
33 | {%- endif %}
34 |
--------------------------------------------------------------------------------
/smartsim/templates/templates/preview/plain_text/orchestrator_info.template:
--------------------------------------------------------------------------------
1 |
2 | = Database Identifier: {{ db.name }} =
3 | TCP/IP Port(s):
4 | {%- for port in db.ports %}
5 | {{ port }}
6 | {%- endfor %}
7 | Network Interface: {{ db._interfaces[0] }}
8 | Type: {{ config.database_cli | get_dbtype }}
9 | {%- if db.batch %}
10 | Batch Launch: {{ db.batch }}
11 | {%- endif %}
12 |
--------------------------------------------------------------------------------
/tests/__init__.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/tests/test_configs/alloc_spec_sheet_examples/blank_alloc_specs.json:
--------------------------------------------------------------------------------
1 | {
2 | "host_list": [],
3 | "queue": "",
4 | "num_tasks": 0,
5 | "tasks_per_node": {}
6 | }
7 |
--------------------------------------------------------------------------------
/tests/test_configs/alloc_spec_sheet_examples/pbs_alloc_specs.example.json:
--------------------------------------------------------------------------------
1 | {
2 | "host_list": ["nid00005"],
3 | "queue": "workq",
4 | "num_tasks": 36,
5 | "tasks_per_node": {
6 | "crystal_16": 12,
7 | "crystal_17": 12,
8 | "crystal_18": 12
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tests/test_configs/alloc_spec_sheet_examples/slurm_alloc_specs.example.json:
--------------------------------------------------------------------------------
1 | {
2 | "host_list": ["nid00000", "nid00001", "nid00002"],
3 | "queue": "workq",
4 | "num_tasks": 20,
5 | "tasks_per_node": {
6 | "nid00000": 7,
7 | "nid00001": 7,
8 | "nid00002": 6
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tests/test_configs/bad.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import argparse
28 | import time
29 |
30 |
31 | def divide_by_zero(time_to_wait):
32 | """A sample program to test error handling at different points in execution"""
33 | time.sleep(time_to_wait)
34 | print(1 / 0)
35 |
36 |
37 | if __name__ == "__main__":
38 | parser = argparse.ArgumentParser()
39 | parser.add_argument("--time", type=int, default=0)
40 | args = parser.parse_args()
41 | divide_by_zero(args.time)
42 |
--------------------------------------------------------------------------------
/tests/test_configs/check_dirs.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import os
28 | from pathlib import Path
29 |
30 | """
31 | Verify home directory only contains a single directory.
32 | This script is intended to be run by a container test with a test directory
33 | mounted into the $HOME directory.
34 | """
35 |
36 | directories = os.listdir(str(Path.home()))
37 | print(directories)
38 | assert len(directories) == 1
39 |
--------------------------------------------------------------------------------
/tests/test_configs/check_env.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 |
4 | var_name = sys.argv[1]
5 | env_value = os.environ.get(sys.argv[1], None)
6 |
7 | if env_value:
8 | print(f"{var_name}=={env_value}")
9 | sys.exit(0)
10 |
11 | print("env var not found")
12 |
--------------------------------------------------------------------------------
/tests/test_configs/cov/cobalt_cov.cfg:
--------------------------------------------------------------------------------
1 | [run]
2 | omit =
3 | *slurm*
4 | *local*
5 | *pbs*
6 | *alps*
7 | *redis_starter.py*
8 | */_cli/*
9 | */_install/*
10 | *constants.py*
11 | */entrypoints/*
12 |
13 | [report]
14 | exclude_lines=
15 | # Have to re-enable the standard pragma
16 | pragma: no cover
17 |
18 | # Don't complain about missing debug-only code:
19 | def __repr__
20 | if self\.debug
21 |
22 | # Don't complain if tests don't hit defensive assertion code:
23 | raise AssertionError
24 | raise NotImplementedError
25 |
26 | # Don't complain about type-checking only blocks
27 | if (t(yping)?\.)?TYPE_CHECKING:
28 |
29 | # Don't complain if non-runnable code isn't run:
30 | if 0:
31 | if __name__ == .__main__.:
32 |
33 | # Don't complain about abstract methods, they aren't run:
34 | @(abc\.)?abstractmethod
35 |
36 | cov-slurm
37 | cov-local
38 | cov-pbs
39 | cov-alps
40 | pass
41 | launcher == "local"
42 | launcher == "slurm"
43 | launcher == "pbs"
44 |
--------------------------------------------------------------------------------
/tests/test_configs/cov/local_cov.cfg:
--------------------------------------------------------------------------------
1 | [run]
2 | omit =
3 | *pbs*
4 | *slurm*
5 | *mpirun*
6 | *alps*
7 | *pals*
8 | *redis_starter.py*
9 | */_cli/*
10 | */_install/*
11 | *constants.py*
12 | */entrypoints/*
13 |
14 | [report]
15 | exclude_lines=
16 | # Have to re-enable the standard pragma
17 | pragma: no cover
18 |
19 | # Don't complain about missing debug-only code:
20 | def __repr__
21 | if self\.debug
22 |
23 | # Don't complain if tests don't hit defensive assertion code:
24 | raise AssertionError
25 | raise NotImplementedError
26 |
27 | # Don't complain about type-checking only blocks
28 | if (t(yping)?\.)?TYPE_CHECKING:
29 |
30 | # Don't complain if non-runnable code isn't run:
31 | if 0:
32 | if __name__ == .__main__.:
33 |
34 | # Don't complain about abstract methods, they aren't run:
35 | @(abc\.)?abstractmethod
36 |
37 | pragma: no cover
38 | cov-pbs
39 | cov-slurm
40 | cov-alps
41 | cov-mpirun
42 | cov-wlm
43 | pass
44 | batch
45 |
46 | launcher == "slurm"
47 | launcher == "pbs"
48 | launcher == "pals"
49 |
--------------------------------------------------------------------------------
/tests/test_configs/cov/lsf_cov.cfg:
--------------------------------------------------------------------------------
1 | [run]
2 | omit =
3 | *slurm*
4 | *local*
5 | *pbs*
6 | *alps*
7 | *redis_starter.py*
8 | */_cli/*
9 | */_install/*
10 | *constants.py*
11 | */entrypoints/*
12 |
13 | [report]
14 | exclude_lines=
15 | # Have to re-enable the standard pragma
16 | pragma: no cover
17 |
18 | # Don't complain about missing debug-only code:
19 | def __repr__
20 | if self\.debug
21 |
22 | # Don't complain if tests don't hit defensive assertion code:
23 | raise AssertionError
24 | raise NotImplementedError
25 |
26 | # Don't complain about type-checking only blocks
27 | if (t(yping)?\.)?TYPE_CHECKING:
28 |
29 | # Don't complain if non-runnable code isn't run:
30 | if 0:
31 | if __name__ == .__main__.:
32 |
33 | # Don't complain about abstract methods, they aren't run:
34 | @(abc\.)?abstractmethod
35 |
36 | cov-slurm
37 | cov-local
38 | cov-alps
39 | cov-pbs
40 | pass
41 | launcher == "local"
42 | launcher == "slurm"
43 | launcher == "pbs"
44 |
--------------------------------------------------------------------------------
/tests/test_configs/cov/pbs_cov.cfg:
--------------------------------------------------------------------------------
1 | [run]
2 | omit =
3 | *slurm*
4 | *local*
5 | *mpirun*
6 | *alps*
7 | *redis_starter.py*
8 | */_cli/*
9 | */_install/*
10 | *constants.py*
11 | */entrypoints/*
12 |
13 | [report]
14 | exclude_lines=
15 | # Have to re-enable the standard pragma
16 | pragma: no cover
17 |
18 | # Don't complain about missing debug-only code:
19 | def __repr__
20 | if self\.debug
21 |
22 | # Don't complain if tests don't hit defensive assertion code:
23 | raise AssertionError
24 | raise NotImplementedError
25 |
26 | # Don't complain about type-checking only blocks
27 | if (t(yping)?\.)?TYPE_CHECKING:
28 |
29 | # Don't complain if non-runnable code isn't run:
30 | if 0:
31 | if __name__ == .__main__.:
32 |
33 | # Don't complain about abstract methods, they aren't run:
34 | @(abc\.)?abstractmethod
35 |
36 | cov-slurm
37 | cov-local
38 | cov-alps
39 | pass
40 | launcher == "local"
41 | launcher == "slurm"
42 |
--------------------------------------------------------------------------------
/tests/test_configs/cov/slurm_cov.cfg:
--------------------------------------------------------------------------------
1 | [run]
2 | omit =
3 | *pbs*
4 | *local*
5 | *mpirun*
6 | *alps*
7 | *redis_starter.py*
8 | */_cli/*
9 | */_install/*
10 | *constants.py*
11 | */entrypoints/*
12 |
13 | [report]
14 | exclude_lines=
15 | # Have to re-enable the standard pragma
16 | pragma: no cover
17 |
18 | # Don't complain about missing debug-only code:
19 | def __repr__
20 | if self\.debug
21 |
22 | # Don't complain if tests don't hit defensive assertion code:
23 | raise AssertionError
24 | raise NotImplementedError
25 |
26 | # Don't complain about type-checking only blocks
27 | if (t(yping)?\.)?TYPE_CHECKING:
28 |
29 | # Don't complain if non-runnable code isn't run:
30 | if 0:
31 | if __name__ == .__main__.:
32 |
33 | # Don't complain about abstract methods, they aren't run:
34 | @(abc\.)?abstractmethod
35 |
36 | cov-pbs
37 | cov-local
38 | cov-alps
39 | pass
40 | launcher == "local"
41 | launcher == "pbs"
42 |
--------------------------------------------------------------------------------
/tests/test_configs/echo.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import argparse
28 | import time
29 |
30 |
31 | def echo(message: str, sleep_time: int):
32 | if sleep_time > 0:
33 | time.sleep(sleep_time)
34 | print(f"Echoing: {message}")
35 |
36 |
37 | if __name__ == "__main__":
38 | parser = argparse.ArgumentParser()
39 | parser.add_argument("--message", type=str, default="Lorem ipsum")
40 | parser.add_argument("--sleep_time", type=int, default=0)
41 | args = parser.parse_args()
42 | echo(args.message, args.sleep_time)
43 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/circular_config/sub_dir/circle:
--------------------------------------------------------------------------------
1 | ../
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/circular_config/sub_dir/hello.sh:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | echo "Param \`P\` is ;P;"
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/correct/in.airebo:
--------------------------------------------------------------------------------
1 | # AIREBO polyethelene benchmark
2 |
3 | units metal
4 | atom_style atomic
5 |
6 | read_data data.airebo
7 |
8 | replicate 20 16 2
9 |
10 | neighbor 0.5 bin
11 | neigh_modify delay 5 every 1
12 |
13 | pair_style airebo 3.0 1 1
14 | pair_coeff * * CH.airebo C H
15 |
16 | velocity all create 300.0 761341
17 |
18 | fix 1 all nve
19 | timestep 0.0005
20 |
21 | thermo 10
22 | run 100
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/correct/in.atm:
--------------------------------------------------------------------------------
1 | # Axilrod-Teller-Muto potential example
2 |
3 | variable x index 1
4 | variable y index 1
5 | variable z index 1
6 |
7 | variable xx equal 10*$x
8 | variable yy equal 10*$y
9 | variable zz equal 10*$z
10 |
11 | units lj
12 | atom_style atomic
13 |
14 | lattice fcc 0.70
15 | region box block 0 ${xx} 0 ${yy} 0 ${zz}
16 | create_box 1 box
17 | create_atoms 1 box
18 |
19 | pair_style hybrid/overlay lj/cut 4.5 atm 4.5 2.5
20 | pair_coeff * * lj/cut 1.0 1.0
21 | pair_coeff * * atm * 0.072
22 |
23 | mass * 1.0
24 | velocity all create 1.033 12345678 loop geom
25 |
26 | fix 1 all nvt temp 1.033 1.033 0.05
27 |
28 | timestep 0.002
29 | thermo 5
30 |
31 | run 25
32 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/correct/in.crack:
--------------------------------------------------------------------------------
1 | # 2d LJ crack simulation
2 |
3 | dimension 2
4 | boundary s s p
5 |
6 | atom_style atomic
7 | neighbor 0.3 bin
8 | neigh_modify delay 5
9 |
10 | # create geometry
11 |
12 | lattice hex 0.93
13 | region box block 0 100 0 40 -0.25 0.25
14 | create_box 5 box
15 | create_atoms 1 box
16 |
17 | mass 1 1.0
18 | mass 2 1.0
19 | mass 3 1.0
20 | mass 4 1.0
21 | mass 5 1.0
22 |
23 | # LJ potentials
24 |
25 | pair_style lj/cut 2.5
26 | pair_coeff * * 1.0 1.0 2.5
27 |
28 | # define groups
29 |
30 | region 1 block INF INF INF 1.25 INF INF
31 | group lower region 1
32 | region 2 block INF INF 38.75 INF INF INF
33 | group upper region 2
34 | group boundary union lower upper
35 | group mobile subtract all boundary
36 | group leftupper region
37 |
38 | region leftupper block INF 20 20 INF INF INF
39 | region leftlower block INF 20 INF 20 INF INF
40 | group leftupper region leftupper
41 | group leftlower region leftlower
42 |
43 | set group leftupper type 2
44 | set group leftlower type 3
45 | set group lower type 4
46 | set group upper type 5
47 |
48 | # initial velocities
49 |
50 | compute new mobile temp
51 | velocity mobile create 0.01 887723 temp new
52 | velocity upper set 0.0 0.3 0.0
53 | velocity mobile ramp vy 0.0 0.3 y 1.25 38.75 sum yes
54 |
55 | # fixes
56 |
57 | fix 1 all nve
58 | fix 2 boundary setforce NULL 0.0 0.0
59 |
60 | # run
61 |
62 | timestep 0.003
63 | thermo 200
64 | thermo_modify temp new
65 |
66 | neigh_modify exclude type 2 3
67 |
68 | #dump 1 all atom 500 dump.crack
69 |
70 | #dump 2 all image 250 image.*.jpg type type &
71 | # zoom 1.6 adiam 1.5
72 | #dump_modify 2 pad 4
73 |
74 | #dump 3 all movie 250 movie.mpg type type &
75 | # zoom 1.6 adiam 1.5
76 | #dump_modify 3 pad 4
77 |
78 | run 5000
79 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/correct/in.ellipse.gayberne:
--------------------------------------------------------------------------------
1 | # GayBerne ellipsoids in LJ background fluid
2 |
3 | units lj
4 | atom_style ellipsoid
5 | dimension 2
6 |
7 | lattice sq 0.02
8 | region box block 0 20 0 20 -0.5 0.5
9 | create_box 2 box
10 | create_atoms 1 box
11 |
12 | set group all type/fraction 2 0.1 95392
13 | set type 1 mass 1.0
14 | set type 2 mass 1.5
15 | set type 1 shape 1 1 1
16 | set type 2 shape 3 1 1
17 | set group all quat/random 18238
18 |
19 | compute rot all temp/asphere
20 | group spheroid type 1
21 | variable dof equal count(spheroid)+2
22 | compute_modify rot extra/dof ${dof}
23 |
24 | velocity all create 2.4 87287 loop geom
25 |
26 | pair_style gayberne 1.0 3.0 1.0 4.0
27 | pair_coeff 1 1 3.0 1.0 1 1 1 1 1 1 2.5
28 | pair_coeff 1 2 3.0 1.0 1 1 1 0 0 0
29 | pair_coeff 2 2 1.0 1.0 1 1 0.2 0 0 0
30 |
31 | neighbor 0.8 bin
32 |
33 | thermo_style custom step c_rot epair etotal press vol
34 | thermo 100
35 |
36 | timestep 0.002
37 |
38 | compute q all property/atom quatw quati quatj quatk
39 |
40 | #dump 1 all custom 100 dump.ellipse.gayberne &
41 | # id type x y z c_q[1] c_q[2] c_q[3] c_q[4]
42 |
43 | #dump 2 all image 100 image.*.jpg type type &
44 | # zoom 1.6 center d 0.5 0.5 0.5
45 | #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0
46 |
47 | #dump 3 all movie 100 movie.mpg type type &
48 | # zoom 1.6 center d 0.5 0.5 0.5
49 | #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0
50 |
51 | fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 &
52 | mtk no pchain 0 tchain 1
53 | fix 2 all enforce2d
54 |
55 | compute_modify 1_temp extra/dof ${dof}
56 |
57 | # equilibrate to shrink box around dilute system
58 |
59 | run 2000
60 |
61 | # run dynamics on dense system
62 |
63 | unfix 1
64 | fix 1 all nve/asphere
65 |
66 | run 2000
67 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/correct/input.nml:
--------------------------------------------------------------------------------
1 | &MOM_input_nml
2 | output_directory = './',
3 | input_filename = 'n'
4 | restart_input_dir = 'INPUT/',
5 | restart_output_dir = 'RESTART/',
6 | parameter_filename = 'MOM_input',
7 | 'MOM_override' /
8 | &fms_nml
9 | domains_stack_size = 552960
10 | /
11 |
12 | &diag_manager_nml
13 | /
14 |
15 | &ocean_solo_nml
16 | months = 120
17 | days = 0
18 | date_init = 1,1,1,0,0,0
19 | hours = 0
20 | minutes = 0
21 | seconds = 0
22 | calendar = 'noleap' /
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/marked/in.airebo:
--------------------------------------------------------------------------------
1 | # AIREBO polyethelene benchmark
2 |
3 | units metal
4 | atom_style atomic
5 |
6 | read_data data.airebo
7 |
8 | replicate ;17; 16 2
9 |
10 | neighbor 0.5 bin
11 | neigh_modify delay 5 every 1
12 |
13 | pair_style airebo 3.0 1 1
14 | pair_coeff * * CH.airebo C H
15 |
16 | velocity all create 300.0 761341
17 |
18 | fix 1 all nve
19 | timestep 0.0005
20 |
21 | thermo 10
22 | run 100
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/marked/in.atm:
--------------------------------------------------------------------------------
1 | # Axilrod-Teller-Muto potential example
2 |
3 | variable x index 1
4 | variable y index 1
5 | variable z index 1
6 |
7 | variable xx equal 10*$x
8 | variable yy equal 10*$y
9 | variable zz equal 10*$z
10 |
11 | units lj
12 | atom_style atomic
13 |
14 | lattice fcc 0.;65;
15 | region box block 0 ${xx} 0 ${yy} 0 ${zz}
16 | create_box 1 box
17 | create_atoms 1 box
18 |
19 | pair_style hybrid/overlay lj/cut 4.5 atm 4.5 2.5
20 | pair_coeff * * lj/cut 1.0 1.0
21 | pair_coeff * * atm * 0.072
22 |
23 | mass * 1.0
24 | velocity all create 1.033 12345678 loop geom
25 |
26 | fix 1 all nvt temp 1.033 1.033 0.05
27 |
28 | timestep 0.002
29 | thermo 5
30 |
31 | run 25
32 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/marked/in.crack:
--------------------------------------------------------------------------------
1 | # 2d LJ crack simulation
2 |
3 | dimension 2
4 | boundary s s p
5 |
6 | atom_style atomic
7 | neighbor 0.3 bin
8 | neigh_modify delay 5
9 |
10 | # create geometry
11 |
12 | lattice hex 0.93
13 | region box block 0 100 0 40 -0.25 0.25
14 | create_box 5 box
15 | create_atoms 1 box
16 |
17 | mass 1 1.0
18 | mass 2 1.0
19 | mass 3 1.0
20 | mass 4 1.0
21 | mass 5 1.0
22 |
23 | # LJ potentials
24 |
25 | pair_style lj/cut 2.5
26 | pair_coeff * * 1.0 1.0 2.5
27 |
28 | # define groups
29 |
30 | region 1 block INF INF INF 1.25 INF INF
31 | group lower region 1
32 | region 2 block INF INF 38.75 INF INF INF
33 | group upper region 2
34 | group boundary union lower upper
35 | group mobile subtract all boundary
36 | ;placeholder;
37 |
38 | region leftupper block INF 20 20 INF INF INF
39 | region leftlower block INF 20 INF 20 INF INF
40 | group leftupper region leftupper
41 | group leftlower region leftlower
42 |
43 | set group leftupper type 2
44 | set group leftlower type 3
45 | set group lower type 4
46 | set group upper type 5
47 |
48 | # initial velocities
49 |
50 | compute new mobile temp
51 | velocity mobile create 0.01 887723 temp new
52 | velocity upper set 0.0 0.3 0.0
53 | velocity mobile ramp vy 0.0 0.3 y 1.25 38.75 sum yes
54 |
55 | # fixes
56 |
57 | fix 1 all nve
58 | fix 2 boundary setforce NULL 0.0 0.0
59 |
60 | # run
61 |
62 | timestep 0.003
63 | thermo 200
64 | thermo_modify temp new
65 |
66 | neigh_modify exclude type 2 3
67 |
68 | #dump 1 all atom 500 dump.crack
69 |
70 | #dump 2 all image 250 image.*.jpg type type &
71 | # zoom 1.6 adiam 1.5
72 | #dump_modify 2 pad 4
73 |
74 | #dump 3 all movie 250 movie.mpg type type &
75 | # zoom 1.6 adiam 1.5
76 | #dump_modify 3 pad 4
77 |
78 | run 5000
79 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/marked/in.ellipse.gayberne:
--------------------------------------------------------------------------------
1 | # GayBerne ellipsoids in LJ background fluid
2 |
3 | units lj
4 | atom_style ellipsoid
5 | dimension 2
6 |
7 | lattice sq 0.02
8 | region box block 0 20 0 20 -0.5 0.5
9 | create_box 2 box
10 | create_atoms 1 box
11 |
12 | set group all type/fraction 2 0.1 95392
13 | set type 1 mass 1.0
14 | set type 2 mass 1.5
15 | set type 1 shape 1 1 1
16 | set type 2 shape 3 1 1
17 | set group all quat/random 18238
18 |
19 | compute rot all temp/asphere
20 | group spheroid type 1
21 | variable dof equal count(spheroid)+2
22 | compute_modify rot extra/dof ${dof}
23 |
24 | velocity all create 2.4 87287 loop geom
25 |
26 | pair_style gayberne 1.0 3.0 1.0 4.0
27 | pair_coeff 1 1 3.0 1.0 1 1 1 1 1 1 2.5
28 | pair_coeff 1 2 3.0 1.0 1 1 1 0 0 0
29 | pair_coeff 2 2 1.0 1.0 1 1 0.2 0 0 0
30 |
31 | neighbor 0.8 bin
32 |
33 | thermo_style custom step c_rot epair etotal press vol
34 | thermo 100
35 |
36 | timestep 0.002
37 |
38 | compute q all property/atom quatw quati quatj quatk
39 |
40 | #dump 1 all custom 100 dump.ellipse.gayberne &
41 | # id type x y z c_q[1] c_q[2] c_q[3] c_q[4]
42 |
43 | #dump 2 all image 100 image.*.jpg type type &
44 | # zoom 1.6 center d 0.5 0.5 0.5
45 | #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0
46 |
47 | #dump 3 all movie 100 movie.mpg type type &
48 | # zoom 1.6 center d 0.5 0.5 0.5
49 | #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0
50 |
51 | fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 &
52 | mtk no pchain 0 tchain 1
53 | fix 2 all enforce2d
54 |
55 | compute_modify 1_temp extra/dof ${dof}
56 |
57 | # equilibrate to shrink box around dilute system
58 |
59 | run 2000
60 |
61 | # run dynamics on dense system
62 |
63 | unfix 1
64 | fix 1 all nve/asphere
65 |
66 | run 2000
67 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/easy/marked/input.nml:
--------------------------------------------------------------------------------
1 | &MOM_input_nml
2 | output_directory = './',
3 | input_filename = 'n'
4 | restart_input_dir = 'INPUT/',
5 | restart_output_dir = 'RESTART/',
6 | parameter_filename = 'MOM_input',
7 | 'MOM_override' /
8 | &fms_nml
9 | domains_stack_size = 552960
10 | /
11 |
12 | &diag_manager_nml
13 | /
14 |
15 | &ocean_solo_nml
16 | months = ;1200;
17 | days = 0
18 | date_init = 1,1,1,0,0,0
19 | hours = 0
20 | minutes = 0
21 | seconds = 0
22 | calendar = 'noleap' /
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/in.atm:
--------------------------------------------------------------------------------
1 | # Axilrod-Teller-Muto potential example
2 |
3 | variable x index 1
4 | variable y index 1
5 | variable z index 1
6 |
7 | variable xx equal 10*$x
8 | variable yy equal 10*$y
9 | variable zz equal 10*$z
10 |
11 | units lj
12 | atom_style atomic
13 |
14 | lattice fcc 0.65
15 | region box block 0 ${xx} 0 ${yy} 0 ${zz}
16 | create_box 1 box
17 | create_atoms 1 box
18 |
19 | pair_style hybrid/overlay lj/cut 4.5 atm 4.5 2.5
20 | pair_coeff * * lj/cut 1.0 1.0
21 | pair_coeff * * atm * 0.072
22 |
23 | mass * 1.0
24 | velocity all create 1.033 12345678 loop geom
25 |
26 | fix 1 all nvt temp 1.033 1.033 0.05
27 |
28 | timestep 0.002
29 | thermo ;THERMO;
30 |
31 | run ;STEPS;
32 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/log_params/dir_test/dir_test_0/smartsim_params.txt:
--------------------------------------------------------------------------------
1 | Model name: dir_test_0
2 | File name Parameters
3 | -------------------------- ---------------
4 | dir_test/dir_test_0/in.atm Name Value
5 | ------ -------
6 | THERMO 10
7 | STEPS 10
8 |
9 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/log_params/dir_test/dir_test_1/smartsim_params.txt:
--------------------------------------------------------------------------------
1 | Model name: dir_test_1
2 | File name Parameters
3 | -------------------------- ---------------
4 | dir_test/dir_test_1/in.atm Name Value
5 | ------ -------
6 | THERMO 10
7 | STEPS 20
8 |
9 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/log_params/dir_test/dir_test_2/smartsim_params.txt:
--------------------------------------------------------------------------------
1 | Model name: dir_test_2
2 | File name Parameters
3 | -------------------------- ---------------
4 | dir_test/dir_test_2/in.atm Name Value
5 | ------ -------
6 | THERMO 20
7 | STEPS 10
8 |
9 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/log_params/dir_test/dir_test_3/smartsim_params.txt:
--------------------------------------------------------------------------------
1 | Model name: dir_test_3
2 | File name Parameters
3 | -------------------------- ---------------
4 | dir_test/dir_test_3/in.atm Name Value
5 | ------ -------
6 | THERMO 20
7 | STEPS 20
8 |
9 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/log_params/smartsim_params.txt:
--------------------------------------------------------------------------------
1 | Generation start date and time: 08/09/2023 18:22:44
2 | Model name: dir_test_0
3 | File name Parameters
4 | -------------------------- ---------------
5 | dir_test/dir_test_0/in.atm Name Value
6 | ------ -------
7 | THERMO 10
8 | STEPS 10
9 |
10 | Model name: dir_test_1
11 | File name Parameters
12 | -------------------------- ---------------
13 | dir_test/dir_test_1/in.atm Name Value
14 | ------ -------
15 | THERMO 10
16 | STEPS 20
17 |
18 | Model name: dir_test_2
19 | File name Parameters
20 | -------------------------- ---------------
21 | dir_test/dir_test_2/in.atm Name Value
22 | ------ -------
23 | THERMO 20
24 | STEPS 10
25 |
26 | Model name: dir_test_3
27 | File name Parameters
28 | -------------------------- ---------------
29 | dir_test/dir_test_3/in.atm Name Value
30 | ------ -------
31 | THERMO 20
32 | STEPS 20
33 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/correct/in.airebo:
--------------------------------------------------------------------------------
1 | # AIREBO polyethelene benchmark
2 |
3 | units metal
4 | atom_style atomic
5 |
6 | read_data data.airebo
7 |
8 | replicate 17 16 2
9 |
10 | neighbor 0.5 bin
11 | neigh_modify delay 5 every 1
12 |
13 | pair_style airebo 3.0 1 1
14 | pair_coeff * * CH.airebo C H
15 |
16 | velocity all create 300.0 761341
17 |
18 | fix 1 all nve
19 | timestep 0.0005
20 |
21 | thermo 10
22 | run 100
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/correct/in.atm:
--------------------------------------------------------------------------------
1 | # Axilrod-Teller-Muto potential example
2 |
3 | variable x index 1
4 | variable y index 1
5 | variable z index 1
6 |
7 | variable xx equal 10*$x
8 | variable yy equal 10*$y
9 | variable zz equal 10*$z
10 |
11 | units lj
12 | atom_style atomic
13 |
14 | lattice fcc 0.65
15 | region box block 0 ${xx} 0 ${yy} 0 ${zz}
16 | create_box 1 box
17 | create_atoms 1 box
18 |
19 | pair_style hybrid/overlay lj/cut 4.5 atm 4.5 2.5
20 | pair_coeff * * lj/cut 1.0 1.0
21 | pair_coeff * * atm * 0.072
22 |
23 | mass * 1.0
24 | velocity all create 1.033 12345678 loop geom
25 |
26 | fix 1 all nvt temp 1.033 1.033 0.05
27 |
28 | timestep 0.002
29 | thermo 5
30 |
31 | run 25
32 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/correct/in.crack:
--------------------------------------------------------------------------------
1 | # 2d LJ crack simulation
2 |
3 | dimension 2
4 | boundary s s p
5 |
6 | atom_style atomic
7 | neighbor 0.3 bin
8 | neigh_modify delay 5
9 |
10 | # create geometry
11 |
12 | lattice hex 0.93
13 | region box block 0 100 0 40 -0.25 0.25
14 | create_box 5 box
15 | create_atoms 1 box
16 |
17 | mass 1 1.0
18 | mass 2 1.0
19 | mass 3 1.0
20 | mass 4 1.0
21 | mass 5 1.0
22 |
23 | # LJ potentials
24 |
25 | pair_style lj/cut 2.5
26 | pair_coeff * * 1.0 1.0 2.5
27 |
28 | # define groups
29 |
30 | region 1 block INF INF INF 1.25 INF INF
31 | group lower region 1
32 | region 2 block INF INF 38.75 INF INF INF
33 | group upper region 2
34 | group boundary union lower upper
35 | group mobile subtract all boundary
36 |
37 | region leftupper block INF 20 20 INF INF INF
38 | region leftlower block INF 20 INF 20 INF INF
39 | group leftupper region leftupper
40 | group leftlower region leftlower
41 |
42 | set group leftupper type 2
43 | set group leftlower type 3
44 | set group lower type 4
45 | set group upper type 5
46 |
47 | # initial velocities
48 |
49 | compute new mobile temp
50 | velocity mobile create 0.01 887723 temp new
51 | velocity upper set 0.0 0.3 0.0
52 | velocity mobile ramp vy 0.0 0.3 y 1.25 38.75 sum yes
53 |
54 | # fixes
55 |
56 | fix 1 all nve
57 | fix 2 boundary setforce NULL 0.0 0.0
58 |
59 | # run
60 |
61 | timestep 0.003
62 | thermo 200
63 | thermo_modify temp new
64 |
65 | neigh_modify exclude type 2 3
66 |
67 | #dump 1 all atom 500 dump.crack
68 |
69 | #dump 2 all image 250 image.*.jpg type type &
70 | # zoom 1.6 adiam 1.5
71 | #dump_modify 2 pad 4
72 |
73 | #dump 3 all movie 250 movie.mpg type type &
74 | # zoom 1.6 adiam 1.5
75 | #dump_modify 3 pad 4
76 |
77 | run 5000
78 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/correct/in.ellipse.gayberne:
--------------------------------------------------------------------------------
1 | # GayBerne ellipsoids in LJ background fluid
2 |
3 | units lj
4 | atom_style ellipsoid
5 | dimension 2
6 |
7 | lattice sq 0.02
8 | region box block 0 20 0 20 -0.5 0.5
9 | create_box 2 box
10 | create_atoms 1 box
11 |
12 | set group all type/fraction 2 0.1 95392
13 | set type 1 mass 1.0
14 | set type 2 mass 1.5
15 | set type 1 shape 1 1 1
16 | set type 2 shape 3 1 1
17 | set group all quat/random 18238
18 |
19 | compute rot all temp/asphere
20 | group spheroid type 1
21 | variable dof equal count(spheroid)+2
22 | compute_modify rot extra/dof ${dof}
23 |
24 | velocity all create 2.4 87287 loop geom
25 |
26 | pair_style gayberne 1.0 3.0 1.0 4.0
27 | pair_coeff 1 1 3.0 1.0 1 1 1 1 1 1 2.5
28 | pair_coeff 1 2 3.0 1.0 1 1 3 0 0 0
29 | pair_coeff 2 2 1.0 1.0 1 1 0.2 0 0 0
30 |
31 | neighbor 0.8 bin
32 |
33 | thermo_style custom step c_rot epair etotal press vol
34 | thermo 100
35 |
36 | timestep 0.002
37 |
38 | compute q all property/atom quatw quati quatj quatk
39 |
40 | #dump 1 all custom 100 dump.ellipse.gayberne &
41 | # id type x y z c_q[1] c_q[2] c_q[3] c_q[4]
42 |
43 | #dump 2 all image 100 image.*.jpg type type &
44 | # zoom 1.6 center d 0.5 0.5 0.5
45 | #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0
46 |
47 | #dump 3 all movie 100 movie.mpg type type &
48 | # zoom 1.6 center d 0.5 0.5 0.5
49 | #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0
50 |
51 | fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 &
52 | mtk no pchain 0 tchain 1
53 | fix 2 all enforce2d
54 |
55 | compute_modify 1_temp extra/dof ${dof}
56 |
57 | # equilibrate to shrink box around dilute system
58 |
59 | run 2000
60 |
61 | # run dynamics on dense system
62 |
63 | unfix 1
64 | fix 1 all nve/asphere
65 |
66 | run 2000
67 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/correct/input.nml:
--------------------------------------------------------------------------------
1 | &MOM_input_nml
2 | output_directory = './',
3 | input_filename = 'n'
4 | restart_input_dir = 'INPUT/',
5 | restart_output_dir = 'RESTART/',
6 | parameter_filename = 'MOM_input',
7 | 'MOM_override' /
8 | &fms_nml
9 | domains_stack_size = 552960
10 | /
11 |
12 | &diag_manager_nml
13 | /
14 |
15 | &ocean_solo_nml
16 | months = 1200
17 | days = 0
18 | date_init = 1,1,1,0,0,0
19 | hours = 0
20 | minutes = 0
21 | seconds = 0
22 | calendar = 'leap' /
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/marked/in.airebo:
--------------------------------------------------------------------------------
1 | # AIREBO polyethelene benchmark
2 |
3 | units metal
4 | atom_style atomic
5 |
6 | read_data data.airebo
7 |
8 | replicate 17 16 2
9 |
10 | neighbor 0.5 bin
11 | neigh_modify delay 5 every 1
12 |
13 | pair_style airebo 3.0 1 1
14 | pair_coeff * * CH.airebo C H
15 |
16 | velocity all create 300.0 761341
17 |
18 | fix 1 all nve
19 | timestep 0.0005
20 |
21 | thermo 10
22 | run 100
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/marked/in.atm:
--------------------------------------------------------------------------------
1 | # Axilrod-Teller-Muto potential example
2 |
3 | variable x index 1
4 | variable y index 1
5 | variable z index 1
6 |
7 | variable xx equal 10*$x
8 | variable yy equal 10*$y
9 | variable zz equal 10*$z
10 |
11 | units lj
12 | atom_style atomic
13 |
14 | lattice fcc 0.65
15 | region box block 0 ${xx} 0 ${yy} 0 ${zz}
16 | create_box 1 box
17 | create_atoms 1 box
18 |
19 | pair_style hybrid/overlay lj/cut 4.5 atm 4.5 2.5
20 | pair_coeff * * lj/cut 1.0 1.0
21 | pair_coeff * * atm * 0.072
22 |
23 | mass * 1.0
24 | velocity all create 1.033 12345678 loop geom
25 |
26 | fix 1 all nvt temp 1.033 1.033 0.05
27 |
28 | timestep 0.002
29 | thermo 5
30 |
31 | run 25
32 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/marked/in.crack:
--------------------------------------------------------------------------------
1 | # 2d LJ crack simulation
2 |
3 | dimension 2
4 | boundary s s p
5 |
6 | atom_style atomic
7 | neighbor 0.3 bin
8 | neigh_modify delay 5
9 |
10 | # create geometry
11 |
12 | lattice hex 0.93
13 | region box block 0 100 0 40 -0.25 0.25
14 | create_box 5 box
15 | create_atoms 1 box
16 |
17 | mass 1 1.0
18 | mass 2 1.0
19 | mass 3 1.0
20 | mass 4 1.0
21 | mass 5 1.0
22 |
23 | # LJ potentials
24 |
25 | pair_style lj/cut 2.5
26 | pair_coeff * * 1.0 1.0 2.5
27 |
28 | # define groups
29 |
30 | region 1 block INF INF INF 1.25 INF INF
31 | group lower region 1
32 | region 2 block INF INF 38.75 INF INF INF
33 | group upper region 2
34 | group boundary union lower upper
35 | group mobile subtract all boundary
36 |
37 | region leftupper block INF 20 20 INF INF INF
38 | region leftlower block INF 20 INF 20 INF INF
39 | group leftupper region leftupper
40 | group leftlower region leftlower
41 |
42 | set group leftupper type 2
43 | set group leftlower type 3
44 | set group lower type 4
45 | set group upper type 5
46 |
47 | # initial velocities
48 |
49 | compute new mobile temp
50 | velocity mobile create 0.01 887723 temp new
51 | velocity upper set 0.0 0.3 0.0
52 | velocity mobile ramp vy 0.0 0.3 y 1.25 38.75 sum yes
53 |
54 | # fixes
55 |
56 | fix 1 all nve
57 | fix 2 boundary setforce NULL 0.0 0.0
58 |
59 | # run
60 |
61 | timestep 0.003
62 | thermo 200
63 | thermo_modify temp new
64 |
65 | neigh_modify exclude type 2 3
66 |
67 | #dump 1 all atom 500 dump.crack
68 |
69 | #dump 2 all image 250 image.*.jpg type type &
70 | # zoom 1.6 adiam 1.5
71 | #dump_modify 2 pad 4
72 |
73 | #dump 3 all movie 250 movie.mpg type type &
74 | # zoom 1.6 adiam 1.5
75 | #dump_modify 3 pad 4
76 |
77 | run 5000
78 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/marked/in.ellipse.gayberne:
--------------------------------------------------------------------------------
1 | # GayBerne ellipsoids in LJ background fluid
2 |
3 | units lj
4 | atom_style ellipsoid
5 | dimension 2
6 |
7 | lattice sq 0.02
8 | region box block 0 20 0 20 -0.5 0.5
9 | create_box 2 box
10 | create_atoms 1 box
11 |
12 | set group all type/fraction 2 0.1 95392
13 | set type 1 mass 1.0
14 | set type 2 mass 1.5
15 | set type 1 shape 1 1 1
16 | set type 2 shape 3 1 1
17 | set group all quat/random 18238
18 |
19 | compute rot all temp/asphere
20 | group spheroid type 1
21 | variable dof equal count(spheroid)+2
22 | compute_modify rot extra/dof ${dof}
23 |
24 | velocity all create 2.4 87287 loop geom
25 |
26 | pair_style gayberne 1.0 3.0 1.0 4.0
27 | pair_coeff 1 1 3.0 1.0 1 1 1 1 1 1 2.5
28 | pair_coeff 1 2 3.0 1.0 1 1 ;1 0 0 0;
29 | pair_coeff 2 2 1.0 1.0 1 1 0.2 0 0 0
30 |
31 | neighbor 0.8 bin
32 |
33 | thermo_style custom step c_rot epair etotal press vol
34 | thermo 100
35 |
36 | timestep 0.002
37 |
38 | compute q all property/atom quatw quati quatj quatk
39 |
40 | #dump 1 all custom 100 dump.ellipse.gayberne &
41 | # id type x y z c_q[1] c_q[2] c_q[3] c_q[4]
42 |
43 | #dump 2 all image 100 image.*.jpg type type &
44 | # zoom 1.6 center d 0.5 0.5 0.5
45 | #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0
46 |
47 | #dump 3 all movie 100 movie.mpg type type &
48 | # zoom 1.6 center d 0.5 0.5 0.5
49 | #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0
50 |
51 | fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 &
52 | mtk no pchain 0 tchain 1
53 | fix 2 all enforce2d
54 |
55 | compute_modify 1_temp extra/dof ${dof}
56 |
57 | # equilibrate to shrink box around dilute system
58 |
59 | run 2000
60 |
61 | # run dynamics on dense system
62 |
63 | unfix 1
64 | fix 1 all nve/asphere
65 |
66 | run 2000
67 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/med/marked/input.nml:
--------------------------------------------------------------------------------
1 | &MOM_input_nml
2 | output_directory = './',
3 | input_filename = 'n'
4 | restart_input_dir = 'INPUT/',
5 | restart_output_dir = 'RESTART/',
6 | parameter_filename = 'MOM_input',
7 | 'MOM_override' /
8 | &fms_nml
9 | domains_stack_size = 552960
10 | /
11 |
12 | &diag_manager_nml
13 | /
14 |
15 | &ocean_solo_nml
16 | months = 1200
17 | days = 0
18 | date_init = 1,1,1,0,0,0
19 | hours = 0
20 | minutes = 0
21 | seconds = 0
22 | calendar = ;'noleap'; /
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/multi_tags_template.sh:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | echo "My two parameters are ;port; and ;password;, OK?"
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/correct/in.airebo:
--------------------------------------------------------------------------------
1 | # AIREBO polyethelene benchmark
2 |
3 | units metal
4 | atom_style atomic
5 |
6 | read_data data.airebo
7 |
8 | replicate 17 16 2
9 |
10 | neighbor 0.5 bin
11 | neigh_modify delay 5 every 1
12 |
13 | pair_style airebo 3.0 1 1
14 | pair_coeff * * CH.airebo C H
15 |
16 | velocity all create 300.0 761341
17 |
18 | fix 1 all nve
19 | timestep 0.0005
20 |
21 | thermo 10
22 | run 100
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/correct/in.atm:
--------------------------------------------------------------------------------
1 | # Axilrod-Teller-Muto potential example
2 |
3 | variable x index 1
4 | variable y index 1
5 | variable z index 1
6 |
7 | variable xx equal 10*$x
8 | variable yy equal 10*$y
9 | variable zz equal 10*$z
10 |
11 | units lj
12 | atom_style atomic
13 |
14 | lattice fcc 0.65
15 | region box block 0 ${xx} 0 ${yy} 0 ${zz}
16 | create_box 1 box
17 | create_atoms 1 box
18 |
19 | pair_style hybrid/overlay lj/cut 4.5 atm 4.5 2.5
20 | pair_coeff * * lj/cut 1.0 1.0
21 | pair_coeff * * atm * 0.072
22 |
23 | mass * 1.0
24 | velocity all create 1.033 12345678 loop geom
25 |
26 | fix 1 all nvt temp 1.033 1.033 0.05
27 |
28 | timestep 0.002
29 | thermo 5
30 |
31 | run 25
32 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/correct/in.crack:
--------------------------------------------------------------------------------
1 | # 2d LJ crack simulation
2 |
3 | dimension 2
4 | boundary s s p
5 |
6 | atom_style atomic
7 | neighbor 0.3 bin
8 | neigh_modify delay 5
9 |
10 | # create geometry
11 |
12 | lattice hex 0.93
13 | region box block 0 100 0 40 -0.25 0.25
14 | create_box 5 box
15 | create_atoms 1 box
16 |
17 | mass 1 1.0
18 | mass 2 1.0
19 | mass 3 1.0
20 | mass 4 1.0
21 | mass 5 1.0
22 |
23 | # LJ potentials
24 |
25 | pair_style lj/cut 2.5
26 | pair_coeff * * 1.0 1.0 2.5
27 |
28 | # define groups
29 |
30 | region 1 block INF INF INF 1.25 INF INF
31 | group lower region 1
32 | region 2 block INF INF 38.75 INF INF INF
33 | group upper region 2
34 | group boundary union lower upper
35 | group mobile subtract all boundary
36 |
37 | region leftupper block INF 20 20 INF INF INF
38 | region leftlower block INF 20 INF 20 INF INF
39 | group leftupper region leftupper
40 | group leftlower region leftlower
41 |
42 | set group leftupper type 2
43 | set group leftlower type 3
44 | set group lower type 4
45 | set group upper type 5
46 |
47 | # initial velocities
48 |
49 | compute new mobile temp
50 | velocity mobile create 0.01 887723 temp new
51 | velocity upper set 0.0 0.3 0.0
52 | velocity mobile ramp vy 0.0 0.3 y 1.25 38.75 sum yes
53 |
54 | # fixes
55 |
56 | fix 1 all nve
57 | fix 2 boundary setforce NULL 0.0 0.0
58 |
59 | # run
60 |
61 | timestep 0.003
62 | thermo 200
63 | thermo_modify temp new
64 |
65 | neigh_modify exclude type 2 3
66 |
67 | #dump 1 all atom 500 dump.crack
68 |
69 | #dump 2 all image 250 image.*.jpg type type &
70 | # zoom 1.6 adiam 1.5
71 | #dump_modify 2 pad 4
72 |
73 | #dump 3 all movie 250 movie.mpg type type &
74 | # zoom 1.6 adiam 1.5
75 | #dump_modify 3 pad 4
76 |
77 | run 5000
78 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/correct/in.ellipse.gayberne:
--------------------------------------------------------------------------------
1 | # GayBerne ellipsoids in LJ background fluid
2 |
3 | units lj
4 | atom_style ellipsoid
5 | dimension 2
6 |
7 | lattice sq 0.02
8 | region box block 0 20 0 20 -0.5 0.5
9 | create_box 2 box
10 | create_atoms 1 box
11 |
12 | set group all type/fraction 2 0.1 95392
13 | set type 1 mass 1.0
14 | set type 2 mass 1.5
15 | set type 1 shape 1 1 1
16 | set type 2 shape 3 1 1
17 | set group all quat/random 18238
18 |
19 | compute rot all temp/asphere
20 | group spheroid type 1
21 | variable dof equal count(spheroid)+2
22 | compute_modify rot extra/dof ${dof}
23 |
24 | velocity all create 2.4 87287 loop geom
25 |
26 | pair_style gayberne 1.0 3.0 1.0 4.0
27 | pair_coeff 1 1 3.0 1.0 1 1 1 1 1 1 2.5
28 | pair_coeff 1 2 3.0 1.0 1 1 3 0 0 0
29 | pair_coeff 2 2 1.0 1.0 1 1 0.2 0 0 0
30 |
31 | neighbor 0.8 bin
32 |
33 | thermo_style custom step c_rot epair etotal press vol
34 | thermo 100
35 |
36 | timestep 0.002
37 |
38 | compute q all property/atom quatw quati quatj quatk
39 |
40 | #dump 1 all custom 100 dump.ellipse.gayberne &
41 | # id type x y z c_q[1] c_q[2] c_q[3] c_q[4]
42 |
43 | #dump 2 all image 100 image.*.jpg type type &
44 | # zoom 1.6 center d 0.5 0.5 0.5
45 | #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0
46 |
47 | #dump 3 all movie 100 movie.mpg type type &
48 | # zoom 1.6 center d 0.5 0.5 0.5
49 | #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0
50 |
51 | fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 &
52 | mtk no pchain 0 tchain 1
53 | fix 2 all enforce2d
54 |
55 | compute_modify 1_temp extra/dof ${dof}
56 |
57 | # equilibrate to shrink box around dilute system
58 |
59 | run 2000
60 |
61 | # run dynamics on dense system
62 |
63 | unfix 1
64 | fix 1 all nve/asphere
65 |
66 | run 2000
67 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/correct/input.nml:
--------------------------------------------------------------------------------
1 | &MOM_input_nml
2 | output_directory = './',
3 | input_filename = 'n'
4 | restart_input_dir = 'INPUT/',
5 | restart_output_dir = 'RESTART/',
6 | parameter_filename = 'MOM_input',
7 | 'MOM_override' /
8 | &fms_nml
9 | domains_stack_size = 552960
10 | /
11 |
12 | &diag_manager_nml
13 | /
14 |
15 | &ocean_solo_nml
16 | months = 1200
17 | days = 0
18 | date_init = 1,1,1,0,0,0
19 | hours = 0
20 | minutes = 0
21 | seconds = 0
22 | calendar = 'leap' /
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/marked/in.airebo:
--------------------------------------------------------------------------------
1 | # AIREBO polyethelene benchmark
2 |
3 | units metal
4 | atom_style atomic
5 |
6 | read_data data.airebo
7 |
8 | replicate 17 16 2
9 |
10 | neighbor 0.5 bin
11 | neigh_modify delay 5 every 1
12 |
13 | pair_style airebo 3.0 1 1
14 | pair_coeff * * CH.airebo C H
15 |
16 | velocity all create 300.0 761341
17 |
18 | fix 1 all nve
19 | timestep 0.0005
20 |
21 | thermo 10
22 | run 100
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/marked/in.atm:
--------------------------------------------------------------------------------
1 | # Axilrod-Teller-Muto potential example
2 |
3 | variable x index 1
4 | variable y index 1
5 | variable z index 1
6 |
7 | variable xx equal 10*$x
8 | variable yy equal 10*$y
9 | variable zz equal 10*$z
10 |
11 | units lj
12 | atom_style atomic
13 |
14 | lattice fcc 0.65
15 | region box block 0 ${xx} 0 ${yy} 0 ${zz}
16 | create_box 1 box
17 | create_atoms 1 box
18 |
19 | pair_style hybrid/overlay lj/cut 4.5 atm 4.5 2.5
20 | pair_coeff * * lj/cut 1.0 1.0
21 | pair_coeff * * atm * 0.072
22 |
23 | mass * 1.0
24 | velocity all create 1.033 12345678 loop geom
25 |
26 | fix 1 all nvt temp 1.033 1.033 0.05
27 |
28 | timestep 0.002
29 | thermo 5
30 |
31 | run 25
32 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/marked/in.crack:
--------------------------------------------------------------------------------
1 | # 2d LJ crack simulation
2 |
3 | dimension 2
4 | boundary s s p
5 |
6 | atom_style atomic
7 | neighbor 0.3 bin
8 | neigh_modify delay 5
9 |
10 | # create geometry
11 |
12 | lattice hex 0.93
13 | region box block 0 100 0 40 -0.25 0.25
14 | create_box 5 box
15 | create_atoms 1 box
16 |
17 | mass 1 1.0
18 | mass 2 1.0
19 | mass 3 1.0
20 | mass 4 1.0
21 | mass 5 1.0
22 |
23 | # LJ potentials
24 |
25 | pair_style lj/cut 2.5
26 | pair_coeff * * 1.0 1.0 2.5
27 |
28 | # define groups
29 |
30 | region 1 block INF INF INF 1.25 INF INF
31 | group lower region 1
32 | region 2 block INF INF 38.75 INF INF INF
33 | group upper region 2
34 | group boundary union lower upper
35 | group mobile subtract all boundary
36 |
37 | region leftupper block INF 20 20 INF INF INF
38 | region leftlower block INF 20 INF 20 INF INF
39 | group leftupper region leftupper
40 | group leftlower region leftlower
41 |
42 | set group leftupper type 2
43 | set group leftlower type 3
44 | set group lower type 4
45 | set group upper type 5
46 |
47 | # initial velocities
48 |
49 | compute new mobile temp
50 | velocity mobile create 0.01 887723 temp new
51 | velocity upper set 0.0 0.3 0.0
52 | velocity mobile ramp vy 0.0 0.3 y 1.25 38.75 sum yes
53 |
54 | # fixes
55 |
56 | fix 1 all nve
57 | fix 2 boundary setforce NULL 0.0 0.0
58 |
59 | # run
60 |
61 | timestep 0.003
62 | thermo 200
63 | thermo_modify temp new
64 |
65 | neigh_modify exclude type 2 3
66 |
67 | #dump 1 all atom 500 dump.crack
68 |
69 | #dump 2 all image 250 image.*.jpg type type &
70 | # zoom 1.6 adiam 1.5
71 | #dump_modify 2 pad 4
72 |
73 | #dump 3 all movie 250 movie.mpg type type &
74 | # zoom 1.6 adiam 1.5
75 | #dump_modify 3 pad 4
76 |
77 | run 5000
78 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/marked/in.ellipse.gayberne:
--------------------------------------------------------------------------------
1 | # GayBerne ellipsoids in LJ background fluid
2 |
3 | units lj
4 | atom_style ellipsoid
5 | dimension 2
6 |
7 | lattice sq 0.02
8 | region box block 0 20 0 20 -0.5 0.5
9 | create_box 2 box
10 | create_atoms 1 box
11 |
12 | set group all type/fraction 2 0.1 95392
13 | set type 1 mass 1.0
14 | set type 2 mass 1.5
15 | set type 1 shape 1 1 1
16 | set type 2 shape 3 1 1
17 | set group all quat/random 18238
18 |
19 | compute rot all temp/asphere
20 | group spheroid type 1
21 | variable dof equal count(spheroid)+2
22 | compute_modify rot extra/dof ${dof}
23 |
24 | velocity all create 2.4 87287 loop geom
25 |
26 | pair_style gayberne 1.0 3.0 1.0 4.0
27 | pair_coeff 1 1 3.0 1.0 1 1 1 1 1 1 2.5
28 | pair_coeff 1 2 3.0 1.0 1 1 @1 0 0 0@
29 | pair_coeff 2 2 1.0 1.0 1 1 0.2 0 0 0
30 |
31 | neighbor 0.8 bin
32 |
33 | thermo_style custom step c_rot epair etotal press vol
34 | thermo 100
35 |
36 | timestep 0.002
37 |
38 | compute q all property/atom quatw quati quatj quatk
39 |
40 | #dump 1 all custom 100 dump.ellipse.gayberne &
41 | # id type x y z c_q[1] c_q[2] c_q[3] c_q[4]
42 |
43 | #dump 2 all image 100 image.*.jpg type type &
44 | # zoom 1.6 center d 0.5 0.5 0.5
45 | #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0
46 |
47 | #dump 3 all movie 100 movie.mpg type type &
48 | # zoom 1.6 center d 0.5 0.5 0.5
49 | #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0
50 |
51 | fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 &
52 | mtk no pchain 0 tchain 1
53 | fix 2 all enforce2d
54 |
55 | compute_modify 1_temp extra/dof ${dof}
56 |
57 | # equilibrate to shrink box around dilute system
58 |
59 | run 2000
60 |
61 | # run dynamics on dense system
62 |
63 | unfix 1
64 | fix 1 all nve/asphere
65 |
66 | run 2000
67 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/new-tag/marked/input.nml:
--------------------------------------------------------------------------------
1 | &MOM_input_nml
2 | output_directory = './',
3 | input_filename = 'n'
4 | restart_input_dir = 'INPUT/',
5 | restart_output_dir = 'RESTART/',
6 | parameter_filename = 'MOM_input',
7 | 'MOM_override' /
8 | &fms_nml
9 | domains_stack_size = 552960
10 | /
11 |
12 | &diag_manager_nml
13 | /
14 |
15 | &ocean_solo_nml
16 | months = 1200
17 | days = 0
18 | date_init = 1,1,1,0,0,0
19 | hours = 0
20 | minutes = 0
21 | seconds = 0
22 | calendar = @'noleap'@ /
23 |
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/tag_dir_template/nested_0/tagged_0.sh:
--------------------------------------------------------------------------------
1 | echo "Hello with parameter 0 = ;PARAM0;"
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/tag_dir_template/nested_1/tagged_1.sh:
--------------------------------------------------------------------------------
1 | echo "Hello with parameter 1 = ;PARAM1;"
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/test_dir/test.in:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | thermo = @THERMO@
28 | steps = @STEPS@
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/test_dir/test_dir_1/config.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrayLabs/SmartSim/a54c3b30a04b2aeb9f37a407ccb278e362b83f8b/tests/test_configs/generator_files/test_dir/test_dir_1/config.txt
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/to_copy_dir/mock.txt:
--------------------------------------------------------------------------------
1 | File mockup.
--------------------------------------------------------------------------------
/tests/test_configs/generator_files/to_symlink_dir/mock2.txt:
--------------------------------------------------------------------------------
1 | File mockup two.
--------------------------------------------------------------------------------
/tests/test_configs/mpi/mpi_hello.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 |
9 | int main(int argc, char** argv) {
10 | sleep(1);
11 | // Initialize the MPI environment
12 | MPI_Init(NULL, NULL);
13 |
14 | // Get the number of processes
15 | int world_size;
16 | MPI_Comm_size(MPI_COMM_WORLD, &world_size);
17 |
18 | // Get the rank of the process
19 | int world_rank;
20 | MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
21 |
22 | char filename[64];
23 | sprintf(filename, "mpi_hello.%d.log", world_rank);
24 | FILE *log = fopen(filename, "w");
25 |
26 | fprintf(log, "Hello world from rank %d out of %d processors\n",
27 | world_rank, world_size);
28 | fflush(log);
29 |
30 | // unlink(filename);
31 | fclose(log);
32 |
33 | // Finalize the MPI environment.
34 | MPI_Finalize();
35 | }
36 |
--------------------------------------------------------------------------------
/tests/test_configs/mpi_impl_stubs/openmpi4/mpiexec:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # BSD 2-Clause License
4 | #
5 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
6 | # All rights reserved.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions are met:
10 | #
11 | # 1. Redistributions of source code must retain the above copyright notice, this
12 | # list of conditions and the following disclaimer.
13 | #
14 | # 2. Redistributions in binary form must reproduce the above copyright notice,
15 | # this list of conditions and the following disclaimer in the documentation
16 | # and/or other materials provided with the distribution.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | echo "mpiexec (OpenRTE) 4.1.2
30 |
31 | Report bugs to http://www.open-mpi.org/community/help/"
--------------------------------------------------------------------------------
/tests/test_configs/mpi_impl_stubs/openmpi4/mpirun:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # BSD 2-Clause License
4 | #
5 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
6 | # All rights reserved.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions are met:
10 | #
11 | # 1. Redistributions of source code must retain the above copyright notice, this
12 | # list of conditions and the following disclaimer.
13 | #
14 | # 2. Redistributions in binary form must reproduce the above copyright notice,
15 | # this list of conditions and the following disclaimer in the documentation
16 | # and/or other materials provided with the distribution.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | echo "mpirun (Open MPI) 4.1.2
30 |
31 | Report bugs to http://www.open-mpi.org/community/help/"
--------------------------------------------------------------------------------
/tests/test_configs/mpi_impl_stubs/openmpi4/orterun:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # BSD 2-Clause License
4 | #
5 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
6 | # All rights reserved.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions are met:
10 | #
11 | # 1. Redistributions of source code must retain the above copyright notice, this
12 | # list of conditions and the following disclaimer.
13 | #
14 | # 2. Redistributions in binary form must reproduce the above copyright notice,
15 | # this list of conditions and the following disclaimer in the documentation
16 | # and/or other materials provided with the distribution.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | echo "orterun (OpenRTE) 4.1.2
30 |
31 | Report bugs to http://www.open-mpi.org/community/help/"
--------------------------------------------------------------------------------
/tests/test_configs/mpi_impl_stubs/pals/mpiexec:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # BSD 2-Clause License
4 | #
5 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
6 | # All rights reserved.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions are met:
10 | #
11 | # 1. Redistributions of source code must retain the above copyright notice, this
12 | # list of conditions and the following disclaimer.
13 | #
14 | # 2. Redistributions in binary form must reproduce the above copyright notice,
15 | # this list of conditions and the following disclaimer in the documentation
16 | # and/or other materials provided with the distribution.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | # Stub executable to print out a generic PALS ``mpiexec --version`` message
30 |
31 | echo "mpiexec version 1.2.12 revision d3dd612f9372 built Apr 12 2023"
32 |
--------------------------------------------------------------------------------
/tests/test_configs/printing_model.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 |
4 |
5 | def main() -> int:
6 | print(";START;")
7 | time.sleep(20)
8 | print(";MID;")
9 | print("This is an error msg", file=sys.stderr)
10 | time.sleep(20)
11 | print(";END;")
12 |
13 | print("yay!!")
14 | return 0
15 |
16 |
17 | if __name__ == "__main__":
18 | sys.exit(main())
19 |
--------------------------------------------------------------------------------
/tests/test_configs/qstat.json:
--------------------------------------------------------------------------------
1 | {
2 | "pbs_server":"sdb",
3 | "Jobs":{
4 | "16705.sdb":{
5 | "Job_Name":"run.sh",
6 | "Job_Owner":"username",
7 | "resources_used":{
8 | "cpupercent":10,
9 | "cput":"00:00:01",
10 | "mem":"35844kb",
11 | "ncpus":17,
12 | "vmem":"462556kb",
13 | "walltime":"00:00:26"
14 | },
15 | "job_state":"R",
16 | "queue":"that_queue",
17 | "exec_host":"server/4+server/5",
18 | "exec_vnode":"(server_1:ncpus=1)+(server_2:ncpus=1)",
19 | "Hold_Types":"n",
20 | "Join_Path":"n",
21 | "Keep_Files":"n",
22 | "Mail_Points":"a",
23 | "mtime":"Wed Nov 4 12:23:28 2020"
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/tests/test_configs/reconnect_node.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import numpy as np
28 |
29 | from smartsim import Client
30 |
31 | if __name__ == "__main__":
32 | import argparse
33 |
34 | argparser = argparse.ArgumentParser()
35 | argparser.add_argument("--cluster", default=False, action="store_true")
36 | args = argparser.parse_args()
37 |
38 | client = None
39 | if args.cluster:
40 | client = Client(cluster=True)
41 | else:
42 | client = Client(cluster=False)
43 |
44 | for i in range(0, 5):
45 | data = client.get_array_nd_float64(str(i))
46 | for d in data:
47 | print(d)
48 |
--------------------------------------------------------------------------------
/tests/test_configs/sample.json:
--------------------------------------------------------------------------------
1 | {
2 | "param1": ;placeholder_1;
3 | }
--------------------------------------------------------------------------------
/tests/test_configs/send_data_local_smartredis.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import numpy as np
28 | from smartredis import Client
29 |
30 |
31 | def main():
32 | # address should be set as we are launching through
33 | # SmartSim.
34 |
35 | client = Client(cluster=False)
36 |
37 | array = np.array([1, 2, 3, 4])
38 | client.put_tensor("test_array", array)
39 | returned = client.get_tensor("test_array")
40 |
41 | np.testing.assert_array_equal(array, returned)
42 | print(f"Test worked! Sent {str(array)} and received {str(returned)}")
43 |
44 |
45 | if __name__ == "__main__":
46 | main()
47 |
--------------------------------------------------------------------------------
/tests/test_configs/sleep.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | import argparse
28 | import time
29 |
30 |
31 | def sleep(time_to_sleep):
32 | print("Starting sleep.py", flush=True)
33 | time.sleep(time_to_sleep)
34 | print(str(time_to_sleep), flush=True)
35 | print("done", flush=True)
36 |
37 |
38 | if __name__ == "__main__":
39 | parser = argparse.ArgumentParser()
40 | parser.add_argument("--time", type=int, default=15)
41 | args = parser.parse_args()
42 | sleep(args.time)
43 |
--------------------------------------------------------------------------------
/tests/test_configs/torchscript.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | # import torch
28 |
29 |
30 | def average(x):
31 | return torch.tensor(torch.mean(x)).unsqueeze(0)
32 |
--------------------------------------------------------------------------------
/tests/test_init.py:
--------------------------------------------------------------------------------
1 | # BSD 2-Clause License
2 | #
3 | # Copyright (c) 2021-2024, Hewlett Packard Enterprise
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | #
9 | # 1. Redistributions of source code must retain the above copyright notice, this
10 | # list of conditions and the following disclaimer.
11 | #
12 | # 2. Redistributions in binary form must reproduce the above copyright notice,
13 | # this list of conditions and the following disclaimer in the documentation
14 | # and/or other materials provided with the distribution.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 |
28 | import pytest
29 |
30 | # The tests in this file belong to the group_a group
31 | pytestmark = pytest.mark.group_a
32 |
33 |
34 | __author__ = "Sam Partee"
35 |
36 |
37 | try:
38 | from smartsim import *
39 |
40 | _top_import_error = None
41 | except Exception as e:
42 | _top_import_error = e
43 |
44 |
45 | def test_import_ss():
46 | # Test either above import has failed for some reason
47 | # "import *" is discouraged outside of the module level, hence we
48 | # rely on setting up the variable above
49 | assert _top_import_error is None
50 |
51 |
52 | test_import_ss()
53 |
--------------------------------------------------------------------------------
/tests/utils/test_network.py:
--------------------------------------------------------------------------------
1 | import pytest
2 |
3 | from smartsim._core.utils.network import find_free_port
4 |
5 | # The tests in this file belong to the group_a group
6 | pytestmark = pytest.mark.group_a
7 |
8 |
9 | def test_find_free_port_no_start():
10 | """Test that a free port is identified and returned when no
11 | starting port number is specified"""
12 | port = find_free_port()
13 | assert port > 0
14 |
15 |
16 | @pytest.mark.parametrize(
17 | "start_at",
18 | [
19 | pytest.param(1000, id="start at 1000"),
20 | pytest.param(2000, id="start at 2000"),
21 | pytest.param(5000, id="start at 5000"),
22 | pytest.param(10000, id="start at 10000"),
23 | pytest.param(16000, id="start at 16000"),
24 | ],
25 | )
26 | def test_find_free_port_range_specified(start_at):
27 | """Test that a free port greater than or equal to the specified
28 | starting port number is identified and returned"""
29 | port = find_free_port(start_at)
30 | assert port >= start_at
31 |
--------------------------------------------------------------------------------