NcmMPIJob

NcmMPIJob — Abstract class to implement MPI jobs

Properties

guint placeholder Read / Write / Construct

Types and Values

Object Hierarchy

    GEnum
    ├── NcmMPIJobCtrlMsg
    ╰── NcmMPIJobCtrlTag
    GObject
    ╰── NcmMPIJob
        ├── NcmMPIJobFEval
        ├── NcmMPIJobFit
        ├── NcmMPIJobMCMC
        ╰── NcmMPIJobTest

Description

FIXME

Functions

ncm_mpi_job_ref ()

NcmMPIJob *
ncm_mpi_job_ref (NcmMPIJob *mpi_job);

Increase the reference of mpi_job by one.

Parameters

mpi_job

a NcmMPIJob

 

Returns

mpi_job .

[transfer full]


ncm_mpi_job_free ()

void
ncm_mpi_job_free (NcmMPIJob *mpi_job);

Decrease the reference count of mpi_job by one.

Parameters

mpi_job

a NcmMPIJob

 

ncm_mpi_job_clear ()

void
ncm_mpi_job_clear (NcmMPIJob **mpi_job);

Decrease the reference count of mpi_job by one, and sets the pointer *mpi_job to NULL.

Parameters

mpi_job

a NcmMPIJob

 

ncm_mpi_job_work_init ()

void
ncm_mpi_job_work_init (NcmMPIJob *mpi_job);

Method called after mpi_job is initialized at the slave and before start working.

[virtual work_init]

Parameters

mpi_job

a NcmMPIJob

 

ncm_mpi_job_work_clear ()

void
ncm_mpi_job_work_clear (NcmMPIJob *mpi_job);

Method called during the working phase of mpi_job and in the end before object destruction. This method can be called multiple times during the work phase.

[virtual work_clear]

Parameters

mpi_job

a NcmMPIJob

 

ncm_mpi_job_input_datatype ()

NcmMPIDatatype
ncm_mpi_job_input_datatype (NcmMPIJob *mpi_job,
                            gint *len,
                            gint *size);

Computes the size and datatype of the input buffer.

[virtual input_datatype]

Parameters

mpi_job

a NcmMPIJob

 

len

input length.

[out]

size

input buffer size.

[out]

Returns

the input datatype.

[transfer none]


ncm_mpi_job_return_datatype ()

NcmMPIDatatype
ncm_mpi_job_return_datatype (NcmMPIJob *mpi_job,
                             gint *len,
                             gint *size);

Computes the size and datatype of the return buffer.

[virtual return_datatype]

Parameters

mpi_job

a NcmMPIJob

 

len

input length.

[out]

size

input buffer size.

[out]

Returns

the return datatype.

[transfer none]


ncm_mpi_job_create_input ()

gpointer
ncm_mpi_job_create_input (NcmMPIJob *mpi_job);

Creates a new input object.

[virtual create_input]

Parameters

mpi_job

a NcmMPIJob

 

Returns

the newly input object.

[transfer none]


ncm_mpi_job_create_return ()

gpointer
ncm_mpi_job_create_return (NcmMPIJob *mpi_job);

Creates a new return object.

[virtual create_return]

Parameters

mpi_job

a NcmMPIJob

 

Returns

the newly return object.

[transfer none]


ncm_mpi_job_destroy_input ()

void
ncm_mpi_job_destroy_input (NcmMPIJob *mpi_job,
                           gpointer input);

Destroy the input object created with ncm_mpi_job_create_input().

[virtual destroy_input]

Parameters

mpi_job

a NcmMPIJob

 

input

an input object

 

ncm_mpi_job_destroy_return ()

void
ncm_mpi_job_destroy_return (NcmMPIJob *mpi_job,
                            gpointer ret);

Destroy the return object created with ncm_mpi_job_create_return().

[virtual destroy_return]

Parameters

mpi_job

a NcmMPIJob

 

ret

a return object

 

ncm_mpi_job_get_input_buffer ()

gpointer
ncm_mpi_job_get_input_buffer (NcmMPIJob *mpi_job,
                              gpointer input);

Creates a buffer from input compatible with ncm_mpi_job_input_datatype().

[virtual get_input_buffer]

Parameters

mpi_job

a NcmMPIJob

 

input

an input object

 

Returns

the created buffer.

[transfer none]


ncm_mpi_job_get_return_buffer ()

gpointer
ncm_mpi_job_get_return_buffer (NcmMPIJob *mpi_job,
                               gpointer ret);

Creates a buffer from ret compatible with ncm_mpi_job_return_datatype().

[virtual get_return_buffer]

Parameters

mpi_job

a NcmMPIJob

 

ret

a return object

 

Returns

the created buffer.

[transfer none]


ncm_mpi_job_destroy_input_buffer ()

void
ncm_mpi_job_destroy_input_buffer (NcmMPIJob *mpi_job,
                                  gpointer input,
                                  gpointer buf);

Destroy buf created with ncm_mpi_job_get_input_buffer() or ncm_mpi_job_pack_input().

[virtual destroy_input_buffer]

Parameters

mpi_job

a NcmMPIJob

 

input

an input object

 

buf

a input buffer

 

ncm_mpi_job_destroy_return_buffer ()

void
ncm_mpi_job_destroy_return_buffer (NcmMPIJob *mpi_job,
                                   gpointer ret,
                                   gpointer buf);

Destroy buf created with ncm_mpi_job_get_return_buffer() or ncm_mpi_job_pack_return().

[virtual destroy_return_buffer]

Parameters

mpi_job

a NcmMPIJob

 

ret

a return object

 

buf

a return buffer

 

ncm_mpi_job_pack_input ()

gpointer
ncm_mpi_job_pack_input (NcmMPIJob *mpi_job,
                        gpointer input);

Packs (when necessary) the input into the input buffer.

[virtual pack_input]

Parameters

mpi_job

a NcmMPIJob

 

input

the input pointer

 

Returns

the packed buffer.

[transfer none]


ncm_mpi_job_pack_return ()

gpointer
ncm_mpi_job_pack_return (NcmMPIJob *mpi_job,
                         gpointer ret);

Packs (when necessary) the return into the return buffer buf .

[virtual pack_return]

Parameters

mpi_job

a NcmMPIJob

 

ret

the return pointer

 

Returns

the packed buffer.

[transfer none]


ncm_mpi_job_unpack_input ()

void
ncm_mpi_job_unpack_input (NcmMPIJob *mpi_job,
                          gpointer buf,
                          gpointer input);

Unpacks (when necessary) the buffer buf into the input pointer input .

[virtual unpack_input]

Parameters

mpi_job

a NcmMPIJob

 

buf

the received buffer

 

input

the unpacked buffer

 

ncm_mpi_job_unpack_return ()

void
ncm_mpi_job_unpack_return (NcmMPIJob *mpi_job,
                           gpointer buf,
                           gpointer ret);

Unpacks (when necessary) the buffer buf into the return pointer return .

[virtual unpack_return]

Parameters

mpi_job

a NcmMPIJob

 

buf

the received buffer

 

ret

the unpacked buffer

 

ncm_mpi_job_run ()

void
ncm_mpi_job_run (NcmMPIJob *mpi_job,
                 gpointer input,
                 gpointer ret);

Runs job mpi_job using input and returns in ret .

[virtual run]

Parameters

mpi_job

a NcmMPIJob

 

input

an input pointer

 

ret

an return pointer

 

ncm_mpi_job_init_all_slaves ()

void
ncm_mpi_job_init_all_slaves (NcmMPIJob *mpi_job,
                             NcmSerialize *ser);

Initialize all available slaves with mpi_job .

Parameters

mpi_job

a NcmMPIJob

 

ser

a NcmSerialize

 

ncm_mpi_job_run_array ()

void
ncm_mpi_job_run_array (NcmMPIJob *mpi_job,
                       GPtrArray *input_array,
                       GPtrArray *ret_array);

Send work to all slaves in a round-robin fashion. Both arrays input_array and ret_array must have the same length and should be filled with the appropriated pointers.

Parameters

mpi_job

a NcmMPIJob

 

input_array

an array of input pointers.

[array][element-type GObject]

ret_array

an array of (allocated) return pointers.

[array][element-type GObject]

ncm_mpi_job_run_array_async ()

void
ncm_mpi_job_run_array_async (NcmMPIJob *mpi_job,
                             GPtrArray *input_array,
                             GPtrArray *ret_array);

Send work to all slaves using an additional thread to control the slaves work. The main execution thread runs jobs in parallel while it waits for the slaves to finish. Both arrays input_array and ret_array must have the same length and should be filled with the appropriated pointers.

Parameters

mpi_job

a NcmMPIJob

 

input_array

an array of input pointers.

[array][element-type GObject]

ret_array

an array of (allocated) return pointers.

[array][element-type GObject]

ncm_mpi_job_free_all_slaves ()

void
ncm_mpi_job_free_all_slaves (NcmMPIJob *mpi_job);

Frees all available slaves used by mpi_job .

Parameters

mpi_job

a NcmMPIJob

 

NCM_MPI_JOB_DEBUG_PRINT()

#define NCM_MPI_JOB_DEBUG_PRINT(fmt, ...)  printf (fmt, ## __VA_ARGS__)

Types and Values

NcmMPIDatatype

typedef MPI_Datatype NcmMPIDatatype;

NCM_MPI_CTRL_MASTER_ID

#define NCM_MPI_CTRL_MASTER_ID (0)

enum NcmMPIJobCtrlMsg

FIXME

Members

NCM_MPI_CTRL_SLAVE_INIT

FIXME

 

NCM_MPI_CTRL_SLAVE_FREE

FIXME

 

NCM_MPI_CTRL_SLAVE_KILL

FIXME

 

NCM_MPI_CTRL_SLAVE_WORK

FIXME

 

enum NcmMPIJobCtrlTag

FIXME

Members

NCM_MPI_CTRL_TAG_CMD

FIXME

 

NCM_MPI_CTRL_TAG_JOB

FIXME

 

NCM_MPI_CTRL_TAG_WORK_INPUT

FIXME

 

NCM_MPI_CTRL_TAG_WORK_RETURN

FIXME

 

Property Details

The “placeholder” property

  “placeholder”              guint

placeholder.

Owner: NcmMPIJob

Flags: Read / Write / Construct

Default value: 0