Skip to content

Commit

Permalink
runeclipse: Support multiple license servers (#718)
Browse files Browse the repository at this point in the history
Close #714
  • Loading branch information
alifbe authored Jul 25, 2024
1 parent cb3803a commit 122eae4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dynamic = ["version"]
dependencies = [
"resdata",
"res2df",
"ert>=2.38.0b7",
"ert",
"fmu-tools",
"matplotlib",
"numpy<2",
Expand Down
21 changes: 16 additions & 5 deletions src/subscript/legacy/runeclipse
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@ use Cwd;
use IO::File;

# ------------------------------------------------------
my $hostname = `hostname`;
my $_balance = `date +%s`;

$_balance = $_balance % 2;
my $lisens = "7321\@eclipse1-lic-no.statoil.no:7321\@eclipse2-lic-no.statoil.no";
if ($_balance == 1) {
$lisens = "7321\@eclipse2-lic-no.statoil.no:7321\@eclipse1-lic-no.statoil.no";
}

if (index($hostname, "stjohn-") == 0) {
$lisens = "7321\@stjohn-grid01.stjohn.statoil.no:$lisens";
} elsif (index($hostname, "rio-") == 0) {
$lisens = "7321\@rio-grid01.rio.statoil.no:$lisens";
}

my $ecldir = "/prog/res/ecl/grid";
my $eclolddir = "/prog/ecl/grid";
my $ecltestdir = "/prog/res/ecl/testgrid";
my $mpiintelroot = "/prog/res/ecl/grid/tools/linux_x86_64/intel/mpi/2018.1.163";

my $lisens = "7321\@eclipse-lic-no.statoil.no";

my $extconfig = "macros/CONFIG.ECL";
my $extmpirun64 = "tools/linux_x86_64/mpich_x86_64/bin/mpirun";

Expand Down Expand Up @@ -73,7 +84,7 @@ my $workdir = cwd;
my $scriptname = "runeclipse";

my $usage =
"usage $scriptname [-p program] [-q que_name] [-v version] [-x] [-i] root";
"usage $scriptname [-p program] [-q que_name] [-v version] [-x] [-i] root";

#
# Get command line options:
Expand Down Expand Up @@ -400,7 +411,7 @@ sub build_batch {
if ($testversion) {
print BATCHFIL "echo \"*** RUNNING TEST VERSION $version ****\"\n";
}
print BATCHFIL "export LM_LICENSE_FILE=$lisens\n";
print BATCHFIL "export SLBSLS_LICENSE_FILE=$lisens\n";
print BATCHFIL "export F_UFMTENDIAN=big\n";
print BATCHFIL "export ARCH=\`uname -m\`\n";
print BATCHFIL "cd $workdir\n";
Expand Down Expand Up @@ -437,7 +448,7 @@ sub build_parallel_batch {
or die "$scriptname: Cannot create batch file $batchfilename\n";

print BATCHFIL "#!/bin/sh \n";
print BATCHFIL "export LM_LICENSE_FILE=$lisens\n";
print BATCHFIL "export SLBSLS_LICENSE_FILE=$lisens\n";

# print BATCHFIL
# "export FLEXLM_NO_CKOUT_INSTALL_LIC=1\n" ;
Expand Down

0 comments on commit 122eae4

Please sign in to comment.