Skip to content

Commit

Permalink
Merge pull request #198 from jpwhite4/templates
Browse files Browse the repository at this point in the history
Update templates for new archive layout.
  • Loading branch information
jpwhite4 authored Apr 10, 2019
2 parents 5dcc3ab + 28000a1 commit ec6c2bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/templates/pmlogger/control
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $PMCD_REQUEST_TIMEOUT=120
# (LOCALHOSTNAME is expanded to local: in the first column,
# and to `hostname` in the fourth (directory) column.)
#
LOCALHOSTNAME y n "PCP_LOG_DIR/pmlogger/LOCALHOSTNAME/$(date +%Y)/$(date +%m)/$(date +%d)" -r -c /etc/pcp/pmlogger/pmlogger-supremm.config
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

# Note: if multiple pmloggers for the same host (e.g. both primary and
# non-primary loggers are active), then they MUST use different
Expand Down
9 changes: 8 additions & 1 deletion config/templates/slurm/slurm-epilog
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@

use strict;
use Sys::Hostname;
use Date::Simple;
use POSIX qw(strftime);

my $jobid = $ENV{SLURM_JOB_ID};
my $today = Date::Simple->new;

my $logyear = $today->format("%Y");
my $logmonth = $today->format("%m");
my $logday = $today->format("%d");

my $jobdatelong = strftime "%Y%m%d.%H.%M.%S", localtime;
my $fullhost = hostname();

# PCP End of job logging

my $logdir = "/<GLOBAL_SHARED_SPACE>/supremm/pmlogger/$fullhost/$logyear/$logmonth/$logday";
my $logdir = "/<GLOBAL_SHARED_SPACE>/supremm/pmlogger/$logyear/$logmonth/$fullhost/$logyear-$logmonth-$logday";
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");

exit(0);
11 changes: 8 additions & 3 deletions config/templates/slurm/slurm-prolog
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

use strict;
use Sys::Hostname;
use Date::Simple;
use POSIX qw(strftime setsid);

my $today = Date::Simple->new;

my $logyear = $today->format("%Y");
my $logmonth = $today->format("%m");
my $logday = $today->format("%d");

my $jobdatelong = strftime "%Y%m%d.%H.%M.%S", localtime;
my $host = ( split('\.', hostname()) )[0];
my $jobid = $ENV{SLURM_JOB_ID};
Expand All @@ -27,11 +34,9 @@ open( STDERR, ">&STDOUT" ); # Detach STDERR from shell
chdir '/tmp'; # Change working directory
umask(0); # Reset umask

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

# The prolog config runs every 10 seconds, we exit after 4 samples
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");

exec( $cmd );

exit(0)

0 comments on commit ec6c2bb

Please sign in to comment.