Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update templates for new archive layout. #198

Merged
merged 1 commit into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)