https://arc-ts.umich.edu/flux-user-guide/ 
7. GET A PBS BATCH SCRIPT
Some subtitles of "Video: PBS Basics"
#PBS -N jobname
jobname doesn’t have to be unique. It’s not even required. It’s optional. If you don’t have it, it just gives it some default name. It can’t have spaces and a few other things but if you try to submit a job with an invalid name, the system will just reject it right away so something like job name with numbers and stuff is fine.
 
# PBS –m n
# PBS –m b
# PBS –m e
# PBS –m a
Lower case m is when to be notified. So there’s a couple different values here I can put n for never. I can put b for beginning so when a job starts it emailed me because it may be queued right it may be waiting to run behind lab mates or your other jobs. There is e for email me when it ends and there is a for email me one of the boards. And so I can combine these together. So I can have abe which means email me when it aborts it or it begins or when it ends. So that’s a common collection there when you really get going a lot of times you want to change it to this and if you have a lot of jobs maybe you want to change it to that so well if you have a lot of jobs you are going to kind of watch it manually to see when a large chunk of jobs is done so you don’t to get an email for every job that ends but you want to know if it fails so you leave a board. But we’re gonna go ahead and say email me when it starts and when it begins and when it ends.
 
#PBS -V
The next piece of information I want to have is something on – capital V. It’s just something our system requires if you don’t have it you’re gonna have problems so it just always include pound PBS – capital V. What it does is it copies the submit environment to the batch environment so this allows you to change environment variables if you don’t have this you’ll get errors so just always include that.
 
#PBS –l
#PBS –l walltime=01:00:00
So what come after this is the resource information this is how many processors and stuff I want like that and those always go on minus l lines. Lowercase l and lowercase l can appear multiple times. So I want things like wall time in this case it’s in the format of hours minutes seconds so I can say something like 3600 seconds so this is one hour or I can say give me hour. This is walltime time not CPU time so if I ask for 12 processors I’m going to get 12 processors for an hour so a total of 12 CPU hours. If a job ends early that is the last line of the script finishes before the times up. Fine. You’re not gonna waste any resources. It’ll end and you’ll get an email and that email normally says how it ran for. But if you request too short of time we kill it so when you hit an hour and you’re still running we kick off your job so you always want to request more time than you think. To check how much time you can request the maximum amount of time you can request unlike flux q is six hundred and seventy-two hours (In Xshell, input “qstat –q” and you will see the results. I have tried this) so like what two full weeks 14 days and you can always figure that by typing q’s that –q which is query the q’s so somebody of the other ELLs 
 
#PBS –l procs=6, pmem=1gb
(After procs -6 or =6?)
Notice I can have more than one of them is I can say proc so in this case I want to have let’s say 6 processors. And I’m gonna separate with a comma. pmem equals 1 gigabyte so pmem is the amount of memory per processor I want to request. There is a default quantity. The default quantity is 768 megabytes so what this would be is my total memory would be 768 megabytes times 6 processors about 4 gigabytes of memory. So pmem is memory per processor. So it’s and you want to use pmem rather than mem most of time because mem is squishy about where the memory is supposed to be. And with pmem you know you’re gonna have 768 next to each processor you can actually touch. Same proxy cool (The words maybe not correct) 6 does not put all your processors in one node. So 2 if you’re using a shared memory code like P threads or openmp where everything needs to stay inside one computer. You need to use a different syntax and I’ll touch on that at the end into more advanced topics. But proc sequel 6 (The words maybe not correct) is the one that’s going to start your job to fastest because that’ll say give me 6 processors and any number of machine so I may have 6 machines with 1 process for each, one machine was 6, 2 with 3, 1 with 3, 3 with 1, you know they’ll be spread all around so we have the more options to start your jobs. The more restrictive you get on your resources that is longer runtime more memory per processor specific geometries you know the 12 processors per node or sth like that. The harder it is for start your jobs because we all have less options to possibly start code on Fluxus. Generally isn’t that much of an issue but for people who are trying to request specific machines sometimes it can take a little bit longer. You can request other things. You can request something called AG res which is like a software license for things that are licensed. We need to track those ahead of time you can’t just arbitrarily put stuff in there but this is the kind of thing you can request. So in this case I want 6 processors 768 megabytes of memory per processor and for one hour.   
 
In Xshell, input
bc -lq
768*6
you will get
4608
 
#PBS –q flux
The next chunk is their credentials I want to submit to so on Fluxus minus q flux there is fluxm for large memory flux and fluxg for GPUs and things like that. 
 
The following sentences are from: https://arc-ts.umich.edu/flux-user-guide/
Also note that GPUs are available only with a GPU allocation, and those have names that end with _fluxg instead of _flux. Make sure that the line requesting the queue matches the GPU allocation name; i.e.,
#PBS -q fluxg
HOW DO I USE THE LSA PUBLIC ALLOCATIONS?
To use lsa_flux, specify the following credentials in your PBS script:
#PBS -A lsa_flux
#PBS -q flux
To use lsa_fluxm, specify the following credentials in your PBS script:
#PBS -A lsa_fluxm
#PBS -q fluxm
To use lsa_fluxg, specify the following credentials in your PBS script:
#PBS -A lsa_fluxg
#PBS -q fluxg
 
#PBS –A cocstaff_flux
And then I need the account charge from s minus capital A so I’m going to use the cocstaff_flux. This is your allocation or account this is a thing that actually lets you run jobs. If you don’t have one of these, you really can’t run jobs. I’ll show you later how you can find out what allocations have available and what resources are available in them and how to check on the status of individual allocations. It takes us a very short period of time to make allocations so you need an allocation to use resources. Just let us know and we can set you up with and you know set you up with the needs information how to get this started. 
 
#PBS –l qos=flux
Lastly, there is one last little thing you have to do. It’s an l so it’s a resource line technically we need to have qos equals flux. So again you know useful information you know when to be emailed, where to emailed at job name, minus v again is this required resources so wall time processors memory and possibly software licenses and other things and then where does run again. So flux your allocation to charge against and your quality of service. Ok. So this is the PBS part. This is the stuff that you that you talk to PBS with what comes afterwards or just normal commands. 
 
#comment
Anything serves a pound is a comment so you can comment stuff you notice I’m using a liberal white space I can use all the way space I want. So pound without capital PBS after it is just a comma pound with capital PBS is special
 
cat 
These are some more advanced topics. Let’s print out all the processors we were assigned. And so that’s basically all I’m going to do but normally