Hi,
I'm writing a KSH script, and at one point, I have to call a new shell and perform some variable assignments.
I noticed that the assignment is not working.
Please see two samples below:
Command 1:
#>ksh "i=2;echo I is $i"
Output:
#>I is
Command 2:
#>ksh <<EOF
> i=2
> echo I... (7 Replies)
I have a very tough shell program to do. Here is the assignment:
Write a non-interactive script that takes in any number of directory names as arguments and calculates and outputs the total number of blocks of disk space occupied by the ordinary files in all the directories. For example, the... (0 Replies)
Doubt #1
I have a program that I want the user to input date. When the user inputs the date, is it able to format it to system date dd-mm-yyy and then echo the value into a text file?
Doubt#2
If the above is not going to work, I tried to have the system date appear in the user input field and... (6 Replies)
Hi guys,
I'm basically looking for some help with a bash script I've written. It's purpose is to assign process to individual CPU cores once that process hits 15% CPU usage or more. If it drops below 15%, it's unassigned again (using taskset).
My problem is that I can't think of a way to... (2 Replies)
Here's the assignment. I'll bold the parts that are rough for me. Unfortunately, that's quite a bit lol. The syntax is, of course, where my issues lie, for the most part. I don't have a lot of programming experience at all :/. I'd post what I've already done, but I'm so lost I really don't know... (1 Reply)
I am going to provide a chunks of codes that I do not understand. Please help with them in a layman's terms.
1) ${DEBUG:-0}
--------------------------------------------------------------------------
2) print "${1}"
... (7 Replies)
Suppose I have a file named Stuff in the same directory as my script. Does the following assign the file Stuff to a variable?
Var="Stuff"
Why doesn't this just assign the string Stuff? Or rather how would I assign the string Stuff to a variable in this situation?
Also, what exactly is... (3 Replies)
I have come across a weird behaviour in bash and would love to get to the bottom of it. If I execute echo -e "\na\nb\nc\n" at the command line, I get:
a
b
c
However, if I wrap it in an assignment such as:
A="$( echo -e "\na\nb\nc\n" )"then I get
a
b
cIt doesn't show very well,... (4 Replies)
I have a little code block (executing on AIX 7.1) that I cannot understand why the NOTFREE=0 does not appear to be assigned even though it goes through that block. This causes a unary operator issue.
#!/bin/bash
PLATFORM="AIX"
NEEDSPC=3000
set -x
if ; then
lsvg | grep -v rootvg | while... (6 Replies)
Discussion started by: port43
6 Replies
LEARN ABOUT DEBIAN
slurm::stepctx
Slurm::Stepctx(3pm) User Contributed Perl Documentation Slurm::Stepctx(3pm)NAME
Slurm::Stepctx - Step launching functions in libslurm
SYNOPSIS
use Slurm;
$slurm = Slurm::new();
$params = {job_id => 1234, ...};
$ctx = $slurm->step_ctx_create($params);
$rc = $ctx->launch({...}, {task_start => sub {...},
task_finish => sub {...} });
DESCRIPTION
The Slurm::Stepctx class is a wrapper of the job step context and step launching functions in libslurm. This package is loaded and
bootstraped with package Slurm.
METHODS
STEP CONTEXT CREATION FUNCTIONS
Please see "SLURM TASK SPAWNING FUNCTIONS" in Slurm for step context creation functions.
STEP CONTEXT MANIPULATION FUNCTIONS
$rc = $ctx->get($ctx_key, ...);
Get parameters from a job step context.
o INPUT $ctx_key: type of the parameter to get. Supported key and the corresponding result data are:
o $rc = $ctx->get(SLURM_STEP_CTX_STEPID, $stepid);
Get the created job step id. $stepid will be set to the step id number.
o $rc = $ctx->get(SLURM_STEP_CTX_TASKS, $tasks);
Get array of task count on each node. $tasks will be set to an array reference.
o $rc = $ctx->get(SLURM_STEP_CTX_TID, $nodeid, $tids);
Get array of task IDs for specified node. $nodeid specifies index of the node. $tids will be set to an array reference.
o $rc = $ctx->get(SLURM_STEP_CTX_RESP, $resp);
TODO: this is not exported. Get job step create response message.
o $rc = $ctx->get(SLURM_STEP_CTX_CRED, $cred);
Get credential of the created job step. $cred will be an opaque object blessed to "Slurm::slurm_cred_t".
o $rc = $ctx->get(SLURM_STEP_CTX_SWITCH_JOB, $switch_info);
Get switch plugin specific info of the step. $switch_info will be an opaque object blessed to "Slurm::switch_jobinfo_t".
o $rc = $ctx->get(SLURM_STEP_CTX_NUM_HOSTS, $num);
Get number of nodes allocated to the job step.
o $rc = $ctx->get(SLURM_STEP_CTX_HOST, $nodeid, $nodename);
Get node name allocated to the job step. $nodeid specifies index of the node.
o $rc = $ctx->get(SLURM_STEP_CTX_JOBID, $jobid);
Get job ID of the job step.
o $rc = $ctx->get(SLURM_STEP_CTX_USER_MANAGED_SOCKETS, $numtasks, $sockets);
Get user managed I/O sockets. TODO: describe the parameters.
o RET: error code.
$rc = $ctx->daemon_per_node_hack();
Hack the step context to run a single process per node, regardless of the settings selected at Slurm::Stepctx::create() time.
o RET: error code.
STEP TASK LAUNCHING FUNCTIONS
$rc = $ctx->launch($params, $callbacks);
Launch a parallel job step.
o IN $params: parameters of task launching, with structure of "slurm_step_launch_params_t".
o IN $callbacks: callback functions, with structure of "slurm_step_launch_callbacks_t". NOTE: the callback functions will be called in a
thread different from the thread calling the "launch()" function.
o RET: error code.
$rc = $ctx->launch_wait_start();
Block until all tasks have started.
o RET: error code.
$ctx->launch_wait_finish();
Block until all tasks have finished (or failed to start altogether).
$ctx->launch_abort();
Abort an in-progress launch, or terminate the fully launched job step. Can be called from a signal handler.
$ctx->launch_fwd_signal($signo);
Forward a signal to all those nodes with running tasks.
o IN $signo: signal number.
SEE ALSO
Slurm
AUTHOR
This library is created by Hongjia Cao, <hjcao(AT)nudt.edu.cn> and Danny Auble, <da(AT)llnl.gov>. It is distributed with SLURM.
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
perl v5.14.2 2012-03-16 Slurm::Stepctx(3pm)