File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed
Scheduler/HPCSchedulerBasics/HPCSchedulerBasics Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -73,25 +73,17 @@ static int Main(string[] args)
7373 // Create a scheduler object to be used to
7474 // establish a connection to the scheduler on the headnode
7575 using IScheduler scheduler = new Scheduler ( ) ;
76- try
76+ if ( userName != null )
7777 {
78- if ( userName != null )
79- {
80- // Connect to the scheduler as another user
81- Console . WriteLine ( "Connecting to {0} as {1}..." , clusterName , userName ) ;
82- scheduler . ConnectServiceAsClient ( clusterName , ( ) => userName ) ;
83- }
84- else
85- {
86- // Connect to the scheduler
87- Console . WriteLine ( "Connecting to {0}..." , clusterName ) ;
88- scheduler . Connect ( clusterName ) ;
89- }
78+ // Connect to the scheduler as another user
79+ Console . WriteLine ( "Connecting to {0} as {1}..." , clusterName , userName ) ;
80+ scheduler . ConnectServiceAsClient ( clusterName , ( ) => userName ) ;
9081 }
91- catch ( Exception e )
82+ else
9283 {
93- Console . Error . WriteLine ( "Could not connect to the scheduler: {0}" , e . Message ) ;
94- return 1 ; //abort if no connection could be made
84+ // Connect to the scheduler
85+ Console . WriteLine ( "Connecting to {0}..." , clusterName ) ;
86+ scheduler . Connect ( clusterName ) ;
9587 }
9688
9789 //Create a job to submit to the scheduler
You can’t perform that action at this time.
0 commit comments