Utility scripts for the pom package.
Many of the functions here are for just testing the python based MPIPOM scripts during its development, can be replaced with much sophisticated functions in the produtil modules.
- Note
- Please report bugs/questions/comments to bijuthomas(at)mail(dot)uri(dot)edu.
- Author
- Biju Thomas, GSO, University of Rhode Island.
- Date
- June 8, 2014
|
def | ysplitter (ymdh) |
| Splits a string with a ten digit YYYYMMDDHH into components. More...
|
|
def | trailzero (astr, n) |
| Returns a string of length n or greater, that consists of n-len(astr) zeros followed by astr. More...
|
|
def | inpfile |
| Creates an input file from a list of strings. More...
|
|
def | remove (file) |
| Deletes the specified file. More...
|
|
def | rmall (args) |
| Deletes a list of files. More...
|
|
def | copy |
| Copies the source to the destination without retaining permissions our group IDs. More...
|
|
def | move |
| Renames the source file to the destination. More...
|
|
def | link (src, dest) |
| Links the source file to the destination. More...
|
|
def | runexe (nproc, rundir, exefile, stdin, stdout) |
| Runs an executable. More...
|
|
def | read_input (filename) |
| Reads the contents of the file for name,value pairs and returns a dict with the contents. More...
|
|
def | makenwrap (f) |
| Wrapper for making the POM namelist. More...
|
|
def | dateplushours (ymdh, hours) |
| Adds a given number of hours to the date. More...
|
|
def | logi2int (l) |
| Turns a bool to an int, returning 1 for True or 0 for False. More...
|
|
def | veto () |
| Prints a message about not exiting, and returns False. More...
|
|
def pom.util.read_input |
( |
|
filename | ) |
|
Reads the contents of the file for name,value pairs and returns a dict with the contents.
Reads the file line-by-line. Searches for pairs of strings "string1,string2" separated by spaces, colons, semicolons or commas. Creates a dict mapping from the first string to the second. Any strings past the second are ignored.
- Parameters
-
filename | the file to read. |
Definition at line 185 of file util.py.