none
Making email notification default on? RRS feed

  • Question

  • We use the MATLAB GUI to submit jobs to Windows HPC Pack 2012R2 U2. This software doesn't allow (as far as I can see) an option to set the two Notify parameters on jobs, so the user can get an email when their job starts and completes.

    Is there any way to set the two Notify parameters to True, on all jobs submitted to the cluster instead? I thought a Job Template might allow this, but I can't see an option for the Notify parameters here.

    Are there other solutions?

    Many thanks, Mark

    Saturday, January 16, 2016 11:45 AM

Answers

  • I suppose 2015b won't be quite different from 2015a, and here is how you can do it now:

    1. Create an empty job with the email notification option on (Using Job GUI), export the job to job XML

    2. Open matlab, in the Cluster Profile Manager, edit the HPC Pack profile->Properties->"XML job description file to use when creating jobs"(JobDescriptionFile) with the value of the job xml file you exported in step 1

    After doing so, your matlab jobs will set with the email notification. And you can use this way to customize your matlab jobs for example, adding job pre/post tasks.


    Qiufang Shi

    • Marked as answer by SparkyW Tuesday, January 19, 2016 7:53 PM
    Tuesday, January 19, 2016 9:52 AM

All replies

  • Hi Mark,

      Matlab allows you to specify a job XML as a template to submit the job. Within the job you can specify the Job notify parameter. (Not sure which version of Matlab you're using).

      It is a good suggestion to us to include the Job Notify parameter to be included in the job template, we will evaluate this in the upcoming new release.


    Qiufang Shi

    Monday, January 18, 2016 3:12 AM
  • Thank you - we are using 2015b (the latest). I will see if I can figure out how to specify a custom XML job template and what the format of the file should be. I assume there is one on the filesystem already somewhere I can use as a guide. I can't find very much in the online documentation, though I notice you can specify JobTemplate as a parameter on a MATLAB parallel.cluster.HPCServer object, so will start there. Please let me know if you have any more pointers.

    It would be very useful to specify both Notify parameters in a HPC Server-side template, thank you for taking this idea onboard. I look forward to seeing if this made it into the next release.

    Cheers, Mark

    Monday, January 18, 2016 11:31 PM
  • I suppose 2015b won't be quite different from 2015a, and here is how you can do it now:

    1. Create an empty job with the email notification option on (Using Job GUI), export the job to job XML

    2. Open matlab, in the Cluster Profile Manager, edit the HPC Pack profile->Properties->"XML job description file to use when creating jobs"(JobDescriptionFile) with the value of the job xml file you exported in step 1

    After doing so, your matlab jobs will set with the email notification. And you can use this way to customize your matlab jobs for example, adding job pre/post tasks.


    Qiufang Shi

    • Marked as answer by SparkyW Tuesday, January 19, 2016 7:53 PM
    Tuesday, January 19, 2016 9:52 AM
  • That worked great, thankyou. I created an empty job within the HPC management UI, exported this as an XML file, then edited it to remove everything except the two Notify attributes I was looking for. Pointing the MATLAB Cluster Profile at this file for the JobDescriptionFile worked, and the rest of the job details were left untouched - but I now received email telling me when jobs had started, failed and completed.

    Tomorrow I will make the JobDescriptionFile part of the autodiscover process MATLAB uses, so this is the default for all new users.

    For reference, here is the XML file I ended up using (though anyone else should follow the advice above, to create their own in case future versions change the format).

    <?xml version="1.0" encoding="utf-8"?>
    <Job Version="3.000" NotifyOnStart="true" NotifyOnCompletion="true" xmlns="http://schemas.microsoft.com/HPCS2008R2/scheduler/">
        <Dependencies />
        <Tasks />

    </Job>

    Many thanks, Mark
    Tuesday, January 19, 2016 7:53 PM
  • What is the recommended way to achieve the same for a SOA based DLL? I would like that the user to get an email notification when his/her job finishes

    This info is in ISchedulerJob interface and I am assuming this needs to be set when the session is created in client code (but before the EndRequests is called), but could not get the 'job' info by passing the session id via IScheduler.ConfigureJob().. 

    Any other way to achieve this programatically?

    Here is my code..:

     SessionStartInfo info = new SessionStartInfo("SERVERNAME", "MyHPCService");
                info.JobTemplate = "MyJobTemplate";
    //DID not find any way to modify the job template
    //to enable email notification to info.Username 
    //when job completes.
    
     using (DurableSession session = DurableSession.CreateSession(info))
                {
                    intSessionID = session.Id;
    
                    IScheduler scheduler = new Scheduler();
                    scheduler.Connect("SERVERNAME");
                    scheduler.ConfigureJob(intSessionID);
                    //How to set the email notification for this job?
    
                    using (BrokerClient<IMyHPCService> client = new BrokerClient<IMyHPCService>(session))
                    {
                     //do something   
                     }
                        client.EndRequests();
                    }
                }

    or can I use the following:

    ISchedulerJob job = scheduler.OpenJob(intSessionID); job.NotifyOnCompletion = true; job.EmailAddress = UserPrincipal.Current.EmailAddress;

    ..

    ..

    client.EndRequests();

    Is this recommended?



    • Edited by SRIRAM R Monday, June 27, 2016 3:57 PM
    Monday, June 27, 2016 3:48 PM
  • Hi SRIRAM R,

    Yes, you may use IScheduler.OpenJob and other scheduler API to operate on the session job directly for the email related configurations. Session API does not expose these configurations.

    Regards,

    Yutong Sun

    Wednesday, June 29, 2016 6:48 AM
  • Thanks. Tried using IScheduler.OpenJob to set email notification, but I am getting an exception when I commit the changes -- It's saying the job is already in running state and no changes can be made to it.

    I am calling OpenJob() just after CreateSession().

    So what's the best way to intercept the job and modify it's properties?

    Wednesday, June 29, 2016 12:01 PM
  • Hi,

      Only limited properties are allowed to be changed when the job is in running state (Like job name, project name). And it should allow to set the job finish email notification. We will have a double check at our side. If this is an issue will fix in the next QFE.


    Qiufang Shi

    • Proposed as answer by SRIRAM R Thursday, June 30, 2016 2:39 AM
    Thursday, June 30, 2016 1:24 AM
  • You are correct. NotifyOnCompletion() works fine.

    IScheduler.NotifyOnStart is what was failing for me.

    Thanks again. 

    Look forward to some documentation on what can be changed on a job and when once an SOA session is created.


    Thursday, June 30, 2016 2:38 AM