主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

parallel.validateProfile

验证并行环境配置文件

自 R2025a 起

    说明

    parallel.validateProfile 验证默认并行环境或集群配置文件。

    parallel.validateProfile 函数打印已执行的验证阶段,并指示每个阶段是否通过、失败或被跳过。

    如果验证阶段失败,函数将验证报告保存到临时文件夹中。

    示例

    parallel.validateProfile(profile) 验证由 profile 指定的并行环境配置文件。

    示例

    parallel.validateProfile(___,Name=Value) 使用一个或多个名称-值参量指定附加配置文件验证选项。

    示例

    示例

    全部折叠

    验证默认配置文件。parallel.validateProfile 函数打印已执行的验证阶段,并指示每个阶段是否通过、失败或被跳过。

    parallel.validateProfile
    Beginning validation for cluster profile 'Processes'
    Cluster connection test (parcluster)
       Stage started at 13:30:11.
       Finished at 13:30:11.
    ..........................................................................PASSED
    
    Job test (createJob)
       Stage started at 13:30:11.
       Finished at 13:30:59.
    ..........................................................................PASSED
    
    SPMD job test (createCommunicatingJob)
       Stage started at 13:31:04.
       Job ran with 6 workers.
       Finished at 13:32:26.
    ..........................................................................PASSED
    
    Pool job test (createCommunicatingJob)
       Stage started at 13:32:33.
       Job ran with 6 workers.
       Finished at 13:33:55.
    ..........................................................................PASSED
    
    Parallel pool test (parpool)
       Stage started at 13:34:04.
       20-Nov-2024 13:35:08: Job Queued. Waiting for parallel pool job with ID 43 to
       start ...
       Connected to parallel pool with 6 workers.
       Parallel pool using the 'Processes' profile is shutting down.
       Parallel pool ran with 6 workers.
       Finished at 13:35:44.
    ..........................................................................PASSED
    
    Finished cluster profile validation with status: PASSED
    

    验证 Threads 配置文件。parallel.validateProfile 函数仅对线程类型配置文件运行 Parallel pool test (parpool) 验证阶段。

    parallel.validateProfile("Threads")
    Beginning validation for cluster profile 'Threads'
    Parallel pool test (parpool)
       Stage started at 13:43:30.
       Starting parallel pool (parpool) using the 'Threads' profile ...
       Connected to parallel pool with 6 workers.
       Parallel pool using the 'Threads' profile is shutting down.
       Parallel pool ran with 6 workers.
       Finished at 13:43:30.
    ..........................................................................PASSED
    
    Finished cluster profile validation with status: PASSED
    

    使用 5 个工作单元验证远程 MATLAB® 作业调度器集群 myCluster 的配置文件。仅运行 "parcluster", "pool-job""parpool" 阶段。将验证结果保存到一个名为 "validation.txt" 的报告文件中。parallel.validateProfile 函数打印已执行的验证阶段,并指示每个阶段是否通过或失败。

    parallel.validateProfile("myCluster",NumWorkersToUse=5,StagesToRun=["parcluster","pool-job","parpool"],ReportFile="validation.txt");
    Beginning validation for cluster profile 'myCluster'
    Cluster connection test (parcluster)
       Stage started at 14:00:46.
       Finished at 14:00:47.
    ..........................................................................PASSED
    
    Pool job test (createCommunicatingJob)
       Stage started at 14:00:47.
       Job ran with 5 workers.
       Finished at 14:01:40.
    ..........................................................................PASSED
    
    Parallel pool test (parpool)
       Stage started at 14:01:55.
       Connected to parallel pool with 5 workers.
       Parallel pool using the 'myCluster' profile is shutting down.
       Parallel pool ran with 5 workers.
       Finished at 14:03:03.
    ..........................................................................PASSED
    
    Finished cluster profile validation with status: PASSED
    Validation report written to validation.txt
    

    验证为第三方远程集群新创建的配置文件。

    为了确保您已成功将 MATLAB® Parallel Server™ 集成到您的 Spark™ 集群中,并且您的配置文件已正确配置,请验证名为 "SparkProfile1" 的 Spark 配置文件。验证失败是因为配置文件设置错误,parallel.validateProfile 会自动将报告保存到临时文件夹中。

    parallel.validateProfile("SparkProfile1")
    Beginning validation for cluster profile 'SparkProfile1'
    Cluster connection test (parcluster)
       Stage started at 14:10:26.
       Unable to find Spark. Set the SPARK_HOME environment variable to a valid
       Spark installation folder or use the 'SparkInstallFolder' name-value
       parameter.
    ..........................................................................FAILED
    
    Spark job test (tall)
       Validation skipped due to previous failure.
    .........................................................................SKIPPED
    
    Tall evaluation test (tall gather)
       Validation skipped due to previous failure.
    .........................................................................SKIPPED
    
    Finished cluster profile validation with status: FAILED
    See validation report for full details:
     C:\Users\user\AppData\Local\Temp\validation_report_SparkProfile1.txt

    您可以使用 -batch MATLAB 启动选项在命令行上以非交互方式验证配置文件。要了解有关 MATLAB 启动选项的详细信息,请参阅 常用启动选项

    在命令行提示符下,使用 4 个工作单元验证远程集群 mySlurmCluster 的配置文件。跳过 "parpool" 阶段。将验证结果保存到一个名为 'validation.txt' 的报告文件中。parallel.validateProfile 函数打印已执行的验证阶段,并指示每个阶段是否通过或失败。

    matlab -batch "parallel.validateProfile('mySlurmCluster',NumWorkersToUse=4,StagesToSkip='parpool',ReportFile='validation.txt')"
    Beginning validation for cluster profile 'mySlurmCluster'
    Cluster connection test (parcluster)
       Stage started at 14:53:30.
       Finished at 14:53:31.
    ..........................................................................PASSED
    
    Job test (createJob)
       Stage started at 14:53:31.
       Finished at 14:53:54.
    ..........................................................................PASSED
    
    SPMD job test (createCommunicatingJob)
       Stage started at 14:54:04.
       Job ran with 4 workers.
       Finished at 14:54:44.
    ..........................................................................PASSED
    
    Pool job test (createCommunicatingJob)
       Stage started at 14:54:59.
       Job ran with 4 workers.
       Finished at 14:55:45.
    ..........................................................................PASSED
    
    Finished cluster profile validation with status: PASSED
    Validation report written to 'validation.txt'

    输入参数

    全部折叠

    并行环境或集群配置文件,指定为字符向量或字符串。如果您未指定配置文件,parallel.validateProfile 将验证默认配置文件。

    示例: "Processes"

    示例: "Threads"

    示例: "myMJSCluster"

    数据类型: char | string

    名称-值参数

    全部折叠

    将可选参量对指定为 Name1=Value1,...,NameN=ValueN,其中 Name 是参量名称,Value 是相应的值。名称-值参量必须出现在其他参量之后,但对的顺序并不重要。

    示例: NumWorkersToUse=4

    验证中使用的工作单元数,指定为非负整数。使用此参量可验证工作单元数少于配置文件的 PreferredPoolNumWorkersNumWorkers 属性中指定的工作单元数的配置文件。

    示例: NumWorkersToUse=4

    数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    要运行的验证阶段,指定为字符串数组或字符向量元胞数组,包含一个或多个以下阶段值:

    • "parcluster" - Cluster connection test (parcluster) 阶段。

    • "job" - Job test (createJob) 阶段。

    • "spmd-job" - SPMD job test (createCommunicatingJob) 阶段。

    • "pool-job" - Pool job test (createCommunicatingJob) 阶段。

    • "parpool" - Parallel pool test (parpool) 阶段。

    • "spark" - Spark job test (tall) 阶段。

    • "tall" - Tall evaluation test (tall gather) 阶段。

    某些阶段仅适用于特定的并行环境或集群类型。如果指定了 StagesToSkip 参量,则不能指定此参量。要了解每个阶段的详细信息,请参阅 验证阶段列表

    示例: StagesToRun=["parcluster","parpool"]

    数据类型: char | string | cell

    要跳过的验证阶段,指定为字符串数组或字符向量元胞数组,其中包含一个或多个以下阶段值:

    • "parcluster" - Cluster connection test (parcluster) 阶段。

    • "job" - Job test (createJob) 阶段。

    • "spmd-job" - SPMD job test (createCommunicatingJob) 阶段。

    • "pool-job" - Pool job test (createCommunicatingJob) 阶段。

    • "parpool" - Parallel pool test (parpool) 阶段。

    • "spark" - Spark job test (tall) 阶段。

    • "tall" - Tall evaluation test (tall gather) 阶段。

    某些阶段仅适用于特定的并行环境或集群类型。如果指定了 StagesToRun 参量,则不能指定此参量。要了解每个阶段的详细信息,请参阅 验证阶段列表

    示例: StagesToSkip=["parcluster","spmd-job"]

    数据类型: char | string | cell

    保存验证报告的文件名,指定为字符向量或字符串。

    如果未设置 ReportFile 参量且验证成功,则 parallel.validateProfile 不会创建报告。如果未设置 ReportFile 参量且验证失败,parallel.validateProfile 会自动创建一个验证报告并将其保存在临时文件夹中。

    示例: ReportFile="validation.txt"

    数据类型: char | string

    限制

    • 当您验证线程并行环境的配置文件时,parallel.validateProfile 只运行 Parallel pool test (parpool) 阶段。

    算法

    全部折叠

    版本历史记录

    在 R2025a 中推出