Skip to content

Commit ec6c2bb

Browse files
authored
Merge pull request #198 from jpwhite4/templates
Update templates for new archive layout.
2 parents 5dcc3ab + 28000a1 commit ec6c2bb

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

config/templates/pmlogger/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $PMCD_REQUEST_TIMEOUT=120
3636
# (LOCALHOSTNAME is expanded to local: in the first column,
3737
# and to `hostname` in the fourth (directory) column.)
3838
#
39-
LOCALHOSTNAME y n "PCP_LOG_DIR/pmlogger/LOCALHOSTNAME/$(date +%Y)/$(date +%m)/$(date +%d)" -r -c /etc/pcp/pmlogger/pmlogger-supremm.config
39+
LOCALHOSTNAME y n "PCP_LOG_DIR/pmlogger/$(date +%Y)/$(date +%m)/LOCALHOSTNAME/$(date +%Y)-$(date +%m)-$(date +%d)" -r -c /etc/pcp/pmlogger/pmlogger-supremm.config
4040

4141
# Note: if multiple pmloggers for the same host (e.g. both primary and
4242
# non-primary loggers are active), then they MUST use different

config/templates/slurm/slurm-epilog

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22

33
use strict;
44
use Sys::Hostname;
5+
use Date::Simple;
56
use POSIX qw(strftime);
67

78
my $jobid = $ENV{SLURM_JOB_ID};
9+
my $today = Date::Simple->new;
10+
11+
my $logyear = $today->format("%Y");
12+
my $logmonth = $today->format("%m");
13+
my $logday = $today->format("%d");
14+
815
my $jobdatelong = strftime "%Y%m%d.%H.%M.%S", localtime;
916
my $fullhost = hostname();
1017

1118
# PCP End of job logging
1219

13-
my $logdir = "/<GLOBAL_SHARED_SPACE>/supremm/pmlogger/$fullhost/$logyear/$logmonth/$logday";
20+
my $logdir = "/<GLOBAL_SHARED_SPACE>/supremm/pmlogger/$logyear/$logmonth/$fullhost/$logyear-$logmonth-$logday";
1421
system("env PMLOGGER_EPILOG=yes pmlogger -U pcp -c /etc/pcp/pmlogger/pmlogger-supremm.config -s 1 -l /tmp/job-$jobid-end-$jobdatelong.log $logdir/job-$jobid-end-$jobdatelong &> /dev/null");
1522

1623
exit(0);

config/templates/slurm/slurm-prolog

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
use strict;
44
use Sys::Hostname;
5+
use Date::Simple;
56
use POSIX qw(strftime setsid);
67

8+
my $today = Date::Simple->new;
9+
10+
my $logyear = $today->format("%Y");
11+
my $logmonth = $today->format("%m");
12+
my $logday = $today->format("%d");
13+
714
my $jobdatelong = strftime "%Y%m%d.%H.%M.%S", localtime;
815
my $host = ( split('\.', hostname()) )[0];
916
my $jobid = $ENV{SLURM_JOB_ID};
@@ -27,11 +34,9 @@ open( STDERR, ">&STDOUT" ); # Detach STDERR from shell
2734
chdir '/tmp'; # Change working directory
2835
umask(0); # Reset umask
2936

30-
my $logdir = "/<GLOBAL_SHARED_SPACE>/supremm/pmlogger/$fullhost/$logyear/$logmonth/$logday";
37+
my $logdir = "/<GLOBAL_SHARED_SPACE>/supremm/pmlogger/$logyear/$logmonth/$fullhost/$logyear-$logmonth-$logday";
3138

3239
# The prolog config runs every 10 seconds, we exit after 4 samples
3340
system("env PMLOGGER_PROLOG=yes pmlogger -U pcp -c /etc/pcp/pmlogger/pmlogger-supremm.config -s 4 -l /tmp/job-$jobid-begin-$jobdatelong.log $logdir/job-$jobid-begin-$jobdatelong &> /dev/null");
3441

35-
exec( $cmd );
36-
3742
exit(0)

0 commit comments

Comments
 (0)