Commit ce2c07b5 authored by iker_martin's avatar iker_martin
Browse files

Finalizada la inclusion de los resultados. Se han anadido comentarios a varias...

Finalizada la inclusion de los resultados. Se han anadido comentarios a varias funciones que no tenian
parent 306f3cd5
...@@ -134,7 +134,7 @@ void free_config(configuration *user_config) { ...@@ -134,7 +134,7 @@ void free_config(configuration *user_config) {
void print_config(configuration *user_config, int grp) { void print_config(configuration *user_config, int grp) {
if(user_config != NULL) { if(user_config != NULL) {
int i; int i;
printf("Config loaded: resizes=%d, matrix=%d, sdr=%d, adr=%d, aib=%d time=%f || grp=%d\n", printf("Config loaded: resizes=%d, matrix=%d, sdr=%d, adr=%d, aib=%d, time=%f || grp=%d\n",
user_config->resizes, user_config->matrix_tam, user_config->sdr, user_config->adr, user_config->aib, user_config->general_time, grp); user_config->resizes, user_config->matrix_tam, user_config->sdr, user_config->adr, user_config->aib, user_config->general_time, grp);
for(i=0; i<user_config->resizes; i++) { for(i=0; i<user_config->resizes; i++) {
printf("Resize %d: Iters=%d, Procs=%d, Factors=%f, Phy=%d\n", printf("Resize %d: Iters=%d, Procs=%d, Factors=%f, Phy=%d\n",
...@@ -144,6 +144,10 @@ void print_config(configuration *user_config, int grp) { ...@@ -144,6 +144,10 @@ void print_config(configuration *user_config, int grp) {
} }
/*
* Imprime por salida estandar la informacion relacionada con un
* solo grupo de procesos en su configuracion.
*/
void print_config_group(configuration *user_config, int grp) { void print_config_group(configuration *user_config, int grp) {
if(user_config != NULL) { if(user_config != NULL) {
int parents, sons; int parents, sons;
...@@ -162,8 +166,6 @@ void print_config_group(configuration *user_config, int grp) { ...@@ -162,8 +166,6 @@ void print_config_group(configuration *user_config, int grp) {
} }
} }
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| || //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| || //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||
//| FUNCIONES DE INTERCOMUNICACION DE ESTRUCTURA DE CONFIGURACION || //| FUNCIONES DE INTERCOMUNICACION DE ESTRUCTURA DE CONFIGURACION ||
......
...@@ -3,52 +3,79 @@ ...@@ -3,52 +3,79 @@
#include <mpi.h> #include <mpi.h>
#include "results.h" #include "results.h"
void def_results_type(results_data *results, MPI_Datatype *results_type); void def_results_type(results_data *results, int resizes, MPI_Datatype *results_type);
//======================================================|| //======================================================||
//======================================================|| //======================================================||
//================MPI RESULTS FUNCTIONS=================|| //================MPI RESULTS FUNCTIONS=================||
//======================================================|| //======================================================||
//======================================================|| //======================================================||
void send_results(results_data *results, int root, MPI_Comm intercomm) {
/*
* Envia una estructura de resultados al grupo de procesos al que se
* enlaza este grupo a traves del intercomunicador pasado como argumento.
*
* Esta funcion tiene que ser llamada por todos los procesos del mismo grupo
* e indicar cual es el proceso raiz que se encargara de enviar los
* resultados al otro grupo.
*/
void send_results(results_data *results, int root, int resizes, MPI_Comm intercomm) {
MPI_Datatype results_type; MPI_Datatype results_type;
// Obtener un tipo derivado para enviar todos los // Obtener un tipo derivado para enviar todos los
// datos escalares con una sola comunicacion // datos escalares con una sola comunicacion
def_results_type(results, &results_type); def_results_type(results, resizes, &results_type);
MPI_Bcast(results, 1, results_type, root, intercomm); MPI_Bcast(results, 1, results_type, root, intercomm);
//Liberar tipos derivados //Liberar tipos derivados
MPI_Type_free(&results_type); MPI_Type_free(&results_type);
} }
void recv_results(results_data *results, int root, MPI_Comm intercomm) { /*
* Recibe una estructura de resultados desde otro grupo de procesos
* y la devuelve. La memoria de la estructura se tiene que reservar con antelacion
* con la función "init_results_data".
*
* Esta funcion tiene que ser llamada por todos los procesos del mismo grupo
* e indicar cual es el proceso raiz del otro grupo que se encarga de enviar
* los resultados a este grupo.
*/
void recv_results(results_data *results, int root, int resizes, MPI_Comm intercomm) {
MPI_Datatype results_type; MPI_Datatype results_type;
// Obtener un tipo derivado para enviar todos los // Obtener un tipo derivado para enviar todos los
// datos escalares con una sola comunicacion // datos escalares con una sola comunicacion
def_results_type(results, &results_type); def_results_type(results, resizes, &results_type);
MPI_Bcast(results, 1, results_type, root, intercomm); MPI_Bcast(results, 1, results_type, root, intercomm);
//Liberar tipos derivados //Liberar tipos derivados
MPI_Type_free(&results_type); MPI_Type_free(&results_type);
} }
void def_results_type(results_data *results, MPI_Datatype *results_type) { /*
int i, counts = 3; * Define un tipo derivado de MPI para mandar los tiempos
int blocklengths[3] = {1, 1, 1}; * con una sola comunicacion.
*
* En concreto son tres escales y un vector de tamaño "resizes"
*/
void def_results_type(results_data *results, int resizes, MPI_Datatype *results_type) {
int i, counts = 4;
int blocklengths[4] = {1, 1, 1, 1};
MPI_Aint displs[counts], dir; MPI_Aint displs[counts], dir;
MPI_Datatype types[counts]; MPI_Datatype types[counts];
// Rellenar vector types // Rellenar vector types
types[0] = types[1] = types[2] = MPI_DOUBLE; types[0] = types[1] = types[2] = types[3] = MPI_DOUBLE;
blocklengths[3] = resizes;
// Rellenar vector displs // Rellenar vector displs
MPI_Get_address(results, &dir); MPI_Get_address(results, &dir);
MPI_Get_address(&(results->sync_start), &displs[0]); MPI_Get_address(&(results->sync_start), &displs[0]);
MPI_Get_address(&(results->async_start), &displs[1]); MPI_Get_address(&(results->async_start), &displs[1]);
MPI_Get_address(&(results->spawn_time), &displs[2]); MPI_Get_address(&(results->exec_start), &displs[2]);
MPI_Get_address(&(results->spawn_time[0]), &displs[3]); //TODO Revisar si se puede simplificar
for(i=0;i<counts;i++) displs[i] -= dir; for(i=0;i<counts;i++) displs[i] -= dir;
...@@ -61,6 +88,13 @@ void def_results_type(results_data *results, MPI_Datatype *results_type) { ...@@ -61,6 +88,13 @@ void def_results_type(results_data *results, MPI_Datatype *results_type) {
//===============PRINT RESULTS FUNCTIONS================|| //===============PRINT RESULTS FUNCTIONS================||
//======================================================|| //======================================================||
//======================================================|| //======================================================||
/*
* Imprime por pantalla los resultados locales.
* Estos son los relacionados con las iteraciones, que son el tiempo
* por iteracion, el tipo (Normal o durante communicacion asincrona)
* y cuantas operaciones internas se han realizado en cada iteracion.
*/
void print_iter_results(results_data *results, int last_normal_iter_index) { void print_iter_results(results_data *results, int last_normal_iter_index) {
int i, aux; int i, aux;
...@@ -82,12 +116,44 @@ void print_iter_results(results_data *results, int last_normal_iter_index) { ...@@ -82,12 +116,44 @@ void print_iter_results(results_data *results, int last_normal_iter_index) {
printf("\n"); printf("\n");
} }
/*
* Imprime por pantalla los resultados globales.
* Estos son el tiempo de creacion de procesos, los de comunicacion
* asincrona y sincrona y el tiempo total de ejecucion.
*/
void print_global_results(results_data *results, int resizes) {
int i;
printf("Tspawn: ");
for(i=0; i< resizes - 1; i++) {
printf("%lf ", results->spawn_time[i]);
}
printf("\nTsync: ");
for(i=1; i < resizes; i++) {
printf("%lf ", results->sync_time[i]);
}
printf("\nTasync: ");
for(i=1; i < resizes; i++) {
printf("%lf ", results->async_time[i]);
}
printf("\nTex: %lf\n", results->exec_time);
}
//======================================================|| //======================================================||
//======================================================|| //======================================================||
//=============INIT/FREE RESULTS FUNCTIONS==============|| //=============INIT/FREE RESULTS FUNCTIONS==============||
//======================================================|| //======================================================||
//======================================================|| //======================================================||
/*
* Inicializa los datos relacionados con una estructura de resultados.
*
* Los argumentos "resizes" y "iters_size" se necesitan para obtener el tamaño
* de los vectores de resultados.
*/
void init_results_data(results_data **results, int resizes, int iters_size) { void init_results_data(results_data **results, int resizes, int iters_size) {
*results = malloc(1 * sizeof(results_data)); *results = malloc(1 * sizeof(results_data));
...@@ -95,15 +161,18 @@ void init_results_data(results_data **results, int resizes, int iters_size) { ...@@ -95,15 +161,18 @@ void init_results_data(results_data **results, int resizes, int iters_size) {
(*results)->sync_time = calloc(resizes, sizeof(double)); (*results)->sync_time = calloc(resizes, sizeof(double));
(*results)->async_time = calloc(resizes, sizeof(double)); (*results)->async_time = calloc(resizes, sizeof(double));
(*results)->iters_time = calloc(iters_size * 20, sizeof(double)); (*results)->iters_time = calloc(iters_size * 20, sizeof(double)); //FIXME Numero magico - Añadir funcion que amplie tamaño
(*results)->iters_type = calloc(iters_size * 20, sizeof(int)); (*results)->iters_type = calloc(iters_size * 20, sizeof(int));
(*results)->iter_index = 0; (*results)->iter_index = 0;
} }
/*
* Libera toda la memoria asociada con una estructura de resultados.
*/
void free_results_data(results_data **results) { void free_results_data(results_data **results) {
//free((*results)->spawn_time); free((*results)->spawn_time);
//free((*results)->sync_time); free((*results)->sync_time);
//free((*results)->async_time); free((*results)->async_time);
free((*results)->iters_time); free((*results)->iters_time);
free((*results)->iters_type); free((*results)->iters_type);
......
...@@ -11,12 +11,14 @@ typedef struct { ...@@ -11,12 +11,14 @@ typedef struct {
double spawn_start, *spawn_time; double spawn_start, *spawn_time;
double sync_start, *sync_time; double sync_start, *sync_time;
double async_start, *async_time; double async_start, *async_time;
double exec_start, exec_time;
} results_data; } results_data;
void send_results(results_data *results, int root, MPI_Comm intercomm); void send_results(results_data *results, int root, int resizes, MPI_Comm intercomm);
void recv_results(results_data *results, int root, MPI_Comm intercomm); void recv_results(results_data *results, int root, int resizes, MPI_Comm intercomm);
void print_iter_results(results_data *results, int last_normal_iter_index); void print_iter_results(results_data *results, int last_normal_iter_index);
void print_global_results(results_data *results, int resizes);
void init_results_data(results_data **results, int resizes, int iters_size); void init_results_data(results_data **results, int resizes, int iters_size);
void free_results_data(results_data **results); void free_results_data(results_data **results);
...@@ -20,7 +20,12 @@ void iterate(double *matrix, int n, int async_comm); ...@@ -20,7 +20,12 @@ void iterate(double *matrix, int n, int async_comm);
void computeMatrix(double *matrix, int n); void computeMatrix(double *matrix, int n);
void initMatrix(double **matrix, int n); void initMatrix(double **matrix, int n);
void init_group_struct(char *argv[], int myId, int numP);
void init_application();
void free_application_data();
void print_general_info(int myId, int grp, int numP); void print_general_info(int myId, int grp, int numP);
void print_final_results();
typedef struct { typedef struct {
int myId; int myId;
...@@ -38,54 +43,29 @@ group_data *group; ...@@ -38,54 +43,29 @@ group_data *group;
results_data *results; results_data *results;
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
int numP, myId; int numP, myId, res;
MPI_Init(&argc, &argv); MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numP); MPI_Comm_size(MPI_COMM_WORLD, &numP);
MPI_Comm_rank(MPI_COMM_WORLD, &myId); MPI_Comm_rank(MPI_COMM_WORLD, &myId);
group = malloc(1 * sizeof(group_data)); init_group_struct(argv, myId, numP);
group->myId = myId; init_application();
group->numP = numP;
group->grp = 0;
group->iter_start = 0;
group->argv = argv;
MPI_Comm_get_parent(&(group->parents));
if(group->parents != MPI_COMM_NULL ) { // Si son procesos hijos deben comunicarse con las padres
Sons_init();
} else { // Si son el primer grupo de procesos, recogen la configuracion inicial if(group->grp == 0) {
config_file = read_ini_file(argv[1]); MPI_Barrier(MPI_COMM_WORLD);
init_results_data(&results, config_file->resizes - 1, config_file->iters[group->grp]); results->exec_start = MPI_Wtime();
if(config_file->sdr > 0) {
malloc_comm_array(&(group->sync_array), config_file->sdr , group->myId, group->numP);
}
if(config_file->adr > 0) {
malloc_comm_array(&(group->async_array), config_file->adr , group->myId, group->numP);
} }
}
//if(myId== ROOT) print_config(config_file, group->grp); res = work();
work();
if(group->myId == ROOT) { // Print results if(res) { // Se he llegado al final de la aplicacion
print_config_group(config_file, group->grp); MPI_Barrier(MPI_COMM_WORLD);
print_iter_results(results, config_file->iters[group->grp] -1); results->exec_time = MPI_Wtime() - results->exec_start;
} }
print_final_results();
free_application_data();
if(config_file->sdr > 0) {
free(group->sync_array);
}
if(config_file->adr > 0) {
free(group->async_array);
}
free(group);
free_config(config_file);
free_results_data(&results); //FIXME Provoca un error - Entro mal a algun vector??
MPI_Finalize(); MPI_Finalize();
return 0; return 0;
} }
...@@ -100,9 +80,13 @@ int main(int argc, char *argv[]) { ...@@ -100,9 +80,13 @@ int main(int argc, char *argv[]) {
* Si el redimensionado se realiza de forma asincrona se * Si el redimensionado se realiza de forma asincrona se
* siguen realizando iteraciones de computo hasta que termine la * siguen realizando iteraciones de computo hasta que termine la
* comunicacion asincrona y realizar entonces la sincrona. * comunicacion asincrona y realizar entonces la sincrona.
*
* Si el grupo de procesos es el ultimo que va a ejecutar, se devuelve
* el valor 1 para indicar que no se va a seguir trabajando con nuevos grupos
* de procesos. En caso contrario se devuelve 0.
*/ */
int work() { int work() {
int iter, maxiter, state; int iter, maxiter, state, res;
double *matrix; double *matrix;
MPI_Request *async_comm; MPI_Request *async_comm;
...@@ -110,6 +94,7 @@ int work() { ...@@ -110,6 +94,7 @@ int work() {
initMatrix(&matrix, config_file->matrix_tam); initMatrix(&matrix, config_file->matrix_tam);
state = MAL_COMM_UNINITIALIZED; state = MAL_COMM_UNINITIALIZED;
res = 0;
for(iter=group->iter_start; iter < maxiter; iter++) { for(iter=group->iter_start; iter < maxiter; iter++) {
iterate(matrix, config_file->matrix_tam, state); iterate(matrix, config_file->matrix_tam, state);
} }
...@@ -122,7 +107,8 @@ int work() { ...@@ -122,7 +107,8 @@ int work() {
state = checkpoint(iter, state, &async_comm); state = checkpoint(iter, state, &async_comm);
} }
return 0; if(config_file->resizes - 1 == group->grp) res=1;
return res;
} }
/* /*
...@@ -150,7 +136,7 @@ int checkpoint(int iter, int state, MPI_Request **comm_req) { ...@@ -150,7 +136,7 @@ int checkpoint(int iter, int state, MPI_Request **comm_req) {
results->spawn_start = MPI_Wtime(); results->spawn_start = MPI_Wtime();
TC(numS); TC(numS);
results->spawn_time[group->grp + 1] = MPI_Wtime() - results->spawn_start; results->spawn_time[group->grp] = MPI_Wtime() - results->spawn_start;
state = start_redistribution(numS, comm_req); state = start_redistribution(numS, comm_req);
...@@ -177,6 +163,20 @@ void TC(int numS){ ...@@ -177,6 +163,20 @@ void TC(int numS){
} }
} }
/*
* Comienza la redistribucion de los datos con el nuevo grupo de procesos.
*
* Primero se envia la configuracion a utilizar al nuevo grupo de procesos y a continuacion
* se realiza el envio asincrono y/o sincrono si lo hay.
*
* En caso de que haya comunicacion asincrona, se comienza y se termina la funcion
* indicando que se ha comenzado un envio asincrono.
*
* Si no hay comunicacion asincrono se pasa a realizar la sincrona si la hubiese.
*
* Finalmente se envian datos sobre los resultados a los hijos y se desconectan ambos
* grupos de procesos.
*/
int start_redistribution(int numS, MPI_Request **comm_req) { int start_redistribution(int numS, MPI_Request **comm_req) {
int rootBcast = MPI_PROC_NULL; int rootBcast = MPI_PROC_NULL;
if(group->myId == ROOT) rootBcast = MPI_ROOT; if(group->myId == ROOT) rootBcast = MPI_ROOT;
...@@ -196,13 +196,26 @@ int start_redistribution(int numS, MPI_Request **comm_req) { ...@@ -196,13 +196,26 @@ int start_redistribution(int numS, MPI_Request **comm_req) {
} }
send_results(results, rootBcast, group->children); send_results(results, rootBcast, config_file->resizes, group->children);
// Desconectar intercomunicador con los hijos // Desconectar intercomunicador con los hijos
MPI_Comm_disconnect(&(group->children)); MPI_Comm_disconnect(&(group->children));
return MAL_COMM_COMPLETED; return MAL_COMM_COMPLETED;
} }
/*
* Comprueba si la redistribucion asincrona ha terminado.
* Si no ha terminado la funcion termina indicandolo, en caso contrario,
* se continua con la comunicacion sincrona, el envio de resultados y
* se desconectan los grupos de procesos.
*
* Esta funcion permite dos modos de funcionamiento al comprobar si la
* comunicacion asincrona ha terminado.
* Si se utiliza el modo "MAL_USE_NORMAL", se considera terminada cuando
* los padres terminan de enviar.
* Si se utiliza el modo "MAL_USE_IBARRIER", se considera terminada cuando
* los hijos han terminado de recibir.
*/
int check_redistribution(int iter, MPI_Request **comm_req) { int check_redistribution(int iter, MPI_Request **comm_req) {
int completed, all_completed, test_err, iter_send; int completed, all_completed, test_err, iter_send;
int numS = config_file->procs[group->grp +1]; int numS = config_file->procs[group->grp +1];
...@@ -237,7 +250,7 @@ int check_redistribution(int iter, MPI_Request **comm_req) { ...@@ -237,7 +250,7 @@ int check_redistribution(int iter, MPI_Request **comm_req) {
results->sync_start = MPI_Wtime(); results->sync_start = MPI_Wtime();
send_sync(group->sync_array, config_file->sdr, group->myId, group->numP, ROOT, group->children, numS); send_sync(group->sync_array, config_file->sdr, group->myId, group->numP, ROOT, group->children, numS);
} }
send_results(results, rootBcast, group->children); send_results(results, rootBcast, config_file->resizes, group->children);
// Desconectar intercomunicador con los hijos // Desconectar intercomunicador con los hijos
MPI_Comm_disconnect(&(group->children)); MPI_Comm_disconnect(&(group->children));
...@@ -263,14 +276,14 @@ void Sons_init() { ...@@ -263,14 +276,14 @@ void Sons_init() {
if(config_file->adr > 0) { // Recibir datos asincronos if(config_file->adr > 0) { // Recibir datos asincronos
recv_async(&(group->async_array), config_file->adr, group->myId, group->numP, ROOT, group->parents, numP_parents, config_file->aib); recv_async(&(group->async_array), config_file->adr, group->myId, group->numP, ROOT, group->parents, numP_parents, config_file->aib);
MPI_Bcast(&(group->iter_start), 1, MPI_INT, ROOT, group->parents);
results->async_time[group->grp] = MPI_Wtime(); results->async_time[group->grp] = MPI_Wtime();
MPI_Bcast(&(group->iter_start), 1, MPI_INT, ROOT, group->parents);
} }
if(config_file->sdr > 0) { // Recibir datos sincronos if(config_file->sdr > 0) { // Recibir datos sincronos
recv_sync(&(group->sync_array), config_file->sdr, group->myId, group->numP, ROOT, group->parents, numP_parents); recv_sync(&(group->sync_array), config_file->sdr, group->myId, group->numP, ROOT, group->parents, numP_parents);
results->sync_time[group->grp] = MPI_Wtime(); results->sync_time[group->grp] = MPI_Wtime();
} }
recv_results(results, ROOT, group->parents); recv_results(results, ROOT, config_file->resizes, group->parents);
results->sync_time[group->grp] = MPI_Wtime() - results->sync_start; results->sync_time[group->grp] = MPI_Wtime() - results->sync_start;
results->async_time[group->grp] = MPI_Wtime() - results->async_start; results->async_time[group->grp] = MPI_Wtime() - results->async_start;
...@@ -354,10 +367,14 @@ void initMatrix(double **matrix, int n) { ...@@ -354,10 +367,14 @@ void initMatrix(double **matrix, int n) {
//======================================================|| //======================================================||
//======================================================|| //======================================================||
//=============???????¿¿¿¿¿¿¿¿ FUNCTIONS================|| //=============INIT/FREE/PRINT FUNCTIONS================||
//======================================================|| //======================================================||
//======================================================|| //======================================================||
/*
* Muestra datos generales sobre los procesos, su grupo,
* en que nodo residen y la version de MPI utilizada.
*/
void print_general_info(int myId, int grp, int numP) { void print_general_info(int myId, int grp, int numP) {
int len; int len;
char *name = malloc(MPI_MAX_PROCESSOR_NAME * sizeof(char)); char *name = malloc(MPI_MAX_PROCESSOR_NAME * sizeof(char));
...@@ -370,4 +387,72 @@ void print_general_info(int myId, int grp, int numP) { ...@@ -370,4 +387,72 @@ void print_general_info(int myId, int grp, int numP) {
free(version); free(version);
} }
/*
* Pide al proceso raiz imprimir los datos sobre las iteraciones realizadas por el grupo de procesos.
*
* Si es el ultimo grupo de procesos, muestra los datos obtenidos de tiempo de ejecucion, creacion de procesos
* y las comunicaciones.
*/
void print_final_results() {
if(group->myId == ROOT) {
print_config_group(config_file, group->grp);
print_iter_results(results, config_file->iters[group->grp] -1);
if(group->grp == config_file->resizes -1) {
print_config(config_file, group->grp);
print_global_results(results, config_file->resizes);
}
}
}
/*
* Inicializa la estructura group
*/
void init_group_struct(char *argv[], int myId, int numP) {
group = malloc(1 * sizeof(group_data));
group->myId = myId;
group->numP = numP;
group->grp = 0;
group->iter_start = 0;
group->argv = argv;
}
/*
* Inicializa los datos para este grupo de procesos.
*
* En caso de ser el primer grupo de procesos, lee el fichero de configuracion
* e inicializa los vectores de comunicacion.
*
* En caso de ser otro grupo de procesos entra a la funcion "Sons_init()" donde
* se comunican con los padres para inicializar sus datos.
*/
void init_application() {
MPI_Comm_get_parent(&(group->parents));
if(group->parents != MPI_COMM_NULL ) { // Si son procesos hijos deben comunicarse con las padres
Sons_init();
} else { // Si son el primer grupo de procesos, recogen la configuracion inicial
config_file = read_ini_file(group->argv[1]);
init_results_data(&results, config_file->resizes, config_file->iters[group->grp]);
if(config_file->sdr > 0) {
malloc_comm_array(&(group->sync_array), config_file->sdr , group->myId, group->numP);
}
if(config_file->adr > 0) {
malloc_comm_array(&(group->async_array), config_file->adr , group->myId, group->numP);
}
}
}
/*
* Libera toda la memoria asociada con la aplicacion
*/
void free_application_data() {
if(config_file->sdr > 0) {
free(group->sync_array);
}
if(config_file->adr > 0) {
free(group->async_array);
}
free(group);
free_config(config_file);
free_results_data(&results);
}
...@@ -114,14 +114,6 @@ void node_dist(slurm_job_info_t job_record, int type, int total_procs, int **qty ...@@ -114,14 +114,6 @@ void node_dist(slurm_job_info_t job_record, int type, int total_procs, int **qty
*qty = procs; *qty = procs;
} }
/*
*qty = calloc(*used_nodes, sizeof(int)); // Numero de procesos por nodo
for(i=0; i< *used_nodes; i++) {
(*qty)[i] = procs[i];
}
free(procs);
*/
/* /*
* Crea un fichero que se utilizara como hostfile * Crea un fichero que se utilizara como hostfile
* para un nuevo grupo de procesos. * para un nuevo grupo de procesos.
......
MPICH
P1 of 2 | Padrescounts[2]=25 disp=0
P1 of 2 | Padrescounts[3]=25 disp=25
P0 of 2 | Padrescounts[0]=25 disp=0
P0 of 2 | Padrescounts[1]=25 disp=25
P0 of 4 | Hijoscounts[0]=25 disp=0
P1 of 4 | Hijoscounts[0]=25 disp=0
P2 of 4 | Hijoscounts[1]=25 disp=0
P3 of 4 | Hijoscounts[1]=25 disp=0
Fatal error in PMPI_Wait: Unknown error class, error stack:
PMPI_Wait(204).................: MPI_Wait(request=0x7ffcfa166230, status=0x1) failed
MPIR_Wait(104).................:
MPIDU_Sched_progress_state(955): Invalid communicator
Fatal error in PMPI_Wait: Unknown error class, error stack:
PMPI_Wait(204).................: MPI_Wait(request=0x7ffdd2541a10, status=0x1) failed
MPIR_Wait(104).................:
MPIDU_Sched_progress_state(955): Invalid communicator
Fatal error in PMPI_Wait: Unknown error class, error stack:
PMPI_Wait(204).................: MPI_Wait(request=0x7ffe39910c20, status=0x1) failed
MPIR_Wait(104).................:
MPIDU_Sched_progress_state(955): Invalid communicator
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 35108 RUNNING AT n01
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
END RUN
...@@ -9,8 +9,8 @@ module load mpich-3.4.1-noucx ...@@ -9,8 +9,8 @@ module load mpich-3.4.1-noucx
numP=$(bash recordMachinefile.sh test.ini) numP=$(bash recordMachinefile.sh test.ini)
#mpirun -f hostfile.o$SLURM_JOB_ID -np $numP ./a.out test.ini mpirun -f hostfile.o$SLURM_JOB_ID -np $numP ./a.out test.ini
mpirun -np 2 ./a.out test.ini #mpirun -np 2 ./a.out test.ini
rm hostfile.o$SLURM_JOB_ID rm hostfile.o$SLURM_JOB_ID
......
MPICH
Config loaded: resizes=3, matrix=2000, sdr=20, adr=20, time=0.500000 || NUMP=1
Resize 0: Iters=5, Procs=1, Factors=1.000000, Phy=1
Resize 1: Iters=5, Procs=2, Factors=1.500000, Phy=2
Resize 2: Iters=5, Procs=8, Factors=0.250000, Phy=1
Config loaded: resizes=3, matrix=2000, sdr=20, adr=20, time=0.500000 || NUMP=2
Resize 0: Iters=5, Procs=1, Factors=1.000000, Phy=1
Resize 1: Iters=5, Procs=2, Factors=1.500000, Phy=2
Resize 2: Iters=5, Procs=8, Factors=0.250000, Phy=1
P0 Nuevo GRUPO 0 de 1 procs en nodo n00 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P0 Nuevo GRUPO 1 de 2 procs en nodo n00 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P1 Nuevo GRUPO 1 de 2 procs en nodo n00 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
Config loaded: resizes=3, matrix=2000, sdr=20, adr=20, time=0.500000 || NUMP=8
Resize 0: Iters=5, Procs=1, Factors=1.000000, Phy=1
Resize 1: Iters=5, Procs=2, Factors=1.500000, Phy=2
Resize 2: Iters=5, Procs=8, Factors=0.250000, Phy=1
P2 Nuevo GRUPO 2 de 8 procs en nodo n00 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P4 Nuevo GRUPO 2 de 8 procs en nodo n01 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P6 Nuevo GRUPO 2 de 8 procs en nodo n01 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P7 Nuevo GRUPO 2 de 8 procs en nodo n01 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P5 Nuevo GRUPO 2 de 8 procs en nodo n01 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P1 Nuevo GRUPO 2 de 8 procs en nodo n00 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P3 Nuevo GRUPO 2 de 8 procs en nodo n00 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
P0 Nuevo GRUPO 2 de 8 procs en nodo n00 con MPICH Version: 3.4.1
MPICH Release date: Fri Jan 22 14:17:48 CST 2021
MPICH ABI: 13:10:1
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/soft/gnu/mpich-3.4.1-noucx --with-device=ch3:nemesis
MPICH CC: gcc -O2
MPICH CXX: g++ -O2
MPICH F77: gfortran -O2
MPICH FC: gfortran -O2
END RUN
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment