Sponsored Content
Full Discussion: bc calculate problem
Top Forums UNIX for Dummies Questions & Answers bc calculate problem Post 55480 by zazzybob on Monday 13th of September 2004 10:14:12 AM
Old 09-13-2004
Try

Code:
toto=400; echo "scale=1; $toto / 1000" | bc

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

calculate from three files

Hi all I have 3 three files like: file1: 1|100 2|200 3|300 4|400 5|500 file2: 1|200 2|200 3|600 4|800 file3: 1|300 2|100 (5 Replies)
Discussion started by: koti_rama
5 Replies

2. Shell Programming and Scripting

How To Calculate

I have 2 variables in my shell scripts in which i am using awk and calculating 2 files and getting 2 different variable called in_total and out_total. I want to subtract one variable from another so plz tell me how i can do that. Example is: cat in_file | awk -F: '{ in_total += $1 * 86400... (3 Replies)
Discussion started by: krishna_sicsr
3 Replies

3. Shell Programming and Scripting

Calculate P Value -Awk

Is there any awk command to calculate P Value ?(Probability) Is it possib;e to calculate P va;ue for this data for ex? 7.891284 8.148193 7.749575 7.958188 7.887702 7.714877 8.141548 7.51845 8.27736 7.929853 7.92456 8.249126 7.989113 8.012573 8.351206 (2 Replies)
Discussion started by: stateperl
2 Replies

4. Shell Programming and Scripting

Calculate age of a file | calculate time difference

Hello, I'm trying to create a shell script (#!/bin/sh) which should tell me the age of a file in minutes... I have a process, which delivers me all 15 minutes a new file and I want to have a monitoring script, which sends me an email, if the present file is older than 20 minutes. To do... (10 Replies)
Discussion started by: worm
10 Replies

5. Shell Programming and Scripting

Calculate Averages !

Hi, I have a file with more than 2,000 rows like this: 05/26/2011,1200,1500 I would like to create a awk shell script that calculate the price average of the second and third field each 5,10 and 20 rows or ask me for the values, starting at first row. Finally compare the average value... (1 Reply)
Discussion started by: csierra
1 Replies

6. Shell Programming and Scripting

Help with calculate total sum of same data problem

Long list of input file: AGDRE1 0.1005449050 AGDRE1 2.1005443435 AGDRE1 1.2005449050 AGDRE1 5.1005487870 AASFV3 50.456304789 AASFV3 2.3659706549 AASFV3 6.3489807860 AASFV3 3.0089890148 RTRTRS 5.6546403546 . . Desired output file: AGDRE1 8.5021829410 AASFV3 62.180245240... (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. UNIX for Dummies Questions & Answers

Calculate %Cpu

Hi. For an homework, I have to simulate some part of the PS function. By reading the doc I've been able to find most of it but I don't how I can get the %cpu for each PID. I've read on Internet that I have to do: (utime(t)-utim(t-1))/(cputime(t)-cputime(t-1)) where cputime is the sum of... (2 Replies)
Discussion started by: elnabo
2 Replies

8. UNIX for Dummies Questions & Answers

Calculate

i have file input abcedef|wert|13|03|10|04|23|A1|13|05|01|09|31 fsdasdf|ferg|12|04|25|21|21|A1|13|02|26|20|31 dfsfsad|gerg|12|04|25|21|21|A1|13|02|25|25|31 i expect the output abcedef|wert|13|03|10|04|23|A1|13|05|01|09|31|9.516666667... (5 Replies)
Discussion started by: radius
5 Replies

9. Shell Programming and Scripting

How to calculate difference:?

Experts, file1 : Want to find the difference of $3 field from next line's 3rd field, The difference to be calculated from next lines 3rd field, to current lines lines 3rd field. file1 : Jun24_2013.06242013 3301244928 3133059904 167370640 95% Jun25_1124.06252013 3301244928... (4 Replies)
Discussion started by: rveri
4 Replies

10. Shell Programming and Scripting

Calculate % done when using tar

Hi is there a way to calculate the progress when using the tar -cvf a folder say of 300Gb (4 Replies)
Discussion started by: fretagi
4 Replies
oarsub(1)							   OAR commands 							 oarsub(1)

NAME
oarsub - OAR batch scheduler job submission command. SYNOPSIS
oarsub [OPTIONS] <job executable> oarsub [OPTIONS] -I oarsub [OPTIONS] -C <JOB ID> DESCRIPTION
One uses oarsub to submit a job to the OAR batch scheduler managing the resources of a HPC Cluster. A job is defined by the description of a set of resources needed to execute a task and a script or executable to run. A job may also be run interactively, and one may also use oarsub to connect to a previously submitted job. The scheduler is in charge of providing a set of resources matching the oarsub command request. Once scheduled and then launched, a job consists of one process executed on the first node of the resources it was attibuted, with a set of environment variables that define the resources which are at the job disposal. That means that the job's executable is responsible for connecting those resources and dispatching the tasks. OPTIONS
-I, --interactive Request an interactive job. Open a login shell on the first node of the reservation instead of running a script. -C, --connect <JOB ID> Connect to a running job. -l, --resource <LIST> Set the requested resources for the job. The different parameters are resource properties registered in OAR database, and `walltime' which specifies the duration before the job must be automatically terminated if still running. Walltime format is [hour:mn:sec|hour:mn|hour]. Ex: nodes=4/cpu=1,walltime=2:00:00 You can specify multiple -l options at the same line. This tells OAR that this is a moldable job so it can take different shapes. For example if you have an application that is very scalable: oarsub -l cpu=2,walltime=20:00:00 -l cpu=4,walltime=10:00:00 -l cpu=8,walltime=5:00:00 ./script.sh OAR will schedule one of these three resource definitions (depending of the current load of the cluster). --array <NUMBER> Submit an array job containing "NUMBER" subjobs. All the subjobs share the same array_id but each subjob is independent and has its own job_id. All the subjobs have the same characteristics (script, requirements) and can be identified by an environment variable $OAR_ARRAY_INDEX. Array jobs can neither be Interactive (-I) nor a reservation (-r). --array-param-file <FILE> Submit a parametric array job. Each non-empty line of "FILE" defines the parameters for the submition of new subjob. All the subjobs have the same characteristics (script, requirements) and can be identified by an environment variable $OAR_ARRAY_INDEX. '#' is the comment sign. Parametric array jobs can neither be Interactive (-I) nor a reservation (-r). -S, --scanscript Batch mode only: ask oarsub to scan the given script for OAR directives (#OAR -l ...) -q, --queue <QUEUE> Set the the queue to submit the job to. -p, --property "<LIST>" Add a list of constraints to properties for the job. The format of a contraint is the one of a WHERE clause using the SQL syntax. -r, --reservation <DATE> Request that the job starts at a specified time. A job creation using this option is called a reservation and instead of a submission. --checkpoint <DELAY> Enable the checkpointing mechanism for the job. A signal will be sent DELAY seconds before the walltime to the first processus of the job (on the first node of the resources). --signal <#SIG> Specify the signal to use when checkpointing. Use signal numbers (see kill -l), default is 12 (SIGUSR2). -t, --type <TYPE> Specify a specific type (besteffort, timesharing, idempotent, cosystem, deploy, container, inner, token:xxx=yy) Note: a job with a type of idempotent will be automatically resubmitted if its exit code is 99. -d, --directory <DIR> Specify the directory where to launch the command (default is current directory) --project <TXT> Specify a name of a project the job belongs to. -n, --name <TXT> Specify an arbitrary name for the job. -a, --anterior <OAR JOB ID> Previously submitted job that this new job execution must depend on. The new job will only start upon the end of the previous one. --notify <TXT> Specify a notification method (mail or command to execute). Ex: --notify "mail:name@domain.com" --notify "exec:/path/to/script args" args are job_id,job_name,TAG,comment TAG can be: - RUNNING : when the job is launched - END : when the job is finished normally - ERROR : when the job is finished abnormally - INFO : used when oardel is called on the job - SUSPENDED : when the job is suspended - RESUMING : when the job is resumed --resubmit <OAR JOB ID> Resubmit the given job as a new one. -k, --use-job-key Activate the job-key mechanism. A job-key will be generated allowing to connect the job from outside the set of resources managed by OAR. The job-key mechanism may be activated by default in your OAR environment. In this case this option is useless. -i, --import-job-key-from-file Import the job-key to use from existing files (public and private key files) instead of generating a new one. One may also use the OAR_JOB_KEY_FILE environment variable. --import-job-key-inline Import the job-key to use inline instead of generating a new one. -e, --export-job-key-to-file Export the the job key to a file. Warning: the file will be overwritten if it already exists. (the %jobid% pattern is automatically replaced) -O <FILE> Specify the files that will store the standard output stream of the job. The %jobid% pattern is automatically replaced. -E <FILE> Specify the files that will store the standard error stream of the job. The %jobid% pattern is automatically replaced. --hold Set the job state into Hold instead of Waiting, so that it is not scheduled (you must run oarresume to turn it into the Waiting state). -D, --dumper Print result in Perl Data::Dumper format. -X, --xml Print result in XML format. -Y, --yaml Print result in YAML format. -J, --json Print result in JSON format. -h, --help Print this help message. -V, --version Print the version of OAR. ENVIRONMENT
OAR_FILE_NODES aka OAR_NODE_FILE aka OAR_NODEFILE Pathname to the file containing the list of the nodes that are allocated to the job. OAR_JOB_NAME Name of the job as given using the -n option. OAR_JOB_ID aka OAR_JOBID Id of the job. Each job get a unique job identifier. This identifier can be use to retrieve information about the job using oarstat, or to connect to a running job using oarsub -C or oarsh for instance. OAR_ARRAY_ID aka OAR_ARRAYID Array Id of the job. Each array job get an unique array identifier that is shared by all the subjobs of the array job. This identifier can be used to identify the different subjobs pertaining to a same array job. It can also be used to deal with all the subjobs of a given array at once (by means of the option --array in the case of oarstat, oarhold, oarresume and oardel). By definition, single jobs are considered array jobs with only one subjob. OAR_JOB_INDEX aka OAR_JOBINDEX Array Index of the job. On an array job, each job get an unique an unique (on a given array) job index. This identifier can be used to differ jobs on the context of a given array, for instance to give a different behaviour to each of the subjobs. By definition, single jobs are considered array jobs with only one subjob, having OAR_JOB_INDEX = 0. OAR_JOB_WALLTIME resp. OAR_JOB_WALLTIME_SECONDS Walltime of the job in the hh:mm:ss format resp. in seconds. OAR_RESOURCE_PROPERTIES_FILE Pathname to the file containing the list of all resources attributes for the job, and their value OAR_PROJECT_NAME Name of the project the job is part of, as given using the --project option. OAR_STDOUT and OAR_STDERR Pathname to the files storing the standard output and error of the job's executable when not running in interactive mode. OAR_WORKING_DIRECTORY aka OAR_WORKDIR aka OAR_O_WORKDIR Working directory for the job. The job executable will be executed in this directory on the first node allocated to the job. OAR_JOB_KEY_FILE Key file to use for the submission (or for oarsh) if using a job key (-k or --use-job-key option). One may provide the job key to import using the -i or --import-job-key-from-file option as well. SCRIPT
Script can contain the description of the job. Lines with options must begin by the key #OAR. There are the same options as previous. EXAMPLES
Job submission with arguments : oarsub -l /nodes=4 -I oarsub -q default -l /nodes=10/cpu=3,walltime=50:30:00 -p "switch = 'sw1'" /home/users/toto/prog oarsub -r "2009-04-27 11:00:00" -l /nodes=12/cpu=2 oarsub -C 154 Submit an array job with 10 identic subjobs: oarsub -l /nodes=4 /home/users/toto/prog --array 10 Submit a parametric array job (file params.txt): oarsub /home/users/toto/prog --array-param-file /home/users/toto/params.txt Parameter File example (params.txt): # my param file =item #single param =item 100 =item #a subjob without parameters =item "" =item #a subjob with a string containing spaces as parameter =item "arg1a arg1b arg1c" "arg2a arg2b" Script example (file /home/users/toto/script.sh): #!/bin/bash #OAR -l /nodes=4/cpu=1,walltime=3:15:00 #OAR -p switch = 'sw3' or switch = 'sw5' #OAR -t besteffort #OAR -t type2 #OAR -k #OAR -e /path/to/job/key #OAR --stdout stdoutfile.log /home/users/toto/prog Submit the script : oarsub -S /home/users/toto/script.sh SEE ALSO
oarsh(1), oardel(1), oarstat(1), oarnodes(1), oarhold(1), oarresume(1) COPYRIGHTS
Copyright X 2008 Laboratoire d'Informatique de Grenoble (http://www.liglab.fr). This software is licensed under the GNU Library General Public License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. oarsub 2012-05-23 oarsub(1)
All times are GMT -4. The time now is 05:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy