Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6395


Ignore:
Timestamp:
06/08/11 14:37:40 (13 years ago)
Author:
svonolfe
Message:

Added cloning and storing to the MPIEngine (#1542)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MPI/HeuristicLab.MPIEngine/3.3/MPIEngine.cs

    r6394 r6395  
    4646  [Item("MPI Engine", "Engine for parallel execution of algorithms using multiple processes (suitable for distributed memory systems with multiple cores).")]
    4747  public class MPIEngine : Engine {
     48    private string username;
     49    private string password;
     50
     51    [Storable]
     52    private string headNode;
     53
     54    [Storable]
     55    private string path;
     56
     57    [Storable]
     58    private int cpuPerNode;
     59
     60    [Storable]
     61    private List<string> requestedNodes;
     62
    4863    [StorableConstructor]
    4964    protected MPIEngine(bool deserializing) : base(deserializing) { }
    50     protected MPIEngine(MPIEngine original, Cloner cloner) : base(original, cloner) { }
    51     public MPIEngine() : base() { }
     65
     66    protected MPIEngine(MPIEngine original, Cloner cloner) : base(original, cloner) {
     67      username = original.username;
     68      password = original.password;
     69      headNode = original.headNode;
     70      path = original.path;
     71      cpuPerNode = original.cpuPerNode;
     72      requestedNodes = new List<string>();
     73      foreach (string node in original.requestedNodes)
     74        requestedNodes.Add(node);
     75    }
     76
     77    public MPIEngine() : base() {
     78      username = @"user";
     79      password = @"password";
     80      headNode = "blade00.hpc.fh-hagenberg.at";
     81      path = @"C:\public\MPISupport";
     82      cpuPerNode = 8;
     83      requestedNodes = new List<string>();
     84      requestedNodes.Add("BLADE00");
     85    }
    5286
    5387    public override IDeepCloneable Clone(Cloner cloner) {
     
    83117
    84118    protected override void Run(System.Threading.CancellationToken cancellationToken) {
    85       string username = @"user";
    86       string password = @"password";
    87       string headNode = "blade00.hpc.fh-hagenberg.at";
    88       List<string> requestedNodes = new List<string>();
    89       requestedNodes.Add("BLADE00");
    90       string path = @"C:\public\MPISupport";
    91       int cpuPerNode = 8;
    92 
    93119      if (ExecutionStack.Count == 1) {
    94120        ExecutionContext context = ExecutionStack.Pop() as ExecutionContext;
     
    115141        job.AddTask(task);
    116142
    117         scheduler.SubmitJob(job, username, "");
     143        scheduler.SubmitJob(job, username, password);
    118144
    119145        try {
Note: See TracChangeset for help on using the changeset viewer.