主要内容

validate

Validate cluster object

Since R2026a

    Description

    validate(myCluster) validates the cluster specified by the cluster object myCluster. You can use the validate function to validate a cluster object after you modify a cluster object property.

    The validate function prints the validation stages performed and an indication of whether each stage passed, failed, or was skipped.

    If a validation stage fails, the function saves a validation report to the temporary folder.

    example

    validate(___,Name=Value) specifies additional cluster validation options using one or more name-value arguments.

    example

    Examples

    collapse all

    Create a cluster object for a remote cluster with the profile name myMJSCluster, using the parcluster function.

    c = parcluster(myMJSCluster);

    Validate the cluster object, c. The validate function prints the validation stages performed and an indication of whether each stage passed, failed, or was skipped.

    validate(c)
    Beginning cluster validation.
    Cluster connection test (parcluster)
       Stage started at 15:52:05.
       Using existing cluster object.
       ✓ Network latency: 6 ms
       ✓ Upload speed: 22915 KB/s
       ✓ Download speed: 43480 KB/s
       For more information on these results, see the
       "Troubleshooting Slow Network Connection" documentation
       page.
       Finished at 15:52:11.
    ......................................................PASSED
    Job test (createJob)
       Stage started at 15:52:11.
       Finished at 15:52:21.
    ......................................................PASSED
    SPMD job test (createCommunicatingJob)
       Stage started at 15:52:21.
       Job ran with 1 worker.
       Finished at 15:52:26.
    ......................................................PASSED
    Pool job test (createCommunicatingJob)
       Stage started at 15:52:26.
       Job ran with 1 worker.
       Finished at 15:52:45.
    ......................................................PASSED
    Parallel pool test (parpool)
       Stage started at 15:52:45.
       Connected to parallel pool with 12 workers.
       Parallel pool is shutting down.
       Parallel pool ran with 12 worker.
       Finished at 15:52:53.
    ......................................................PASSED
    Finished cluster validation with status: PASSED

    Create a cluster object using the default cluster profile.

    c = parcluster;

    Validate the cluster object, c using 5 workers. Run only the "job", "spmd-job", and "pool-job" stages. Save the validation results to a report file with the name "validation.txt".

    validate(c,NumWorkersToUse=5, ...
        StagesToRun=["job","spmd-job","pool-job"],ReportFile="validation.txt")
    
    Beginning cluster validation
    Cluster connection test (parcluster)
       Stage started at 14:46:04.
       Using existing cluster object.
       Finished at 14:46:06.
    ..........................................................................PASSED
    
    Job test (createJob)
       Stage started at 14:46:06.
       Finished at 14:46:52.
    ..........................................................................PASSED
    
    SPMD job test (createCommunicatingJob)
       Stage started at 14:46:55.
       Job ran with 5 workers.
       Finished at 14:47:57.
    ..........................................................................PASSED
    
    Pool job test (createCommunicatingJob)
       Stage started at 14:48:01.
       Job ran with 5 workers.
       Finished at 14:49:11.
    ..........................................................................PASSED
    
    Finished validation with status: PASSED
    Validation report written to validation.txt

    Input Arguments

    collapse all

    Cluster, specified as a parallel.Cluster object that represents cluster compute resources. To create the parallel.Cluster object, use the parcluster function.

    Example: cluster = parcluster; validate(cluster);

    Data Types: parallel.Cluster

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: NumWorkersToUse=4

    Number of workers to use in validation, specified as a nonnegative integer. Use this argument to validate the cluster object with fewer workers than those specified in the cluster object's PreferredPoolNumWorkers or NumWorkers property.

    Example: NumWorkersToUse=4

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Validation stages to run, specified as a string array or cell array of character vectors with one or more of these stage values:

    • "parcluster"Cluster connection test (parcluster) stage.

    • "job"Job test (createJob) stage.

    • "spmd-job"SPMD job test (createCommunicatingJob) stage.

    • "pool-job"Pool job test (createCommunicatingJob) stage.

    • "parpool"Parallel pool test (parpool) stage.

    • "spark"Spark job test (tall) stage.

    • "tall"Tall evaluation test (tall gather) stage.

    Some stages are only available for certain parallel environment or cluster types. You cannot specify this argument if you specify the StagesToSkip argument. To learn more about each stage, see List of Validation Stages.

    Example: StagesToRun=["job","parpool"]

    Data Types: char | string | cell

    Validation stages to skip, specified as a string array or cell array of character vectors with one or more of these stage values:

    • "parcluster"Cluster connection test (parcluster) stage.

    • "job"Job test (createJob) stage.

    • "spmd-job"SPMD job test (createCommunicatingJob) stage.

    • "pool-job"Pool job test (createCommunicatingJob) stage.

    • "parpool"Parallel pool test (parpool) stage.

    • "spark"Spark job test (tall) stage.

    • "tall"Tall evaluation test (tall gather) stage.

    Some stages are only available for certain parallel environment or cluster types. You cannot specify this argument if you specify the StagesToRun argument. To learn more about each stage, see List of Validation Stages.

    Example: StagesToSkip=["job","spmd-job"]

    Data Types: char | string | cell

    Filename to save validation report, specified as a character vector or string.

    If you do not set the ReportFile argument and validation is successful, validate does not create a report. If you do not set the ReportFile argument and validation fails, validate automatically creates a validation report and saves it in the temporary folder.

    Example: ReportFile="validation.txt"

    Data Types: char | string

    Algorithms

    collapse all

    Version History

    Introduced in R2026a