source: PSPA/madxPSPA/testing/MadTrigWindowsCompilation.pl @ 457

Last change on this file since 457 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 1.3 KB
Line 
1#!/usr/bin/perl
2
3# this triggers remote invocation of the MAD-X compilation on Windows,
4# through an intermediate machine on which the NFS directory seen through
5# Samba is mounted.
6
7
8use IO::Socket::INET;
9
10my $intermediateNfsLinuxHost = 'cs-ccr-dev1'; # a.k.a abcopl1
11my $intermediateSocketPort = 7075;
12
13# this value should be such as to allow the acrontab to recreate the
14# MadWindowsCompileClient.pl process in case it just died after 10 days
15# of so or running, after which the AFS and Kerberos tokens can no
16# longer be refreshed and need to be recreated with a brand new process
17
18my $socket;
19my $minutes = 5;
20TWO_TRIALS: for ($i=1; $i<$minutes; $i++) {
21    $socket = new IO::Socket::INET(
22                                      PeerAddr => $intermediateNfsLinuxHost,
23                                      PeerPort => $intermediateSocketPort,
24                                      Proto => 'tcp',
25                                      );
26    if ($socket) { last TWO_TRIALS; } else {
27        sleep 60;
28    }# exit the loop
29}
30
31
32
33# die "Could not create socket: $!\n" unless $socket;
34
35if ($socket){
36    print $socket "Trigger Windows compilation\n";
37    print "success\n"; # output in case of success
38
39    close($socket);
40} else {
41    # output in case of failure
42    print "failure: failed to create socket $intermediateSocketPort\n";
43}
44
45# we don't wait the reply, as the intermediate Linux perl script will handle it
Note: See TracBrowser for help on using the repository browser.