Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alvarez, Gonzalo
PsimagLite
Commits
3a5a4683
Commit
3a5a4683
authored
Aug 05, 2020
by
Alvarez, Gonzalo
Browse files
Batch.pl: bug fix
parent
f64ab12c
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/Batch.pl
View file @
3a5a4683
...
...
@@ -13,7 +13,8 @@ chdir $ENV{"PBS_O_WORKDIR"};
#date
my
$np
=
4
;
my
$h
=
`
../scripts/mpiRoundRobin.pl
\
$PBS_NODEFILE
$np
`;
my
$nodefile
=
$ENV
{"
PBS_NODEFILE
"};
my
$h
=
getHostString
(
$nodefile
,
$np
);
#my $realCmd = "hostname";
my
$realCmd
=
"
./internode 4
";
...
...
@@ -22,10 +23,9 @@ my $command = "LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib ";
$command
.=
"
/usr/lib64/openmpi/bin/mpiexec -n
$np
-host
\"
$h
\"
$realCmd
";
system
("
$command
");
sub
mpiRoundRob
in
sub
getHostStr
in
g
{
my
(
$file
,
$mpiJobs
)
=
@ARGV
;
defined
(
$file
)
or
die
"
USAGE: $0 filename
\n
";
my
(
$file
,
$mpiJobs
)
=
@_
;
my
%h
;
my
$firstNode
;
...
...
@@ -50,13 +50,14 @@ sub mpiRoundRobin
die
"
$0: No nodes!
\n
"
if
(
$nodes
==
0
or
!
defined
(
$firstNode
));
my
$ppn
=
$h
{"
$firstNode
"};
my
$repeat
=
$mpiJobs
/
$nodes
;
printStuff
(
$repeat
,
\
%h
);
return
getHostString2
(
$repeat
,
\
%h
);
}
sub
printStuff
sub
getHostString2
{
my
(
$repeat
,
$h
)
=
@_
;
my
$firstcall
=
1
;
my
$str
=
"";
for
(
my
$i
=
0
;
$i
<
$repeat
;
++
$i
)
{
foreach
my
$key
(
sort
keys
%$h
)
{
my
$n
=
$h
->
{"
$key
"};
...
...
@@ -64,11 +65,13 @@ sub printStuff
if
(
$firstcall
)
{
$firstcall
=
0
;
}
else
{
print
"
,
";
$str
.=
"
,
";
}
print
"
$key
";
$str
.=
"
$key
";
}
}
return
$str
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment