sfepy.base.multiproc_mpi module

Multiprocessing functions.

class sfepy.base.multiproc_mpi.MPIFileHandler(filename, mode=4, comm=<mpi4py.MPI.Intracomm object>)[source]

MPI file class for logging process communication.

close()[source]

Tidy up any resources used by the handler.

This version removes the handler from an internal map of handlers, _handlers, which is used for handler lookup by name. Subclasses should ensure that this gets called from overridden close() methods.

emit(record)[source]

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an ‘encoding’ attribute, it is used to determine how to do the output to the stream.

class sfepy.base.multiproc_mpi.MPILogFile(comm, filename, mode)[source]
close()[source]
sync()[source]
write(msg)[source]
class sfepy.base.multiproc_mpi.RemoteDict(name, mutable=False)[source]

Remote dictionary class - slave side.

get(key, default=None)[source]
keys()[source]
update(other)[source]
class sfepy.base.multiproc_mpi.RemoteDictMaster(name, mutable=False, soft_set=False, *args)[source]

Remote dictionary class - master side.

remote_get(key, slave)[source]
remote_get_in(key, slave)[source]
remote_get_keys(slave)[source]
remote_get_len(slave)[source]
remote_set(data, slave, mutable=False)[source]
class sfepy.base.multiproc_mpi.RemoteInt(remote_dict, value=None)[source]

Remote intiger class, data saved in RemoteDict.

class IntDesc[source]
value
class sfepy.base.multiproc_mpi.RemoteLock[source]

Remote lock class - lock and unlock restricted access to the master.

acquire()[source]
release()[source]
class sfepy.base.multiproc_mpi.RemoteQueue(name)[source]

Remote queue class - slave side.

get()[source]
put(value)[source]
class sfepy.base.multiproc_mpi.RemoteQueueMaster(name, mode='fifo', *args)[source]

Remote queue class - master side.

clean()[source]
get()[source]
static get_gdict_key(name)[source]
put(value)[source]
remote_get(slave)[source]
remote_put(value, slave)[source]
sfepy.base.multiproc_mpi.cpu_count()[source]

Get the number of MPI nodes.

sfepy.base.multiproc_mpi.enum(*sequential)[source]
sfepy.base.multiproc_mpi.get_dict(name, mutable=False, clear=False, soft_set=False)[source]

Get the remote dictionary.

sfepy.base.multiproc_mpi.get_int_value(name, init_value=0)[source]

Get the remote integer value.

sfepy.base.multiproc_mpi.get_logger(log_filename='multiproc_mpi.log')[source]

Get the MPI logger which log information into a shared file.

sfepy.base.multiproc_mpi.get_queue(name)[source]

Get the queue.

sfepy.base.multiproc_mpi.get_slaves()[source]

Get the list of slave nodes

sfepy.base.multiproc_mpi.is_remote_dict(d)[source]

Return True if ‘d’ is RemoteDict or RemoteDictMaster instance.

sfepy.base.multiproc_mpi.master_loop()[source]

Run the master loop - wait for requests from slaves.

sfepy.base.multiproc_mpi.master_send_continue()[source]

Send ‘continue’ to all slaves.

sfepy.base.multiproc_mpi.master_send_task(task, data)[source]

Send task to all slaves.

sfepy.base.multiproc_mpi.set_logging_level(log_level='info')[source]
sfepy.base.multiproc_mpi.slave_get_task(name='')[source]

Start the slave nodes.

sfepy.base.multiproc_mpi.slave_task_done(task='')[source]

Stop the slave nodes.

sfepy.base.multiproc_mpi.tags

alias of Enum

sfepy.base.multiproc_mpi.wait_for_tag(wtag, num=1)[source]