Пример #1
0
        /// <summary>
        /// Main method that is invoked by SubmitJob Program
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            var getIp = GetLocalIpAddress();

            getIp.Wait();

            // try to connect to the NodeManager

            var jobRef   = new JobRef();
            var loader   = new CoreLoader <Job>(args[0]);
            var userArgs = new string[args.Length - 1];

            for (var i = 1; i < args.Length; i++)
            {
                userArgs[i - 1] = args[i];
            }
            // setup the job reference
            jobRef.RequestedNodes = (int)loader.CallMethod("RequestedNodes", new object[] {});
            jobRef.Username       = GetUserName();
            jobRef.PathToDll      = args[0];
            jobRef.FileName       = Path.GetFileName(args[0]);
            Console.WriteLine(jobRef.FileName);
            jobRef.UserArgs = userArgs;
            // call the initial method
            loader.CallMethod("RunInitialTask", new object[] {});
            var sj = new SubmitJob(_ipAddr, NetworkSendReceive.ServerPort, jobRef);

            Console.CancelKeyPress += sj.OnUserExit;
        }
Пример #2
0
 public JobSender(JobRef job, SubmitJob parent)
 {
     _parent = parent;
     _job    = job;
     _loader = new CoreLoader <Job>(_job.PathToDll);
 }