Add the following property in the SMAExeServer.properties file to specify your custom file transfer script: fiper.station.sim.stageFileScript=</path/filename> For example: fiper.station.sim.stageFileScript=/r/cluster_software/scripts/opendrm/rsync.pl This property, and the script it names, are used by the simulation physics apps that invoke the remote execution process: Structural Validation, Structural Scenario Creation, Mechanical Scenario Creation, Fluid Scenario Creation, etc. The property and script are also used by the Functional Generative Design app. Your script is passed three arguments by the process/workflow being executed:
An example file transfer script using Perl and the rsync utility is shown below. #!/usr/bin/env perl use strict; use Cwd; my $rsync = "/usr/bin/rsync -avz"; my $controllerHost = $ARGV[0]; # Windows detached controller host my $activityDir = $ARGV[1]; # value of activity directory in fiper.file.fs.simshared on Windows controller host my $mode = $ARGV[2]; # either PUSH or PULL my $winSimshared = "/e4all_fs/vdevpril989am/home/WORKING/stagescript"; #fiper.file.fs.simshared relative to Linux transfer host my $transferHost = "lsfportal2"; my $cwd = cwd(); my $sig = "TRANSFER SCRIPT"; die "$sig ERROR: missing controller host argument.\n" if ($controllerHost eq ""); die "$sig ERROR: missing activityDir argument.\n" if ($activityDir eq ""); die "$sig ERROR: missing script mode argument.\n" if ($mode eq ""); die "$sig ERROR: This script is not supported on Windows\n" if ($^O =~ /MSWin/); print "$sig INFO: controller host - $controllerHost\n"; print "$sig INFO: activityDir - $activityDir\n"; print "$sig INFO: mode - $mode\n"; print "$sig Executing copy...\n"; if ($mode eq "PULL") { print "$sig INFO: running $rsync ${transferHost}:$winSimshared/$activityDir . (working dir: $cwd)\n"; if ( system("$rsync ${transferHost}:$winSimshared/$activityDir/* .") ) { die "$sig ERROR: file transfer pull failed.\n"; } } elsif ($mode eq "PUSH") { print "$sig INFO: running $rsync ./* ${transferHost}:$winSimshared/$activityDir (working dir: $cwd)\n"; if ( system("$rsync ./* ${transferHost}:$winSimshared/$activityDir") ) { die "$sig ERROR: file transfer push failed.\n"; } } else { die "$sig ERROR: unhandled mode specified.\n"; } print "$sig done\n"; exit 0; Another example file transfer script using the scp utility is shown below. #!/usr/bin/env perl use strict; use Cwd; my $scp = "/usr/bin/scp -rp"; my $controllerHost = $ARGV[0]; # Windows detached controller host my $activityDir = $ARGV[1]; # value of activity directory in fiper.file.fs.simshared on Windows controller host my $mode = $ARGV[2]; # either PUSH or PULL my $winSimshared = "/e4all_fs/vdevpril989am/home/WORKING/stagescript"; #fiper.file.fs.simshared relative to Linux transfer host my $transferHost = "lsfportal2"; my $cwd = cwd(); my $sig = "TRANSFER SCRIPT"; die "$sig ERROR: missing controller host argument.\n" if ($controllerHost eq ""); die "$sig ERROR: missing activityDir argument.\n" if ($activityDir eq ""); die "$sig ERROR: missing script mode argument.\n" if ($mode eq ""); die "$sig ERROR: This script is not supported on Windows\n" if ($^O =~ /MSWin/); print "$sig INFO: controller host - $controllerHost\n"; print "$sig INFO: activityDir - $activityDir\n"; print "$sig INFO: mode - $mode\n"; print "$sig Executing copy...\n"; if ($mode eq "PULL") { print "$sig INFO: running $scp ${transferHost}:$winSimshared/$activityDir . (working dir: $cwd)\n"; if ( system("$scp ${transferHost}:$winSimshared/$activityDir .") ) { die "$sig ERROR: file transfer pull failed.\n"; } else { system("mv ./$activityDir/* ."); } } elsif ($mode eq "PUSH") { system("mv * ./$activityDir"); #mv to avoid doubling disk space, but toscaResults.zip must remain in activityDir system("cp ./$activityDir/toscaResults.zip ."); #hack, otherwise results generation fails. Rsync avoids this. print "$sig INFO: running $scp ./$activityDir ${transferHost}:$winSimshared (working dir: $cwd)\n"; if ( system("$scp ./$activityDir ${transferHost}:$winSimshared ") ) { die "$sig ERROR: file transfer push failed.\n"; } } else { die "$sig ERROR: unhandled mode specified.\n"; } print "$sig done\n"; exit 0; |