Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn
Commits
f5ca0770
Commit
f5ca0770
authored
Apr 11, 2021
by
Max
Browse files
Put back commented, but default to /dev/null if no LDAP
parent
8436ccf2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/alien/site/batchqueue/SLURM.java
View file @
f5ca0770
...
...
@@ -112,43 +112,38 @@ public class SLURM extends BatchQueue {
DateFormat
date_format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
current_date_str
=
date_format
.
format
(
new
Date
());
Long
timestamp
=
Long
.
valueOf
(
System
.
currentTimeMillis
());
// Create log directory
String
host_logdir
=
(
environment
.
get
(
"SLURM_LOG_PATH"
)
!=
null
?
environment
.
get
(
"SLURM_LOG_PATH"
)
:
(
String
)
config
.
get
(
"host_logdir"
));
String
log_folder_path
=
String
.
format
(
"%s/%s"
,
host_logdir
,
current_date_str
);
File
log_folder
=
new
File
(
log_folder_path
);
if
(!(
log_folder
.
exists
())
||
!(
log_folder
.
isDirectory
()))
{
try
{
log_folder
.
mkdir
();
}
catch
(
SecurityException
e
)
{
this
.
logger
.
info
(
String
.
format
(
"[SLURM] Couldn't create log folder: %s"
,
log_folder_path
));
e
.
printStackTrace
();
// Logging setup
String
out_cmd
=
"#SBATCH -o /dev/null"
;
String
err_cmd
=
"#SBATCH -e /dev/null"
;
String
name
=
String
.
format
(
"jobagent_%s_%d"
,
this
.
config
.
get
(
"host_host"
),
timestamp
);
//Check if we can use SLURM_LOG_PATH instead of sending to /dev/null
String
host_logdir
=
environment
.
get
(
"SLURM_LOG_PATH"
);
if
(
host_logdir
!=
null
)
{
String
log_folder_path
=
String
.
format
(
"%s/%s"
,
host_logdir
,
current_date_str
);
File
log_folder
=
new
File
(
log_folder_path
);
if
(!(
log_folder
.
exists
())
||
!(
log_folder
.
isDirectory
()))
{
try
{
log_folder
.
mkdir
();
}
catch
(
SecurityException
e
)
{
this
.
logger
.
info
(
String
.
format
(
"[SLURM] Couldn't create log folder: %s"
,
log_folder_path
));
e
.
printStackTrace
();
}
}
}
// Generate name for SLURM output files
Long
timestamp
=
Long
.
valueOf
(
System
.
currentTimeMillis
());
String
file_base_name
=
String
.
format
(
"%s/jobagent_%s_%d"
,
Functions
.
resolvePathWithEnv
(
log_folder_path
),
config
.
get
(
"host_host"
),
timestamp
);
// Put generate output options
String
out_cmd
=
""
;
String
err_cmd
=
""
;
String
name
=
String
.
format
(
"jobagent_%s_%d"
,
this
.
config
.
get
(
"host_host"
),
timestamp
);
File
enable_sandbox_file
=
new
File
(
environment
.
get
(
"TMP"
)
+
"/enable-sandbox"
);
// if (enable_sandbox_file.exists() || (this.logger.getLevel() != null)) {
// out_cmd = String.format("#SBATCH -o %s.out", file_base_name);
// err_cmd = String.format("#SBATCH -e %s.err", file_base_name);
// }
// else {
// out_cmd = "#SBATCH -o /dev/null";
// err_cmd = "#SBATCH -e /dev/null";
// }
out_cmd
=
"#SBATCH -o /dev/null"
;
err_cmd
=
"#SBATCH -e /dev/null"
;
// Generate name for SLURM output files
String
file_base_name
=
String
.
format
(
"%s/jobagent_%s_%d"
,
Functions
.
resolvePathWithEnv
(
log_folder_path
),
config
.
get
(
"host_host"
),
timestamp
);
// Put generate output options
File
enable_sandbox_file
=
new
File
(
environment
.
get
(
"TMP"
)
+
"/enable-sandbox"
);
if
(
enable_sandbox_file
.
exists
()
||
(
this
.
logger
.
getLevel
()
!=
null
))
{
out_cmd
=
String
.
format
(
"#SBATCH -o %s.out"
,
file_base_name
);
err_cmd
=
String
.
format
(
"#SBATCH -e %s.err"
,
file_base_name
);
}
}
// Build SLURM script
String
submit_cmd
=
"#!/bin/bash\n"
;
...
...
Write
Preview
Supports
Markdown
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