User code can be run in mode:
"Sandbox" - a directory, in which actor will be run. Before execution of user codes wrapped by FC2K generated actor, directory will be changed to "sandbox", and after actor finishes, current directory will be switched back to previous value. The name (path) of "sandbox" directory will be created automatically or specified by user in actor configuration dialog.
Actor will use existing directory or will create it, if directory not exists.
Typical usage: checkpointing, caching intermediate results, usage of additional information (input, config files) not provided in workflow.
def actor_name(integer0, integer1, double0, double1, core_profiles0, core_profiles1, equilibrium0, exec_type='mpi_local', mpi_process = 4, strip_output = True): |
exec_type='')
.exec_type
:ctypes
- interactive execution (yes - this name is REALLY CONFUSING)dbg
- to keep compatibility with obsolete 'debug' argument of wrapperAuxiliary keyword arguments:
mpi_processes
- integer - number of MPI processeslib_opt
- boolean - determines of alternative user library should be used, instead of the default oneget_output_idss
- boolean - determines, what actually will be returned if returned argument is IDS: an IDS object, or metadata describing itstrip_output
- boolean - it determines (if returned argument is a string) it it should be stripped or notdbgmode
- boolean - unknown purposeOutput values:
None
- if nothing is returned from called F/C++ method diagnostic_info
if being used.def actor_name(code_args = None, xml_parameters = None, job_settings = None): return None. # no returned values! |
General:
All code samples below use |
# AUTO GENERATED ! class <ActorName>Arguments : def __init__(self): self.arg1 = <ToolName>Argument( 'InVar', int, None, IN) self.arg2 = <ToolName>Argument( 'OutVar', double, None, OUT) self.diagnostic_info = <ToolName>DiagnosticInfo() # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>Argument : def __init__(self, name, type, sub_type, intent): self.name = name #'argument name' READ ONLY self.type = type # (INT, DOUBLE, STRING, COMPLEX, IDS) READ ONLY self.sub_type = sub_type #'equilibrium' for IDSes only READ ONLY self.intent = intent # (IN/OUT) READ ONLY self.value = 7. # to be set by user # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>DiagnosticInfo : def __init__(self): self.status self.message |
class <ToolName>XMLParamaters : def __init__(self): self.parameters = # file name or string or... (?) self.default_parameters = # file name or string or ... (?) self.schema = # file name or string or ... (?) |
class <ToolName>JobSettings : def __init__(self): self.batch_job = <ToolName>BatchJob() self.debug = <ToolName>Debug() self.mpi = <ToolName>MPI() self.open_mp = <ToolName>OpenMP() self.sandbox = <ToolName>Sandbox() self.????? #any other info needed? # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>BatchJob : def __init__(self): self.queue = self.TBD # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>Debug : def __init__(self): self.debugger #TotalView/gdb self.mode #attach/standalone self.TBD # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>MPI : def __init__(self): self.TBD self.debug_switch # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>OpenMP : def __init__(self): self.TBD # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>Sandbox : def __init__(self): self.path self.lifetime self.TBD |
from my_test.wrapper import my_test_actor # # # # # JOB SETTINGS # # # # # # # job_settings = <ToolName>JobSettings() #batch job job_settings.batch_job.queue = 'gw_default" #debugging # no debugging for batch jobs #mpi job_settings.mpi.nodes = 5 #OpenMP # it is not OpenMP job # Sandbox job_settings.sandbox.lifetime = LIFTIME_WORKFLOW job_settings.sandbox.clean_up = True # # # # # CODE ARGUMENTS # # # # # # # arguments = <ActorName>Arguments() self.my_in_arg_01.value = 5 self.my_in_arg_02.value = 0.123 self.my_in_core_profiles_01.value = in_cp_obj self.my_in_core_profiles_02.value = in_cp_metadata #object keeping shot/run/user # # # # # RUNNING ACTOR # # # # # # # my_test(code_args = arguments, job_settings = job_settings) # # # # # RETURN # # # # # # # ret_eq = arguments.my_out_equilibrium_02.value |