Browse Source

remove xdmod scripts

pull/17/head
B.E. Droge 1 year ago
parent
commit
ecc56268c4
  1. 23
      roles/slurm-client/files/epilog.d/xdmod-slurm.epilog
  2. 42
      roles/slurm-client/files/prolog.d/xdmod-slurm.prolog

23
roles/slurm-client/files/epilog.d/xdmod-slurm.epilog

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
#!/usr/bin/perl
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 = "/data/pg-beheer/XDMoD/PCP_logs/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);

42
roles/slurm-client/files/prolog.d/xdmod-slurm.prolog

@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
#!/usr/bin/perl
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};
# PCP job Start Logging
my $fullhost = hostname();
# This is the every 10 seconds for a total of 30 second log, after job start time
# Slurm kills child processes of the prolog so we need to start our own process group to keep this running for 30 seconds after prolog is done
$SIG{CHLD} = 'IGNORE'; # Configure to autoreap zombies
exit(0) unless defined ( my $child = fork ); # fork, or just exit if failed
exit(0) if $child; # Main prolog exits with success
# Below this is now the child
setsid(); # Become session leader
open( STDIN, "</dev/null" ); # Detach STDIN from shell
open( STDOUT, ">/dev/null" ); # Detach STDOUT from shell
open( STDERR, ">&STDOUT" ); # Detach STDERR from shell
chdir '/tmp'; # Change working directory
umask(0); # Reset umask
my $logdir = "/data/pg-beheer/XDMoD/PCP_logs/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");
exit(0)
Loading…
Cancel
Save