Skip to content

Commit

Permalink
update code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
plopezx committed Aug 2, 2022
1 parent cbb4983 commit eed6932
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
51 changes: 47 additions & 4 deletions include/eddl/mpi_distributed/data_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@
#define DG_LIN 2




/**
* @brief Initializes data generator
*
* @param [in] dg_id Id of data generator. Only *one* data generator is allowed.
* @param [in] filenameX Name of dataset file with samples
* @param [in] filenameY Name of dataset file with labels
* @param [in] ds (global) Batch size
* @param [in] bs (global) Batch size
* @param [in] distr_ds DISTR_DS or NO_DISTR_DS
* @param [out] dataset_size Dataset size
* @param [out] nbpp Nr of batches per proc
Expand Down Expand Up @@ -132,12 +130,57 @@ struct DG_Data {
char filenameY[128]="";
};


/**
* @brief Creates and initializes a new data generator structure
*
* @param [in] DG Pointer to data generator var
* @param [in] filenameX Name of dataset file with samples
* @param [in] filenameY Name of dataset file with labels
* @param [in] bs (global) Batch size
* @param [in] distr_ds DISTR_DS or NO_DISTR_DS
* @param [out] dataset_size Dataset size
* @param [out] nbpp Nr of batches per proc
* @param [in] method DG_LIN, DG_RANDOM or DG_PERFECT
* @param [in] num_threads Nr of threads to load samples
* @param [in] buffer_size Size of buffer in (local) batches
*/
void* new_DataGen(DG_Data* DG, const char* filenameX, const char* filenameY, int bs, bool distr_ds, int* dataset_size, int* nbpp, int method, int num_threads, int buffer_size);

/**
* @brief Starts data generator
* @param [in] DG Pointer to data generator var
*/
void* start_DataGen(DG_Data* DG);

/**
* @brief Stops data generator
*
* @param [in] DG Pointer to data generator var
*/
void* stop_DataGen(DG_Data* DG);

/**
* @brief Copy next batch from buffer
*
* @param [in] DG Pointer to data generator var
* @param [out] in Tensor of batch samples
* @param [out] out Tensor of batch labels
*/
void* get_batch_DataGen(DG_Data* DG, Tensor* in, Tensor* out);

/**
* @brief Frees data structures of data generator
* @param [in] DG Pointer to data generator var
*/
void* end_DataGen (DG_Data* DG) ;

/**
* @brief Aux functions to print DG data
*
* @param [in] titulo Text to print before DG Data
* @param [in] DG Pointer to data generator var
*
*/
void* imprime_DG(const char* titulo, DG_Data* DG);
void* imprime_buffer(DG_Data* DG);

Expand Down
10 changes: 5 additions & 5 deletions scripts/mpi_distributed/cluster.nodos
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#altec2
#altec3
#altec4
#altec5
#altec6
altec2
altec3
altec4
altec5
altec6
altec7
altec8
altec9
Expand Down
2 changes: 1 addition & 1 deletion scripts/mpi_distributed/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SBATCH="sbatch -n ${PROCS} -N ${PROCS} --out ${OUTPUT} --err ${ERR} -J ${FILENAM

# node specific options
if [[ "$HOSTNAME" =~ "altec" ]]; then
MPI_MACHINE="-map-by node:PE=28 --mca pml ucx --mca btl ^openib --mca btl_openib_verbose 1 --mca pml_ucx_verbose 1"
MPI_MACHINE="-map-by node:PE=14 --mca pml ucx --mca btl ^openib --mca btl_openib_verbose 1 --mca pml_ucx_verbose 1"
fi

if [[ "$HOSTNAME" =~ "cmts" ]]; then
Expand Down

0 comments on commit eed6932

Please sign in to comment.