Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion BLACS/SRC/blacs_exit_.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ F_VOID_FUNC blacs_exit_(Int *NotDone)
Int BI_BuffIsFree(BLACBUFF *, Int);
BLACBUFF *bp;
extern BLACBUFF *BI_ReadyB, *BI_ActiveQ, BI_AuxBuff;
extern MPI_Status *BI_Stats;
Int i;
extern Int BI_MaxNCtxt, BI_Np;
extern BLACSCONTEXT **BI_MyContxts;
Expand All @@ -30,6 +31,7 @@ F_VOID_FUNC blacs_exit_(Int *NotDone)
free(bp);
}
free (BI_AuxBuff.Aops);
free (BI_Stats);

/*
* Reset parameters to initial values
Expand All @@ -39,7 +41,12 @@ F_VOID_FUNC blacs_exit_(Int *NotDone)
BI_Np = -1;
if (!Mpval(NotDone))
{
MPI_Finalize();
free(BI_COMM_WORLD);
BI_COMM_WORLD = NULL;
MPI_Finalize();
}
BI_ReadyB = NULL;
BI_ActiveQ = NULL;
BI_AuxBuff.Aops = NULL;
BI_Stats = NULL;
}
4 changes: 2 additions & 2 deletions BLACS/SRC/blacs_pinfo_.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ F_VOID_FUNC blacs_pinfo_(Int *mypnum, Int *nprocs)

BI_COMM_WORLD = (Int *) malloc(sizeof(Int));
*BI_COMM_WORLD = MPI_Comm_c2f(MPI_COMM_WORLD);
MPI_Comm_size(MPI_COMM_WORLD, &Np);
MPI_Comm_rank(MPI_COMM_WORLD, &Iam);
}
MPI_Comm_size(MPI_COMM_WORLD, &Np);
MPI_Comm_rank(MPI_COMM_WORLD, &Iam);
*mypnum = BI_Iam = Iam;
*nprocs = BI_Np = Np;
}